@temboplus/frontend-core 0.4.3 → 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.
Files changed (2) hide show
  1. package/README.md +63 -22
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,31 +1,72 @@
1
- # @temboplus/frontend-core
1
+ # @temboplus/frontend-core-legacy
2
2
 
3
- A robust and versatile JavaScript/TypeScript library designed to streamline the development of TemboPlus front-end applications. This library provides a comprehensive suite of utilities, standardized data models, and services to ensure consistency, efficiency, and maintainability across all TemboPlus projects.
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 pre-built helper functions to simplify common development tasks.
8
- * **Standardized Data Models:** Consistent and reliable data structures for managing essential data types, including phone numbers, amounts, currencies, countries, and bank details.
9
- * **Comprehensive Report Management:** A powerful `ReportManager` for generating and downloading reports in various formats across different TemboPlus projects.
10
- * **Centralized Configuration Service:** A flexible `ConfigService` for managing application settings and environment configurations.
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
- ## Data Models
57
+ ## Installation
13
58
 
14
- This library offers a set of meticulously crafted data models, each designed to handle specific data types with precision:
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
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/frontend-core",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
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",