@mohasinac/appkit 4.30.12 → 4.30.15

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 (57) hide show
  1. package/dist/errors/degraded.d.ts +52 -0
  2. package/dist/errors/degraded.js +47 -0
  3. package/dist/errors/index.d.ts +1 -0
  4. package/dist/errors/index.js +1 -0
  5. package/dist/features/admin/components/AdminBlogView.js +8 -1
  6. package/dist/features/admin/components/AdminCouponsView.js +8 -1
  7. package/dist/features/admin/components/AdminOffersView.js +9 -1
  8. package/dist/features/admin/components/AdminPayoutsView.js +9 -1
  9. package/dist/features/admin/components/AdminReviewsView.js +14 -1
  10. package/dist/features/admin/components/AdminScammersView.js +15 -1
  11. package/dist/features/admin/components/DataListingView.d.ts +22 -1
  12. package/dist/features/admin/components/DataListingView.js +7 -0
  13. package/dist/features/admin/hooks/useAdminListing.d.ts +9 -0
  14. package/dist/features/admin/hooks/useAdminListing.js +30 -2
  15. package/dist/features/events/components/AdminEventsView.js +7 -1
  16. package/dist/features/events/server.d.ts +0 -1
  17. package/dist/features/events/server.js +0 -1
  18. package/dist/features/faq/index.d.ts +0 -1
  19. package/dist/features/faq/index.js +0 -1
  20. package/dist/features/faq/server.d.ts +0 -1
  21. package/dist/features/faq/server.js +0 -1
  22. package/dist/features/reviews/server.d.ts +0 -1
  23. package/dist/features/reviews/server.js +0 -1
  24. package/dist/features/scams/repository/scammer.repository.d.ts +10 -1
  25. package/dist/features/scams/repository/scammer.repository.js +20 -2
  26. package/dist/features/scams/schemas/firestore.d.ts +10 -0
  27. package/dist/features/scams/schemas/firestore.js +1 -0
  28. package/dist/features/scams/schemas/index.d.ts +10 -10
  29. package/dist/features/seller/components/SellerCouponsView.js +7 -1
  30. package/dist/features/seller/components/SellerOffersView.js +8 -1
  31. package/dist/features/seller/components/SellerOrdersView.js +8 -1
  32. package/dist/features/seller/hooks/useSellerListingData.d.ts +11 -25
  33. package/dist/features/seller/hooks/useSellerListingData.js +0 -38
  34. package/dist/features/stores/server.d.ts +0 -1
  35. package/dist/features/stores/server.js +0 -1
  36. package/dist/index.d.ts +2 -7
  37. package/dist/index.js +3 -13
  38. package/dist/providers/db-firebase/base.js +7 -11
  39. package/dist/schemas/registry.d.ts +8 -8
  40. package/dist/security/index.d.ts +1 -1
  41. package/dist/security/index.js +1 -1
  42. package/dist/security/pii-encrypt.d.ts +0 -10
  43. package/dist/security/pii-encrypt.js +0 -38
  44. package/dist/seed/_helpers/search-txt-wrappers.d.ts +2 -0
  45. package/dist/seed/_helpers/search-txt-wrappers.js +4 -1
  46. package/dist/seed/scammers-seed-data.js +10 -1
  47. package/dist/server.d.ts +0 -6
  48. package/dist/server.js +0 -10
  49. package/dist/styles.css +1 -1
  50. package/dist/tailwind-utilities.css +1 -1
  51. package/dist/utils/index.d.ts +0 -1
  52. package/dist/utils/index.js +0 -1
  53. package/dist/utils/search-txt-builders.d.ts +13 -0
  54. package/dist/utils/search-txt-builders.js +20 -0
  55. package/dist/utils/sieve-builder.d.ts +0 -5
  56. package/dist/utils/sieve-builder.js +7 -8
  57. package/package.json +2 -9
@@ -10,7 +10,6 @@ export * from "./array.helper";
10
10
  export * from "./object.helper";
11
11
  export * from "./pagination.helper";
12
12
  export * from "./sorting.helper";
13
- export * from "./filter.helper";
14
13
  export * from "./animation.helper";
15
14
  export * from "./color.helper";
16
15
  export * from "./business-day";
@@ -10,7 +10,6 @@ export * from "./array.helper";
10
10
  export * from "./object.helper";
11
11
  export * from "./pagination.helper";
12
12
  export * from "./sorting.helper";
13
- export * from "./filter.helper";
14
13
  export * from "./animation.helper";
15
14
  export * from "./color.helper";
16
15
  export * from "./business-day";
@@ -1,4 +1,5 @@
1
1
  import type { ProductDocument } from "../features/products/schemas/firestore";
2
+ import type { ScammerDocument } from "../features/scams/schemas/firestore";
2
3
  import type { StoreDocument } from "../features/stores/schemas/firestore";
3
4
  import type { EventDocument } from "../features/events/schemas/firestore";
4
5
  import type { BlogPostDocument } from "../features/blog/schemas/firestore";
@@ -45,3 +46,15 @@ export declare function buildCouponSearchTxt(c: Partial<CouponDocument>): string
45
46
  * findable by substring from an admin list.
46
47
  */
47
48
  export declare function buildOfferSearchTxt(o: Partial<OfferDocument>): string[];
49
+ /**
50
+ * The scam registry's identity fields are stored PLAINTEXT on purpose — a
51
+ * victim googles a UPI ID before paying, so SEO is the feature (see the field
52
+ * comments on ScammerDocument). Indexing them is therefore aligned with the
53
+ * feature rather than a PII risk, and it is why this collection can have a
54
+ * partial-match box where users/reviews/payouts cannot.
55
+ *
56
+ * `description` is the reporter's narrative and is NOT indexed: it is free
57
+ * text naming victims and third parties, and the 600-token cap would let one
58
+ * long report crowd out every identity token in the same document.
59
+ */
60
+ export declare function buildScammerSearchTxt(s: Partial<ScammerDocument>): string[];
@@ -116,3 +116,23 @@ export function buildCouponSearchTxt(c) {
116
116
  export function buildOfferSearchTxt(o) {
117
117
  return buildSearchTxt([o.productTitle, o.productSlug, o.storeName]);
118
118
  }
119
+ /**
120
+ * The scam registry's identity fields are stored PLAINTEXT on purpose — a
121
+ * victim googles a UPI ID before paying, so SEO is the feature (see the field
122
+ * comments on ScammerDocument). Indexing them is therefore aligned with the
123
+ * feature rather than a PII risk, and it is why this collection can have a
124
+ * partial-match box where users/reviews/payouts cannot.
125
+ *
126
+ * `description` is the reporter's narrative and is NOT indexed: it is free
127
+ * text naming victims and third parties, and the 600-token cap would let one
128
+ * long report crowd out every identity token in the same document.
129
+ */
130
+ export function buildScammerSearchTxt(s) {
131
+ return buildSearchTxt([
132
+ s.displayNames ?? [],
133
+ s.phones ?? [],
134
+ s.upiIds ?? [],
135
+ s.emails ?? [],
136
+ s.scamType,
137
+ ]);
138
+ }
@@ -11,11 +11,6 @@ export declare const SIEVE_OP: {
11
11
  readonly NOT_CONTAINS: "!@=";
12
12
  readonly NOT_STARTS: "!_=";
13
13
  readonly NOT_ENDS: "!_-=";
14
- readonly CONTAINS_CI: "@=*";
15
- readonly STARTS_CI: "_=*";
16
- readonly ENDS_CI: "_-=*";
17
- readonly EQ_CI: "==*";
18
- readonly NEQ_CI: "!=*";
19
14
  };
20
15
  export type SieveOp = (typeof SIEVE_OP)[keyof typeof SIEVE_OP];
21
16
  /** Operators for which the pipe `|` is valid for OR-matching within a single clause */
@@ -11,20 +11,19 @@ export const SIEVE_OP = {
11
11
  NOT_CONTAINS: "!@=",
12
12
  NOT_STARTS: "!_=",
13
13
  NOT_ENDS: "!_-=",
14
- CONTAINS_CI: "@=*",
15
- STARTS_CI: "_=*",
16
- ENDS_CI: "_-=*",
17
- EQ_CI: "==*",
18
- NEQ_CI: "!=*",
14
+ // The five case-insensitive operators (@=* _=* _-=* ==* !=*) were
15
+ // DELETED. Firestore has no case-insensitive comparison, so the adapter
16
+ // threw on every one — and with `throwExceptions: false` that throw
17
+ // returned a PARTIALLY-BUILT query rather than an error, so the clause,
18
+ // and every clause after it, was silently dropped. They read as working
19
+ // search operators and did the opposite. `searchTxt` + `array-contains`
20
+ // is the replacement.
19
21
  };
20
22
  /** Operators for which the pipe `|` is valid for OR-matching within a single clause */
21
23
  export const SIEVE_PIPE_OPS = new Set([
22
24
  SIEVE_OP.CONTAINS,
23
25
  SIEVE_OP.STARTS,
24
26
  SIEVE_OP.ENDS,
25
- SIEVE_OP.CONTAINS_CI,
26
- SIEVE_OP.STARTS_CI,
27
- SIEVE_OP.ENDS_CI,
28
27
  ]);
29
28
  /** Single Sieve clause: sieveFilter("status", "==", "published") → "status==published" */
30
29
  export function sieveFilter(field, op, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "4.30.12",
3
+ "version": "4.30.15",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -167,8 +167,6 @@
167
167
  "audit:sieve-views": "node scripts/audit-sieve-constants-views.mjs",
168
168
  "check:types": "tsc -p tsconfig.build.json --noEmit",
169
169
  "check:audits": "node scripts/audit-violations.mjs && node scripts/verify-entries.mjs && node scripts/verify-css-build.mjs && node scripts/audit-use-client.mjs && node scripts/audit-double-navigation.mjs && node scripts/audit-repository-fields.mjs && node scripts/audit-query-provider.mjs && node scripts/audit-export-paths.mjs && node scripts/audit-listing-indices.mjs && node scripts/audit-listing-type-reads.mjs && node scripts/audit-create-with-id.mjs && node scripts/audit-css-imports.mjs && node scripts/audit-appkit-reexports.mjs && node scripts/audit-action-confirmation.mjs && node scripts/audit-route-strings.mjs && node scripts/audit-paginated-select.mjs && node scripts/audit-sieve-constants-views.mjs && node scripts/audit-schema-registry-completeness.mjs && node scripts/audit-firestore-schema-coverage.mjs && node scripts/audit-catch-normalize.mjs && node scripts/audit-route-schema-registry.mjs && node scripts/audit-z-any-z-unknown.mjs && node scripts/audit-dynamic-tailwind-arbitrary.mjs && node scripts/audit-surface-props-completeness.mjs && node scripts/audit-touch-handler-completeness.mjs && node scripts/audit-field-primitive-contract.mjs && node scripts/audit-innerhtml-sanitization.mjs",
170
- "test": "vitest run --passWithNoTests",
171
- "test:watch": "vitest",
172
170
  "check": "npm run check:types && npm run check:audits"
173
171
  },
174
172
  "dependencies": {
@@ -215,15 +213,12 @@
215
213
  "devDependencies": {
216
214
  "@tailwindcss/cli": "^4.3.3",
217
215
  "@tanstack/react-query": "^5.0.0",
218
- "@testing-library/jest-dom": "^7.0.1",
219
- "@testing-library/react": "^16.3.2",
220
216
  "@types/babel__generator": "^7.27.0",
221
217
  "@types/babel__template": "^7.4.4",
222
218
  "@types/babel__traverse": "^7.28.0",
223
219
  "@types/caseless": "^0.12.5",
224
220
  "@types/d3-color": "^3.1.3",
225
221
  "@types/d3-path": "^3.1.1",
226
- "@types/istanbul-lib-report": "^3.0.3",
227
222
  "@types/ms": "^2.1.0",
228
223
  "@types/yargs-parser": "^21.0.3",
229
224
  "@upstash/ratelimit": "^2.0.8",
@@ -233,7 +228,6 @@
233
228
  "firebase": "^12.18.0",
234
229
  "firebase-admin": "^14.3.0",
235
230
  "firebase-functions": "^7.3.2",
236
- "jsdom": "^29.1.1",
237
231
  "lucide-react": "^1.33.0",
238
232
  "next": "^15.0.0",
239
233
  "next-intl": "^4.9.1",
@@ -243,8 +237,7 @@
243
237
  "resend": "^6.10.0",
244
238
  "server-only": "^0.0.1",
245
239
  "tailwindcss": "^4.3.3",
246
- "typescript": "^5.9.3",
247
- "vitest": "^4.1.11"
240
+ "typescript": "^5.9.3"
248
241
  },
249
242
  "engines": {
250
243
  "node": ">=22"