@mohasinac/appkit 3.2.14 → 3.2.16

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,6 +7,7 @@
7
7
  * (`p` directly) or infinite-mode (forward `cursor` from previous response).
8
8
  */
9
9
  import { bidRepository, blogRepository, categoriesRepository, couponsRepository, eventEntryRepository, eventRepository, faqsRepository, homepageSectionsRepository, notificationRepository, orderRepository, payoutRepository, productFeaturesRepository, productRepository, productTemplateRepository, reviewRepository, scammerRepository, storeRepository, userRepository, } from "../../../../repositories";
10
+ import { normalizeError } from "../../../../errors/normalize";
10
11
  const DEFAULT_SORT = "-createdAt";
11
12
  const DEFAULT_PAGE = 1;
12
13
  const DEFAULT_PAGE_SIZE = 20;
@@ -84,7 +85,7 @@ function decodeCursor(cursor) {
84
85
  return Number.isFinite(page) && page > 0 ? page : null;
85
86
  }
86
87
  catch (_err) {
87
- // Malformed base64 or JSON — treat as no cursor (start from first page)
88
+ void normalizeError(_err); // Malformed base64 or JSON — treat as no cursor
88
89
  return null;
89
90
  }
90
91
  }
@@ -7,6 +7,7 @@
7
7
  * UI sees a row for every Cloud Function failure.
8
8
  */
9
9
  import { mapToHttpError } from "../../../../errors/error-mapping";
10
+ import { normalizeError } from "../../../../errors/normalize";
10
11
  import { serverErrorsRepository } from "../../../../features/server-errors/repository/server-errors.repository";
11
12
  async function persist(name, err, ctxLike) {
12
13
  const mapped = mapToHttpError(err);
@@ -22,7 +23,7 @@ async function persist(name, err, ctxLike) {
22
23
  });
23
24
  }
24
25
  catch (_err) {
25
- // Logging the logging failure would cause infinite recursion — intentionally swallowed
26
+ void normalizeError(_err); // Logging the logging failure only normalize, never re-log
26
27
  }
27
28
  }
28
29
  export function wrapScheduleHandler(name, handler) {
@@ -37,7 +37,7 @@ export const actionTracker = {
37
37
  }
38
38
  }
39
39
  catch (_err) {
40
- // Telemetry sink threw synchronously — swallowed so the caller action always completes
40
+ void normalizeError(_err); // Telemetry sink threw synchronously — swallowed so caller always completes
41
41
  }
42
42
  },
43
43
  };
@@ -182,7 +182,7 @@ class ChatRepository extends BaseRepository {
182
182
  await getAdminRealtimeDb().ref(`/chat/${chatId}`).remove();
183
183
  }
184
184
  catch (_err) {
185
- // RTDB cleanup is best-effort — Firestore doc already deleted, messages will be orphaned until TTL cleanup
185
+ void normalizeError(_err); // RTDB cleanup is best-effort — Firestore doc already deleted
186
186
  }
187
187
  return "deleted";
188
188
  }
@@ -211,7 +211,7 @@ class ChatRepository extends BaseRepository {
211
211
  await getAdminRealtimeDb().ref(`/chat/${chatId}`).remove();
212
212
  }
213
213
  catch (_err) {
214
- // RTDB cleanup is best-effort — adminDeleted flag in Firestore already revokes access
214
+ void normalizeError(_err); // RTDB cleanup is best-effort — adminDeleted flag already revokes access
215
215
  }
216
216
  }
217
217
  catch (error) {
@@ -133,7 +133,7 @@ export class SiteSettingsRepository extends BaseRepository {
133
133
  result[key] = decryptSecret(value);
134
134
  }
135
135
  catch (_err) {
136
- // Auth-tag mismatch or malformed ciphertext (e.g., key rotation) — treat as missing credential
136
+ void normalizeError(_err); // Auth-tag mismatch or key rotation — treat as missing credential
137
137
  result[key] = "";
138
138
  }
139
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "3.2.14",
3
+ "version": "3.2.16",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"