more-apartments-astro-integration 1.0.1 → 1.1.2
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/.more-apartments/properties.json +451 -226
- package/dist/cli/index.js +27 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.mts +97 -30
- package/dist/index.d.ts +97 -30
- package/dist/index.js +31 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/routes/availability.js +1 -1
- package/routes/property.js +1 -1
- package/src/components/PropertySearchGrid.astro +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -288,19 +288,28 @@ declare const PropertySchema: z.ZodObject<{
|
|
|
288
288
|
check_out: z.ZodNullable<z.ZodString>;
|
|
289
289
|
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
290
290
|
id: z.ZodNumber;
|
|
291
|
-
url: z.ZodString;
|
|
292
|
-
thumb_url: z.ZodString;
|
|
293
291
|
alt: z.ZodString;
|
|
292
|
+
small_url: z.ZodString;
|
|
293
|
+
medium_url: z.ZodString;
|
|
294
|
+
large_url: z.ZodString;
|
|
295
|
+
srcset: z.ZodString;
|
|
296
|
+
url: z.ZodString;
|
|
294
297
|
}, "strip", z.ZodTypeAny, {
|
|
295
298
|
id: number;
|
|
296
|
-
url: string;
|
|
297
|
-
thumb_url: string;
|
|
298
299
|
alt: string;
|
|
300
|
+
small_url: string;
|
|
301
|
+
medium_url: string;
|
|
302
|
+
large_url: string;
|
|
303
|
+
srcset: string;
|
|
304
|
+
url: string;
|
|
299
305
|
}, {
|
|
300
306
|
id: number;
|
|
301
|
-
url: string;
|
|
302
|
-
thumb_url: string;
|
|
303
307
|
alt: string;
|
|
308
|
+
small_url: string;
|
|
309
|
+
medium_url: string;
|
|
310
|
+
large_url: string;
|
|
311
|
+
srcset: string;
|
|
312
|
+
url: string;
|
|
304
313
|
}>, "many">>;
|
|
305
314
|
status: z.ZodNullable<z.ZodString>;
|
|
306
315
|
provider_name: z.ZodNullable<z.ZodString>;
|
|
@@ -390,9 +399,12 @@ declare const PropertySchema: z.ZodObject<{
|
|
|
390
399
|
external_id?: number | undefined;
|
|
391
400
|
images?: {
|
|
392
401
|
id: number;
|
|
393
|
-
url: string;
|
|
394
|
-
thumb_url: string;
|
|
395
402
|
alt: string;
|
|
403
|
+
small_url: string;
|
|
404
|
+
medium_url: string;
|
|
405
|
+
large_url: string;
|
|
406
|
+
srcset: string;
|
|
407
|
+
url: string;
|
|
396
408
|
}[] | undefined;
|
|
397
409
|
}, {
|
|
398
410
|
type: string | null;
|
|
@@ -478,9 +490,12 @@ declare const PropertySchema: z.ZodObject<{
|
|
|
478
490
|
external_id?: number | undefined;
|
|
479
491
|
images?: {
|
|
480
492
|
id: number;
|
|
481
|
-
url: string;
|
|
482
|
-
thumb_url: string;
|
|
483
493
|
alt: string;
|
|
494
|
+
small_url: string;
|
|
495
|
+
medium_url: string;
|
|
496
|
+
large_url: string;
|
|
497
|
+
srcset: string;
|
|
498
|
+
url: string;
|
|
484
499
|
}[] | undefined;
|
|
485
500
|
}>;
|
|
486
501
|
declare const AvailableDay: z.ZodObject<{
|
|
@@ -488,16 +503,19 @@ declare const AvailableDay: z.ZodObject<{
|
|
|
488
503
|
morning_available: z.ZodBoolean;
|
|
489
504
|
date: z.ZodString;
|
|
490
505
|
day: z.ZodNumber;
|
|
506
|
+
stay_minimum: z.ZodNumber;
|
|
491
507
|
}, "strip", z.ZodTypeAny, {
|
|
492
508
|
date: string;
|
|
493
509
|
available: boolean;
|
|
494
510
|
morning_available: boolean;
|
|
495
511
|
day: number;
|
|
512
|
+
stay_minimum: number;
|
|
496
513
|
}, {
|
|
497
514
|
date: string;
|
|
498
515
|
available: boolean;
|
|
499
516
|
morning_available: boolean;
|
|
500
517
|
day: number;
|
|
518
|
+
stay_minimum: number;
|
|
501
519
|
}>;
|
|
502
520
|
declare const AvailabilitySchema: z.ZodObject<{
|
|
503
521
|
days: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -505,16 +523,19 @@ declare const AvailabilitySchema: z.ZodObject<{
|
|
|
505
523
|
morning_available: z.ZodBoolean;
|
|
506
524
|
date: z.ZodString;
|
|
507
525
|
day: z.ZodNumber;
|
|
526
|
+
stay_minimum: z.ZodNumber;
|
|
508
527
|
}, "strip", z.ZodTypeAny, {
|
|
509
528
|
date: string;
|
|
510
529
|
available: boolean;
|
|
511
530
|
morning_available: boolean;
|
|
512
531
|
day: number;
|
|
532
|
+
stay_minimum: number;
|
|
513
533
|
}, {
|
|
514
534
|
date: string;
|
|
515
535
|
available: boolean;
|
|
516
536
|
morning_available: boolean;
|
|
517
537
|
day: number;
|
|
538
|
+
stay_minimum: number;
|
|
518
539
|
}>>;
|
|
519
540
|
}, "strip", z.ZodTypeAny, {
|
|
520
541
|
days: Record<string, {
|
|
@@ -522,6 +543,7 @@ declare const AvailabilitySchema: z.ZodObject<{
|
|
|
522
543
|
available: boolean;
|
|
523
544
|
morning_available: boolean;
|
|
524
545
|
day: number;
|
|
546
|
+
stay_minimum: number;
|
|
525
547
|
}>;
|
|
526
548
|
}, {
|
|
527
549
|
days: Record<string, {
|
|
@@ -529,6 +551,7 @@ declare const AvailabilitySchema: z.ZodObject<{
|
|
|
529
551
|
available: boolean;
|
|
530
552
|
morning_available: boolean;
|
|
531
553
|
day: number;
|
|
554
|
+
stay_minimum: number;
|
|
532
555
|
}>;
|
|
533
556
|
}>;
|
|
534
557
|
declare const PropertySearchParamsSchema: z.ZodObject<{
|
|
@@ -658,19 +681,28 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
658
681
|
check_out: z.ZodNullable<z.ZodString>;
|
|
659
682
|
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
660
683
|
id: z.ZodNumber;
|
|
661
|
-
url: z.ZodString;
|
|
662
|
-
thumb_url: z.ZodString;
|
|
663
684
|
alt: z.ZodString;
|
|
685
|
+
small_url: z.ZodString;
|
|
686
|
+
medium_url: z.ZodString;
|
|
687
|
+
large_url: z.ZodString;
|
|
688
|
+
srcset: z.ZodString;
|
|
689
|
+
url: z.ZodString;
|
|
664
690
|
}, "strip", z.ZodTypeAny, {
|
|
665
691
|
id: number;
|
|
666
|
-
url: string;
|
|
667
|
-
thumb_url: string;
|
|
668
692
|
alt: string;
|
|
693
|
+
small_url: string;
|
|
694
|
+
medium_url: string;
|
|
695
|
+
large_url: string;
|
|
696
|
+
srcset: string;
|
|
697
|
+
url: string;
|
|
669
698
|
}, {
|
|
670
699
|
id: number;
|
|
671
|
-
url: string;
|
|
672
|
-
thumb_url: string;
|
|
673
700
|
alt: string;
|
|
701
|
+
small_url: string;
|
|
702
|
+
medium_url: string;
|
|
703
|
+
large_url: string;
|
|
704
|
+
srcset: string;
|
|
705
|
+
url: string;
|
|
674
706
|
}>, "many">>;
|
|
675
707
|
status: z.ZodNullable<z.ZodString>;
|
|
676
708
|
provider_name: z.ZodNullable<z.ZodString>;
|
|
@@ -760,9 +792,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
760
792
|
external_id?: number | undefined;
|
|
761
793
|
images?: {
|
|
762
794
|
id: number;
|
|
763
|
-
url: string;
|
|
764
|
-
thumb_url: string;
|
|
765
795
|
alt: string;
|
|
796
|
+
small_url: string;
|
|
797
|
+
medium_url: string;
|
|
798
|
+
large_url: string;
|
|
799
|
+
srcset: string;
|
|
800
|
+
url: string;
|
|
766
801
|
}[] | undefined;
|
|
767
802
|
}, {
|
|
768
803
|
type: string | null;
|
|
@@ -848,9 +883,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
848
883
|
external_id?: number | undefined;
|
|
849
884
|
images?: {
|
|
850
885
|
id: number;
|
|
851
|
-
url: string;
|
|
852
|
-
thumb_url: string;
|
|
853
886
|
alt: string;
|
|
887
|
+
small_url: string;
|
|
888
|
+
medium_url: string;
|
|
889
|
+
large_url: string;
|
|
890
|
+
srcset: string;
|
|
891
|
+
url: string;
|
|
854
892
|
}[] | undefined;
|
|
855
893
|
}>, "many">;
|
|
856
894
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -938,9 +976,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
938
976
|
external_id?: number | undefined;
|
|
939
977
|
images?: {
|
|
940
978
|
id: number;
|
|
941
|
-
url: string;
|
|
942
|
-
thumb_url: string;
|
|
943
979
|
alt: string;
|
|
980
|
+
small_url: string;
|
|
981
|
+
medium_url: string;
|
|
982
|
+
large_url: string;
|
|
983
|
+
srcset: string;
|
|
984
|
+
url: string;
|
|
944
985
|
}[] | undefined;
|
|
945
986
|
}[];
|
|
946
987
|
}, {
|
|
@@ -1028,9 +1069,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
1028
1069
|
external_id?: number | undefined;
|
|
1029
1070
|
images?: {
|
|
1030
1071
|
id: number;
|
|
1031
|
-
url: string;
|
|
1032
|
-
thumb_url: string;
|
|
1033
1072
|
alt: string;
|
|
1073
|
+
small_url: string;
|
|
1074
|
+
medium_url: string;
|
|
1075
|
+
large_url: string;
|
|
1076
|
+
srcset: string;
|
|
1077
|
+
url: string;
|
|
1034
1078
|
}[] | undefined;
|
|
1035
1079
|
}[];
|
|
1036
1080
|
}>;
|
|
@@ -2055,6 +2099,17 @@ declare class MoreApartmentsClient {
|
|
|
2055
2099
|
}): Promise<PaginatedResponse<Property>>;
|
|
2056
2100
|
getProperty(propertyIdOrSlug: number | string): Promise<Property>;
|
|
2057
2101
|
getAvailability(propertySlug: string, startDate: string, endDate: string): Promise<Availability>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Get property calendar with pricing information (legacy endpoint)
|
|
2104
|
+
* Returns daily rates and availability for the specified date range
|
|
2105
|
+
*/
|
|
2106
|
+
getPropertyCalendar(propertySlug: string, fromDate: string, toDate: string): Promise<Array<{
|
|
2107
|
+
date: string;
|
|
2108
|
+
available: boolean;
|
|
2109
|
+
season: string;
|
|
2110
|
+
final_rate: number;
|
|
2111
|
+
stay_minimum: number;
|
|
2112
|
+
}>>;
|
|
2058
2113
|
getPages(): Promise<Page[]>;
|
|
2059
2114
|
getPage(slug: string): Promise<Page>;
|
|
2060
2115
|
getPosts(params?: {
|
|
@@ -2093,6 +2148,7 @@ declare class MoreApartmentsClient {
|
|
|
2093
2148
|
declare function getPrimaryImageUrl(property: Property, fallbackUrl?: string): string;
|
|
2094
2149
|
/**
|
|
2095
2150
|
* Get thumbnail image URL from property
|
|
2151
|
+
* Uses small_url (400×300) for efficient thumbnails
|
|
2096
2152
|
* @param property - Property object with optional images array
|
|
2097
2153
|
* @param fallbackUrl - Optional fallback image URL
|
|
2098
2154
|
* @returns Thumbnail URL string
|
|
@@ -2106,6 +2162,7 @@ declare function getThumbnailUrl(property: Property, fallbackUrl?: string): stri
|
|
|
2106
2162
|
declare function getAllImageUrls(property: Property): string[];
|
|
2107
2163
|
/**
|
|
2108
2164
|
* Get all thumbnail URLs from property
|
|
2165
|
+
* Uses small_url (400×300) for efficient thumbnails
|
|
2109
2166
|
* @param property - Property object with optional images array
|
|
2110
2167
|
* @returns Array of thumbnail URL strings
|
|
2111
2168
|
*/
|
|
@@ -2275,9 +2332,12 @@ declare function fetchProperties(client: MoreApartmentsClient, params?: {
|
|
|
2275
2332
|
external_id?: number | undefined;
|
|
2276
2333
|
images?: {
|
|
2277
2334
|
id: number;
|
|
2278
|
-
url: string;
|
|
2279
|
-
thumb_url: string;
|
|
2280
2335
|
alt: string;
|
|
2336
|
+
small_url: string;
|
|
2337
|
+
medium_url: string;
|
|
2338
|
+
large_url: string;
|
|
2339
|
+
srcset: string;
|
|
2340
|
+
url: string;
|
|
2281
2341
|
}[] | undefined;
|
|
2282
2342
|
}> | {
|
|
2283
2343
|
data: never[];
|
|
@@ -2380,9 +2440,12 @@ declare function fetchProperty(client: MoreApartmentsClient, idOrSlug: number |
|
|
|
2380
2440
|
external_id?: number | undefined;
|
|
2381
2441
|
images?: {
|
|
2382
2442
|
id: number;
|
|
2383
|
-
url: string;
|
|
2384
|
-
thumb_url: string;
|
|
2385
2443
|
alt: string;
|
|
2444
|
+
small_url: string;
|
|
2445
|
+
medium_url: string;
|
|
2446
|
+
large_url: string;
|
|
2447
|
+
srcset: string;
|
|
2448
|
+
url: string;
|
|
2386
2449
|
}[] | undefined;
|
|
2387
2450
|
} | null>;
|
|
2388
2451
|
/**
|
|
@@ -2405,6 +2468,7 @@ declare function fetchAvailability(client: MoreApartmentsClient, propertySlug: s
|
|
|
2405
2468
|
available: boolean;
|
|
2406
2469
|
morning_available: boolean;
|
|
2407
2470
|
day: number;
|
|
2471
|
+
stay_minimum: number;
|
|
2408
2472
|
}>;
|
|
2409
2473
|
} | null>;
|
|
2410
2474
|
/**
|
|
@@ -2723,9 +2787,12 @@ declare function searchProperties(client: MoreApartmentsClient, params: Property
|
|
|
2723
2787
|
external_id?: number | undefined;
|
|
2724
2788
|
images?: {
|
|
2725
2789
|
id: number;
|
|
2726
|
-
url: string;
|
|
2727
|
-
thumb_url: string;
|
|
2728
2790
|
alt: string;
|
|
2791
|
+
small_url: string;
|
|
2792
|
+
medium_url: string;
|
|
2793
|
+
large_url: string;
|
|
2794
|
+
srcset: string;
|
|
2795
|
+
url: string;
|
|
2729
2796
|
}[] | undefined;
|
|
2730
2797
|
}[]>;
|
|
2731
2798
|
|
package/dist/index.d.ts
CHANGED
|
@@ -288,19 +288,28 @@ declare const PropertySchema: z.ZodObject<{
|
|
|
288
288
|
check_out: z.ZodNullable<z.ZodString>;
|
|
289
289
|
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
290
290
|
id: z.ZodNumber;
|
|
291
|
-
url: z.ZodString;
|
|
292
|
-
thumb_url: z.ZodString;
|
|
293
291
|
alt: z.ZodString;
|
|
292
|
+
small_url: z.ZodString;
|
|
293
|
+
medium_url: z.ZodString;
|
|
294
|
+
large_url: z.ZodString;
|
|
295
|
+
srcset: z.ZodString;
|
|
296
|
+
url: z.ZodString;
|
|
294
297
|
}, "strip", z.ZodTypeAny, {
|
|
295
298
|
id: number;
|
|
296
|
-
url: string;
|
|
297
|
-
thumb_url: string;
|
|
298
299
|
alt: string;
|
|
300
|
+
small_url: string;
|
|
301
|
+
medium_url: string;
|
|
302
|
+
large_url: string;
|
|
303
|
+
srcset: string;
|
|
304
|
+
url: string;
|
|
299
305
|
}, {
|
|
300
306
|
id: number;
|
|
301
|
-
url: string;
|
|
302
|
-
thumb_url: string;
|
|
303
307
|
alt: string;
|
|
308
|
+
small_url: string;
|
|
309
|
+
medium_url: string;
|
|
310
|
+
large_url: string;
|
|
311
|
+
srcset: string;
|
|
312
|
+
url: string;
|
|
304
313
|
}>, "many">>;
|
|
305
314
|
status: z.ZodNullable<z.ZodString>;
|
|
306
315
|
provider_name: z.ZodNullable<z.ZodString>;
|
|
@@ -390,9 +399,12 @@ declare const PropertySchema: z.ZodObject<{
|
|
|
390
399
|
external_id?: number | undefined;
|
|
391
400
|
images?: {
|
|
392
401
|
id: number;
|
|
393
|
-
url: string;
|
|
394
|
-
thumb_url: string;
|
|
395
402
|
alt: string;
|
|
403
|
+
small_url: string;
|
|
404
|
+
medium_url: string;
|
|
405
|
+
large_url: string;
|
|
406
|
+
srcset: string;
|
|
407
|
+
url: string;
|
|
396
408
|
}[] | undefined;
|
|
397
409
|
}, {
|
|
398
410
|
type: string | null;
|
|
@@ -478,9 +490,12 @@ declare const PropertySchema: z.ZodObject<{
|
|
|
478
490
|
external_id?: number | undefined;
|
|
479
491
|
images?: {
|
|
480
492
|
id: number;
|
|
481
|
-
url: string;
|
|
482
|
-
thumb_url: string;
|
|
483
493
|
alt: string;
|
|
494
|
+
small_url: string;
|
|
495
|
+
medium_url: string;
|
|
496
|
+
large_url: string;
|
|
497
|
+
srcset: string;
|
|
498
|
+
url: string;
|
|
484
499
|
}[] | undefined;
|
|
485
500
|
}>;
|
|
486
501
|
declare const AvailableDay: z.ZodObject<{
|
|
@@ -488,16 +503,19 @@ declare const AvailableDay: z.ZodObject<{
|
|
|
488
503
|
morning_available: z.ZodBoolean;
|
|
489
504
|
date: z.ZodString;
|
|
490
505
|
day: z.ZodNumber;
|
|
506
|
+
stay_minimum: z.ZodNumber;
|
|
491
507
|
}, "strip", z.ZodTypeAny, {
|
|
492
508
|
date: string;
|
|
493
509
|
available: boolean;
|
|
494
510
|
morning_available: boolean;
|
|
495
511
|
day: number;
|
|
512
|
+
stay_minimum: number;
|
|
496
513
|
}, {
|
|
497
514
|
date: string;
|
|
498
515
|
available: boolean;
|
|
499
516
|
morning_available: boolean;
|
|
500
517
|
day: number;
|
|
518
|
+
stay_minimum: number;
|
|
501
519
|
}>;
|
|
502
520
|
declare const AvailabilitySchema: z.ZodObject<{
|
|
503
521
|
days: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -505,16 +523,19 @@ declare const AvailabilitySchema: z.ZodObject<{
|
|
|
505
523
|
morning_available: z.ZodBoolean;
|
|
506
524
|
date: z.ZodString;
|
|
507
525
|
day: z.ZodNumber;
|
|
526
|
+
stay_minimum: z.ZodNumber;
|
|
508
527
|
}, "strip", z.ZodTypeAny, {
|
|
509
528
|
date: string;
|
|
510
529
|
available: boolean;
|
|
511
530
|
morning_available: boolean;
|
|
512
531
|
day: number;
|
|
532
|
+
stay_minimum: number;
|
|
513
533
|
}, {
|
|
514
534
|
date: string;
|
|
515
535
|
available: boolean;
|
|
516
536
|
morning_available: boolean;
|
|
517
537
|
day: number;
|
|
538
|
+
stay_minimum: number;
|
|
518
539
|
}>>;
|
|
519
540
|
}, "strip", z.ZodTypeAny, {
|
|
520
541
|
days: Record<string, {
|
|
@@ -522,6 +543,7 @@ declare const AvailabilitySchema: z.ZodObject<{
|
|
|
522
543
|
available: boolean;
|
|
523
544
|
morning_available: boolean;
|
|
524
545
|
day: number;
|
|
546
|
+
stay_minimum: number;
|
|
525
547
|
}>;
|
|
526
548
|
}, {
|
|
527
549
|
days: Record<string, {
|
|
@@ -529,6 +551,7 @@ declare const AvailabilitySchema: z.ZodObject<{
|
|
|
529
551
|
available: boolean;
|
|
530
552
|
morning_available: boolean;
|
|
531
553
|
day: number;
|
|
554
|
+
stay_minimum: number;
|
|
532
555
|
}>;
|
|
533
556
|
}>;
|
|
534
557
|
declare const PropertySearchParamsSchema: z.ZodObject<{
|
|
@@ -658,19 +681,28 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
658
681
|
check_out: z.ZodNullable<z.ZodString>;
|
|
659
682
|
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
660
683
|
id: z.ZodNumber;
|
|
661
|
-
url: z.ZodString;
|
|
662
|
-
thumb_url: z.ZodString;
|
|
663
684
|
alt: z.ZodString;
|
|
685
|
+
small_url: z.ZodString;
|
|
686
|
+
medium_url: z.ZodString;
|
|
687
|
+
large_url: z.ZodString;
|
|
688
|
+
srcset: z.ZodString;
|
|
689
|
+
url: z.ZodString;
|
|
664
690
|
}, "strip", z.ZodTypeAny, {
|
|
665
691
|
id: number;
|
|
666
|
-
url: string;
|
|
667
|
-
thumb_url: string;
|
|
668
692
|
alt: string;
|
|
693
|
+
small_url: string;
|
|
694
|
+
medium_url: string;
|
|
695
|
+
large_url: string;
|
|
696
|
+
srcset: string;
|
|
697
|
+
url: string;
|
|
669
698
|
}, {
|
|
670
699
|
id: number;
|
|
671
|
-
url: string;
|
|
672
|
-
thumb_url: string;
|
|
673
700
|
alt: string;
|
|
701
|
+
small_url: string;
|
|
702
|
+
medium_url: string;
|
|
703
|
+
large_url: string;
|
|
704
|
+
srcset: string;
|
|
705
|
+
url: string;
|
|
674
706
|
}>, "many">>;
|
|
675
707
|
status: z.ZodNullable<z.ZodString>;
|
|
676
708
|
provider_name: z.ZodNullable<z.ZodString>;
|
|
@@ -760,9 +792,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
760
792
|
external_id?: number | undefined;
|
|
761
793
|
images?: {
|
|
762
794
|
id: number;
|
|
763
|
-
url: string;
|
|
764
|
-
thumb_url: string;
|
|
765
795
|
alt: string;
|
|
796
|
+
small_url: string;
|
|
797
|
+
medium_url: string;
|
|
798
|
+
large_url: string;
|
|
799
|
+
srcset: string;
|
|
800
|
+
url: string;
|
|
766
801
|
}[] | undefined;
|
|
767
802
|
}, {
|
|
768
803
|
type: string | null;
|
|
@@ -848,9 +883,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
848
883
|
external_id?: number | undefined;
|
|
849
884
|
images?: {
|
|
850
885
|
id: number;
|
|
851
|
-
url: string;
|
|
852
|
-
thumb_url: string;
|
|
853
886
|
alt: string;
|
|
887
|
+
small_url: string;
|
|
888
|
+
medium_url: string;
|
|
889
|
+
large_url: string;
|
|
890
|
+
srcset: string;
|
|
891
|
+
url: string;
|
|
854
892
|
}[] | undefined;
|
|
855
893
|
}>, "many">;
|
|
856
894
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -938,9 +976,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
938
976
|
external_id?: number | undefined;
|
|
939
977
|
images?: {
|
|
940
978
|
id: number;
|
|
941
|
-
url: string;
|
|
942
|
-
thumb_url: string;
|
|
943
979
|
alt: string;
|
|
980
|
+
small_url: string;
|
|
981
|
+
medium_url: string;
|
|
982
|
+
large_url: string;
|
|
983
|
+
srcset: string;
|
|
984
|
+
url: string;
|
|
944
985
|
}[] | undefined;
|
|
945
986
|
}[];
|
|
946
987
|
}, {
|
|
@@ -1028,9 +1069,12 @@ declare const PropertySearchResultSchema: z.ZodObject<{
|
|
|
1028
1069
|
external_id?: number | undefined;
|
|
1029
1070
|
images?: {
|
|
1030
1071
|
id: number;
|
|
1031
|
-
url: string;
|
|
1032
|
-
thumb_url: string;
|
|
1033
1072
|
alt: string;
|
|
1073
|
+
small_url: string;
|
|
1074
|
+
medium_url: string;
|
|
1075
|
+
large_url: string;
|
|
1076
|
+
srcset: string;
|
|
1077
|
+
url: string;
|
|
1034
1078
|
}[] | undefined;
|
|
1035
1079
|
}[];
|
|
1036
1080
|
}>;
|
|
@@ -2055,6 +2099,17 @@ declare class MoreApartmentsClient {
|
|
|
2055
2099
|
}): Promise<PaginatedResponse<Property>>;
|
|
2056
2100
|
getProperty(propertyIdOrSlug: number | string): Promise<Property>;
|
|
2057
2101
|
getAvailability(propertySlug: string, startDate: string, endDate: string): Promise<Availability>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Get property calendar with pricing information (legacy endpoint)
|
|
2104
|
+
* Returns daily rates and availability for the specified date range
|
|
2105
|
+
*/
|
|
2106
|
+
getPropertyCalendar(propertySlug: string, fromDate: string, toDate: string): Promise<Array<{
|
|
2107
|
+
date: string;
|
|
2108
|
+
available: boolean;
|
|
2109
|
+
season: string;
|
|
2110
|
+
final_rate: number;
|
|
2111
|
+
stay_minimum: number;
|
|
2112
|
+
}>>;
|
|
2058
2113
|
getPages(): Promise<Page[]>;
|
|
2059
2114
|
getPage(slug: string): Promise<Page>;
|
|
2060
2115
|
getPosts(params?: {
|
|
@@ -2093,6 +2148,7 @@ declare class MoreApartmentsClient {
|
|
|
2093
2148
|
declare function getPrimaryImageUrl(property: Property, fallbackUrl?: string): string;
|
|
2094
2149
|
/**
|
|
2095
2150
|
* Get thumbnail image URL from property
|
|
2151
|
+
* Uses small_url (400×300) for efficient thumbnails
|
|
2096
2152
|
* @param property - Property object with optional images array
|
|
2097
2153
|
* @param fallbackUrl - Optional fallback image URL
|
|
2098
2154
|
* @returns Thumbnail URL string
|
|
@@ -2106,6 +2162,7 @@ declare function getThumbnailUrl(property: Property, fallbackUrl?: string): stri
|
|
|
2106
2162
|
declare function getAllImageUrls(property: Property): string[];
|
|
2107
2163
|
/**
|
|
2108
2164
|
* Get all thumbnail URLs from property
|
|
2165
|
+
* Uses small_url (400×300) for efficient thumbnails
|
|
2109
2166
|
* @param property - Property object with optional images array
|
|
2110
2167
|
* @returns Array of thumbnail URL strings
|
|
2111
2168
|
*/
|
|
@@ -2275,9 +2332,12 @@ declare function fetchProperties(client: MoreApartmentsClient, params?: {
|
|
|
2275
2332
|
external_id?: number | undefined;
|
|
2276
2333
|
images?: {
|
|
2277
2334
|
id: number;
|
|
2278
|
-
url: string;
|
|
2279
|
-
thumb_url: string;
|
|
2280
2335
|
alt: string;
|
|
2336
|
+
small_url: string;
|
|
2337
|
+
medium_url: string;
|
|
2338
|
+
large_url: string;
|
|
2339
|
+
srcset: string;
|
|
2340
|
+
url: string;
|
|
2281
2341
|
}[] | undefined;
|
|
2282
2342
|
}> | {
|
|
2283
2343
|
data: never[];
|
|
@@ -2380,9 +2440,12 @@ declare function fetchProperty(client: MoreApartmentsClient, idOrSlug: number |
|
|
|
2380
2440
|
external_id?: number | undefined;
|
|
2381
2441
|
images?: {
|
|
2382
2442
|
id: number;
|
|
2383
|
-
url: string;
|
|
2384
|
-
thumb_url: string;
|
|
2385
2443
|
alt: string;
|
|
2444
|
+
small_url: string;
|
|
2445
|
+
medium_url: string;
|
|
2446
|
+
large_url: string;
|
|
2447
|
+
srcset: string;
|
|
2448
|
+
url: string;
|
|
2386
2449
|
}[] | undefined;
|
|
2387
2450
|
} | null>;
|
|
2388
2451
|
/**
|
|
@@ -2405,6 +2468,7 @@ declare function fetchAvailability(client: MoreApartmentsClient, propertySlug: s
|
|
|
2405
2468
|
available: boolean;
|
|
2406
2469
|
morning_available: boolean;
|
|
2407
2470
|
day: number;
|
|
2471
|
+
stay_minimum: number;
|
|
2408
2472
|
}>;
|
|
2409
2473
|
} | null>;
|
|
2410
2474
|
/**
|
|
@@ -2723,9 +2787,12 @@ declare function searchProperties(client: MoreApartmentsClient, params: Property
|
|
|
2723
2787
|
external_id?: number | undefined;
|
|
2724
2788
|
images?: {
|
|
2725
2789
|
id: number;
|
|
2726
|
-
url: string;
|
|
2727
|
-
thumb_url: string;
|
|
2728
2790
|
alt: string;
|
|
2791
|
+
small_url: string;
|
|
2792
|
+
medium_url: string;
|
|
2793
|
+
large_url: string;
|
|
2794
|
+
srcset: string;
|
|
2795
|
+
url: string;
|
|
2729
2796
|
}[] | undefined;
|
|
2730
2797
|
}[]>;
|
|
2731
2798
|
|
package/dist/index.js
CHANGED
|
@@ -136,9 +136,18 @@ var PropertySchema = zod.z.object({
|
|
|
136
136
|
// Media
|
|
137
137
|
images: zod.z.array(zod.z.object({
|
|
138
138
|
id: zod.z.number(),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
alt: zod.z.string(),
|
|
140
|
+
// Responsive image sizes
|
|
141
|
+
small_url: zod.z.string(),
|
|
142
|
+
// 400×300
|
|
143
|
+
medium_url: zod.z.string(),
|
|
144
|
+
// 800×600
|
|
145
|
+
large_url: zod.z.string(),
|
|
146
|
+
// 1200×900
|
|
147
|
+
srcset: zod.z.string(),
|
|
148
|
+
// Responsive srcset string
|
|
149
|
+
// Default fallback (backward compatibility)
|
|
150
|
+
url: zod.z.string()
|
|
142
151
|
})).optional(),
|
|
143
152
|
// Metadata
|
|
144
153
|
status: zod.z.string().nullable(),
|
|
@@ -150,7 +159,8 @@ var AvailableDay = zod.z.object({
|
|
|
150
159
|
available: zod.z.boolean(),
|
|
151
160
|
morning_available: zod.z.boolean(),
|
|
152
161
|
date: zod.z.string(),
|
|
153
|
-
day: zod.z.number()
|
|
162
|
+
day: zod.z.number(),
|
|
163
|
+
stay_minimum: zod.z.number()
|
|
154
164
|
});
|
|
155
165
|
var AvailabilitySchema = zod.z.object({
|
|
156
166
|
days: zod.z.record(zod.z.string(), AvailableDay)
|
|
@@ -522,6 +532,19 @@ var MoreApartmentsClient = class {
|
|
|
522
532
|
const response = await this.fetchWithRetry(url, {}, zod.z.object({ data: AvailabilitySchema }));
|
|
523
533
|
return response.data;
|
|
524
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* Get property calendar with pricing information (legacy endpoint)
|
|
537
|
+
* Returns daily rates and availability for the specified date range
|
|
538
|
+
*/
|
|
539
|
+
async getPropertyCalendar(propertySlug, fromDate, toDate) {
|
|
540
|
+
const queryParams = new URLSearchParams({
|
|
541
|
+
from: fromDate,
|
|
542
|
+
to: toDate
|
|
543
|
+
});
|
|
544
|
+
const url = `${this.config.baseUrl}/api/properties/${propertySlug}/calendars?${queryParams}`;
|
|
545
|
+
const response = await this.fetchWithRetry(url);
|
|
546
|
+
return response.data;
|
|
547
|
+
}
|
|
525
548
|
// Content endpoints
|
|
526
549
|
async getPages() {
|
|
527
550
|
const url = `${this.config.baseUrl}/api/v1/pages`;
|
|
@@ -648,7 +671,7 @@ function getPrimaryImageUrl(property, fallbackUrl) {
|
|
|
648
671
|
}
|
|
649
672
|
function getThumbnailUrl(property, fallbackUrl) {
|
|
650
673
|
if (property.images && property.images.length > 0) {
|
|
651
|
-
return property.images[0].
|
|
674
|
+
return property.images[0].small_url;
|
|
652
675
|
}
|
|
653
676
|
if (fallbackUrl) {
|
|
654
677
|
return fallbackUrl;
|
|
@@ -659,7 +682,7 @@ function getAllImageUrls(property) {
|
|
|
659
682
|
return property.images?.map((img) => img.url) || [];
|
|
660
683
|
}
|
|
661
684
|
function getAllThumbnailUrls(property) {
|
|
662
|
-
return property.images?.map((img) => img.
|
|
685
|
+
return property.images?.map((img) => img.small_url) || [];
|
|
663
686
|
}
|
|
664
687
|
function getImageWithAlt(property, index = 0) {
|
|
665
688
|
const image = property.images?.[index];
|
|
@@ -781,11 +804,11 @@ function moreApartmentsIntegration(options) {
|
|
|
781
804
|
entrypoint: "@shelfwood/more-apartments-astro-integration/routes/properties.js"
|
|
782
805
|
});
|
|
783
806
|
injectRoute({
|
|
784
|
-
pattern: `${routePrefix}/properties/[
|
|
807
|
+
pattern: `${routePrefix}/properties/[slug]`,
|
|
785
808
|
entrypoint: "@shelfwood/more-apartments-astro-integration/routes/property.js"
|
|
786
809
|
});
|
|
787
810
|
injectRoute({
|
|
788
|
-
pattern: `${routePrefix}/properties/[
|
|
811
|
+
pattern: `${routePrefix}/properties/[slug]/availability`,
|
|
789
812
|
entrypoint: "@shelfwood/more-apartments-astro-integration/routes/availability.js"
|
|
790
813
|
});
|
|
791
814
|
injectRoute({
|