@temboplus/frontend-core 0.2.1 → 0.2.3

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 (200) hide show
  1. package/README.md +126 -25
  2. package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
  3. package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
  4. package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
  5. package/esm/mod.d.ts +2 -0
  6. package/esm/mod.d.ts.map +1 -1
  7. package/esm/mod.js +2 -0
  8. package/esm/src/config/config_service.d.ts +11 -0
  9. package/esm/src/config/config_service.d.ts.map +1 -0
  10. package/esm/src/config/config_service.js +19 -0
  11. package/esm/src/config/index.d.ts +2 -0
  12. package/esm/src/config/index.d.ts.map +1 -0
  13. package/esm/src/config/index.js +1 -0
  14. package/esm/src/{models/bank/banks.d.ts → data/banks_tz.d.ts} +1 -1
  15. package/esm/src/data/banks_tz.d.ts.map +1 -0
  16. package/esm/src/data/countries.d.ts +6 -0
  17. package/esm/src/data/countries.d.ts.map +1 -0
  18. package/esm/src/data/countries.js +974 -0
  19. package/esm/src/data/currencies.d.ts +1901 -0
  20. package/esm/src/data/currencies.d.ts.map +1 -0
  21. package/esm/src/data/currencies.js +1073 -0
  22. package/esm/src/data/phone_patterns.d.ts +3809 -0
  23. package/esm/src/data/phone_patterns.d.ts.map +1 -0
  24. package/esm/src/data/phone_patterns.js +2325 -0
  25. package/esm/src/models/amount/amount.d.ts +10 -12
  26. package/esm/src/models/amount/amount.d.ts.map +1 -1
  27. package/esm/src/models/amount/amount.js +58 -96
  28. package/esm/src/models/bank/bank.d.ts +58 -53
  29. package/esm/src/models/bank/bank.d.ts.map +1 -1
  30. package/esm/src/models/bank/bank.js +49 -84
  31. package/esm/src/models/bank/index.d.ts +1 -1
  32. package/esm/src/models/bank/index.d.ts.map +1 -1
  33. package/esm/src/models/bank/index.js +1 -1
  34. package/esm/src/models/bank/service.d.ts +106 -0
  35. package/esm/src/models/bank/service.d.ts.map +1 -0
  36. package/esm/src/models/bank/service.js +240 -0
  37. package/esm/src/models/country/country.d.ts +568 -0
  38. package/esm/src/models/country/country.d.ts.map +1 -0
  39. package/esm/src/models/country/country.js +165 -0
  40. package/esm/src/models/country/country.test.d.ts.map +1 -0
  41. package/esm/src/models/country/index.d.ts +3 -0
  42. package/esm/src/models/country/index.d.ts.map +1 -0
  43. package/esm/src/models/country/index.js +2 -0
  44. package/esm/src/models/country/service.d.ts +75 -0
  45. package/esm/src/models/country/service.d.ts.map +1 -0
  46. package/esm/src/models/country/service.js +267 -0
  47. package/esm/src/models/currency/currency.d.ts +341 -0
  48. package/esm/src/models/currency/currency.d.ts.map +1 -0
  49. package/esm/src/models/currency/currency.js +225 -0
  50. package/esm/src/models/currency/currency.test.d.ts.map +1 -0
  51. package/esm/src/models/currency/index.d.ts +3 -0
  52. package/esm/src/models/currency/index.d.ts.map +1 -0
  53. package/esm/src/models/currency/index.js +2 -0
  54. package/esm/src/models/currency/service.d.ts +96 -0
  55. package/esm/src/models/currency/service.d.ts.map +1 -0
  56. package/esm/src/models/currency/service.js +194 -0
  57. package/esm/src/models/index.d.ts +2 -0
  58. package/esm/src/models/index.d.ts.map +1 -1
  59. package/esm/src/models/index.js +2 -0
  60. package/esm/src/models/phone_number/format.d.ts +14 -0
  61. package/esm/src/models/phone_number/format.d.ts.map +1 -0
  62. package/esm/src/models/phone_number/format.js +14 -0
  63. package/esm/src/models/phone_number/global/phone_number.d.ts +160 -0
  64. package/esm/src/models/phone_number/global/phone_number.d.ts.map +1 -0
  65. package/esm/src/models/phone_number/global/phone_number.js +453 -0
  66. package/esm/src/models/phone_number/global/phone_number.test.d.ts.map +1 -0
  67. package/esm/src/models/phone_number/global/service.d.ts +260 -0
  68. package/esm/src/models/phone_number/global/service.d.ts.map +1 -0
  69. package/esm/src/models/phone_number/global/service.js +477 -0
  70. package/esm/src/models/phone_number/global/service.test.d.ts.map +1 -0
  71. package/esm/src/models/phone_number/index.d.ts +5 -3
  72. package/esm/src/models/phone_number/index.d.ts.map +1 -1
  73. package/esm/src/models/phone_number/index.js +5 -3
  74. package/esm/src/models/phone_number/{antd_validator.d.ts → tz/antd_validator.d.ts} +2 -2
  75. package/esm/src/models/phone_number/tz/antd_validator.d.ts.map +1 -0
  76. package/esm/src/models/phone_number/{antd_validator.js → tz/antd_validator.js} +2 -2
  77. package/esm/src/models/phone_number/tz/antdvalidator.test.d.ts.map +1 -0
  78. package/esm/src/models/phone_number/tz/network_operator.d.ts.map +1 -0
  79. package/{script/src/models/phone_number → esm/src/models/phone_number/tz}/phone_number.d.ts +46 -29
  80. package/esm/src/models/phone_number/tz/phone_number.d.ts.map +1 -0
  81. package/esm/src/models/phone_number/{phone_number.js → tz/phone_number.js} +87 -41
  82. package/esm/src/models/phone_number/tz/phone_number.test.d.ts.map +1 -0
  83. package/esm/src/reports/index.d.ts +2 -0
  84. package/esm/src/reports/index.d.ts.map +1 -0
  85. package/esm/src/reports/index.js +1 -0
  86. package/esm/src/reports/report_manager.d.ts +144 -0
  87. package/esm/src/reports/report_manager.d.ts.map +1 -0
  88. package/esm/src/reports/report_manager.js +315 -0
  89. package/package.json +4 -3
  90. package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
  91. package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
  92. package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
  93. package/script/mod.d.ts +2 -0
  94. package/script/mod.d.ts.map +1 -1
  95. package/script/mod.js +2 -0
  96. package/script/src/config/config_service.d.ts +11 -0
  97. package/script/src/config/config_service.d.ts.map +1 -0
  98. package/script/src/config/config_service.js +23 -0
  99. package/script/src/config/index.d.ts +2 -0
  100. package/script/src/config/index.d.ts.map +1 -0
  101. package/script/src/config/index.js +17 -0
  102. package/script/src/{models/bank/banks.d.ts → data/banks_tz.d.ts} +1 -1
  103. package/script/src/data/banks_tz.d.ts.map +1 -0
  104. package/script/src/data/countries.d.ts +6 -0
  105. package/script/src/data/countries.d.ts.map +1 -0
  106. package/script/src/data/countries.js +976 -0
  107. package/script/src/data/currencies.d.ts +1901 -0
  108. package/script/src/data/currencies.d.ts.map +1 -0
  109. package/script/src/data/currencies.js +1075 -0
  110. package/script/src/data/phone_patterns.d.ts +3809 -0
  111. package/script/src/data/phone_patterns.d.ts.map +1 -0
  112. package/script/src/data/phone_patterns.js +2327 -0
  113. package/script/src/models/amount/amount.d.ts +10 -12
  114. package/script/src/models/amount/amount.d.ts.map +1 -1
  115. package/script/src/models/amount/amount.js +60 -98
  116. package/script/src/models/bank/bank.d.ts +58 -53
  117. package/script/src/models/bank/bank.d.ts.map +1 -1
  118. package/script/src/models/bank/bank.js +49 -87
  119. package/script/src/models/bank/index.d.ts +1 -1
  120. package/script/src/models/bank/index.d.ts.map +1 -1
  121. package/script/src/models/bank/index.js +1 -1
  122. package/script/src/models/bank/service.d.ts +106 -0
  123. package/script/src/models/bank/service.d.ts.map +1 -0
  124. package/script/src/models/bank/service.js +247 -0
  125. package/script/src/models/country/country.d.ts +568 -0
  126. package/script/src/models/country/country.d.ts.map +1 -0
  127. package/script/src/models/country/country.js +169 -0
  128. package/script/src/models/country/country.test.d.ts.map +1 -0
  129. package/script/src/models/country/index.d.ts +3 -0
  130. package/script/src/models/country/index.d.ts.map +1 -0
  131. package/script/src/models/country/index.js +18 -0
  132. package/script/src/models/country/service.d.ts +75 -0
  133. package/script/src/models/country/service.d.ts.map +1 -0
  134. package/script/src/models/country/service.js +274 -0
  135. package/script/src/models/currency/currency.d.ts +341 -0
  136. package/script/src/models/currency/currency.d.ts.map +1 -0
  137. package/script/src/models/currency/currency.js +229 -0
  138. package/script/src/models/currency/currency.test.d.ts.map +1 -0
  139. package/script/src/models/currency/index.d.ts +3 -0
  140. package/script/src/models/currency/index.d.ts.map +1 -0
  141. package/script/src/models/currency/index.js +18 -0
  142. package/script/src/models/currency/service.d.ts +96 -0
  143. package/script/src/models/currency/service.d.ts.map +1 -0
  144. package/script/src/models/currency/service.js +201 -0
  145. package/script/src/models/index.d.ts +2 -0
  146. package/script/src/models/index.d.ts.map +1 -1
  147. package/script/src/models/index.js +2 -0
  148. package/script/src/models/phone_number/format.d.ts +14 -0
  149. package/script/src/models/phone_number/format.d.ts.map +1 -0
  150. package/script/src/models/phone_number/format.js +17 -0
  151. package/script/src/models/phone_number/global/phone_number.d.ts +160 -0
  152. package/script/src/models/phone_number/global/phone_number.d.ts.map +1 -0
  153. package/script/src/models/phone_number/global/phone_number.js +457 -0
  154. package/script/src/models/phone_number/global/phone_number.test.d.ts.map +1 -0
  155. package/script/src/models/phone_number/global/service.d.ts +260 -0
  156. package/script/src/models/phone_number/global/service.d.ts.map +1 -0
  157. package/script/src/models/phone_number/global/service.js +485 -0
  158. package/script/src/models/phone_number/global/service.test.d.ts.map +1 -0
  159. package/script/src/models/phone_number/index.d.ts +5 -3
  160. package/script/src/models/phone_number/index.d.ts.map +1 -1
  161. package/script/src/models/phone_number/index.js +5 -3
  162. package/script/src/models/phone_number/{antd_validator.d.ts → tz/antd_validator.d.ts} +2 -2
  163. package/script/src/models/phone_number/tz/antd_validator.d.ts.map +1 -0
  164. package/script/src/models/phone_number/{antd_validator.js → tz/antd_validator.js} +1 -1
  165. package/script/src/models/phone_number/tz/antdvalidator.test.d.ts.map +1 -0
  166. package/script/src/models/phone_number/tz/network_operator.d.ts.map +1 -0
  167. package/{esm/src/models/phone_number → script/src/models/phone_number/tz}/phone_number.d.ts +46 -29
  168. package/script/src/models/phone_number/tz/phone_number.d.ts.map +1 -0
  169. package/script/src/models/phone_number/{phone_number.js → tz/phone_number.js} +89 -43
  170. package/script/src/models/phone_number/tz/phone_number.test.d.ts.map +1 -0
  171. package/script/src/reports/index.d.ts +2 -0
  172. package/script/src/reports/index.d.ts.map +1 -0
  173. package/script/src/reports/index.js +17 -0
  174. package/script/src/reports/report_manager.d.ts +144 -0
  175. package/script/src/reports/report_manager.d.ts.map +1 -0
  176. package/script/src/reports/report_manager.js +325 -0
  177. package/esm/src/models/bank/banks.d.ts.map +0 -1
  178. package/esm/src/models/bank/utils.d.ts +0 -25
  179. package/esm/src/models/bank/utils.d.ts.map +0 -1
  180. package/esm/src/models/bank/utils.js +0 -35
  181. package/esm/src/models/phone_number/antd_validator.d.ts.map +0 -1
  182. package/esm/src/models/phone_number/antdvalidator.test.d.ts.map +0 -1
  183. package/esm/src/models/phone_number/network_operator.d.ts.map +0 -1
  184. package/esm/src/models/phone_number/phone_number.d.ts.map +0 -1
  185. package/esm/src/models/phone_number/phone_number.test.d.ts.map +0 -1
  186. package/script/src/models/bank/banks.d.ts.map +0 -1
  187. package/script/src/models/bank/utils.d.ts +0 -25
  188. package/script/src/models/bank/utils.d.ts.map +0 -1
  189. package/script/src/models/bank/utils.js +0 -41
  190. package/script/src/models/phone_number/antd_validator.d.ts.map +0 -1
  191. package/script/src/models/phone_number/antdvalidator.test.d.ts.map +0 -1
  192. package/script/src/models/phone_number/network_operator.d.ts.map +0 -1
  193. package/script/src/models/phone_number/phone_number.d.ts.map +0 -1
  194. package/script/src/models/phone_number/phone_number.test.d.ts.map +0 -1
  195. /package/esm/src/{models/bank/banks.js → data/banks_tz.js} +0 -0
  196. /package/esm/src/models/phone_number/{network_operator.d.ts → tz/network_operator.d.ts} +0 -0
  197. /package/esm/src/models/phone_number/{network_operator.js → tz/network_operator.js} +0 -0
  198. /package/script/src/{models/bank/banks.js → data/banks_tz.js} +0 -0
  199. /package/script/src/models/phone_number/{network_operator.d.ts → tz/network_operator.d.ts} +0 -0
  200. /package/script/src/models/phone_number/{network_operator.js → tz/network_operator.js} +0 -0
@@ -0,0 +1,315 @@
1
+ import FileSaver from "file-saver";
2
+ import { ConfigService } from "../config/index.js";
3
+ /**
4
+ * Available file formats for reports
5
+ */
6
+ export var FileFormat;
7
+ (function (FileFormat) {
8
+ /** PDF file format */
9
+ FileFormat["PDF"] = "pdf";
10
+ /** Excel file format */
11
+ FileFormat["EXCEL"] = "excel";
12
+ })(FileFormat || (FileFormat = {}));
13
+ /**
14
+ * Available project types
15
+ */
16
+ export var ProjectType;
17
+ (function (ProjectType) {
18
+ /** Tembo Dashboard project */
19
+ ProjectType["DASHBOARD"] = "dashboard";
20
+ /** Afloat project */
21
+ ProjectType["AFLOAT"] = "afloat";
22
+ /** VertoX project */
23
+ ProjectType["VERTO_X"] = "verto_x";
24
+ })(ProjectType || (ProjectType = {}));
25
+ /**
26
+ * Available report types with improved naming
27
+ */
28
+ export var ReportType;
29
+ (function (ReportType) {
30
+ /** Merchant payout statement (Dashboard) */
31
+ ReportType["MERCHANT_DISBURSEMENT_REPORT"] = "merchant_disbursement_report";
32
+ /** Transaction revenue summary (Dashboard) */
33
+ ReportType["TRANSACTION_REVENUE_SUMMARY"] = "transaction_revenue_summary";
34
+ /** Customer wallet activity (Afloat) */
35
+ ReportType["CUSTOMER_WALLET_ACTIVITY"] = "customer_wallet_activity";
36
+ /** Customer profile information (Afloat) */
37
+ ReportType["CUSTOMER_PROFILE_SNAPSHOT"] = "customer_profile_snapshot";
38
+ /** Gateway transaction log (VertoX) */
39
+ ReportType["GATEWAY_TRANSACTION_LOG"] = "gateway_transaction_log";
40
+ })(ReportType || (ReportType = {}));
41
+ /**
42
+ * Registry of all available reports
43
+ */
44
+ export const REPORTS = {
45
+ // Dashboard Reports
46
+ [ReportType.MERCHANT_DISBURSEMENT_REPORT]: {
47
+ id: "merchant_disbursement_report",
48
+ displayName: "Merchant Disbursement Report",
49
+ endpoint: "/dashboard/merchant_disbursements",
50
+ availableFormats: [FileFormat.PDF, FileFormat.EXCEL],
51
+ projectType: ProjectType.DASHBOARD,
52
+ reportType: ReportType.MERCHANT_DISBURSEMENT_REPORT,
53
+ description: "Detailed breakdown of payments made to merchants",
54
+ },
55
+ [ReportType.TRANSACTION_REVENUE_SUMMARY]: {
56
+ id: "transaction_revenue_summary",
57
+ displayName: "Transaction Revenue Summary",
58
+ endpoint: "/dashboard/revenue_summary",
59
+ availableFormats: [FileFormat.PDF, FileFormat.EXCEL],
60
+ projectType: ProjectType.DASHBOARD,
61
+ reportType: ReportType.TRANSACTION_REVENUE_SUMMARY,
62
+ description: "Summary of all revenue transactions by period",
63
+ },
64
+ // Afloat Reports
65
+ [ReportType.CUSTOMER_WALLET_ACTIVITY]: {
66
+ id: "customer_wallet_activity",
67
+ displayName: "Customer Wallet Activity",
68
+ endpoint: "/afloat/wallet_activity",
69
+ availableFormats: [FileFormat.PDF, FileFormat.EXCEL],
70
+ projectType: ProjectType.AFLOAT,
71
+ reportType: ReportType.CUSTOMER_WALLET_ACTIVITY,
72
+ description: "Detailed record of all customer wallet transactions",
73
+ },
74
+ [ReportType.CUSTOMER_PROFILE_SNAPSHOT]: {
75
+ id: "customer_profile_snapshot",
76
+ displayName: "Customer Profile Snapshot",
77
+ endpoint: "/afloat/profile_snapshot",
78
+ availableFormats: [FileFormat.PDF],
79
+ projectType: ProjectType.AFLOAT,
80
+ reportType: ReportType.CUSTOMER_PROFILE_SNAPSHOT,
81
+ description: "Current account information and status",
82
+ },
83
+ // VertoX Reports
84
+ [ReportType.GATEWAY_TRANSACTION_LOG]: {
85
+ id: "gateway_transaction_log",
86
+ displayName: "Gateway Transaction Log",
87
+ endpoint: "/vertox/gateway_transactions",
88
+ availableFormats: [FileFormat.EXCEL],
89
+ projectType: ProjectType.VERTO_X,
90
+ reportType: ReportType.GATEWAY_TRANSACTION_LOG,
91
+ description: "Log of all payment gateway API transactions",
92
+ },
93
+ };
94
+ /**
95
+ * Get all reports for a specific project
96
+ * @param projectType The project type to filter by
97
+ * @returns Array of report definitions for the project
98
+ */
99
+ export function getReportsByProject(projectType) {
100
+ return Object.values(REPORTS).filter((report) => report.projectType === projectType);
101
+ }
102
+ /**
103
+ * Get a report by its type
104
+ * @param reportType The report type to retrieve
105
+ * @returns The report definition or undefined if not found
106
+ */
107
+ export function getReportByType(reportType) {
108
+ return REPORTS[reportType];
109
+ }
110
+ /**
111
+ * Validates if a report type is available for a project
112
+ * @param projectType The project type
113
+ * @param reportType The report type
114
+ * @returns True if the report is available for the project, false otherwise
115
+ */
116
+ export function isReportAvailableForProject(projectType, reportType) {
117
+ const report = REPORTS[reportType];
118
+ return report !== undefined && report.projectType === projectType;
119
+ }
120
+ /**
121
+ * Report Manager class for handling report downloads
122
+ */
123
+ export class ReportManager {
124
+ constructor() {
125
+ /**
126
+ * Get the base URL for the report API
127
+ * @returns The base URL
128
+ */
129
+ Object.defineProperty(this, "getBaseURL", {
130
+ enumerable: true,
131
+ configurable: true,
132
+ writable: true,
133
+ value: () => {
134
+ const url = ConfigService.instance.pdfMakerBaseUrl;
135
+ if (url.endsWith("/"))
136
+ return url.slice(0, -1);
137
+ return url;
138
+ }
139
+ });
140
+ /**
141
+ * Converts a base64 string to a Blob
142
+ * @param base64 The base64 string
143
+ * @returns A Blob
144
+ */
145
+ Object.defineProperty(this, "b64toBlob", {
146
+ enumerable: true,
147
+ configurable: true,
148
+ writable: true,
149
+ value: (base64) => fetch(base64).then((res) => res.blob())
150
+ });
151
+ }
152
+ /**
153
+ * Get the singleton instance of ReportManager
154
+ */
155
+ static get instance() {
156
+ return this._instance || (this._instance = new this());
157
+ }
158
+ /**
159
+ * Downloads a report based on project type and report type
160
+ * @param args Arguments for the report download
161
+ * @returns Promise that resolves when download is complete
162
+ */
163
+ async downloadReport(args) {
164
+ try {
165
+ // Get the report from the registry
166
+ const report = REPORTS[args.reportType];
167
+ if (!report) {
168
+ throw new Error(`Report type ${args.reportType} not configured`);
169
+ }
170
+ // Validate that the report belongs to the specified project
171
+ if (report.projectType !== args.projectType) {
172
+ throw new Error(`Report type ${args.reportType} does not belong to project ${args.projectType}`);
173
+ }
174
+ // Check if requested format is supported
175
+ if (!report.availableFormats.includes(args.fileFormat)) {
176
+ throw new Error(`File format ${args.fileFormat} not supported for ${report.displayName}`);
177
+ }
178
+ // Build URL using the report's endpoint
179
+ let url = `${this.getBaseURL()}${report.endpoint}`;
180
+ // Create a properly typed query parameters object
181
+ // deno-lint-ignore no-explicit-any
182
+ const queryParams = {
183
+ ...(args.query || {}),
184
+ format: args.fileFormat,
185
+ };
186
+ // Build the query string
187
+ const searchParams = new URLSearchParams();
188
+ for (const key in queryParams) {
189
+ if (Object.prototype.hasOwnProperty.call(queryParams, key)) {
190
+ const value = queryParams[key];
191
+ if (value !== undefined && value !== null) {
192
+ if (Array.isArray(value)) {
193
+ value.forEach((item) => {
194
+ searchParams.append(key + "[]", String(item));
195
+ });
196
+ }
197
+ else {
198
+ searchParams.append(key, String(value));
199
+ }
200
+ }
201
+ }
202
+ }
203
+ const queryString = searchParams.toString();
204
+ if (queryString) {
205
+ url += `?${queryString}`;
206
+ }
207
+ // Make the request
208
+ const response = await fetch(url, {
209
+ method: "GET",
210
+ headers: {
211
+ "Accept": "*/*",
212
+ "Content-Type": "application/json",
213
+ "Authorization": `Bearer ${args.token}`,
214
+ },
215
+ });
216
+ if (response.status !== 200) {
217
+ await this.handleErrorResponse(response);
218
+ }
219
+ // Process the download
220
+ await this.processDownload(response, report, args.fileFormat);
221
+ }
222
+ catch (error) {
223
+ console.error("Report download failed:", error);
224
+ throw error;
225
+ }
226
+ }
227
+ /**
228
+ * Process the download
229
+ * @param response The response from the API
230
+ * @param report The report definition
231
+ * @param fileFormat The requested file format
232
+ */
233
+ async processDownload(response, report, fileFormat) {
234
+ const contentDisposition = response.headers.get("Content-Disposition");
235
+ // Get default filename based on report and file format
236
+ const defaultFilename = this.getDefaultFilename(report, fileFormat);
237
+ // Try to get filename from Content-Disposition, fall back to default
238
+ const fileName = this.extractFilenameFromContentDisposition(contentDisposition) ||
239
+ defaultFilename;
240
+ // Handle the response based on content type
241
+ // deno-lint-ignore no-explicit-any
242
+ const blob = await this.b64toBlob(await response.text());
243
+ FileSaver.saveAs(blob, fileName);
244
+ }
245
+ /**
246
+ * Handle error responses from the API
247
+ * @param response The response from the API
248
+ * @throws Error with appropriate message
249
+ */
250
+ async handleErrorResponse(response) {
251
+ let errorMessage = "Encountered an error while generating report";
252
+ try {
253
+ // Try to parse as JSON first
254
+ const contentType = response.headers.get("Content-Type");
255
+ if (contentType && contentType.includes("application/json")) {
256
+ const errorData = await response.json();
257
+ errorMessage = errorData.message || errorData.error ||
258
+ errorMessage;
259
+ }
260
+ else {
261
+ // Try to get error as text
262
+ const textError = await response.text();
263
+ if (textError) {
264
+ errorMessage = textError;
265
+ }
266
+ }
267
+ }
268
+ catch (parseError) {
269
+ console.error("Error parsing error response:", parseError);
270
+ }
271
+ throw new Error(errorMessage);
272
+ }
273
+ /**
274
+ * Generates a default filename based on report and file format
275
+ * @param report The report definition
276
+ * @param fileFormat The requested file format
277
+ * @returns A suitable default filename with proper extension
278
+ */
279
+ getDefaultFilename(report, fileFormat) {
280
+ const date = new Date().toISOString().slice(0, 10); // YYYY-MM-DD format
281
+ // Build the filename with project, report type, and date
282
+ const baseFilename = `${report.id}_${date}`;
283
+ // Add the extension based on the file format
284
+ return fileFormat === FileFormat.PDF
285
+ ? `${baseFilename}.pdf`
286
+ : `${baseFilename}.xlsx`;
287
+ }
288
+ /**
289
+ * Extracts the filename from the Content-Disposition header
290
+ * @param contentDisposition The Content-Disposition header value
291
+ * @returns The extracted filename or null if not found
292
+ */
293
+ extractFilenameFromContentDisposition(contentDisposition) {
294
+ // Check if the header exists
295
+ if (!contentDisposition) {
296
+ return null;
297
+ }
298
+ // Try to match the filename pattern
299
+ const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
300
+ const matches = filenameRegex.exec(contentDisposition);
301
+ if (matches && matches[1]) {
302
+ // Clean up the filename by removing quotes if present
303
+ let filename = matches[1].trim();
304
+ // Remove surrounding quotes if they exist
305
+ if (filename.startsWith('"') && filename.endsWith('"')) {
306
+ filename = filename.substring(1, filename.length - 1);
307
+ }
308
+ else if (filename.startsWith("'") && filename.endsWith("'")) {
309
+ filename = filename.substring(1, filename.length - 1);
310
+ }
311
+ return filename;
312
+ }
313
+ return null;
314
+ }
315
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/frontend-core",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,9 @@
23
23
  },
24
24
  "private": false,
25
25
  "dependencies": {
26
- "antd": "^5.22.7",
27
- "uuid": "^11.0.3"
26
+ "antd": "^5.24.2",
27
+ "file-saver": "^2.0.5",
28
+ "uuid": "^11.1.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/node": "^20.9.0",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion_state.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,qBAAa,cAAc;;;IAiBzB;;;;;;;;;;;;OAYG;IACH,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAI9B;;;;;;;;;;;;OAYG;IACH,qBAAqB,CAAC,GAAG,EAAE,OAAO;IAIlC;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM;IAI7B;;;;;;;;;;OAUG;IACH,2BAA2B;IAM3B;;;;;;;;;;;;;;;;OAgBG;IACH,wBAAwB,IAAI,OAAO;IAInC;;;;;;;;;;OAUG;IACH,mBAAmB,IAAI,IAAI;IAS3B;;;;;;;;;;;;;;;;OAgBG;IACH,4BAA4B,IAAI,OAAO;CAIxC;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_test_suite.d.ts","s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AC;IAE5C,oDAAoD;IACpD,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAEhD,sDAAsD;IACtD,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAElD,4EAA4E;IAC5E,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,SAAS,CAAC,CAAC,CAAC,CAUd;yBAZe,QAAQ;eAsCc,CAAC,WAC5B,YAAY,CAAC,CAAC,CAAC,KACvB,SAAS,CAAC,CAAC,CAAC;iBA+B2B,CAAC,WAChC,YAAY,CAAC,CAAC,CAAC,KACvB,SAAS,CAAC,CAAC,CAAC;eA+BuB,CAAC,WAC5B,YAAY,CAAC,CAAC,CAAC,KACvB,SAAS,CAAC,CAAC,CAAC"}
package/script/mod.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from "./src/models/index.js";
2
2
  export * from "./src/utils/index.js";
3
+ export * from "./src/reports/index.js";
4
+ export * from "./src/config/index.js";
3
5
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
package/script/mod.js CHANGED
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./src/models/index.js"), exports);
18
18
  __exportStar(require("./src/utils/index.js"), exports);
19
+ __exportStar(require("./src/reports/index.js"), exports);
20
+ __exportStar(require("./src/config/index.js"), exports);
@@ -0,0 +1,11 @@
1
+ export declare class ConfigService {
2
+ private static _instance;
3
+ private _pdfMakerBaseUrl;
4
+ private constructor();
5
+ static get instance(): ConfigService;
6
+ initialize(config: {
7
+ pdfMakerBaseUrl: string;
8
+ }): void;
9
+ get pdfMakerBaseUrl(): string;
10
+ }
11
+ //# sourceMappingURL=config_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config_service.d.ts","sourceRoot":"","sources":["../../../src/src/config/config_service.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IACxC,OAAO,CAAC,gBAAgB,CAAc;IAEtC,OAAO;IAEP,WAAkB,QAAQ,kBAEzB;IAEM,UAAU,CAAC,MAAM,EAAE;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE;IAIrD,IAAW,eAAe,IAAI,MAAM,CAEnC;CACF"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigService = void 0;
4
+ class ConfigService {
5
+ constructor() {
6
+ Object.defineProperty(this, "_pdfMakerBaseUrl", {
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true,
10
+ value: ""
11
+ });
12
+ }
13
+ static get instance() {
14
+ return this._instance || (this._instance = new this());
15
+ }
16
+ initialize(config) {
17
+ this._pdfMakerBaseUrl = config.pdfMakerBaseUrl;
18
+ }
19
+ get pdfMakerBaseUrl() {
20
+ return this._pdfMakerBaseUrl;
21
+ }
22
+ }
23
+ exports.ConfigService = ConfigService;
@@ -0,0 +1,2 @@
1
+ export * from "./config_service.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,17 @@
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("./config_service.js"), exports);
@@ -4,4 +4,4 @@ declare const _default: {
4
4
  swiftCode: string;
5
5
  }[];
6
6
  export default _default;
7
- //# sourceMappingURL=banks.d.ts.map
7
+ //# sourceMappingURL=banks_tz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banks_tz.d.ts","sourceRoot":"","sources":["../../../src/src/data/banks_tz.js"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ name: string;
3
+ code: string;
4
+ }[];
5
+ export default _default;
6
+ //# sourceMappingURL=countries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.d.ts","sourceRoot":"","sources":["../../../src/src/data/countries.js"],"names":[],"mappings":""}