@simonarcher/fika-types 1.0.66 → 1.0.68

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.
package/dist/coffee.d.ts CHANGED
@@ -182,3 +182,25 @@ export declare const COFFEE_PRODUCING_COUNTRIES: string[];
182
182
  export declare const COUNTRY_NAME_TO_CODE: Record<string, string>;
183
183
  export declare const COUNTRY_CODE_TO_NAME: Record<string, string>;
184
184
  export type BrewMethod = "Espresso" | "Filter" | "Pour Over" | "Aeropress" | "French Press" | "Cold Brew" | "Moka Pot" | "Siphon" | "Other";
185
+ export declare const BREW_METHOD_GROUPS: readonly [{
186
+ readonly id: "espresso";
187
+ readonly label: "Espresso Bar";
188
+ readonly methods: readonly ["Espresso"];
189
+ }, {
190
+ readonly id: "pour-over";
191
+ readonly label: "Pour-Over";
192
+ readonly methods: readonly ["V60", "Kalita", "Chemex", "Clever"];
193
+ }, {
194
+ readonly id: "immersion";
195
+ readonly label: "Immersion";
196
+ readonly methods: readonly ["Aeropress", "French Press", "Siphon"];
197
+ }, {
198
+ readonly id: "cold";
199
+ readonly label: "Cold Brew & Iced";
200
+ readonly methods: readonly ["Cold Brew", "Kyoto", "Flash Brew", "Nitro"];
201
+ }, {
202
+ readonly id: "other";
203
+ readonly label: "Other Methods";
204
+ readonly methods: readonly ["Moka Pot", "Turkish", "Batch Brew", "Capsule"];
205
+ }];
206
+ export type BrewMethodGroups = typeof BREW_METHOD_GROUPS;
package/dist/coffee.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COUNTRY_CODE_TO_NAME = exports.COUNTRY_NAME_TO_CODE = exports.COFFEE_PRODUCING_COUNTRIES = exports.DECAF_METHODS = void 0;
3
+ exports.BREW_METHOD_GROUPS = exports.COUNTRY_CODE_TO_NAME = exports.COUNTRY_NAME_TO_CODE = exports.COFFEE_PRODUCING_COUNTRIES = exports.DECAF_METHODS = void 0;
4
4
  exports.DECAF_METHODS = [
5
5
  "Swiss Water",
6
6
  "Sugarcane / Ethyl Acetate",
@@ -73,3 +73,30 @@ exports.COUNTRY_CODE_TO_NAME = {
73
73
  YE: "Yemen",
74
74
  ZZ: "Other",
75
75
  };
76
+ exports.BREW_METHOD_GROUPS = [
77
+ {
78
+ id: 'espresso',
79
+ label: 'Espresso Bar',
80
+ methods: ['Espresso'],
81
+ },
82
+ {
83
+ id: 'pour-over',
84
+ label: 'Pour-Over',
85
+ methods: ['V60', 'Kalita', 'Chemex', 'Clever'],
86
+ },
87
+ {
88
+ id: 'immersion',
89
+ label: 'Immersion',
90
+ methods: ['Aeropress', 'French Press', 'Siphon'],
91
+ },
92
+ {
93
+ id: 'cold',
94
+ label: 'Cold Brew & Iced',
95
+ methods: ['Cold Brew', 'Kyoto', 'Flash Brew', 'Nitro'],
96
+ },
97
+ {
98
+ id: 'other',
99
+ label: 'Other Methods',
100
+ methods: ['Moka Pot', 'Turkish', 'Batch Brew', 'Capsule'],
101
+ },
102
+ ];
package/dist/shop.d.ts CHANGED
@@ -375,32 +375,6 @@ export type SubmissionShopFormData = {
375
375
  };
376
376
  };
377
377
  };
378
- export interface ShopReview {
379
- id: string;
380
- userId: string;
381
- shopId?: string;
382
- reviewText?: string;
383
- imageUrl?: string | undefined;
384
- createdAt: Timestamp;
385
- createdAtISO?: string;
386
- ratings?: {
387
- coffee?: number;
388
- service?: number;
389
- ambience?: number;
390
- };
391
- }
392
- export interface PostShopReviewData {
393
- userId: string | undefined;
394
- shopId: string;
395
- reviewText?: string;
396
- imageUrl?: string | undefined;
397
- ratings?: {
398
- coffee?: number;
399
- service?: number;
400
- ambience?: number;
401
- };
402
- createdAt: AdminTimestamp;
403
- }
404
378
  export interface ShopReviewSubmission {
405
379
  reviewText?: string;
406
380
  imageUrl?: string | undefined;
@@ -481,11 +455,6 @@ export type SpecialtySemanticSignals = {
481
455
  keywordDensity?: number;
482
456
  sources?: Array<'website' | 'ig' | 'menu' | 'other'>;
483
457
  };
484
- export type SpecialtyCrowdSignals = {
485
- votes?: number;
486
- specialtyVotes?: number;
487
- avgCraftRating?: number;
488
- };
489
458
  export type SpecialtySignals = {
490
459
  semantic?: SpecialtySemanticSignals;
491
460
  crowd?: SpecialtyCrowdSignals;
@@ -501,4 +470,97 @@ export type BaristaAchievement = {
501
470
  year?: number;
502
471
  notes?: string;
503
472
  };
473
+ /**
474
+ * Denormalized version used when displaying or exporting reviews.
475
+ * Mirrors PostShopReviewData but includes IDs, timestamps, and optional ISO string.
476
+ */
477
+ export interface ShopReview {
478
+ id: string;
479
+ userId: string;
480
+ shopId?: string;
481
+ reviewText?: string;
482
+ imageUrl?: string | undefined;
483
+ createdAt: Timestamp;
484
+ createdAtISO?: string;
485
+ ratings?: {
486
+ coffee?: number;
487
+ service?: number;
488
+ ambience?: number;
489
+ };
490
+ /** -------- Specialty crowd data -------- */
491
+ craftPerception?: 0 | 0.5 | 1;
492
+ craftRating?: 1 | 2 | 3 | 4 | 5;
493
+ brewSightings?: string[];
494
+ roasterSightings?: string[];
495
+ evidence?: {
496
+ photos?: string[];
497
+ links?: string[];
498
+ };
499
+ reviewerTrust?: number;
500
+ status?: "active" | "flagged" | "hidden";
501
+ }
502
+ /**
503
+ * Incoming payload when a user posts a new review.
504
+ * Used in your client submission and Cloud Functions triggers.
505
+ */
506
+ export interface PostShopReviewData {
507
+ userId: string | undefined;
508
+ shopId: string;
509
+ reviewText?: string;
510
+ imageUrl?: string | undefined;
511
+ ratings?: {
512
+ coffee?: number;
513
+ service?: number;
514
+ ambience?: number;
515
+ };
516
+ createdAt: AdminTimestamp;
517
+ /** -------- Specialty crowd data additions -------- */
518
+ /**
519
+ * User’s perception of whether this is a specialty coffee shop.
520
+ * 1 = Yes, 0.5 = Not sure, 0 = No
521
+ */
522
+ craftPerception?: 0 | 0.5 | 1;
523
+ /**
524
+ * How “craft-focused” the experience felt (1–5 slider).
525
+ */
526
+ craftRating?: 1 | 2 | 3 | 4 | 5;
527
+ /**
528
+ * Brewing methods or equipment observed in the shop.
529
+ * e.g., ["V60", "Aeropress", "Espresso", "Chemex"]
530
+ */
531
+ brewSightings?: string[];
532
+ /**
533
+ * Roasters observed or confirmed at the shop.
534
+ * Ideally references `roasters/{id}` but may also be free text.
535
+ */
536
+ roasterSightings?: string[];
537
+ /**
538
+ * Optional evidence supporting the review — photo links or menu links.
539
+ */
540
+ evidence?: {
541
+ photos?: string[];
542
+ links?: string[];
543
+ };
544
+ /**
545
+ * System-assigned weight (0.5–1.5) to trust reviews more/less
546
+ * based on history, evidence, and consistency.
547
+ */
548
+ reviewerTrust?: number;
549
+ /**
550
+ * Internal moderation / review status.
551
+ */
552
+ status?: "active" | "flagged" | "hidden";
553
+ }
554
+ export interface ShopSignals {
555
+ crowd: SpecialtyCrowdSignals;
556
+ }
557
+ export interface SpecialtyCrowdSignals {
558
+ votes: number;
559
+ specialtyVotes: number;
560
+ avgCraftRating?: number | null;
561
+ brewTallies?: Record<string, number>;
562
+ roasterTallies?: Record<string, number>;
563
+ _smoothedCraftRatio?: number;
564
+ updatedAt: number;
565
+ }
504
566
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonarcher/fika-types",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "Shared TypeScript types for Fika projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",