@temboplus/frontend-core 0.3.0-beta.3 → 0.4.0

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.
@@ -7,20 +7,15 @@
7
7
  * These two classes have been intentionally placed in the same file to resolve
8
8
  * a circular dependency issue. The original implementation had these in separate files:
9
9
  *
10
- * - Currency class: Defines currency properties and static accessors
10
+ * - Currency class: Defines currency properties and lookup helpers
11
11
  * - CurrencyService class: Loads currency data and provides instance methods
12
12
  *
13
13
  * The circular dependency occurred because:
14
- * 1. Currency needed CurrencyService to initialize its static properties
14
+ * 1. Currency needed CurrencyService for centralized lookups
15
15
  * 2. CurrencyService needed Currency to create Currency instances
16
16
  *
17
- * Previous attempts to solve this used setTimeout(0) to defer static initialization,
18
- * but this created race conditions where static properties weren't immediately available
19
- * after import (Currency.AFN would be undefined on first access).
20
- *
21
17
  * By combining both classes in a single file:
22
18
  * - We ensure proper initialization order
23
- * - All static properties are immediately available after import
24
19
  * - The public API remains unchanged
25
20
  *
26
21
  * This approach follows the principle that closely related classes with circular
@@ -45,241 +40,6 @@ export declare class Currency {
45
40
  private readonly _rounding;
46
41
  private readonly _code;
47
42
  private readonly _namePlural;
48
- static readonly USD: Currency;
49
- static readonly CAD: Currency;
50
- static readonly EUR: Currency;
51
- static readonly AED: Currency;
52
- static readonly AFN: Currency;
53
- static readonly ALL: Currency;
54
- static readonly AMD: Currency;
55
- static readonly ARS: Currency;
56
- static readonly AUD: Currency;
57
- static readonly AZN: Currency;
58
- static readonly BAM: Currency;
59
- static readonly BDT: Currency;
60
- static readonly BGN: Currency;
61
- static readonly BHD: Currency;
62
- static readonly BIF: Currency;
63
- static readonly BND: Currency;
64
- static readonly BOB: Currency;
65
- static readonly BRL: Currency;
66
- static readonly BWP: Currency;
67
- static readonly BYN: Currency;
68
- static readonly BZD: Currency;
69
- static readonly CDF: Currency;
70
- static readonly CHF: Currency;
71
- static readonly CLP: Currency;
72
- static readonly CNY: Currency;
73
- static readonly COP: Currency;
74
- static readonly CRC: Currency;
75
- static readonly CVE: Currency;
76
- static readonly CZK: Currency;
77
- static readonly DJF: Currency;
78
- static readonly DKK: Currency;
79
- static readonly DOP: Currency;
80
- static readonly DZD: Currency;
81
- static readonly EEK: Currency;
82
- static readonly EGP: Currency;
83
- static readonly ERN: Currency;
84
- static readonly ETB: Currency;
85
- static readonly GBP: Currency;
86
- static readonly GEL: Currency;
87
- static readonly GHS: Currency;
88
- static readonly GNF: Currency;
89
- static readonly GTQ: Currency;
90
- static readonly HKD: Currency;
91
- static readonly HNL: Currency;
92
- static readonly HRK: Currency;
93
- static readonly HUF: Currency;
94
- static readonly IDR: Currency;
95
- static readonly ILS: Currency;
96
- static readonly INR: Currency;
97
- static readonly IQD: Currency;
98
- static readonly IRR: Currency;
99
- static readonly ISK: Currency;
100
- static readonly JMD: Currency;
101
- static readonly JOD: Currency;
102
- static readonly JPY: Currency;
103
- static readonly KES: Currency;
104
- static readonly KHR: Currency;
105
- static readonly KMF: Currency;
106
- static readonly KRW: Currency;
107
- static readonly KWD: Currency;
108
- static readonly KZT: Currency;
109
- static readonly LBP: Currency;
110
- static readonly LKR: Currency;
111
- static readonly LTL: Currency;
112
- static readonly LVL: Currency;
113
- static readonly LYD: Currency;
114
- static readonly MAD: Currency;
115
- static readonly MDL: Currency;
116
- static readonly MGA: Currency;
117
- static readonly MKD: Currency;
118
- static readonly MMK: Currency;
119
- static readonly MOP: Currency;
120
- static readonly MUR: Currency;
121
- static readonly MXN: Currency;
122
- static readonly MYR: Currency;
123
- static readonly MZN: Currency;
124
- static readonly NAD: Currency;
125
- static readonly NGN: Currency;
126
- static readonly NIO: Currency;
127
- static readonly NOK: Currency;
128
- static readonly NPR: Currency;
129
- static readonly NZD: Currency;
130
- static readonly OMR: Currency;
131
- static readonly PAB: Currency;
132
- static readonly PEN: Currency;
133
- static readonly PHP: Currency;
134
- static readonly PKR: Currency;
135
- static readonly PLN: Currency;
136
- static readonly PYG: Currency;
137
- static readonly QAR: Currency;
138
- static readonly RON: Currency;
139
- static readonly RSD: Currency;
140
- static readonly RUB: Currency;
141
- static readonly RWF: Currency;
142
- static readonly SAR: Currency;
143
- static readonly SDG: Currency;
144
- static readonly SEK: Currency;
145
- static readonly SGD: Currency;
146
- static readonly SOS: Currency;
147
- static readonly SYP: Currency;
148
- static readonly THB: Currency;
149
- static readonly TND: Currency;
150
- static readonly TOP: Currency;
151
- static readonly TRY: Currency;
152
- static readonly TTD: Currency;
153
- static readonly TWD: Currency;
154
- static readonly TZS: Currency;
155
- static readonly UAH: Currency;
156
- static readonly UGX: Currency;
157
- static readonly UYU: Currency;
158
- static readonly UZS: Currency;
159
- static readonly VEF: Currency;
160
- static readonly VND: Currency;
161
- static readonly XAF: Currency;
162
- static readonly XOF: Currency;
163
- static readonly YER: Currency;
164
- static readonly ZAR: Currency;
165
- static readonly ZMK: Currency;
166
- static readonly ZWL: Currency;
167
- static readonly ZIMBABWEAN_DOLLAR: Currency;
168
- static readonly ZAMBIAN_KWACHA: Currency;
169
- static readonly YEMENI_RIAL: Currency;
170
- static readonly URUGUAYAN_PESO: Currency;
171
- static readonly UZBEKISTAN_SOM: Currency;
172
- static readonly VENEZUELAN_BOLIVAR: Currency;
173
- static readonly VIETNAMESE_DONG: Currency;
174
- static readonly UGANDAN_SHILLING: Currency;
175
- static readonly UKRAINIAN_HRYVNIA: Currency;
176
- static readonly TANZANIAN_SHILLING: Currency;
177
- static readonly TAIWAN_NEW_DOLLAR: Currency;
178
- static readonly TRINIDAD_AND_TOBAGO_DOLLAR: Currency;
179
- static readonly TURKISH_LIRA: Currency;
180
- static readonly TONGAN_PAANGA: Currency;
181
- static readonly TUNISIAN_DINAR: Currency;
182
- static readonly THAI_BAHT: Currency;
183
- static readonly SYRIAN_POUND: Currency;
184
- static readonly SOMALI_SHILLING: Currency;
185
- static readonly SINGAPORE_DOLLAR: Currency;
186
- static readonly SWEDISH_KRONA: Currency;
187
- static readonly SUDANESE_POUND: Currency;
188
- static readonly SAUDI_RIYAL: Currency;
189
- static readonly RWANDAN_FRANC: Currency;
190
- static readonly RUSSIAN_RUBLE: Currency;
191
- static readonly SERBIAN_DINAR: Currency;
192
- static readonly ROMANIAN_LEU: Currency;
193
- static readonly QATARI_RIAL: Currency;
194
- static readonly PARAGUAYAN_GUARANI: Currency;
195
- static readonly POLISH_ZLOTY: Currency;
196
- static readonly PAKISTANI_RUPEE: Currency;
197
- static readonly PHILIPPINE_PESO: Currency;
198
- static readonly PERUVIAN_NUEVO_SOL: Currency;
199
- static readonly PANAMANIAN_BALBOA: Currency;
200
- static readonly OMANI_RIAL: Currency;
201
- static readonly NEW_ZEALAND_DOLLAR: Currency;
202
- static readonly NEPALESE_RUPEE: Currency;
203
- static readonly NORWEGIAN_KRONE: Currency;
204
- static readonly NICARAGUAN_CORDOBA: Currency;
205
- static readonly NIGERIAN_NAIRA: Currency;
206
- static readonly NAMIBIAN_DOLLAR: Currency;
207
- static readonly MOZAMBICAN_METICAL: Currency;
208
- static readonly MALAYSIAN_RINGGIT: Currency;
209
- static readonly MEXICAN_PESO: Currency;
210
- static readonly MAURITIAN_RUPEE: Currency;
211
- static readonly MACANESE_PATACA: Currency;
212
- static readonly MYANMA_KYAT: Currency;
213
- static readonly MACEDONIAN_DENAR: Currency;
214
- static readonly MALAGASY_ARIARY: Currency;
215
- static readonly MOLDOVAN_LEU: Currency;
216
- static readonly MOROCCAN_DIRHAM: Currency;
217
- static readonly LIBYAN_DINAR: Currency;
218
- static readonly LATVIAN_LATS: Currency;
219
- static readonly LITHUANIAN_LITAS: Currency;
220
- static readonly SRI_LANKAN_RUPEE: Currency;
221
- static readonly LEBANESE_POUND: Currency;
222
- static readonly KAZAKHSTANI_TENGE: Currency;
223
- static readonly KUWAITI_DINAR: Currency;
224
- static readonly SOUTH_KOREAN_WON: Currency;
225
- static readonly CAMBODIAN_RIEL: Currency;
226
- static readonly KENYAN_SHILLING: Currency;
227
- static readonly JORDANIAN_DINAR: Currency;
228
- static readonly JAMAICAN_DOLLAR: Currency;
229
- static readonly ICELANDIC_KRONA: Currency;
230
- static readonly IRANIAN_RIAL: Currency;
231
- static readonly IRAQI_DINAR: Currency;
232
- static readonly INDIAN_RUPEE: Currency;
233
- static readonly ISRAELI_NEW_SHEQEL: Currency;
234
- static readonly INDONESIAN_RUPIAH: Currency;
235
- static readonly HUNGARIAN_FORINT: Currency;
236
- static readonly CROATIAN_KUNA: Currency;
237
- static readonly HONDURAN_LEMPIRA: Currency;
238
- static readonly HONG_KONG_DOLLAR: Currency;
239
- static readonly GUATEMALAN_QUETZAL: Currency;
240
- static readonly GUINEAN_FRANC: Currency;
241
- static readonly GHANAIAN_CEDI: Currency;
242
- static readonly GEORGIAN_LARI: Currency;
243
- static readonly BRITISH_POUND_STERLING: Currency;
244
- static readonly ETHIOPIAN_BIRR: Currency;
245
- static readonly ERITREAN_NAKFA: Currency;
246
- static readonly EGYPTIAN_POUND: Currency;
247
- static readonly ESTONIAN_KROON: Currency;
248
- static readonly ALGERIAN_DINAR: Currency;
249
- static readonly DOMINICAN_PESO: Currency;
250
- static readonly DANISH_KRONE: Currency;
251
- static readonly DJIBOUTIAN_FRANC: Currency;
252
- static readonly CZECH_REPUBLIC_KORUNA: Currency;
253
- static readonly CAPE_VERDEAN_ESCUDO: Currency;
254
- static readonly COSTA_RICAN_COLON: Currency;
255
- static readonly COLOMBIAN_PESO: Currency;
256
- static readonly CHINESE_YUAN: Currency;
257
- static readonly CHILEAN_PESO: Currency;
258
- static readonly SWISS_FRANC: Currency;
259
- static readonly CONGOLESE_FRANC: Currency;
260
- static readonly BELIZE_DOLLAR: Currency;
261
- static readonly BELARUSIAN_RUBLE: Currency;
262
- static readonly BOTSWANAN_PULA: Currency;
263
- static readonly BRAZILIAN_REAL: Currency;
264
- static readonly BOLIVIAN_BOLIVIANO: Currency;
265
- static readonly BRUNEI_DOLLAR: Currency;
266
- static readonly BURUNDIAN_FRANC: Currency;
267
- static readonly BAHRAINI_DINAR: Currency;
268
- static readonly BULGARIAN_LEV: Currency;
269
- static readonly BANGLADESHI_TAKA: Currency;
270
- static readonly BOSNIAN_CONVERTIBLE_MARK: Currency;
271
- static readonly AZERBAIJANI_MANAT: Currency;
272
- static readonly ARGENTINE_PESO: Currency;
273
- static readonly ARMENIAN_DRAM: Currency;
274
- static readonly ALBANIAN_LEK: Currency;
275
- static readonly AFGHAN_AFGHANI: Currency;
276
- static readonly UNITED_ARAB_EMIRATES_DIRHAM: Currency;
277
- static readonly EURO: Currency;
278
- static readonly CANADIAN_DOLLAR: Currency;
279
- static readonly US_DOLLAR: Currency;
280
- static readonly AUSTRALIAN_DOLLAR: Currency;
281
- static readonly CFA_FRANC_BEAC: Currency;
282
- static readonly CFA_FRANC_BCEAO: Currency;
283
43
  /**
284
44
  * Creates a new Currency instance.
285
45
  * @param {string} _symbol - The international symbol of the currency
@@ -337,12 +97,6 @@ export declare class Currency {
337
97
  * @returns {Currency | undefined} The currency corresponding to the ISO code or `undefined` if not found.
338
98
  */
339
99
  static fromCode(code: CurrencyCode): Currency | undefined;
340
- /**
341
- * Retrieves a currency by its name.
342
- * @param {string} currencyName The name of the currency.
343
- * @returns {Currency | undefined} The currency corresponding to the name or `undefined` if not found.
344
- */
345
- static fromName(currencyName: string): Currency | undefined;
346
100
  /**
347
101
  * Returns all available currencies.
348
102
  * @returns {Currency[]} Array of all currencies
@@ -355,15 +109,9 @@ export declare class Currency {
355
109
  */
356
110
  static isValidCode(code?: CurrencyCode | null): boolean;
357
111
  /**
358
- * Validates if a given currency name is valid
359
- * @param currencyName The currency name to validate
360
- * @returns True if the currency name is valid
361
- */
362
- static isValidName(currencyName?: string | null): boolean;
363
- /**
364
- * Attempts to create a Currency instance from a currency name or ISO code string.
112
+ * Attempts to create a Currency instance from an ISO code string.
365
113
  * The `CurrencyCode` type provides type hints for valid ISO codes but resolves to `string`.
366
- * @param input The currency name or ISO code string.
114
+ * @param input The ISO code string.
367
115
  * @returns A Currency instance if valid input, undefined otherwise.
368
116
  */
369
117
  static from(input: string | CurrencyCode): Currency | undefined;
@@ -402,8 +150,6 @@ export declare class CurrencyService {
402
150
  private static instance;
403
151
  private currencyList;
404
152
  private currencyRecord;
405
- private nameRecord;
406
- private staticReferences;
407
153
  private constructor();
408
154
  /**
409
155
  * Gets the singleton instance of CurrencyService.
@@ -427,23 +173,12 @@ export declare class CurrencyService {
427
173
  * @returns {Record<string, Currency>} Record of currency codes and currency objects
428
174
  */
429
175
  getAllAsRecord(): Record<string, Currency>;
430
- /**
431
- * Gets static currency references to be used by the Currency class.
432
- * @returns {Map<string, Currency>} Map of static references
433
- */
434
- getStaticReferences(): Map<string, Currency>;
435
176
  /**
436
177
  * Retrieves a currency by its ISO code.
437
178
  * @param {string} code The ISO code of the currency.
438
179
  * @returns {Currency | undefined} The currency corresponding to the ISO code or `undefined` if not found.
439
180
  */
440
181
  fromCode(code: string): Currency | undefined;
441
- /**
442
- * Retrieves a currency by its name.
443
- * @param {string} currencyName The name of the currency.
444
- * @returns {Currency | undefined} The currency corresponding to the name or `undefined` if not found.
445
- */
446
- fromName(currencyName: string): Currency | undefined;
447
182
  /**
448
183
  * Validates if a given ISO currency code is valid
449
184
  *
@@ -456,17 +191,6 @@ export declare class CurrencyService {
456
191
  * Returns false otherwise.
457
192
  */
458
193
  isValidCode(code?: string | null): boolean;
459
- /**
460
- * Validates if a given currency name is valid
461
- *
462
- * @param {string | null | undefined} currencyName - The currency name to validate.
463
- *
464
- * @returns {boolean} Returns true if:
465
- * - The currency name is not null/undefined
466
- * - The currency name successfully resolves to a valid Currency instance
467
- * Returns false otherwise.
468
- */
469
- isValidName(currencyName?: string | null): boolean;
470
194
  /**
471
195
  * Gets a regex-ready pattern matching all currency symbols
472
196
  * Pattern is memoized for performance
@@ -14,8 +14,7 @@ export declare enum TZMNOId {
14
14
  * Values are used in payout channel-code field and should not change.
15
15
  */
16
16
  export declare enum KEMNOId {
17
- SAFARICOM = "SAFARICOM",
18
- AIRTEL = "AIRTEL"
17
+ SAFARICOM = "SAFARICOM"
19
18
  }
20
19
  /**
21
20
  * Union type for all MNO IDs
@@ -1,2 +1 @@
1
- export * from "./config.js";
2
1
  export * from "./logger.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/frontend-core",
3
- "version": "0.3.0-beta.3",
3
+ "version": "0.4.0",
4
4
  "description": "A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.",
5
5
  "author": "Okello Gerald",
6
6
  "license": "MIT",
@@ -14,16 +14,16 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "exports": {
16
16
  ".": {
17
+ "types": "./dist/index.d.ts",
17
18
  "import": "./dist/index.esm.js",
18
- "require": "./dist/index.cjs.js",
19
- "types": "./dist/index.d.ts"
19
+ "require": "./dist/index.cjs.js"
20
20
  }
21
21
  },
22
22
  "files": [
23
23
  "dist"
24
24
  ],
25
25
  "scripts": {
26
- "build": "rollup -c rollup.config.js --configTsconfig tsconfig.build.json",
26
+ "build": "rollup -c rollup.config.js",
27
27
  "prepare": "npm run build",
28
28
  "dev": "npm run build -- --watch",
29
29
  "test": "vitest"
@@ -37,7 +37,6 @@
37
37
  },
38
38
  "homepage": "https://github.com/TemboPlus-Frontend/frontend-core-js#readme",
39
39
  "dependencies": {
40
- "file-saver": "^2.0.5",
41
40
  "libphonenumber-js": "^1.12.6",
42
41
  "pino": "^9.13.1",
43
42
  "tslib": "^2.8.1",
@@ -51,7 +50,6 @@
51
50
  "@rollup/plugin-node-resolve": "^16.0.1",
52
51
  "@rollup/plugin-terser": "^0.4.4",
53
52
  "@rollup/plugin-typescript": "^12.1.2",
54
- "@types/file-saver": "^2.0.7",
55
53
  "pino-pretty": "^13.1.1",
56
54
  "rollup": "^4.39.0",
57
55
  "ts-node": "^10.9.2",
@@ -1 +0,0 @@
1
- export * from "./report-manager.js";
@@ -1,176 +0,0 @@
1
- /**
2
- * Available file formats for reports
3
- */
4
- export declare enum FileFormat {
5
- /** PDF file format */
6
- PDF = "pdf",
7
- /** Excel file format */
8
- EXCEL = "excel"
9
- }
10
- /**
11
- * Available project types
12
- */
13
- export declare enum ProjectType {
14
- /** Tembo Dashboard project */
15
- DASHBOARD = "dashboard",
16
- /** Afloat project */
17
- AFLOAT = "afloat",
18
- /** VertoX project */
19
- VERTO_X = "verto_x"
20
- }
21
- /**
22
- * Available report types with improved naming
23
- */
24
- export declare enum ReportType {
25
- /** Merchant payout statement (Dashboard) */
26
- MERCHANT_DISBURSEMENT_REPORT = "merchant_disbursement_report",
27
- /** Merchant wallet statement (Dashboard) */
28
- MERCHANT_WALLET_STATEMENT = "merchant_wallet_statement",
29
- /** Transaction revenue summary (Dashboard) */
30
- TRANSACTION_REVENUE_SUMMARY = "transaction_revenue_summary",
31
- /** Customer wallet activity (Afloat) */
32
- CUSTOMER_WALLET_ACTIVITY = "customer_wallet_activity",
33
- /** Customer profile information (Afloat) */
34
- CUSTOMER_PROFILE_SNAPSHOT = "customer_profile_snapshot",
35
- /** Customer transaction history (Afloat) */
36
- CUSTOMER_TRANSACTION_HISTORY = "customer_transaction_history",
37
- /** Customer saved beneficiary list (Afloat) */
38
- CUSTOMER_SAVED_BENEFICIARY_LIST = "customer_saved_beneficiary_list",
39
- /** Gateway transaction log (VertoX) */
40
- GATEWAY_TRANSACTION_LOG = "gateway_transaction_log"
41
- }
42
- /**
43
- * Report definition interface
44
- */
45
- export interface ReportDefinition {
46
- /** Unique identifier for the report */
47
- id: string;
48
- /** Human-readable report name for UI display */
49
- displayName: string;
50
- /** API endpoint path for the report */
51
- endpoint: string;
52
- /** Available file formats for the report */
53
- availableFormats: FileFormat[];
54
- /** Optional description of the report */
55
- description?: string;
56
- /** Project the report belongs to */
57
- projectType: ProjectType;
58
- /** Type of the report */
59
- reportType: ReportType;
60
- }
61
- /**
62
- * Return type for server-side report downloads
63
- */
64
- export interface ReportDownloadResult {
65
- /** The filename for the downloaded report */
66
- filename: string;
67
- /** The raw base64 data from the response */
68
- data: string;
69
- /** The report definition used */
70
- report: ReportDefinition;
71
- }
72
- /**
73
- * Registry of all available reports
74
- */
75
- export declare const REPORTS: {
76
- merchant_disbursement_report: ReportDefinition;
77
- transaction_revenue_summary: ReportDefinition;
78
- merchant_wallet_statement: ReportDefinition;
79
- customer_wallet_activity: ReportDefinition;
80
- customer_profile_snapshot: ReportDefinition;
81
- customer_transaction_history: ReportDefinition;
82
- customer_saved_beneficiary_list: ReportDefinition;
83
- gateway_transaction_log: ReportDefinition;
84
- };
85
- /**
86
- * Get all reports for a specific project
87
- * @param projectType The project type to filter by
88
- * @returns Array of report definitions for the project
89
- */
90
- export declare function getReportsByProject(projectType: ProjectType): ReportDefinition[];
91
- /**
92
- * Get a report by its type
93
- * @param reportType The report type to retrieve
94
- * @returns The report definition or undefined if not found
95
- */
96
- export declare function getReportByType(reportType: ReportType): ReportDefinition;
97
- /**
98
- * Validates if a report type is available for a project
99
- * @param projectType The project type
100
- * @param reportType The report type
101
- * @returns True if the report is available for the project, false otherwise
102
- */
103
- export declare function isReportAvailableForProject(projectType: ProjectType, reportType: ReportType): boolean;
104
- /**
105
- * Report Manager class for handling report downloads
106
- */
107
- export declare class ReportManager {
108
- private static _instance;
109
- private constructor();
110
- /**
111
- * Get the singleton instance of ReportManager
112
- */
113
- static get instance(): ReportManager;
114
- /**
115
- * Get the base URL for the report API
116
- * @returns The base URL
117
- */
118
- private getBaseURL;
119
- /**
120
- * Downloads a report for client-side usage (browser)
121
- * @param args Arguments for the report download
122
- * @returns Promise that resolves when download is complete
123
- */
124
- downloadReport(args: {
125
- token: string;
126
- projectType: ProjectType;
127
- reportType: ReportType;
128
- fileFormat: FileFormat;
129
- query?: Record<string, any>;
130
- }): Promise<void>;
131
- /**
132
- * Fetches a report for server-side usage or when you want to handle saving separately
133
- * @param args Arguments for the report fetch
134
- * @returns Promise that resolves with the report data and filename
135
- */
136
- fetchReport(args: {
137
- token: string;
138
- projectType: ProjectType;
139
- reportType: ReportType;
140
- fileFormat: FileFormat;
141
- query?: Record<string, any>;
142
- }): Promise<ReportDownloadResult>;
143
- /**
144
- * Get the filename from response or generate a default one
145
- * @param response The response from the API
146
- * @param report The report definition
147
- * @param fileFormat The requested file format
148
- * @returns The filename to use
149
- */
150
- private getFilename;
151
- /**
152
- * Handle error responses from the API
153
- * @param response The response from the API
154
- * @throws Error with appropriate message
155
- */
156
- private handleErrorResponse;
157
- /**
158
- * Generates a default filename based on report and file format
159
- * @param report The report definition
160
- * @param fileFormat The requested file format
161
- * @returns A suitable default filename with proper extension
162
- */
163
- private getDefaultFilename;
164
- /**
165
- * Extracts the filename from the Content-Disposition header
166
- * @param contentDisposition The Content-Disposition header value
167
- * @returns The extracted filename or null if not found
168
- */
169
- private extractFilenameFromContentDisposition;
170
- /**
171
- * Converts a base64 string to a Blob
172
- * @param base64 The base64 string
173
- * @returns A Blob
174
- */
175
- private b64toBlob;
176
- }
@@ -1,12 +0,0 @@
1
- export interface AppConfig {
2
- pdfMakerBaseUrl: string;
3
- }
4
- export declare class ConfigService {
5
- private static _instance;
6
- private _config;
7
- private constructor();
8
- static get instance(): ConfigService;
9
- initialize(config: AppConfig): void;
10
- get pdfMakerBaseUrl(): string;
11
- }
12
- export declare const configService: ConfigService;