react-native-timacare 3.3.46 → 3.3.47

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 (72) hide show
  1. package/lib/commonjs/assets/svgs/question.svg +1 -7
  2. package/lib/commonjs/components/ItemTimaOneV3.js +1 -1
  3. package/lib/commonjs/components/ItemTimaOneV3.js.flow +29 -29
  4. package/lib/commonjs/components/ItemTimaOneV3.js.map +1 -1
  5. package/lib/commonjs/components/SkeletonLoanCard.js +1 -1
  6. package/lib/commonjs/components/SkeletonLoanCard.js.flow +58 -0
  7. package/lib/commonjs/components/SkeletonLoanCard.js.map +1 -1
  8. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  9. package/lib/commonjs/navigation/primary-navigator.js.flow +1 -1
  10. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  11. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js +2 -0
  12. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.flow +199 -0
  13. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.map +1 -0
  14. package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js +2 -0
  15. package/lib/commonjs/screens/{detail-loan/DetailLoanTima.js.flow → detail-loan-tima/PaymentSchedule.js.flow} +107 -118
  16. package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js.map +1 -0
  17. package/lib/commonjs/screens/detail-loan-tima/index.js +2 -0
  18. package/lib/commonjs/screens/detail-loan-tima/index.js.flow +109 -0
  19. package/lib/commonjs/screens/detail-loan-tima/index.js.map +1 -0
  20. package/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
  21. package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +2 -2
  22. package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
  23. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
  24. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +2 -2
  25. package/lib/commonjs/services/api/api.js +1 -1
  26. package/lib/commonjs/services/api/api.js.flow +33 -7
  27. package/lib/commonjs/services/api/api.js.map +1 -1
  28. package/lib/module/assets/svgs/question.svg +1 -7
  29. package/lib/module/components/ItemTimaOneV3.js +1 -1
  30. package/lib/module/components/ItemTimaOneV3.js.map +1 -1
  31. package/lib/module/components/SkeletonLoanCard.js +1 -1
  32. package/lib/module/components/SkeletonLoanCard.js.map +1 -1
  33. package/lib/module/navigation/primary-navigator.js +1 -1
  34. package/lib/module/navigation/primary-navigator.js.map +1 -1
  35. package/lib/module/screens/detail-loan-tima/InforLoan.js +2 -0
  36. package/lib/module/screens/detail-loan-tima/InforLoan.js.map +1 -0
  37. package/lib/module/screens/detail-loan-tima/PaymentSchedule.js +2 -0
  38. package/lib/module/screens/detail-loan-tima/PaymentSchedule.js.map +1 -0
  39. package/lib/module/screens/detail-loan-tima/index.js +2 -0
  40. package/lib/module/screens/detail-loan-tima/index.js.map +1 -0
  41. package/lib/module/screens/home/DigitalTopupItem.js +1 -1
  42. package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
  43. package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
  44. package/lib/module/services/api/api.js +1 -1
  45. package/lib/module/services/api/api.js.map +1 -1
  46. package/lib/typescript/components/SkeletonLoanCard.d.ts +3 -0
  47. package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -1
  48. package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts +4 -0
  49. package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts.map +1 -0
  50. package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts +2 -0
  51. package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts.map +1 -0
  52. package/lib/typescript/screens/detail-loan-tima/index.d.ts +2 -0
  53. package/lib/typescript/screens/detail-loan-tima/index.d.ts.map +1 -0
  54. package/lib/typescript/services/api/api.d.ts +16 -0
  55. package/lib/typescript/services/api/api.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/assets/svgs/question.svg +1 -7
  58. package/src/components/ItemTimaOneV3.tsx +29 -29
  59. package/src/components/SkeletonLoanCard.tsx +58 -0
  60. package/src/navigation/primary-navigator.tsx +1 -1
  61. package/src/screens/detail-loan-tima/InforLoan.tsx +199 -0
  62. package/src/screens/{detail-loan/DetailLoanTima.tsx → detail-loan-tima/PaymentSchedule.tsx} +107 -118
  63. package/src/screens/detail-loan-tima/index.tsx +109 -0
  64. package/src/screens/home/DigitalTopupItem.tsx +2 -2
  65. package/src/screens/home/ItemMotoBikeLoan.tsx +2 -2
  66. package/src/services/api/api.ts +33 -7
  67. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js +0 -2
  68. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.map +0 -1
  69. package/lib/module/screens/detail-loan/DetailLoanTima.js +0 -2
  70. package/lib/module/screens/detail-loan/DetailLoanTima.js.map +0 -1
  71. package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts +0 -2
  72. package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts.map +0 -1
@@ -124,10 +124,15 @@ export class Api {
124
124
  text: 'Đồng ý',
125
125
  onPress: () => {
126
126
  try {
127
- if (this.config.logout && typeof this.config.logout === 'function') {
127
+ if (
128
+ this.config.logout &&
129
+ typeof this.config.logout === 'function'
130
+ ) {
128
131
  this.config.logout();
129
132
  } else {
130
- myLog('[API] Warning: logout function not configured in SDKConfig');
133
+ myLog(
134
+ '[API] Warning: logout function not configured in SDKConfig'
135
+ );
131
136
  }
132
137
  } catch (error) {
133
138
  myLog('[API] Error during logout:', error);
@@ -222,14 +227,14 @@ export class Api {
222
227
  // Seed current state, then listen for changes.
223
228
  netInfo
224
229
  .fetch()
225
- .then(state => {
230
+ .then((state) => {
226
231
  this.isConnected = state.isConnected !== false;
227
232
  })
228
233
  .catch(() => {
229
234
  this.isConnected = true;
230
235
  });
231
236
 
232
- this.netInfoUnsubscribe = netInfo.addEventListener(state => {
237
+ this.netInfoUnsubscribe = netInfo.addEventListener((state) => {
233
238
  this.isConnected = state.isConnected !== false;
234
239
  });
235
240
  }
@@ -241,7 +246,10 @@ export class Api {
241
246
  * 2. Shortens the timeout for idempotent GETs on the main instance so reads
242
247
  * fail fast and hand off to the retry interceptor.
243
248
  */
244
- private attachRequestGuards(instance: ApisauceInstance, splitGetTimeout: boolean) {
249
+ private attachRequestGuards(
250
+ instance: ApisauceInstance,
251
+ splitGetTimeout: boolean
252
+ ) {
245
253
  const getTimeout = this.config.getTimeout || DEFAULT_GET_TIMEOUT;
246
254
 
247
255
  instance.axiosInstance.interceptors.request.use((config: any) => {
@@ -276,7 +284,7 @@ export class Api {
276
284
  */
277
285
  private attachRetryInterceptor(instance: ApisauceInstance) {
278
286
  instance.axiosInstance.interceptors.response.use(
279
- response => response,
287
+ (response) => response,
280
288
  async (error: any) => {
281
289
  const config = error?.config;
282
290
 
@@ -305,7 +313,7 @@ export class Api {
305
313
  `[API] Retry ${config.__retryCount}/${MAX_RETRIES} in ${delay}ms: ${config.url}`
306
314
  );
307
315
 
308
- await new Promise(resolve => setTimeout(resolve, delay));
316
+ await new Promise((resolve) => setTimeout(resolve, delay));
309
317
  return instance.axiosInstance(config);
310
318
  }
311
319
  );
@@ -4161,4 +4169,22 @@ export class Api {
4161
4169
  return { kind: 'bad-data' };
4162
4170
  }
4163
4171
  }
4172
+
4173
+ async get_detail_loan_tima(id) {
4174
+ // make the api call
4175
+ const response: ApiResponse<any> = await this.apisauce.get(
4176
+ `api/v2.0/loanbrief/get_loan_detail_tima?loanBriefId=${id}`
4177
+ );
4178
+ // the typical ways to die when calling an api
4179
+ if (!response.ok) {
4180
+ const problem = getGeneralApiProblem(response);
4181
+ if (problem) return problem;
4182
+ }
4183
+ // transform the data into the format we are expecting
4184
+ try {
4185
+ return { kind: 'ok', data: response.data };
4186
+ } catch {
4187
+ return { kind: 'bad-data' };
4188
+ }
4189
+ }
4164
4190
  }