@srimandir/old-dosha-calculator 1.0.1
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/README.md +53 -0
- package/dist/assets/testimonial-left.png.d.ts +2 -0
- package/dist/assets/testimonial-right.png.d.ts +2 -0
- package/dist/components/DateOfBirthPicker.d.ts +9 -0
- package/dist/components/DoshaCalculatorV2.d.ts +2 -0
- package/dist/components/DoshaDateField/DoshaDateField.d.ts +7 -0
- package/dist/components/DoshaHelpers.d.ts +3 -0
- package/dist/components/DoshaResults.d.ts +8 -0
- package/dist/components/DoshaResultsFull/DoshaResultsFull.d.ts +26 -0
- package/dist/components/DoshaResultsFull/index.d.ts +2 -0
- package/dist/components/DoshaResultsView/DoshaResultsView.d.ts +8 -0
- package/dist/components/DoshaTimeField/DoshaTimeField.d.ts +9 -0
- package/dist/components/Footer.d.ts +1 -0
- package/dist/components/HeaderV2.d.ts +1 -0
- package/dist/components/HomePageExperiment.d.ts +8 -0
- package/dist/components/IndexV2.d.ts +2 -0
- package/dist/components/KundaliCard/KundaliCard.d.ts +11 -0
- package/dist/components/SriMandirPujaCarousel.d.ts +8 -0
- package/dist/components/SriMandirPujaVerticalCard.d.ts +10 -0
- package/dist/components/TestimonialsV2.d.ts +1 -0
- package/dist/components/TimeOfBirthPicker.d.ts +9 -0
- package/dist/components/TrustBarV2.d.ts +1 -0
- package/dist/components/icons.d.ts +16 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/badge.d.ts +6 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/card.d.ts +7 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/config/experiments.d.ts +3 -0
- package/dist/hooks/useExperiment.d.ts +4 -0
- package/dist/hooks/useGooglePlacesAutocomplete.d.ts +19 -0
- package/dist/i18n/i18n.d.ts +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/integrations/supabase/client.d.ts +1 -0
- package/dist/lib/analytics.d.ts +1 -0
- package/dist/lib/kundaliChart.d.ts +11 -0
- package/dist/lib/sriMandirPujaHelpers.d.ts +23 -0
- package/dist/lib/supabase-dosha.d.ts +31 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/old-dosha-calculator.js +22323 -0
- package/dist/old-dosha-calculator.js.map +1 -0
- package/dist/old-dosha-calculator.umd.cjs +113 -0
- package/dist/old-dosha-calculator.umd.cjs.map +1 -0
- package/dist/types/dosha-api.d.ts +83 -0
- package/dist/utils/facebookPixel.d.ts +2 -0
- package/dist/utils/queryParams.d.ts +14 -0
- package/dist/utils/sriMandirPujas.d.ts +4 -0
- package/dist/utils/trafficTracking.d.ts +13 -0
- package/package.json +75 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Old Dosha Calculator
|
|
2
|
+
|
|
3
|
+
This package contains the V2 variant of the Dosha Calculator UI.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
├── components/ # React components
|
|
10
|
+
│ ├── ui/ # UI components (shadcn-style)
|
|
11
|
+
│ ├── IndexV2.tsx
|
|
12
|
+
│ ├── DoshaCalculatorV2.tsx
|
|
13
|
+
│ ├── HeaderV2.tsx
|
|
14
|
+
│ ├── Footer.tsx
|
|
15
|
+
│ ├── TestimonialsV2.tsx
|
|
16
|
+
│ └── TrustBarV2.tsx
|
|
17
|
+
├── lib/ # Library utilities
|
|
18
|
+
├── utils/ # Utility functions
|
|
19
|
+
├── hooks/ # Custom React hooks
|
|
20
|
+
├── i18n/ # Internationalization
|
|
21
|
+
├── integrations/ # Third-party integrations
|
|
22
|
+
└── dev/ # Development files
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm run dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Build
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run build
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- This package is configured to use the astrology-common package for shared components
|
|
41
|
+
- The package.json includes all necessary dependencies
|
|
42
|
+
- Make sure to set up your Supabase credentials in environment variables
|
|
43
|
+
- Replace placeholder assets with actual images
|
|
44
|
+
- Implement the stub functions in lib/ and utils/ directories according to your needs
|
|
45
|
+
|
|
46
|
+
## Environment Variables
|
|
47
|
+
|
|
48
|
+
Create a `.env` file with:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
VITE_SUPABASE_URL=your_supabase_url
|
|
52
|
+
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
|
|
53
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface DateOfBirthPickerProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
error?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const DateOfBirthPicker: React.FC<DateOfBirthPickerProps>;
|
|
9
|
+
export default DateOfBirthPicker;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface DoshaDateFieldProps {
|
|
2
|
+
id: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function DoshaDateField({ id, value, onChange, className, }: DoshaDateFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DoshaResults: ({ results }: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DateOfBirthPicker: ({ value, onChange, error }: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const TimeOfBirthPicker: ({ value, onChange, error }: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DoshaCalculationResult, BirthDetails } from '../../types/dosha-api';
|
|
3
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
4
|
+
export interface DoshaResultsFullProps {
|
|
5
|
+
result: DoshaCalculationResult;
|
|
6
|
+
t: (key: string) => string;
|
|
7
|
+
onEdit?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Optional: scroll target id for "View Kundli" / "Go Back" (e.g. "kundali-chart-section"). If not set, those links are hidden. */
|
|
10
|
+
kundaliSectionId?: string;
|
|
11
|
+
/** Optional: contact email for feedback section */
|
|
12
|
+
feedbackEmail?: string;
|
|
13
|
+
/** Render a puja card for the given dosha type (mangal, kaal-sarp, pitra, shani). When provided, shown in the "Puja Recommendation" section per dosha. */
|
|
14
|
+
renderPujaCard?: (doshaType: string) => React.ReactNode;
|
|
15
|
+
/** When true, show loading state in the puja recommendation area. */
|
|
16
|
+
isLoadingPujas?: boolean;
|
|
17
|
+
/** Optional: render the Kundali chart section (e.g. KundaliCard). When provided, overrides built-in KundaliCard. */
|
|
18
|
+
renderKundali?: () => React.ReactNode;
|
|
19
|
+
/** Birth details from form submit; when set with supabase, built-in KundaliCard is shown (unless renderKundali is provided). */
|
|
20
|
+
birthDetails?: BirthDetails | null;
|
|
21
|
+
/** Supabase client for fetching Kundali chart; required for built-in KundaliCard. */
|
|
22
|
+
supabase?: SupabaseClient | null;
|
|
23
|
+
/** Current locale (e.g. 'en' or 'hi') for KundaliCard. */
|
|
24
|
+
language?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function DoshaResultsFull({ result, t, onEdit, className, kundaliSectionId, feedbackEmail, renderPujaCard, isLoadingPujas, renderKundali, birthDetails, supabase, language, }: DoshaResultsFullProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DoshaCalculationResult } from '../../types/dosha-api';
|
|
2
|
+
export interface DoshaResultsViewProps {
|
|
3
|
+
result: DoshaCalculationResult;
|
|
4
|
+
t: (key: string) => string;
|
|
5
|
+
onEdit?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function DoshaResultsView({ result, t, onEdit, className }: DoshaResultsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DoshaTimeFieldProps {
|
|
2
|
+
id: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function DoshaTimeField({ id, value, onChange, placeholder, disabled, className, }: DoshaTimeFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function HeaderV2(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Home page wrapper that handles A/B testing between v1 and v5
|
|
3
|
+
*
|
|
4
|
+
* v1: Original design (IndexV2)
|
|
5
|
+
* v5: New copy - "Free Birth Chart Analysis to Find Right Puja for You"
|
|
6
|
+
*/
|
|
7
|
+
declare const HomePageExperiment: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default HomePageExperiment;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
import { BirthDetails } from '../../lib/kundaliChart';
|
|
3
|
+
export interface KundaliCardProps {
|
|
4
|
+
birthDetails: BirthDetails;
|
|
5
|
+
supabase: SupabaseClient;
|
|
6
|
+
/** Current language for chart labels (e.g. 'en' or 'hi') */
|
|
7
|
+
language: string;
|
|
8
|
+
/** Translation function for UI strings */
|
|
9
|
+
t: (key: string) => string;
|
|
10
|
+
}
|
|
11
|
+
export declare function KundaliCard({ birthDetails, supabase, language, t }: KundaliCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SriMandirPuja } from '../lib/sriMandirPujaHelpers';
|
|
2
|
+
export declare const SriMandirPujaCarousel: ({ pujas, language, }: {
|
|
3
|
+
pujas: SriMandirPuja[];
|
|
4
|
+
doshaType?: string;
|
|
5
|
+
formData?: any;
|
|
6
|
+
variant?: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SriMandirPuja } from '../lib/sriMandirPujaHelpers';
|
|
2
|
+
export interface SriMandirPujaVerticalCardProps {
|
|
3
|
+
puja: SriMandirPuja;
|
|
4
|
+
doshaType: string;
|
|
5
|
+
/** Current language (e.g. 'en' or 'hi') for title/temple/date/link. */
|
|
6
|
+
language: string;
|
|
7
|
+
onBookClick?: () => void | Promise<void>;
|
|
8
|
+
variant?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function SriMandirPujaVerticalCard({ puja, doshaType, language, onBookClick, }: SriMandirPujaVerticalCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TestimonialsV2(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TimeOfBirthPickerProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
error?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const TimeOfBirthPicker: React.FC<TimeOfBirthPickerProps>;
|
|
9
|
+
export default TimeOfBirthPicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TrustBarV2(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
+
}
|
|
4
|
+
export declare const AlertTriangle: React.FC<IconProps>;
|
|
5
|
+
export declare const CheckCircle: React.FC<IconProps>;
|
|
6
|
+
export declare const Info: React.FC<IconProps>;
|
|
7
|
+
export declare const Flame: React.FC<IconProps>;
|
|
8
|
+
export declare const Waves: React.FC<IconProps>;
|
|
9
|
+
export declare const Users: React.FC<IconProps>;
|
|
10
|
+
export declare const Moon: React.FC<IconProps>;
|
|
11
|
+
export declare const ArrowUp: React.FC<IconProps>;
|
|
12
|
+
export declare const ChevronDown: React.FC<IconProps>;
|
|
13
|
+
export declare const Loader2: React.FC<IconProps>;
|
|
14
|
+
export declare const ExternalLink: React.FC<IconProps>;
|
|
15
|
+
export declare const RotateCcw: React.FC<IconProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
+
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
variant?: 'default' | 'secondary' | 'destructive' | 'outline';
|
|
4
|
+
}
|
|
5
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Badge };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
declare const Collapsible: import('react').ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CollapsibleTrigger: import('react').ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: import('react').ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import('class-variance-authority/types').ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PlacePrediction {
|
|
2
|
+
place_id: string;
|
|
3
|
+
description: string;
|
|
4
|
+
structured_formatting?: {
|
|
5
|
+
main_text: string;
|
|
6
|
+
secondary_text: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const useGooglePlacesAutocomplete: () => {
|
|
10
|
+
predictions: PlacePrediction[];
|
|
11
|
+
isSearching: boolean;
|
|
12
|
+
searchPlaces: (query: string) => void;
|
|
13
|
+
getPlaceDetails: (placeId: string) => Promise<{
|
|
14
|
+
lat: number;
|
|
15
|
+
lon: number;
|
|
16
|
+
tz: string;
|
|
17
|
+
}>;
|
|
18
|
+
clearPredictions: () => void;
|
|
19
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as IndexV2 } from './components/IndexV2';
|
|
2
|
+
export { default as DoshaCalculatorV2 } from './components/DoshaCalculatorV2';
|
|
3
|
+
export { default as HeaderV2 } from './components/HeaderV2';
|
|
4
|
+
export { default as TestimonialsV2 } from './components/TestimonialsV2';
|
|
5
|
+
export { default as TrustBarV2 } from './components/TrustBarV2';
|
|
6
|
+
export { default as Footer } from './components/Footer';
|
|
7
|
+
export { default as HomePageExperiment } from './components/HomePageExperiment';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const supabase: import('@supabase/supabase-js').SupabaseClient<any, "public", "public", any, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const trackEvent: (eventName: string, properties?: any) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
import { BirthDetails } from '../types/dosha-api';
|
|
3
|
+
export type { BirthDetails };
|
|
4
|
+
export type ChartType = 'North' | 'South';
|
|
5
|
+
export interface FetchKundaliOptions {
|
|
6
|
+
birthDetails: BirthDetails;
|
|
7
|
+
chartType: ChartType;
|
|
8
|
+
language: 'en' | 'hi';
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
export declare function fetchKundaliSvg(supabase: SupabaseClient, options: FetchKundaliOptions): Promise<string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sri Mandir Puja display helpers — same logic as celestial-puja-finder.
|
|
3
|
+
* Used by SriMandirPujaVerticalCard for title, temple, date, link, cover image.
|
|
4
|
+
*/
|
|
5
|
+
export interface SriMandirPuja {
|
|
6
|
+
store_id: string;
|
|
7
|
+
pooja_title: string;
|
|
8
|
+
temple_name: string;
|
|
9
|
+
pooja_title_english?: string;
|
|
10
|
+
temple_name_english?: string;
|
|
11
|
+
cover_media_url?: string;
|
|
12
|
+
cover_media_url_english?: string;
|
|
13
|
+
puja_link: string;
|
|
14
|
+
puja_link_hindi?: string;
|
|
15
|
+
individual_pack_price_inr: number;
|
|
16
|
+
schedule_date_ist: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function getPujaTitle(puja: SriMandirPuja | string, language: string): string;
|
|
19
|
+
export declare function getTempleName(puja: SriMandirPuja | string, language: string): string;
|
|
20
|
+
export declare function formatScheduleDate(dateStr: string, language?: string): string;
|
|
21
|
+
export declare function getPujaLink(puja: SriMandirPuja, language: string): string;
|
|
22
|
+
export declare function getCoverImageUrl(puja: SriMandirPuja, language: string): string;
|
|
23
|
+
export declare function getPujaForDosha(pujas: SriMandirPuja[], doshaType: string): SriMandirPuja | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
import { DoshaSubmissionPayload, DoshaCalculationResponse } from '../types/dosha-api';
|
|
3
|
+
export interface SubmitDoshaOptions {
|
|
4
|
+
visitorId?: string;
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
/** If true, insert into session_problem_statements (default true) */
|
|
7
|
+
trackProblemStatements?: boolean;
|
|
8
|
+
/** Problem statements and language for session_problem_statements */
|
|
9
|
+
problemStatements?: string[];
|
|
10
|
+
language?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Insert session problem statements (fire-and-forget).
|
|
14
|
+
*/
|
|
15
|
+
export declare function insertSessionProblemStatements(supabase: SupabaseClient, options: {
|
|
16
|
+
visitorId: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
problemStatements: string[];
|
|
19
|
+
language?: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Invoke the calculate-dosha Edge Function and return the parsed response.
|
|
23
|
+
*/
|
|
24
|
+
export declare function invokeCalculateDosha(supabase: SupabaseClient, payload: DoshaSubmissionPayload, headers?: {
|
|
25
|
+
'x-visitor-id'?: string;
|
|
26
|
+
'x-session-id'?: string;
|
|
27
|
+
}): Promise<DoshaCalculationResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Full submit: optionally insert session_problem_statements, then invoke calculate-dosha.
|
|
30
|
+
*/
|
|
31
|
+
export declare function submitDoshaCalculation(supabase: SupabaseClient, payload: DoshaSubmissionPayload, options?: SubmitDoshaOptions): Promise<DoshaCalculationResponse>;
|