@myrjfa/state 1.1.2 → 2.0.0
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/index.d.ts +18 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/lib/actions/actions.d.ts +1 -20
- package/dist/lib/actions/actions.d.ts.map +1 -1
- package/dist/lib/actions/actions.js +10 -50
- package/dist/lib/actions/auth.d.ts +22 -12
- package/dist/lib/actions/auth.d.ts.map +1 -1
- package/dist/lib/actions/booking.d.ts +30 -0
- package/dist/lib/actions/booking.d.ts.map +1 -0
- package/dist/lib/actions/booking.js +77 -0
- package/dist/lib/actions/fetcher.d.ts +3 -0
- package/dist/lib/actions/fetcher.d.ts.map +1 -1
- package/dist/lib/actions/fetcher.js +6 -44
- package/dist/lib/actions/{serverActions.d.ts → severActions.d.ts} +1 -1
- package/dist/lib/actions/severActions.d.ts.map +1 -0
- package/dist/lib/actions/{serverActions.js → severActions.js} +2 -5
- package/dist/lib/authSessionManager.d.ts.map +1 -1
- package/dist/lib/authSessionManager.js +7 -14
- package/dist/lib/context/ChatContext.d.ts +1 -1
- package/dist/lib/context/ChatContext.d.ts.map +1 -1
- package/dist/lib/models/adventure.d.ts +75 -0
- package/dist/lib/models/adventure.d.ts.map +1 -0
- package/dist/lib/models/adventure.js +1 -0
- package/dist/lib/models/blog.d.ts +6 -7
- package/dist/lib/models/blog.d.ts.map +1 -1
- package/dist/lib/models/booking.d.ts +47 -0
- package/dist/lib/models/booking.d.ts.map +1 -0
- package/dist/lib/models/booking.js +1 -0
- package/dist/lib/models/guide.d.ts +43 -0
- package/dist/lib/models/guide.d.ts.map +1 -0
- package/dist/lib/models/guide.js +1 -0
- package/dist/lib/models/{notifications.d.ts → notfications.d.ts} +1 -1
- package/dist/lib/models/notfications.d.ts.map +1 -0
- package/dist/lib/models/opportunities/freelance.d.ts +94 -54
- package/dist/lib/models/opportunities/freelance.d.ts.map +1 -1
- package/dist/lib/models/opportunities/internship.d.ts +94 -54
- package/dist/lib/models/opportunities/internship.d.ts.map +1 -1
- package/dist/lib/models/opportunities/job.d.ts +104 -64
- package/dist/lib/models/opportunities/job.d.ts.map +1 -1
- package/dist/lib/models/opportunities/opportunity.d.ts +107 -67
- package/dist/lib/models/opportunities/opportunity.d.ts.map +1 -1
- package/dist/lib/models/opportunities/opportunity.js +0 -1
- package/dist/lib/models/opportunities/volunteerJob.d.ts +94 -54
- package/dist/lib/models/opportunities/volunteerJob.d.ts.map +1 -1
- package/dist/lib/models/package.d.ts +264 -0
- package/dist/lib/models/package.d.ts.map +1 -0
- package/dist/lib/models/package.js +58 -0
- package/dist/lib/models/portfolio.d.ts +2 -2
- package/dist/lib/models/props.d.ts +7 -21
- package/dist/lib/models/props.d.ts.map +1 -1
- package/dist/lib/models/props.js +36 -0
- package/dist/lib/models/rental.d.ts +85 -0
- package/dist/lib/models/rental.d.ts.map +1 -0
- package/dist/lib/models/rental.js +1 -0
- package/dist/lib/models/review.d.ts +1 -1
- package/dist/lib/models/review.d.ts.map +1 -1
- package/dist/lib/models/stay.d.ts +459 -0
- package/dist/lib/models/stay.d.ts.map +1 -0
- package/dist/lib/models/stay.js +214 -0
- package/dist/lib/models/tile.d.ts +26 -1
- package/dist/lib/models/tile.d.ts.map +1 -1
- package/dist/lib/models/user.d.ts +52 -19
- package/dist/lib/models/user.d.ts.map +1 -1
- package/dist/lib/models/user.js +10 -5
- package/dist/lib/userAtom.d.ts +44 -24
- package/dist/lib/userAtom.d.ts.map +1 -1
- package/dist/lib/userAtom.js +11 -13
- package/dist/lib/utils.js +4 -4
- package/package.json +5 -2
- package/dist/lib/actions/serverActions.d.ts.map +0 -1
- package/dist/lib/models/notifications.d.ts.map +0 -1
- package/dist/lib/utils/socialMediaUrl.d.ts +0 -25
- package/dist/lib/utils/socialMediaUrl.d.ts.map +0 -1
- package/dist/lib/utils/socialMediaUrl.js +0 -97
- /package/dist/lib/models/{notifications.js → notfications.js} +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Property Type Options ─────────────────────────────────────────────────────
|
|
3
|
+
export const stayTypeOptions = [
|
|
4
|
+
{ value: 'hotel', label: 'Hotel' },
|
|
5
|
+
{ value: 'hostel', label: 'Hostel' },
|
|
6
|
+
{ value: 'homestay', label: 'Homestay' },
|
|
7
|
+
{ value: 'resort', label: 'Resort' },
|
|
8
|
+
{ value: 'guesthouse', label: 'Guesthouse' },
|
|
9
|
+
{ value: 'apartment', label: 'Apartment' },
|
|
10
|
+
{ value: 'villa', label: 'Villa' },
|
|
11
|
+
{ value: 'camping', label: 'Glamping' },
|
|
12
|
+
{ value: 'treehouse', label: 'Treehouse' },
|
|
13
|
+
{ value: 'houseboat', label: 'Houseboat' },
|
|
14
|
+
{ value: 'ngo', label: 'NGO' },
|
|
15
|
+
{ value: 'coworking', label: 'Co-working Space' },
|
|
16
|
+
];
|
|
17
|
+
export const stayStatusOptions = [
|
|
18
|
+
{ value: 'draft', label: 'Draft' },
|
|
19
|
+
{ value: 'pending', label: 'Pending Approval' },
|
|
20
|
+
{ value: 'active', label: 'Active' },
|
|
21
|
+
{ value: 'inactive', label: 'Inactive' },
|
|
22
|
+
{ value: 'open', label: 'Open' },
|
|
23
|
+
{ value: 'closed', label: 'Closed' },
|
|
24
|
+
{ value: 'archived', label: 'Archived' },
|
|
25
|
+
];
|
|
26
|
+
// ── Permissions ───────────────────────────────────────────────────────────────
|
|
27
|
+
export const STAY_PERMISSIONS = [
|
|
28
|
+
'property:read', 'property:write', 'property:delete',
|
|
29
|
+
'opportunity:read', 'opportunity:write',
|
|
30
|
+
'chat:write',
|
|
31
|
+
'rooms:read', 'rooms:write',
|
|
32
|
+
'events:read', 'events:write',
|
|
33
|
+
'packages:approve',
|
|
34
|
+
'managers:manage',
|
|
35
|
+
'analytics:view',
|
|
36
|
+
];
|
|
37
|
+
export const stayPermissionLabels = {
|
|
38
|
+
'property:read': 'View Property Details',
|
|
39
|
+
'property:write': 'Edit Property Details',
|
|
40
|
+
'property:delete': 'Delete Property',
|
|
41
|
+
'opportunity:read': 'View Linked Opportunities',
|
|
42
|
+
'opportunity:write': 'Create/Edit Opportunities',
|
|
43
|
+
'chat:write': 'Create/Manage Chats',
|
|
44
|
+
'rooms:read': 'View Rooms',
|
|
45
|
+
'rooms:write': 'Manage Rooms',
|
|
46
|
+
'events:read': 'View Events',
|
|
47
|
+
'events:write': 'Manage Events',
|
|
48
|
+
'packages:approve': 'Approve Packages',
|
|
49
|
+
'managers:manage': 'Manage Team Members',
|
|
50
|
+
'analytics:view': 'View Analytics',
|
|
51
|
+
};
|
|
52
|
+
export const stayPermissionCategories = [
|
|
53
|
+
{ label: 'Property', permissions: ['property:read', 'property:write'] },
|
|
54
|
+
{ label: 'Opportunities', permissions: ['opportunity:read', 'opportunity:write'] },
|
|
55
|
+
{ label: 'Rooms', permissions: ['rooms:read', 'rooms:write'] },
|
|
56
|
+
{ label: 'Events', permissions: ['events:read', 'events:write'] },
|
|
57
|
+
{ label: 'Communication', permissions: ['chat:write'] },
|
|
58
|
+
{ label: 'Admin', permissions: ['managers:manage', 'analytics:view', 'packages:approve', 'property:delete'] },
|
|
59
|
+
];
|
|
60
|
+
// ── Manager Schema ────────────────────────────────────────────────────────────
|
|
61
|
+
export const StayManagerSchema = z.object({
|
|
62
|
+
_id: z.string().optional(),
|
|
63
|
+
userId: z.string(),
|
|
64
|
+
username: z.string(),
|
|
65
|
+
role: z.enum(['user', 'host']),
|
|
66
|
+
managerRole: z.string().default('operations'),
|
|
67
|
+
permissions: z.array(z.string()),
|
|
68
|
+
isOwner: z.boolean().default(false),
|
|
69
|
+
addedAt: z.date().optional(),
|
|
70
|
+
});
|
|
71
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
72
|
+
// ROOM — Standalone entity linked to a Property via propertyId
|
|
73
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
74
|
+
export const roomTypeOptions = [
|
|
75
|
+
{ value: 'single', label: 'Single Room' },
|
|
76
|
+
{ value: 'double', label: 'Double Room' },
|
|
77
|
+
{ value: 'twin', label: 'Twin Room' },
|
|
78
|
+
{ value: 'suite', label: 'Suite' },
|
|
79
|
+
{ value: 'deluxe', label: 'Deluxe Room' },
|
|
80
|
+
{ value: 'family', label: 'Family Room' },
|
|
81
|
+
{ value: 'dorm-mixed', label: 'Dorm (Mixed)' },
|
|
82
|
+
{ value: 'dorm-female', label: 'Dorm (Female)' },
|
|
83
|
+
{ value: 'dorm-male', label: 'Dorm (Male)' },
|
|
84
|
+
{ value: 'cottage', label: 'Cottage' },
|
|
85
|
+
{ value: 'tent', label: 'Tent / Glamping' },
|
|
86
|
+
{ value: 'penthouse', label: 'Penthouse' },
|
|
87
|
+
{ value: 'studio', label: 'Studio' },
|
|
88
|
+
{ value: 'villa', label: 'Villa' },
|
|
89
|
+
];
|
|
90
|
+
export const bedTypeOptions = [
|
|
91
|
+
{ value: 'single', label: 'Single Bed' },
|
|
92
|
+
{ value: 'double', label: 'Double Bed' },
|
|
93
|
+
{ value: 'queen', label: 'Queen Bed' },
|
|
94
|
+
{ value: 'king', label: 'King Bed' },
|
|
95
|
+
{ value: 'twin', label: 'Twin Beds' },
|
|
96
|
+
{ value: 'bunk', label: 'Bunk Bed' },
|
|
97
|
+
{ value: 'sofa-bed', label: 'Sofa Bed' },
|
|
98
|
+
{ value: 'futon', label: 'Futon' },
|
|
99
|
+
];
|
|
100
|
+
export const mealPlanOptions = [
|
|
101
|
+
{ value: 'none', label: 'No Meals' },
|
|
102
|
+
{ value: 'breakfast', label: 'Breakfast Included' },
|
|
103
|
+
{ value: 'half-board', label: 'Half Board (Breakfast + Dinner)' },
|
|
104
|
+
{ value: 'full-board', label: 'Full Board (All Meals)' },
|
|
105
|
+
{ value: 'all-inclusive', label: 'All Inclusive' },
|
|
106
|
+
];
|
|
107
|
+
export const RoomSchema = z.object({
|
|
108
|
+
_id: z.string().optional(),
|
|
109
|
+
propertyId: z.string(),
|
|
110
|
+
// Core
|
|
111
|
+
roomType: z.string(),
|
|
112
|
+
name: z.string(),
|
|
113
|
+
slug: z.string().optional(),
|
|
114
|
+
description: z.string().optional(),
|
|
115
|
+
// Pricing
|
|
116
|
+
pricePerNight: z.number(),
|
|
117
|
+
currency: z.string().default('INR'),
|
|
118
|
+
// Capacity
|
|
119
|
+
maxAdults: z.number().default(2),
|
|
120
|
+
maxChildren: z.number().default(0),
|
|
121
|
+
maxOccupancy: z.number().default(2),
|
|
122
|
+
totalRooms: z.number().default(1),
|
|
123
|
+
availableRooms: z.number().optional(),
|
|
124
|
+
// Details
|
|
125
|
+
bedType: z.string().optional(),
|
|
126
|
+
bathType: z.enum(['private', 'shared']).default('private'),
|
|
127
|
+
roomSize: z.string().optional(),
|
|
128
|
+
view: z.string().optional(),
|
|
129
|
+
mealPlan: z.string().optional(),
|
|
130
|
+
floorLevel: z.string().optional(),
|
|
131
|
+
// Media
|
|
132
|
+
images: z.array(z.string()).optional(),
|
|
133
|
+
amenities: z.array(z.string()).optional(),
|
|
134
|
+
// Status
|
|
135
|
+
isAvailable: z.boolean().default(true),
|
|
136
|
+
status: z.enum(['active', 'inactive', 'draft']).default('active'),
|
|
137
|
+
createdAt: z.date().optional(),
|
|
138
|
+
updatedAt: z.date().optional(),
|
|
139
|
+
});
|
|
140
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
141
|
+
// PROPERTY — Property-level details (no embedded rooms)
|
|
142
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
143
|
+
export const StaySchema = z.object({
|
|
144
|
+
_id: z.string().optional(),
|
|
145
|
+
title: z.string(),
|
|
146
|
+
name: z.string().optional(),
|
|
147
|
+
slug: z.string().optional(),
|
|
148
|
+
description: z.string().optional(),
|
|
149
|
+
shortDescription: z.string().optional(),
|
|
150
|
+
propertyType: z.string(),
|
|
151
|
+
starRating: z.number().min(1).max(5).optional(),
|
|
152
|
+
status: z.enum(['draft', 'pending', 'active', 'inactive', 'open', 'closed', 'archived']).optional(),
|
|
153
|
+
openedAt: z.date().optional(),
|
|
154
|
+
hostId: z.any(),
|
|
155
|
+
managers: z.array(StayManagerSchema).optional(),
|
|
156
|
+
images: z.array(z.string()).optional(),
|
|
157
|
+
nearbyAreaImages: z.array(z.string()).optional(),
|
|
158
|
+
// Location
|
|
159
|
+
address: z.string().optional(),
|
|
160
|
+
city: z.string(),
|
|
161
|
+
state: z.string(),
|
|
162
|
+
country: z.string().default('India'),
|
|
163
|
+
pincode: z.string().optional(),
|
|
164
|
+
coordinates: z.object({ lat: z.number(), lng: z.number() }).optional(),
|
|
165
|
+
nearbyLandmarks: z.array(z.string()).optional(),
|
|
166
|
+
// Linked room IDs (optional cache — rooms are fetched separately)
|
|
167
|
+
roomIds: z.array(z.string()).optional(),
|
|
168
|
+
// Property-level amenities, facilities & policies
|
|
169
|
+
amenities: z.array(z.string()).optional(),
|
|
170
|
+
facilities: z.array(z.string()).optional(),
|
|
171
|
+
tags: z.array(z.string()).optional(),
|
|
172
|
+
houseRules: z.array(z.string()).optional(),
|
|
173
|
+
checkInTime: z.string().optional(),
|
|
174
|
+
checkOutTime: z.string().optional(),
|
|
175
|
+
cancellationPolicy: z.string().optional(),
|
|
176
|
+
petsAllowed: z.boolean().optional(),
|
|
177
|
+
smokingAllowed: z.boolean().optional(),
|
|
178
|
+
instantBook: z.boolean().optional(),
|
|
179
|
+
// Stats
|
|
180
|
+
rating: z.number().optional(),
|
|
181
|
+
ratingCount: z.number().optional(),
|
|
182
|
+
reviewCount: z.number().optional(),
|
|
183
|
+
views: z.number().optional(),
|
|
184
|
+
isFeatured: z.boolean().optional(),
|
|
185
|
+
adminApproval: z.boolean().optional(),
|
|
186
|
+
// Future linking
|
|
187
|
+
chatIds: z.array(z.string()).optional(),
|
|
188
|
+
linkedEventIds: z.array(z.string()).optional(),
|
|
189
|
+
createdAt: z.date().optional(),
|
|
190
|
+
updatedAt: z.date().optional(),
|
|
191
|
+
});
|
|
192
|
+
// ── Amenity & Facility options ────────────────────────────────────────────────
|
|
193
|
+
export const stayAmenitiesOptions = [
|
|
194
|
+
'Free WiFi', 'Swimming Pool', 'Spa', 'Gym', 'Restaurant', 'Bar',
|
|
195
|
+
'Parking', 'Air Conditioning', 'Breakfast', 'Room Service',
|
|
196
|
+
'Concierge', 'Laundry', 'Yoga Deck', 'Beach Access',
|
|
197
|
+
'Private Pool', 'Hot Tub', '24/7 Security', 'Airport Shuttle',
|
|
198
|
+
'EV Charging', 'Pet Friendly', 'CCTV', 'Kitchen', 'Garden',
|
|
199
|
+
];
|
|
200
|
+
export const stayFacilitiesOptions = [
|
|
201
|
+
'Conference Room', 'Co-working Space', 'Library', 'Rooftop Terrace',
|
|
202
|
+
'Banquet Hall', 'Kids Play Area', 'Bicycle Rental', 'Car Rental Desk',
|
|
203
|
+
'Travel Desk', 'Medical Aid', 'ATM', 'Gift Shop', 'Bonfire Area',
|
|
204
|
+
'Meditation Hall', 'Art Studio', 'Music Room', 'Organic Farm',
|
|
205
|
+
'Water Sports', 'Adventure Desk', 'Craft Workshop',
|
|
206
|
+
];
|
|
207
|
+
export const roomAmenitiesOptions = [
|
|
208
|
+
'AC', 'Free WiFi', 'TV', 'Hot Water', 'Bathtub', 'Minibar',
|
|
209
|
+
'Minifridge', 'Netflix', 'Sea View', 'Mountain View', 'Garden View',
|
|
210
|
+
'Balcony', 'Kitchenette', 'Washing Machine', 'Workspace',
|
|
211
|
+
'Locker', 'Reading Light', 'Power Socket', 'Heating',
|
|
212
|
+
'Hairdryer', 'Meals Included', 'Rainfall Shower', 'Fire Pit',
|
|
213
|
+
'Outdoor Shower', 'Mosquito Net', 'Fan',
|
|
214
|
+
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpportunityType } from "./opportunities/opportunity";
|
|
2
|
-
export type tileType = "opportunities" | "blogs" | "packages";
|
|
2
|
+
export type tileType = "opportunities" | "blogs" | "packages" | "rentals" | "adventures";
|
|
3
3
|
export interface TileProps {
|
|
4
4
|
slug: string;
|
|
5
5
|
image: string;
|
|
@@ -25,5 +25,30 @@ export interface TileProps {
|
|
|
25
25
|
difficultyLevel?: "easy" | "medium" | "hard";
|
|
26
26
|
includeHost?: boolean;
|
|
27
27
|
opportunityType?: OpportunityType;
|
|
28
|
+
vehicleType?: string;
|
|
29
|
+
fuelType?: string;
|
|
30
|
+
driverOption?: string;
|
|
31
|
+
transmission?: string;
|
|
32
|
+
seatingCapacity?: number;
|
|
33
|
+
homeDeliveryAvailable?: boolean;
|
|
34
|
+
homeDeliveryPrice?: number;
|
|
35
|
+
cancellationPolicy?: string;
|
|
36
|
+
lastServiceDate?: string | Date;
|
|
37
|
+
pickupPoints?: {
|
|
38
|
+
name: string;
|
|
39
|
+
address: string;
|
|
40
|
+
lat?: number;
|
|
41
|
+
lng?: number;
|
|
42
|
+
}[];
|
|
43
|
+
payAtPickup?: boolean;
|
|
44
|
+
completedTrips?: number;
|
|
45
|
+
weeklyPrice?: number;
|
|
46
|
+
fifteenDaysPrice?: number;
|
|
47
|
+
monthlyPrice?: number;
|
|
48
|
+
distanceLimit?: string;
|
|
49
|
+
reviewCount?: number;
|
|
50
|
+
brand?: string;
|
|
51
|
+
model?: string;
|
|
52
|
+
depositAmount?: number;
|
|
28
53
|
}
|
|
29
54
|
//# sourceMappingURL=tile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/lib/models/tile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/lib/models/tile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;AAEzF,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const socialLinkTypes:
|
|
2
|
+
export declare const socialLinkTypes: [string, ...string[]];
|
|
3
3
|
export declare const zroles: z.ZodEnum<["host", "user", "admin", "hr", "sales"]>;
|
|
4
4
|
export declare const UserSchema: z.ZodObject<{
|
|
5
5
|
username: z.ZodString;
|
|
@@ -31,7 +31,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
31
31
|
verifiedMobile: z.ZodBoolean;
|
|
32
32
|
verifiedIdCard: z.ZodOptional<z.ZodBoolean>;
|
|
33
33
|
role: z.ZodEnum<["host", "user", "admin", "hr", "sales"]>;
|
|
34
|
-
socialLinks: z.ZodOptional<z.ZodRecord<z.ZodEnum<[
|
|
34
|
+
socialLinks: z.ZodOptional<z.ZodRecord<z.ZodEnum<[string, ...string[]]>, z.ZodString>>;
|
|
35
35
|
userResume: z.ZodOptional<z.ZodString>;
|
|
36
36
|
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
37
37
|
skill: z.ZodString;
|
|
@@ -54,11 +54,34 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
54
54
|
gstNumber: z.ZodOptional<z.ZodString>;
|
|
55
55
|
panCard: z.ZodOptional<z.ZodString>;
|
|
56
56
|
verifiedBusiness: z.ZodOptional<z.ZodEnum<["true", "false", "inProgress"]>>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
type: z.ZodString;
|
|
60
|
+
address: z.ZodString;
|
|
61
|
+
city: z.ZodString;
|
|
62
|
+
state: z.ZodString;
|
|
63
|
+
country: z.ZodString;
|
|
64
|
+
pinCode: z.ZodOptional<z.ZodString>;
|
|
65
|
+
registrationNumber: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
country: string;
|
|
68
|
+
type: string;
|
|
69
|
+
name: string;
|
|
70
|
+
address: string;
|
|
71
|
+
city: string;
|
|
72
|
+
state: string;
|
|
73
|
+
pinCode?: string | undefined;
|
|
74
|
+
registrationNumber?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
country: string;
|
|
77
|
+
type: string;
|
|
78
|
+
name: string;
|
|
79
|
+
address: string;
|
|
80
|
+
city: string;
|
|
81
|
+
state: string;
|
|
82
|
+
pinCode?: string | undefined;
|
|
83
|
+
registrationNumber?: string | undefined;
|
|
84
|
+
}>, "many">>;
|
|
62
85
|
}, "strict", z.ZodTypeAny, {
|
|
63
86
|
username: string;
|
|
64
87
|
firstName: string;
|
|
@@ -89,7 +112,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
89
112
|
accessToken?: string | undefined;
|
|
90
113
|
refreshToken?: string | undefined;
|
|
91
114
|
verifiedIdCard?: boolean | undefined;
|
|
92
|
-
socialLinks?:
|
|
115
|
+
socialLinks?: Record<string, string> | undefined;
|
|
93
116
|
userResume?: string | undefined;
|
|
94
117
|
skills?: {
|
|
95
118
|
skill: string;
|
|
@@ -106,11 +129,16 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
106
129
|
gstNumber?: string | undefined;
|
|
107
130
|
panCard?: string | undefined;
|
|
108
131
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
132
|
+
properties?: {
|
|
133
|
+
country: string;
|
|
134
|
+
type: string;
|
|
135
|
+
name: string;
|
|
136
|
+
address: string;
|
|
137
|
+
city: string;
|
|
138
|
+
state: string;
|
|
139
|
+
pinCode?: string | undefined;
|
|
140
|
+
registrationNumber?: string | undefined;
|
|
141
|
+
}[] | undefined;
|
|
114
142
|
}, {
|
|
115
143
|
username: string;
|
|
116
144
|
firstName: string;
|
|
@@ -141,7 +169,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
141
169
|
accessToken?: string | undefined;
|
|
142
170
|
refreshToken?: string | undefined;
|
|
143
171
|
verifiedIdCard?: boolean | undefined;
|
|
144
|
-
socialLinks?:
|
|
172
|
+
socialLinks?: Record<string, string> | undefined;
|
|
145
173
|
userResume?: string | undefined;
|
|
146
174
|
skills?: {
|
|
147
175
|
skill: string;
|
|
@@ -158,11 +186,16 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
158
186
|
gstNumber?: string | undefined;
|
|
159
187
|
panCard?: string | undefined;
|
|
160
188
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
189
|
+
properties?: {
|
|
190
|
+
country: string;
|
|
191
|
+
type: string;
|
|
192
|
+
name: string;
|
|
193
|
+
address: string;
|
|
194
|
+
city: string;
|
|
195
|
+
state: string;
|
|
196
|
+
pinCode?: string | undefined;
|
|
197
|
+
registrationNumber?: string | undefined;
|
|
198
|
+
}[] | undefined;
|
|
166
199
|
}>;
|
|
167
200
|
export type User = z.infer<typeof UserSchema>;
|
|
168
201
|
export declare const sampleUser: User;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/lib/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/lib/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,EAA6D,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AAE/G,eAAO,MAAM,MAAM,qDAAmD,CAAC;AAEvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEZ,CAAC;AAEZ,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,UAAU,EAAE,IAmCxB,CAAC"}
|
package/dist/lib/models/user.js
CHANGED
|
@@ -51,11 +51,16 @@ export const UserSchema = z.object({
|
|
|
51
51
|
gstNumber: z.string().optional(),
|
|
52
52
|
panCard: z.string().optional(),
|
|
53
53
|
verifiedBusiness: z.enum(["true", "false", "inProgress"]).optional(),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
properties: z.array(z.object({
|
|
55
|
+
name: z.string(),
|
|
56
|
+
type: z.string(),
|
|
57
|
+
address: z.string(),
|
|
58
|
+
city: z.string(),
|
|
59
|
+
state: z.string(),
|
|
60
|
+
country: z.string(),
|
|
61
|
+
pinCode: z.string().optional(),
|
|
62
|
+
registrationNumber: z.string().optional(),
|
|
63
|
+
})).optional(),
|
|
59
64
|
}).strict(); // 👈 .strict() blocks unknown fields
|
|
60
65
|
export const sampleUser = {
|
|
61
66
|
username: "wanderlust_volunteer",
|
package/dist/lib/userAtom.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
31
31
|
accessToken?: string | undefined;
|
|
32
32
|
refreshToken?: string | undefined;
|
|
33
33
|
verifiedIdCard?: boolean | undefined;
|
|
34
|
-
socialLinks?:
|
|
34
|
+
socialLinks?: Record<string, string> | undefined;
|
|
35
35
|
userResume?: string | undefined;
|
|
36
36
|
skills?: {
|
|
37
37
|
skill: string;
|
|
@@ -48,11 +48,16 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
48
48
|
gstNumber?: string | undefined;
|
|
49
49
|
panCard?: string | undefined;
|
|
50
50
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
properties?: {
|
|
52
|
+
country: string;
|
|
53
|
+
type: string;
|
|
54
|
+
name: string;
|
|
55
|
+
address: string;
|
|
56
|
+
city: string;
|
|
57
|
+
state: string;
|
|
58
|
+
pinCode?: string | undefined;
|
|
59
|
+
registrationNumber?: string | undefined;
|
|
60
|
+
}[] | undefined;
|
|
56
61
|
} | null, [{
|
|
57
62
|
username: string;
|
|
58
63
|
firstName: string;
|
|
@@ -83,7 +88,7 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
83
88
|
accessToken?: string | undefined;
|
|
84
89
|
refreshToken?: string | undefined;
|
|
85
90
|
verifiedIdCard?: boolean | undefined;
|
|
86
|
-
socialLinks?:
|
|
91
|
+
socialLinks?: Record<string, string> | undefined;
|
|
87
92
|
userResume?: string | undefined;
|
|
88
93
|
skills?: {
|
|
89
94
|
skill: string;
|
|
@@ -100,11 +105,16 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
100
105
|
gstNumber?: string | undefined;
|
|
101
106
|
panCard?: string | undefined;
|
|
102
107
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
properties?: {
|
|
109
|
+
country: string;
|
|
110
|
+
type: string;
|
|
111
|
+
name: string;
|
|
112
|
+
address: string;
|
|
113
|
+
city: string;
|
|
114
|
+
state: string;
|
|
115
|
+
pinCode?: string | undefined;
|
|
116
|
+
registrationNumber?: string | undefined;
|
|
117
|
+
}[] | undefined;
|
|
108
118
|
} | typeof import("jotai/utils").RESET | ((prev: {
|
|
109
119
|
username: string;
|
|
110
120
|
firstName: string;
|
|
@@ -135,7 +145,7 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
135
145
|
accessToken?: string | undefined;
|
|
136
146
|
refreshToken?: string | undefined;
|
|
137
147
|
verifiedIdCard?: boolean | undefined;
|
|
138
|
-
socialLinks?:
|
|
148
|
+
socialLinks?: Record<string, string> | undefined;
|
|
139
149
|
userResume?: string | undefined;
|
|
140
150
|
skills?: {
|
|
141
151
|
skill: string;
|
|
@@ -152,11 +162,16 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
152
162
|
gstNumber?: string | undefined;
|
|
153
163
|
panCard?: string | undefined;
|
|
154
164
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
properties?: {
|
|
166
|
+
country: string;
|
|
167
|
+
type: string;
|
|
168
|
+
name: string;
|
|
169
|
+
address: string;
|
|
170
|
+
city: string;
|
|
171
|
+
state: string;
|
|
172
|
+
pinCode?: string | undefined;
|
|
173
|
+
registrationNumber?: string | undefined;
|
|
174
|
+
}[] | undefined;
|
|
160
175
|
} | null) => {
|
|
161
176
|
username: string;
|
|
162
177
|
firstName: string;
|
|
@@ -187,7 +202,7 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
187
202
|
accessToken?: string | undefined;
|
|
188
203
|
refreshToken?: string | undefined;
|
|
189
204
|
verifiedIdCard?: boolean | undefined;
|
|
190
|
-
socialLinks?:
|
|
205
|
+
socialLinks?: Record<string, string> | undefined;
|
|
191
206
|
userResume?: string | undefined;
|
|
192
207
|
skills?: {
|
|
193
208
|
skill: string;
|
|
@@ -204,11 +219,16 @@ export declare const userAtom: import("jotai").WritableAtom<{
|
|
|
204
219
|
gstNumber?: string | undefined;
|
|
205
220
|
panCard?: string | undefined;
|
|
206
221
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
222
|
+
properties?: {
|
|
223
|
+
country: string;
|
|
224
|
+
type: string;
|
|
225
|
+
name: string;
|
|
226
|
+
address: string;
|
|
227
|
+
city: string;
|
|
228
|
+
state: string;
|
|
229
|
+
pinCode?: string | undefined;
|
|
230
|
+
registrationNumber?: string | undefined;
|
|
231
|
+
}[] | undefined;
|
|
212
232
|
} | typeof import("jotai/utils").RESET | null) | null], void>;
|
|
213
233
|
export declare const isLoggedInAtom: import("jotai").WritableAtom<boolean, [boolean | typeof import("jotai/utils").RESET | ((prev: boolean) => boolean | typeof import("jotai/utils").RESET)], void>;
|
|
214
234
|
export declare const userLoadingAtom: import("jotai").Atom<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAtom.d.ts","sourceRoot":"","sources":["../../src/lib/userAtom.ts"],"names":[],"mappings":"AAgEA,eAAO,MAAM,sBAAsB;;CAAuB,CAAC;AAG3D,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"userAtom.d.ts","sourceRoot":"","sources":["../../src/lib/userAtom.ts"],"names":[],"mappings":"AAgEA,eAAO,MAAM,sBAAsB;;CAAuB,CAAC;AAG3D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6DAQpB,CAAC;AAEF,eAAO,MAAM,cAAc,iKAA6C,CAAC;AAGzE,eAAO,MAAM,eAAe,+BAM1B,CAAC;AAGH,eAAO,MAAM,yBAAyB;;CA2CrC,CAAC;AAGF,wBAAgB,cAAc,SAS7B"}
|
package/dist/lib/userAtom.js
CHANGED
|
@@ -3,6 +3,7 @@ import CryptoJS from 'crypto-js';
|
|
|
3
3
|
import { atom, getDefaultStore } from 'jotai';
|
|
4
4
|
import { atomWithStorage } from 'jotai/utils';
|
|
5
5
|
import { getCurrentUser } from './actions/actions';
|
|
6
|
+
import { validateSession } from './actions/auth';
|
|
6
7
|
const STORAGE_KEY = process.env.NEXT_PUBLIC_USER_KEY;
|
|
7
8
|
const LOGIN_KEY = process.env.NEXT_PUBLIC_LOGIN_KEY;
|
|
8
9
|
const SECRET_KEY = process.env.NEXT_PUBLIC_RACE;
|
|
@@ -76,19 +77,16 @@ export const initializeAuthSessionAtom = atom(null, async (get, set) => {
|
|
|
76
77
|
// Only run in browser
|
|
77
78
|
if (typeof window === 'undefined')
|
|
78
79
|
return;
|
|
79
|
-
// 1. Validate session (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// to cache/API. A failed ping could mean the backend is temporarily down,
|
|
90
|
-
// the user is a host (different endpoint), etc. We only clear state if we
|
|
91
|
-
// POSITIVELY know the user is logged out (getCurrentUser fails).
|
|
80
|
+
// 1. Validate session (lightweight, no DB)
|
|
81
|
+
const session = await validateSession();
|
|
82
|
+
if (session.success) {
|
|
83
|
+
console.log(session.message);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
resetAuthState();
|
|
87
|
+
set(storageInitializedAtom, true);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
92
90
|
// 2. Try cache (localStorage)
|
|
93
91
|
const userData = getWithExpiry(STORAGE_KEY);
|
|
94
92
|
if (userData) {
|
package/dist/lib/utils.js
CHANGED
|
@@ -61,11 +61,11 @@ export function getProgressValue(status) {
|
|
|
61
61
|
export const truncateText = (text, limit) => text.length > limit ? text.substring(0, limit) + "..." : text;
|
|
62
62
|
export const numToStr = (input) => {
|
|
63
63
|
if (input > 1000000000)
|
|
64
|
-
return `${
|
|
64
|
+
return `${input / 1000000}B+`;
|
|
65
65
|
if (input > 1000000)
|
|
66
|
-
return `${
|
|
66
|
+
return `${input / 1000000}M+`;
|
|
67
67
|
if (input > 1000)
|
|
68
|
-
return `${
|
|
68
|
+
return `${input / 1000}K+`;
|
|
69
69
|
return `${input}`;
|
|
70
70
|
};
|
|
71
71
|
export const handleEmail = (email, subject, body) => window.location.href = `mailto:${email}?subject=${subject}&body=${body}`;
|
|
@@ -173,7 +173,7 @@ export function incompleteMVP(user) {
|
|
|
173
173
|
if (!user.pinCode)
|
|
174
174
|
incompletions.push("PinCode");
|
|
175
175
|
if (!user.profilePic)
|
|
176
|
-
incompletions.push("
|
|
176
|
+
incompletions.push("Proile Pic");
|
|
177
177
|
}
|
|
178
178
|
else {
|
|
179
179
|
incompletions.push("Please login first");
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrjfa/state",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./dist/index.js",
|
|
7
|
+
"./*": "./*.js"
|
|
8
|
+
},
|
|
5
9
|
"description": "Shared state management for myrjfa apps",
|
|
6
10
|
"main": "dist/index.js",
|
|
7
11
|
"types": "dist/index.d.ts",
|
|
8
|
-
"sideEffects": false,
|
|
9
12
|
"files": [
|
|
10
13
|
"dist"
|
|
11
14
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverActions.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/serverActions.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAKvD;AAED,wBAAsB,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/lib/models/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DtB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalizes social media input (username or partial URL) into a fully qualified URL.
|
|
3
|
-
* Handles cases where users enter just a username, handle, or partial URL.
|
|
4
|
-
*/
|
|
5
|
-
export type SocialPlatformType = 'instagram' | 'twitter' | 'linkedin' | 'facebook' | 'youtube' | 'github' | 'googleBusiness';
|
|
6
|
-
interface PlatformConfig {
|
|
7
|
-
baseUrl: string;
|
|
8
|
-
usernameRegex: RegExp;
|
|
9
|
-
urlPattern: RegExp;
|
|
10
|
-
buildUrl: (username: string) => string;
|
|
11
|
-
placeholder: string;
|
|
12
|
-
hint: string;
|
|
13
|
-
}
|
|
14
|
-
declare const PLATFORM_CONFIGS: Record<SocialPlatformType, PlatformConfig>;
|
|
15
|
-
/**
|
|
16
|
-
* Attempts to normalize a social media input into a full URL.
|
|
17
|
-
* Returns { url, error } — url is the corrected URL or the original input, error is a message if invalid.
|
|
18
|
-
*/
|
|
19
|
-
export declare function normalizeSocialUrl(platform: SocialPlatformType, input: string): {
|
|
20
|
-
url: string;
|
|
21
|
-
error: string | null;
|
|
22
|
-
};
|
|
23
|
-
export { PLATFORM_CONFIGS };
|
|
24
|
-
export type { SocialPlatformType as SocialPlatform };
|
|
25
|
-
//# sourceMappingURL=socialMediaUrl.d.ts.map
|