@temboplus/frontend-core 0.4.2 → 0.4.4
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
CHANGED
|
@@ -1,31 +1,72 @@
|
|
|
1
|
-
# @temboplus/frontend-core
|
|
1
|
+
# @temboplus/frontend-core-legacy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
⚠️ **Legacy package**
|
|
4
|
+
|
|
5
|
+
This package contains the previous implementation of the TemboPlus Frontend Core library.
|
|
6
|
+
It is maintained for existing applications that depend on the legacy architecture.
|
|
7
|
+
|
|
8
|
+
**Status:** Maintenance mode
|
|
9
|
+
|
|
10
|
+
* Bug fixes only
|
|
11
|
+
* Security fixes only
|
|
12
|
+
* No new features
|
|
13
|
+
|
|
14
|
+
For new development, use:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
@temboplus/frontend-core
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
A robust and versatile JavaScript/TypeScript library designed to streamline the development of TemboPlus front-end applications.
|
|
25
|
+
|
|
26
|
+
This library provides a comprehensive suite of utilities, standardized data models, and services to ensure consistency, efficiency, and maintainability across legacy TemboPlus projects.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Migration Note
|
|
31
|
+
|
|
32
|
+
Existing projects may continue using:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
@temboplus/frontend-core-legacy
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
New projects should use:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
@temboplus/frontend-core
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Migration timelines depend on product requirements and will be handled incrementally.
|
|
45
|
+
|
|
46
|
+
---
|
|
4
47
|
|
|
5
48
|
## Core Features
|
|
6
49
|
|
|
7
|
-
* **Utility Functions:** A collection of
|
|
8
|
-
* **Standardized Data Models:** Consistent
|
|
9
|
-
* **Comprehensive Report Management:** A powerful `ReportManager` for generating and downloading reports
|
|
10
|
-
* **Centralized Configuration Service:** A flexible `ConfigService` for managing application settings
|
|
50
|
+
* **Utility Functions:** A collection of helper functions to simplify common development tasks
|
|
51
|
+
* **Standardized Data Models:** Consistent data structures for managing essential data types
|
|
52
|
+
* **Comprehensive Report Management:** A powerful `ReportManager` for generating and downloading reports
|
|
53
|
+
* **Centralized Configuration Service:** A flexible `ConfigService` for managing application settings
|
|
54
|
+
|
|
55
|
+
---
|
|
11
56
|
|
|
12
|
-
##
|
|
57
|
+
## Installation
|
|
13
58
|
|
|
14
|
-
|
|
59
|
+
```
|
|
60
|
+
npm install @temboplus/frontend-core-legacy
|
|
61
|
+
```
|
|
15
62
|
|
|
16
|
-
* **PhoneNumber:** Robust international phone number validation and formatting.
|
|
17
|
-
* **TZPhoneNumber:** Specialized phone number handling for Tanzania, including network operator identification.
|
|
18
|
-
* **Amount:** Precise currency value management, with support for formatting and conversion.
|
|
19
|
-
* **Currency:** Detailed currency information, including symbols, formatting rules, and validation.
|
|
20
|
-
* **Country:** Enhanced country data handling with ISO-2 and ISO-3 codes, official names, flag emojis, and strongly-typed geographical categorization.
|
|
21
|
-
* **Bank:** Consistent bank account information management.
|
|
22
63
|
|
|
23
64
|
## Report Management with `ReportManager`
|
|
24
65
|
|
|
25
66
|
The `ReportManager` simplifies the process of generating and downloading reports across various TemboPlus projects.
|
|
26
67
|
|
|
27
68
|
```typescript
|
|
28
|
-
import { ReportManager, FileFormat, ReportType, ProjectType } from '@temboplus/frontend-core';
|
|
69
|
+
import { ReportManager, FileFormat, ReportType, ProjectType } from '@temboplus/frontend-core-legacy';
|
|
29
70
|
|
|
30
71
|
// Download a report
|
|
31
72
|
async function downloadMerchantDisbursementReport() {
|
|
@@ -42,7 +83,7 @@ async function downloadMerchantDisbursementReport() {
|
|
|
42
83
|
}
|
|
43
84
|
|
|
44
85
|
// Get all reports for a specific project
|
|
45
|
-
import { getReportsByProject } from '@temboplus/frontend-core';
|
|
86
|
+
import { getReportsByProject } from '@temboplus/frontend-core-legacy';
|
|
46
87
|
function getAllDashboardReports(){
|
|
47
88
|
const dashboardReports = getReportsByProject(ProjectType.DASHBOARD);
|
|
48
89
|
return dashboardReports;
|
|
@@ -65,7 +106,7 @@ function getAllDashboardReports(){
|
|
|
65
106
|
The `ConfigService` provides a centralized mechanism for managing application configurations.
|
|
66
107
|
|
|
67
108
|
```typescript
|
|
68
|
-
import { ConfigService } from '@temboplus/frontend-core';
|
|
109
|
+
import { ConfigService } from '@temboplus/frontend-core-legacy';
|
|
69
110
|
|
|
70
111
|
// Initialize configuration at application startup
|
|
71
112
|
ConfigService.instance.initialize({
|
|
@@ -82,7 +123,7 @@ Each data model includes validation methods to ensure data integrity:
|
|
|
82
123
|
* **`validate()`:** Verifies the validity of an existing data model instance.
|
|
83
124
|
|
|
84
125
|
```typescript
|
|
85
|
-
import { PhoneNumber, Amount } from '@temboplus/frontend-core';
|
|
126
|
+
import { PhoneNumber, Amount } from '@temboplus/frontend-core-legacy';
|
|
86
127
|
|
|
87
128
|
// Using is()
|
|
88
129
|
if (PhoneNumber.is(someObject)) {
|
|
@@ -121,7 +162,7 @@ import {
|
|
|
121
162
|
ISO3CountryCode,
|
|
122
163
|
CountryCode,
|
|
123
164
|
CurrencyCode
|
|
124
|
-
} from '@temboplus/frontend-core';
|
|
165
|
+
} from '@temboplus/frontend-core-legacy';
|
|
125
166
|
|
|
126
167
|
// Type-safe function parameters
|
|
127
168
|
function processTransaction(
|
|
@@ -146,7 +187,7 @@ processTransaction(400, "USD", "ZZZ"); // Error: "ZZZ" is not a valid CountryCo
|
|
|
146
187
|
Convenient static properties are available for accessing common data:
|
|
147
188
|
|
|
148
189
|
```typescript
|
|
149
|
-
import { Country, Currency, Bank, CONTINENT, SUB_REGION } from '@temboplus/frontend-core';
|
|
190
|
+
import { Country, Currency, Bank, CONTINENT, SUB_REGION } from '@temboplus/frontend-core-legacy';
|
|
150
191
|
|
|
151
192
|
// Country access with enhanced features
|
|
152
193
|
const tanzania = Country.TZ;
|
|
@@ -179,7 +220,7 @@ const nmb = Bank.NMB;
|
|
|
179
220
|
## Phone Number Usage
|
|
180
221
|
|
|
181
222
|
```typescript
|
|
182
|
-
import { PhoneNumber, TZPhoneNumber, PhoneNumberFormat } from '@temboplus/frontend-core';
|
|
223
|
+
import { PhoneNumber, TZPhoneNumber, PhoneNumberFormat } from '@temboplus/frontend-core-legacy';
|
|
183
224
|
|
|
184
225
|
// International phone numbers
|
|
185
226
|
const internationalPhone = PhoneNumber.from("+1 (202) 555-0123");
|
|
@@ -202,5 +243,5 @@ console.log(tanzaniaPhone.networkOperator.name); // "Yas"
|
|
|
202
243
|
## Installation
|
|
203
244
|
|
|
204
245
|
```bash
|
|
205
|
-
npm install @temboplus/frontend-core
|
|
246
|
+
npm install @temboplus/frontend-core-legacy
|
|
206
247
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;IACf,sBAAsB;IACtB,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,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BjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;IACf,sBAAsB;IACtB,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,CAOhB;IAEF;;;;OAIG;IACU,cAAc,CAAC,IAAI,EAAE;QAChC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,UAAU,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;QAEvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmFjB;;;;;OAKG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,mBAAmB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;;;OAIG;IACH,OAAO,CAAC,qCAAqC;IA6B7C;;;;OAIG;IACH,OAAO,CAAC,SAAS,CACyB;CAC3C"}
|
|
@@ -286,9 +286,15 @@ export class ReportManager {
|
|
|
286
286
|
// Build the filename with project, report type, and date
|
|
287
287
|
const baseFilename = `${report.id}_${date}`;
|
|
288
288
|
// Add the extension based on the file format
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
switch (fileFormat) {
|
|
290
|
+
case FileFormat.PDF:
|
|
291
|
+
return `${baseFilename}.pdf`;
|
|
292
|
+
case FileFormat.CSV:
|
|
293
|
+
return `${baseFilename}.csv`;
|
|
294
|
+
case FileFormat.EXCEL:
|
|
295
|
+
default:
|
|
296
|
+
return `${baseFilename}.xlsx`;
|
|
297
|
+
}
|
|
292
298
|
}
|
|
293
299
|
/**
|
|
294
300
|
* Extracts the filename from the Content-Disposition header
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;IACf,sBAAsB;IACtB,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,CAOhB;IAEF;;;;OAIG;IACU,cAAc,CAAC,IAAI,EAAE;QAChC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,UAAU,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;QAEvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmFjB;;;;;OAKG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,mBAAmB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;IACf,sBAAsB;IACtB,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC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EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmFjB;;;;;OAKG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,mBAAmB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;;;OAIG;IACH,OAAO,CAAC,qCAAqC;IA6B7C;;;;OAIG;IACH,OAAO,CAAC,SAAS,CACyB;CAC3C"}
|
|
@@ -295,9 +295,15 @@ class ReportManager {
|
|
|
295
295
|
// Build the filename with project, report type, and date
|
|
296
296
|
const baseFilename = `${report.id}_${date}`;
|
|
297
297
|
// Add the extension based on the file format
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
298
|
+
switch (fileFormat) {
|
|
299
|
+
case FileFormat.PDF:
|
|
300
|
+
return `${baseFilename}.pdf`;
|
|
301
|
+
case FileFormat.CSV:
|
|
302
|
+
return `${baseFilename}.csv`;
|
|
303
|
+
case FileFormat.EXCEL:
|
|
304
|
+
default:
|
|
305
|
+
return `${baseFilename}.xlsx`;
|
|
306
|
+
}
|
|
301
307
|
}
|
|
302
308
|
/**
|
|
303
309
|
* Extracts the filename from the Content-Disposition header
|