@financial-times/content-curation-client 2.3.0 → 2.4.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/_tsup-dts-rollup.d.cts +47 -28
- package/dist/_tsup-dts-rollup.d.ts +47 -28
- package/dist/financial-times-content-curation-client-2.4.0.tgz +0 -0
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/financial-times-content-curation-client-2.3.0.tgz +0 -0
|
@@ -1775,6 +1775,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1775
1775
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
1776
1776
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
1777
1777
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
1778
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
1778
1779
|
} & {
|
|
1779
1780
|
homepageListId: z.ZodString;
|
|
1780
1781
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1785,6 +1786,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1785
1786
|
metaDescription?: string | undefined;
|
|
1786
1787
|
pageTheme?: string | undefined;
|
|
1787
1788
|
sponsorText?: string | undefined;
|
|
1789
|
+
sponsorImage?: string | undefined;
|
|
1788
1790
|
}, {
|
|
1789
1791
|
title: string;
|
|
1790
1792
|
pageId: string;
|
|
@@ -1793,6 +1795,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1793
1795
|
metaDescription?: string | undefined;
|
|
1794
1796
|
pageTheme?: string | undefined;
|
|
1795
1797
|
sponsorText?: string | undefined;
|
|
1798
|
+
sponsorImage?: string | undefined;
|
|
1796
1799
|
}>;
|
|
1797
1800
|
}, "strip", z.ZodTypeAny, {
|
|
1798
1801
|
properties: {
|
|
@@ -1803,6 +1806,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1803
1806
|
metaDescription?: string | undefined;
|
|
1804
1807
|
pageTheme?: string | undefined;
|
|
1805
1808
|
sponsorText?: string | undefined;
|
|
1809
|
+
sponsorImage?: string | undefined;
|
|
1806
1810
|
};
|
|
1807
1811
|
children: ({
|
|
1808
1812
|
type: "HomepageSlice";
|
|
@@ -1938,6 +1942,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1938
1942
|
metaDescription?: string | undefined;
|
|
1939
1943
|
pageTheme?: string | undefined;
|
|
1940
1944
|
sponsorText?: string | undefined;
|
|
1945
|
+
sponsorImage?: string | undefined;
|
|
1941
1946
|
};
|
|
1942
1947
|
children: ({
|
|
1943
1948
|
type: "HomepageSlice";
|
|
@@ -2940,6 +2945,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2940
2945
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
2941
2946
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
2942
2947
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
2948
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
2943
2949
|
} & {
|
|
2944
2950
|
homepageListId: z.ZodString;
|
|
2945
2951
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2950,6 +2956,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2950
2956
|
metaDescription?: string | undefined;
|
|
2951
2957
|
pageTheme?: string | undefined;
|
|
2952
2958
|
sponsorText?: string | undefined;
|
|
2959
|
+
sponsorImage?: string | undefined;
|
|
2953
2960
|
}, {
|
|
2954
2961
|
title: string;
|
|
2955
2962
|
pageId: string;
|
|
@@ -2958,6 +2965,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2958
2965
|
metaDescription?: string | undefined;
|
|
2959
2966
|
pageTheme?: string | undefined;
|
|
2960
2967
|
sponsorText?: string | undefined;
|
|
2968
|
+
sponsorImage?: string | undefined;
|
|
2961
2969
|
}>;
|
|
2962
2970
|
}, "strip", z.ZodTypeAny, {
|
|
2963
2971
|
type: "Homepage";
|
|
@@ -2969,6 +2977,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2969
2977
|
metaDescription?: string | undefined;
|
|
2970
2978
|
pageTheme?: string | undefined;
|
|
2971
2979
|
sponsorText?: string | undefined;
|
|
2980
|
+
sponsorImage?: string | undefined;
|
|
2972
2981
|
};
|
|
2973
2982
|
children: ({
|
|
2974
2983
|
type: "HomepageSlice";
|
|
@@ -3106,6 +3115,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
3106
3115
|
metaDescription?: string | undefined;
|
|
3107
3116
|
pageTheme?: string | undefined;
|
|
3108
3117
|
sponsorText?: string | undefined;
|
|
3118
|
+
sponsorImage?: string | undefined;
|
|
3109
3119
|
};
|
|
3110
3120
|
children: ({
|
|
3111
3121
|
type: "HomepageSlice";
|
|
@@ -3251,34 +3261,35 @@ export { LegacyBlock as LegacyBlock_alias_1 }
|
|
|
3251
3261
|
|
|
3252
3262
|
declare const LegacyBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3253
3263
|
type: z.ZodLiteral<"topper-basic">;
|
|
3254
|
-
children: z.ZodTuple<[], null>;
|
|
3255
3264
|
properties: z.ZodObject<{
|
|
3256
3265
|
title: z.ZodString;
|
|
3257
|
-
sponsorText: z.
|
|
3266
|
+
sponsorText: z.ZodOptional<z.ZodString>;
|
|
3267
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
3258
3268
|
}, "strip", z.ZodTypeAny, {
|
|
3259
3269
|
title: string;
|
|
3260
|
-
sponsorText
|
|
3270
|
+
sponsorText?: string | undefined;
|
|
3271
|
+
sponsorImage?: string | undefined;
|
|
3261
3272
|
}, {
|
|
3262
3273
|
title: string;
|
|
3263
3274
|
sponsorText?: string | undefined;
|
|
3275
|
+
sponsorImage?: string | undefined;
|
|
3264
3276
|
}>;
|
|
3265
3277
|
}, "strip", z.ZodTypeAny, {
|
|
3266
3278
|
type: "topper-basic";
|
|
3267
3279
|
properties: {
|
|
3268
3280
|
title: string;
|
|
3269
|
-
sponsorText
|
|
3281
|
+
sponsorText?: string | undefined;
|
|
3282
|
+
sponsorImage?: string | undefined;
|
|
3270
3283
|
};
|
|
3271
|
-
children: [];
|
|
3272
3284
|
}, {
|
|
3273
3285
|
type: "topper-basic";
|
|
3274
3286
|
properties: {
|
|
3275
3287
|
title: string;
|
|
3276
3288
|
sponsorText?: string | undefined;
|
|
3289
|
+
sponsorImage?: string | undefined;
|
|
3277
3290
|
};
|
|
3278
|
-
children: [];
|
|
3279
3291
|
}>, z.ZodObject<{
|
|
3280
3292
|
type: z.ZodLiteral<"info-box">;
|
|
3281
|
-
children: z.ZodTuple<[], null>;
|
|
3282
3293
|
properties: z.ZodObject<{
|
|
3283
3294
|
bodyHTML: z.ZodString;
|
|
3284
3295
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3291,13 +3302,11 @@ declare const LegacyBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
3291
3302
|
properties: {
|
|
3292
3303
|
bodyHTML: string;
|
|
3293
3304
|
};
|
|
3294
|
-
children: [];
|
|
3295
3305
|
}, {
|
|
3296
3306
|
type: "info-box";
|
|
3297
3307
|
properties: {
|
|
3298
3308
|
bodyHTML: string;
|
|
3299
3309
|
};
|
|
3300
|
-
children: [];
|
|
3301
3310
|
}>, z.ZodObject<{
|
|
3302
3311
|
type: z.ZodLiteral<"container">;
|
|
3303
3312
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
|
|
@@ -3460,36 +3469,41 @@ export { LegacyPageStructureOutput }
|
|
|
3460
3469
|
export { LegacyPageStructureOutput as LegacyPageStructureOutput_alias_1 }
|
|
3461
3470
|
|
|
3462
3471
|
declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
3472
|
+
uuid: z.ZodString;
|
|
3473
|
+
conceptId: z.ZodOptional<z.ZodString>;
|
|
3474
|
+
themeName: z.ZodOptional<z.ZodString>;
|
|
3475
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
3463
3476
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3464
3477
|
type: z.ZodLiteral<"topper-basic">;
|
|
3465
|
-
children: z.ZodTuple<[], null>;
|
|
3466
3478
|
properties: z.ZodObject<{
|
|
3467
3479
|
title: z.ZodString;
|
|
3468
|
-
sponsorText: z.
|
|
3480
|
+
sponsorText: z.ZodOptional<z.ZodString>;
|
|
3481
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
3469
3482
|
}, "strip", z.ZodTypeAny, {
|
|
3470
3483
|
title: string;
|
|
3471
|
-
sponsorText
|
|
3484
|
+
sponsorText?: string | undefined;
|
|
3485
|
+
sponsorImage?: string | undefined;
|
|
3472
3486
|
}, {
|
|
3473
3487
|
title: string;
|
|
3474
3488
|
sponsorText?: string | undefined;
|
|
3489
|
+
sponsorImage?: string | undefined;
|
|
3475
3490
|
}>;
|
|
3476
3491
|
}, "strip", z.ZodTypeAny, {
|
|
3477
3492
|
type: "topper-basic";
|
|
3478
3493
|
properties: {
|
|
3479
3494
|
title: string;
|
|
3480
|
-
sponsorText
|
|
3495
|
+
sponsorText?: string | undefined;
|
|
3496
|
+
sponsorImage?: string | undefined;
|
|
3481
3497
|
};
|
|
3482
|
-
children: [];
|
|
3483
3498
|
}, {
|
|
3484
3499
|
type: "topper-basic";
|
|
3485
3500
|
properties: {
|
|
3486
3501
|
title: string;
|
|
3487
3502
|
sponsorText?: string | undefined;
|
|
3503
|
+
sponsorImage?: string | undefined;
|
|
3488
3504
|
};
|
|
3489
|
-
children: [];
|
|
3490
3505
|
}>, z.ZodObject<{
|
|
3491
3506
|
type: z.ZodLiteral<"info-box">;
|
|
3492
|
-
children: z.ZodTuple<[], null>;
|
|
3493
3507
|
properties: z.ZodObject<{
|
|
3494
3508
|
bodyHTML: z.ZodString;
|
|
3495
3509
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3502,13 +3516,11 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3502
3516
|
properties: {
|
|
3503
3517
|
bodyHTML: string;
|
|
3504
3518
|
};
|
|
3505
|
-
children: [];
|
|
3506
3519
|
}, {
|
|
3507
3520
|
type: "info-box";
|
|
3508
3521
|
properties: {
|
|
3509
3522
|
bodyHTML: string;
|
|
3510
3523
|
};
|
|
3511
|
-
children: [];
|
|
3512
3524
|
}>, z.ZodObject<{
|
|
3513
3525
|
type: z.ZodLiteral<"container">;
|
|
3514
3526
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
|
|
@@ -3665,23 +3677,20 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3665
3677
|
};
|
|
3666
3678
|
children: [];
|
|
3667
3679
|
}>]>, "many">;
|
|
3668
|
-
conceptId: z.ZodOptional<z.ZodString>;
|
|
3669
|
-
themeName: z.ZodOptional<z.ZodString>;
|
|
3670
|
-
uuid: z.ZodString;
|
|
3671
3680
|
}, "strip", z.ZodTypeAny, {
|
|
3681
|
+
uuid: string;
|
|
3672
3682
|
blocks: ({
|
|
3673
3683
|
type: "topper-basic";
|
|
3674
3684
|
properties: {
|
|
3675
3685
|
title: string;
|
|
3676
|
-
sponsorText
|
|
3686
|
+
sponsorText?: string | undefined;
|
|
3687
|
+
sponsorImage?: string | undefined;
|
|
3677
3688
|
};
|
|
3678
|
-
children: [];
|
|
3679
3689
|
} | {
|
|
3680
3690
|
type: "info-box";
|
|
3681
3691
|
properties: {
|
|
3682
3692
|
bodyHTML: string;
|
|
3683
3693
|
};
|
|
3684
|
-
children: [];
|
|
3685
3694
|
} | {
|
|
3686
3695
|
type: "container";
|
|
3687
3696
|
properties: {
|
|
@@ -3714,23 +3723,23 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3714
3723
|
};
|
|
3715
3724
|
children: [];
|
|
3716
3725
|
})[];
|
|
3717
|
-
uuid: string;
|
|
3718
3726
|
conceptId?: string | undefined;
|
|
3727
|
+
metaDescription?: string | undefined;
|
|
3719
3728
|
themeName?: string | undefined;
|
|
3720
3729
|
}, {
|
|
3730
|
+
uuid: string;
|
|
3721
3731
|
blocks: ({
|
|
3722
3732
|
type: "topper-basic";
|
|
3723
3733
|
properties: {
|
|
3724
3734
|
title: string;
|
|
3725
3735
|
sponsorText?: string | undefined;
|
|
3736
|
+
sponsorImage?: string | undefined;
|
|
3726
3737
|
};
|
|
3727
|
-
children: [];
|
|
3728
3738
|
} | {
|
|
3729
3739
|
type: "info-box";
|
|
3730
3740
|
properties: {
|
|
3731
3741
|
bodyHTML: string;
|
|
3732
3742
|
};
|
|
3733
|
-
children: [];
|
|
3734
3743
|
} | {
|
|
3735
3744
|
type: "container";
|
|
3736
3745
|
properties: {
|
|
@@ -3763,8 +3772,8 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3763
3772
|
};
|
|
3764
3773
|
children: [];
|
|
3765
3774
|
})[];
|
|
3766
|
-
uuid: string;
|
|
3767
3775
|
conceptId?: string | undefined;
|
|
3776
|
+
metaDescription?: string | undefined;
|
|
3768
3777
|
themeName?: string | undefined;
|
|
3769
3778
|
}>;
|
|
3770
3779
|
export { LegacyPageStructureOutputSchema }
|
|
@@ -3799,6 +3808,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
3799
3808
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
3800
3809
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
3801
3810
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
3811
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
3802
3812
|
}, "strip", z.ZodTypeAny, {
|
|
3803
3813
|
title: string;
|
|
3804
3814
|
pageId: string;
|
|
@@ -3806,6 +3816,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
3806
3816
|
metaDescription?: string | undefined;
|
|
3807
3817
|
pageTheme?: string | undefined;
|
|
3808
3818
|
sponsorText?: string | undefined;
|
|
3819
|
+
sponsorImage?: string | undefined;
|
|
3809
3820
|
}, {
|
|
3810
3821
|
title: string;
|
|
3811
3822
|
pageId: string;
|
|
@@ -3813,6 +3824,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
3813
3824
|
metaDescription?: string | undefined;
|
|
3814
3825
|
pageTheme?: string | undefined;
|
|
3815
3826
|
sponsorText?: string | undefined;
|
|
3827
|
+
sponsorImage?: string | undefined;
|
|
3816
3828
|
}>;
|
|
3817
3829
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"type", readonly [z.ZodObject<{
|
|
3818
3830
|
type: z.ZodLiteral<"HomepageSlice">;
|
|
@@ -4678,6 +4690,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
4678
4690
|
metaDescription?: string | undefined;
|
|
4679
4691
|
pageTheme?: string | undefined;
|
|
4680
4692
|
sponsorText?: string | undefined;
|
|
4693
|
+
sponsorImage?: string | undefined;
|
|
4681
4694
|
};
|
|
4682
4695
|
children: ({
|
|
4683
4696
|
type: "HomepageSlice";
|
|
@@ -4812,6 +4825,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
4812
4825
|
metaDescription?: string | undefined;
|
|
4813
4826
|
pageTheme?: string | undefined;
|
|
4814
4827
|
sponsorText?: string | undefined;
|
|
4828
|
+
sponsorImage?: string | undefined;
|
|
4815
4829
|
};
|
|
4816
4830
|
children: ({
|
|
4817
4831
|
type: "HomepageSlice";
|
|
@@ -4960,6 +4974,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
4960
4974
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
4961
4975
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
4962
4976
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
4977
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
4963
4978
|
}, "strip", z.ZodTypeAny, {
|
|
4964
4979
|
title: string;
|
|
4965
4980
|
pageId: string;
|
|
@@ -4967,6 +4982,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
4967
4982
|
metaDescription?: string | undefined;
|
|
4968
4983
|
pageTheme?: string | undefined;
|
|
4969
4984
|
sponsorText?: string | undefined;
|
|
4985
|
+
sponsorImage?: string | undefined;
|
|
4970
4986
|
}, {
|
|
4971
4987
|
title: string;
|
|
4972
4988
|
pageId: string;
|
|
@@ -4974,6 +4990,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
4974
4990
|
metaDescription?: string | undefined;
|
|
4975
4991
|
pageTheme?: string | undefined;
|
|
4976
4992
|
sponsorText?: string | undefined;
|
|
4993
|
+
sponsorImage?: string | undefined;
|
|
4977
4994
|
}>;
|
|
4978
4995
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"type", readonly [z.ZodObject<{
|
|
4979
4996
|
type: z.ZodLiteral<"HomepageSlice">;
|
|
@@ -5840,6 +5857,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
5840
5857
|
metaDescription?: string | undefined;
|
|
5841
5858
|
pageTheme?: string | undefined;
|
|
5842
5859
|
sponsorText?: string | undefined;
|
|
5860
|
+
sponsorImage?: string | undefined;
|
|
5843
5861
|
};
|
|
5844
5862
|
children: ({
|
|
5845
5863
|
type: "HomepageSlice";
|
|
@@ -5976,6 +5994,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
5976
5994
|
metaDescription?: string | undefined;
|
|
5977
5995
|
pageTheme?: string | undefined;
|
|
5978
5996
|
sponsorText?: string | undefined;
|
|
5997
|
+
sponsorImage?: string | undefined;
|
|
5979
5998
|
};
|
|
5980
5999
|
children: ({
|
|
5981
6000
|
type: "HomepageSlice";
|
|
@@ -1775,6 +1775,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1775
1775
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
1776
1776
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
1777
1777
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
1778
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
1778
1779
|
} & {
|
|
1779
1780
|
homepageListId: z.ZodString;
|
|
1780
1781
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1785,6 +1786,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1785
1786
|
metaDescription?: string | undefined;
|
|
1786
1787
|
pageTheme?: string | undefined;
|
|
1787
1788
|
sponsorText?: string | undefined;
|
|
1789
|
+
sponsorImage?: string | undefined;
|
|
1788
1790
|
}, {
|
|
1789
1791
|
title: string;
|
|
1790
1792
|
pageId: string;
|
|
@@ -1793,6 +1795,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1793
1795
|
metaDescription?: string | undefined;
|
|
1794
1796
|
pageTheme?: string | undefined;
|
|
1795
1797
|
sponsorText?: string | undefined;
|
|
1798
|
+
sponsorImage?: string | undefined;
|
|
1796
1799
|
}>;
|
|
1797
1800
|
}, "strip", z.ZodTypeAny, {
|
|
1798
1801
|
properties: {
|
|
@@ -1803,6 +1806,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1803
1806
|
metaDescription?: string | undefined;
|
|
1804
1807
|
pageTheme?: string | undefined;
|
|
1805
1808
|
sponsorText?: string | undefined;
|
|
1809
|
+
sponsorImage?: string | undefined;
|
|
1806
1810
|
};
|
|
1807
1811
|
children: ({
|
|
1808
1812
|
type: "HomepageSlice";
|
|
@@ -1938,6 +1942,7 @@ declare const HomepageStructureInputSchema: z.ZodObject<{
|
|
|
1938
1942
|
metaDescription?: string | undefined;
|
|
1939
1943
|
pageTheme?: string | undefined;
|
|
1940
1944
|
sponsorText?: string | undefined;
|
|
1945
|
+
sponsorImage?: string | undefined;
|
|
1941
1946
|
};
|
|
1942
1947
|
children: ({
|
|
1943
1948
|
type: "HomepageSlice";
|
|
@@ -2940,6 +2945,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2940
2945
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
2941
2946
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
2942
2947
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
2948
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
2943
2949
|
} & {
|
|
2944
2950
|
homepageListId: z.ZodString;
|
|
2945
2951
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2950,6 +2956,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2950
2956
|
metaDescription?: string | undefined;
|
|
2951
2957
|
pageTheme?: string | undefined;
|
|
2952
2958
|
sponsorText?: string | undefined;
|
|
2959
|
+
sponsorImage?: string | undefined;
|
|
2953
2960
|
}, {
|
|
2954
2961
|
title: string;
|
|
2955
2962
|
pageId: string;
|
|
@@ -2958,6 +2965,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2958
2965
|
metaDescription?: string | undefined;
|
|
2959
2966
|
pageTheme?: string | undefined;
|
|
2960
2967
|
sponsorText?: string | undefined;
|
|
2968
|
+
sponsorImage?: string | undefined;
|
|
2961
2969
|
}>;
|
|
2962
2970
|
}, "strip", z.ZodTypeAny, {
|
|
2963
2971
|
type: "Homepage";
|
|
@@ -2969,6 +2977,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
2969
2977
|
metaDescription?: string | undefined;
|
|
2970
2978
|
pageTheme?: string | undefined;
|
|
2971
2979
|
sponsorText?: string | undefined;
|
|
2980
|
+
sponsorImage?: string | undefined;
|
|
2972
2981
|
};
|
|
2973
2982
|
children: ({
|
|
2974
2983
|
type: "HomepageSlice";
|
|
@@ -3106,6 +3115,7 @@ declare const HomepageStructureOutputSchema: z.ZodObject<{
|
|
|
3106
3115
|
metaDescription?: string | undefined;
|
|
3107
3116
|
pageTheme?: string | undefined;
|
|
3108
3117
|
sponsorText?: string | undefined;
|
|
3118
|
+
sponsorImage?: string | undefined;
|
|
3109
3119
|
};
|
|
3110
3120
|
children: ({
|
|
3111
3121
|
type: "HomepageSlice";
|
|
@@ -3251,34 +3261,35 @@ export { LegacyBlock as LegacyBlock_alias_1 }
|
|
|
3251
3261
|
|
|
3252
3262
|
declare const LegacyBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3253
3263
|
type: z.ZodLiteral<"topper-basic">;
|
|
3254
|
-
children: z.ZodTuple<[], null>;
|
|
3255
3264
|
properties: z.ZodObject<{
|
|
3256
3265
|
title: z.ZodString;
|
|
3257
|
-
sponsorText: z.
|
|
3266
|
+
sponsorText: z.ZodOptional<z.ZodString>;
|
|
3267
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
3258
3268
|
}, "strip", z.ZodTypeAny, {
|
|
3259
3269
|
title: string;
|
|
3260
|
-
sponsorText
|
|
3270
|
+
sponsorText?: string | undefined;
|
|
3271
|
+
sponsorImage?: string | undefined;
|
|
3261
3272
|
}, {
|
|
3262
3273
|
title: string;
|
|
3263
3274
|
sponsorText?: string | undefined;
|
|
3275
|
+
sponsorImage?: string | undefined;
|
|
3264
3276
|
}>;
|
|
3265
3277
|
}, "strip", z.ZodTypeAny, {
|
|
3266
3278
|
type: "topper-basic";
|
|
3267
3279
|
properties: {
|
|
3268
3280
|
title: string;
|
|
3269
|
-
sponsorText
|
|
3281
|
+
sponsorText?: string | undefined;
|
|
3282
|
+
sponsorImage?: string | undefined;
|
|
3270
3283
|
};
|
|
3271
|
-
children: [];
|
|
3272
3284
|
}, {
|
|
3273
3285
|
type: "topper-basic";
|
|
3274
3286
|
properties: {
|
|
3275
3287
|
title: string;
|
|
3276
3288
|
sponsorText?: string | undefined;
|
|
3289
|
+
sponsorImage?: string | undefined;
|
|
3277
3290
|
};
|
|
3278
|
-
children: [];
|
|
3279
3291
|
}>, z.ZodObject<{
|
|
3280
3292
|
type: z.ZodLiteral<"info-box">;
|
|
3281
|
-
children: z.ZodTuple<[], null>;
|
|
3282
3293
|
properties: z.ZodObject<{
|
|
3283
3294
|
bodyHTML: z.ZodString;
|
|
3284
3295
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3291,13 +3302,11 @@ declare const LegacyBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
3291
3302
|
properties: {
|
|
3292
3303
|
bodyHTML: string;
|
|
3293
3304
|
};
|
|
3294
|
-
children: [];
|
|
3295
3305
|
}, {
|
|
3296
3306
|
type: "info-box";
|
|
3297
3307
|
properties: {
|
|
3298
3308
|
bodyHTML: string;
|
|
3299
3309
|
};
|
|
3300
|
-
children: [];
|
|
3301
3310
|
}>, z.ZodObject<{
|
|
3302
3311
|
type: z.ZodLiteral<"container">;
|
|
3303
3312
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
|
|
@@ -3460,36 +3469,41 @@ export { LegacyPageStructureOutput }
|
|
|
3460
3469
|
export { LegacyPageStructureOutput as LegacyPageStructureOutput_alias_1 }
|
|
3461
3470
|
|
|
3462
3471
|
declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
3472
|
+
uuid: z.ZodString;
|
|
3473
|
+
conceptId: z.ZodOptional<z.ZodString>;
|
|
3474
|
+
themeName: z.ZodOptional<z.ZodString>;
|
|
3475
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
3463
3476
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3464
3477
|
type: z.ZodLiteral<"topper-basic">;
|
|
3465
|
-
children: z.ZodTuple<[], null>;
|
|
3466
3478
|
properties: z.ZodObject<{
|
|
3467
3479
|
title: z.ZodString;
|
|
3468
|
-
sponsorText: z.
|
|
3480
|
+
sponsorText: z.ZodOptional<z.ZodString>;
|
|
3481
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
3469
3482
|
}, "strip", z.ZodTypeAny, {
|
|
3470
3483
|
title: string;
|
|
3471
|
-
sponsorText
|
|
3484
|
+
sponsorText?: string | undefined;
|
|
3485
|
+
sponsorImage?: string | undefined;
|
|
3472
3486
|
}, {
|
|
3473
3487
|
title: string;
|
|
3474
3488
|
sponsorText?: string | undefined;
|
|
3489
|
+
sponsorImage?: string | undefined;
|
|
3475
3490
|
}>;
|
|
3476
3491
|
}, "strip", z.ZodTypeAny, {
|
|
3477
3492
|
type: "topper-basic";
|
|
3478
3493
|
properties: {
|
|
3479
3494
|
title: string;
|
|
3480
|
-
sponsorText
|
|
3495
|
+
sponsorText?: string | undefined;
|
|
3496
|
+
sponsorImage?: string | undefined;
|
|
3481
3497
|
};
|
|
3482
|
-
children: [];
|
|
3483
3498
|
}, {
|
|
3484
3499
|
type: "topper-basic";
|
|
3485
3500
|
properties: {
|
|
3486
3501
|
title: string;
|
|
3487
3502
|
sponsorText?: string | undefined;
|
|
3503
|
+
sponsorImage?: string | undefined;
|
|
3488
3504
|
};
|
|
3489
|
-
children: [];
|
|
3490
3505
|
}>, z.ZodObject<{
|
|
3491
3506
|
type: z.ZodLiteral<"info-box">;
|
|
3492
|
-
children: z.ZodTuple<[], null>;
|
|
3493
3507
|
properties: z.ZodObject<{
|
|
3494
3508
|
bodyHTML: z.ZodString;
|
|
3495
3509
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3502,13 +3516,11 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3502
3516
|
properties: {
|
|
3503
3517
|
bodyHTML: string;
|
|
3504
3518
|
};
|
|
3505
|
-
children: [];
|
|
3506
3519
|
}, {
|
|
3507
3520
|
type: "info-box";
|
|
3508
3521
|
properties: {
|
|
3509
3522
|
bodyHTML: string;
|
|
3510
3523
|
};
|
|
3511
|
-
children: [];
|
|
3512
3524
|
}>, z.ZodObject<{
|
|
3513
3525
|
type: z.ZodLiteral<"container">;
|
|
3514
3526
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
|
|
@@ -3665,23 +3677,20 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3665
3677
|
};
|
|
3666
3678
|
children: [];
|
|
3667
3679
|
}>]>, "many">;
|
|
3668
|
-
conceptId: z.ZodOptional<z.ZodString>;
|
|
3669
|
-
themeName: z.ZodOptional<z.ZodString>;
|
|
3670
|
-
uuid: z.ZodString;
|
|
3671
3680
|
}, "strip", z.ZodTypeAny, {
|
|
3681
|
+
uuid: string;
|
|
3672
3682
|
blocks: ({
|
|
3673
3683
|
type: "topper-basic";
|
|
3674
3684
|
properties: {
|
|
3675
3685
|
title: string;
|
|
3676
|
-
sponsorText
|
|
3686
|
+
sponsorText?: string | undefined;
|
|
3687
|
+
sponsorImage?: string | undefined;
|
|
3677
3688
|
};
|
|
3678
|
-
children: [];
|
|
3679
3689
|
} | {
|
|
3680
3690
|
type: "info-box";
|
|
3681
3691
|
properties: {
|
|
3682
3692
|
bodyHTML: string;
|
|
3683
3693
|
};
|
|
3684
|
-
children: [];
|
|
3685
3694
|
} | {
|
|
3686
3695
|
type: "container";
|
|
3687
3696
|
properties: {
|
|
@@ -3714,23 +3723,23 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3714
3723
|
};
|
|
3715
3724
|
children: [];
|
|
3716
3725
|
})[];
|
|
3717
|
-
uuid: string;
|
|
3718
3726
|
conceptId?: string | undefined;
|
|
3727
|
+
metaDescription?: string | undefined;
|
|
3719
3728
|
themeName?: string | undefined;
|
|
3720
3729
|
}, {
|
|
3730
|
+
uuid: string;
|
|
3721
3731
|
blocks: ({
|
|
3722
3732
|
type: "topper-basic";
|
|
3723
3733
|
properties: {
|
|
3724
3734
|
title: string;
|
|
3725
3735
|
sponsorText?: string | undefined;
|
|
3736
|
+
sponsorImage?: string | undefined;
|
|
3726
3737
|
};
|
|
3727
|
-
children: [];
|
|
3728
3738
|
} | {
|
|
3729
3739
|
type: "info-box";
|
|
3730
3740
|
properties: {
|
|
3731
3741
|
bodyHTML: string;
|
|
3732
3742
|
};
|
|
3733
|
-
children: [];
|
|
3734
3743
|
} | {
|
|
3735
3744
|
type: "container";
|
|
3736
3745
|
properties: {
|
|
@@ -3763,8 +3772,8 @@ declare const LegacyPageStructureOutputSchema: z.ZodObject<{
|
|
|
3763
3772
|
};
|
|
3764
3773
|
children: [];
|
|
3765
3774
|
})[];
|
|
3766
|
-
uuid: string;
|
|
3767
3775
|
conceptId?: string | undefined;
|
|
3776
|
+
metaDescription?: string | undefined;
|
|
3768
3777
|
themeName?: string | undefined;
|
|
3769
3778
|
}>;
|
|
3770
3779
|
export { LegacyPageStructureOutputSchema }
|
|
@@ -3799,6 +3808,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
3799
3808
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
3800
3809
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
3801
3810
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
3811
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
3802
3812
|
}, "strip", z.ZodTypeAny, {
|
|
3803
3813
|
title: string;
|
|
3804
3814
|
pageId: string;
|
|
@@ -3806,6 +3816,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
3806
3816
|
metaDescription?: string | undefined;
|
|
3807
3817
|
pageTheme?: string | undefined;
|
|
3808
3818
|
sponsorText?: string | undefined;
|
|
3819
|
+
sponsorImage?: string | undefined;
|
|
3809
3820
|
}, {
|
|
3810
3821
|
title: string;
|
|
3811
3822
|
pageId: string;
|
|
@@ -3813,6 +3824,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
3813
3824
|
metaDescription?: string | undefined;
|
|
3814
3825
|
pageTheme?: string | undefined;
|
|
3815
3826
|
sponsorText?: string | undefined;
|
|
3827
|
+
sponsorImage?: string | undefined;
|
|
3816
3828
|
}>;
|
|
3817
3829
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"type", readonly [z.ZodObject<{
|
|
3818
3830
|
type: z.ZodLiteral<"HomepageSlice">;
|
|
@@ -4678,6 +4690,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
4678
4690
|
metaDescription?: string | undefined;
|
|
4679
4691
|
pageTheme?: string | undefined;
|
|
4680
4692
|
sponsorText?: string | undefined;
|
|
4693
|
+
sponsorImage?: string | undefined;
|
|
4681
4694
|
};
|
|
4682
4695
|
children: ({
|
|
4683
4696
|
type: "HomepageSlice";
|
|
@@ -4812,6 +4825,7 @@ declare const PageStructureInputSchema: z.ZodObject<{
|
|
|
4812
4825
|
metaDescription?: string | undefined;
|
|
4813
4826
|
pageTheme?: string | undefined;
|
|
4814
4827
|
sponsorText?: string | undefined;
|
|
4828
|
+
sponsorImage?: string | undefined;
|
|
4815
4829
|
};
|
|
4816
4830
|
children: ({
|
|
4817
4831
|
type: "HomepageSlice";
|
|
@@ -4960,6 +4974,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
4960
4974
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
4961
4975
|
pageTheme: z.ZodOptional<z.ZodString>;
|
|
4962
4976
|
sponsorText: z.ZodOptional<z.ZodString>;
|
|
4977
|
+
sponsorImage: z.ZodOptional<z.ZodString>;
|
|
4963
4978
|
}, "strip", z.ZodTypeAny, {
|
|
4964
4979
|
title: string;
|
|
4965
4980
|
pageId: string;
|
|
@@ -4967,6 +4982,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
4967
4982
|
metaDescription?: string | undefined;
|
|
4968
4983
|
pageTheme?: string | undefined;
|
|
4969
4984
|
sponsorText?: string | undefined;
|
|
4985
|
+
sponsorImage?: string | undefined;
|
|
4970
4986
|
}, {
|
|
4971
4987
|
title: string;
|
|
4972
4988
|
pageId: string;
|
|
@@ -4974,6 +4990,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
4974
4990
|
metaDescription?: string | undefined;
|
|
4975
4991
|
pageTheme?: string | undefined;
|
|
4976
4992
|
sponsorText?: string | undefined;
|
|
4993
|
+
sponsorImage?: string | undefined;
|
|
4977
4994
|
}>;
|
|
4978
4995
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"type", readonly [z.ZodObject<{
|
|
4979
4996
|
type: z.ZodLiteral<"HomepageSlice">;
|
|
@@ -5840,6 +5857,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
5840
5857
|
metaDescription?: string | undefined;
|
|
5841
5858
|
pageTheme?: string | undefined;
|
|
5842
5859
|
sponsorText?: string | undefined;
|
|
5860
|
+
sponsorImage?: string | undefined;
|
|
5843
5861
|
};
|
|
5844
5862
|
children: ({
|
|
5845
5863
|
type: "HomepageSlice";
|
|
@@ -5976,6 +5994,7 @@ declare const PageStructureOutputSchema: z.ZodObject<{
|
|
|
5976
5994
|
metaDescription?: string | undefined;
|
|
5977
5995
|
pageTheme?: string | undefined;
|
|
5978
5996
|
sponsorText?: string | undefined;
|
|
5997
|
+
sponsorImage?: string | undefined;
|
|
5979
5998
|
};
|
|
5980
5999
|
children: ({
|
|
5981
6000
|
type: "HomepageSlice";
|
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -259,7 +259,8 @@ var BasePagePropertiesSchema = _zod.z.object({
|
|
|
259
259
|
conceptId: _zod.z.string().optional(),
|
|
260
260
|
metaDescription: _zod.z.string().optional(),
|
|
261
261
|
pageTheme: _zod.z.string().optional(),
|
|
262
|
-
sponsorText: _zod.z.string().optional()
|
|
262
|
+
sponsorText: _zod.z.string().optional(),
|
|
263
|
+
sponsorImage: _zod.z.string().url().optional()
|
|
263
264
|
});
|
|
264
265
|
var PageStructureInputSchema = _zod.z.object({
|
|
265
266
|
properties: BasePagePropertiesSchema,
|
|
@@ -327,15 +328,14 @@ var LegacyContainerChildSchema = _zod.z.discriminatedUnion("source", [
|
|
|
327
328
|
]);
|
|
328
329
|
var LegacyTopperSchema = _zod.z.object({
|
|
329
330
|
type: _zod.z.literal("topper-basic"),
|
|
330
|
-
children: _zod.z.tuple([]),
|
|
331
331
|
properties: _zod.z.object({
|
|
332
332
|
title: _zod.z.string(),
|
|
333
|
-
sponsorText: _zod.z.string().
|
|
333
|
+
sponsorText: _zod.z.string().optional(),
|
|
334
|
+
sponsorImage: _zod.z.string().url().optional()
|
|
334
335
|
})
|
|
335
336
|
});
|
|
336
337
|
var LegacyInfoBoxSchema = _zod.z.object({
|
|
337
338
|
type: _zod.z.literal("info-box"),
|
|
338
|
-
children: _zod.z.tuple([]),
|
|
339
339
|
properties: _zod.z.object({
|
|
340
340
|
bodyHTML: _zod.z.string()
|
|
341
341
|
})
|
|
@@ -371,10 +371,11 @@ var LegacyBlockSchema = _zod.z.discriminatedUnion("type", [
|
|
|
371
371
|
LegacyExperimentSchema
|
|
372
372
|
]);
|
|
373
373
|
var LegacyPageStructureOutputSchema = _zod.z.object({
|
|
374
|
-
|
|
374
|
+
uuid: _zod.z.string().uuid(),
|
|
375
375
|
conceptId: _zod.z.string().uuid().optional(),
|
|
376
376
|
themeName: _zod.z.string().optional(),
|
|
377
|
-
|
|
377
|
+
metaDescription: _zod.z.string().optional(),
|
|
378
|
+
blocks: _zod.z.array(LegacyBlockSchema)
|
|
378
379
|
});
|
|
379
380
|
|
|
380
381
|
// src/page.ts
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/circleci/repo/packages/content-curation-client/dist/index.cjs","../src/schemas/response.ts","../src/base.ts","../src/schemas/ftpink/page/index.ts","../src/schemas/prosemirror.ts","../src/homepage.ts","../src/schemas/ftpink/legacyHubPage/index.ts","../src/page.ts","../src/client.ts"],"names":[],"mappings":"AAAA;ACAA,0BAAmC;AAK5B,IAAM,aAAA,EAAe,MAAA,CAAE,IAAA,CAAK;AAAA,EAClC,cAAA;AAAA,EACA,WAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACD,CAAC,CAAA;AAKD,IAAM,mBAAA,EAAqB,MAAA,CAAE,MAAA,CAAO;AAAA,EACnC,UAAA,EAAY,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACrB,SA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/circleci/repo/packages/content-curation-client/dist/index.cjs","sourcesContent":[null,"import { z, type ZodTypeAny } from \"zod\";\n\n/**\n * Strongly‐typed enum for all possible API error codes.\n */\nexport const ApiErrorCode = z.enum([\n\t\"UNAUTHORIZED\",\n\t\"NOT_FOUND\",\n\t\"INTERNAL_SERVER_ERROR\",\n\t\"INVALID_INPUT_DATA\",\n]);\n\n/**\n * Fields shared by both success and error envelopes (but not the discriminant).\n */\nconst BaseEnvelopeFields = z.object({\n\tstatusCode: z.number(),\n\trequestId: z.string(),\n});\n\n/**\n * Specific details carried in an error payload.\n */\nexport const ApiErrorPayloadSchema = z\n\t.object({\n\t\tcode: ApiErrorCode,\n\t\tmessage: z.string(),\n\t\tdetails: z.string().optional(),\n\t\tpath: z.string().optional(),\n\t\ttimestamp: z.string().optional(),\n\t})\n\t.strict();\n\nexport type ApiErrorPayload = z.infer<typeof ApiErrorPayloadSchema>;\n\n/**\n * Full “envelope” when the API has failed.\n */\nexport const ApiErrorResponseSchema = BaseEnvelopeFields.extend({\n\tstatus: z.literal(\"error\"),\n\terror: ApiErrorPayloadSchema,\n}).strict();\n\nexport type ApiErrorResponse = z.infer<typeof ApiErrorResponseSchema>;\n\n/**\n * Schema for a successful API response, given some data schema T.\n */\nexport function ApiSuccessResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\treturn BaseEnvelopeFields.extend({\n\t\tstatus: z.literal(\"success\"),\n\t\tdata: dataSchema,\n\t}).strict();\n}\n\n/**\n * Union of success or error envelopes, discriminated on `status`.\n */\nexport function ApiResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\tconst successSchema = ApiSuccessResponseSchema(dataSchema);\n\tconst errorSchema = ApiErrorResponseSchema;\n\treturn z.discriminatedUnion(\"status\", [successSchema, errorSchema]);\n}\n","import type { z, ZodTypeAny } from \"zod\";\nimport type { ApiErrorPayloadSchema } from \"./schemas/response\";\nimport { ApiResponseSchema } from \"./schemas/response\";\n\n/**\n * API-level error thrown when { status: 'error' } is returned\n */\nexport class ApiClientError extends Error {\n\tpublic code: string;\n\tpublic details?: string;\n\tpublic path?: string;\n\tpublic timestamp?: string;\n\n\tconstructor(\n\t\tpublic payload: z.infer<typeof ApiErrorPayloadSchema>,\n\t\tpublic statusCode: number,\n\t\tpublic requestId?: string,\n\t) {\n\t\tsuper(payload.message);\n\t\tthis.name = \"ApiError\";\n\t\tthis.code = payload.code;\n\t\tthis.details = payload.details;\n\t\tthis.path = payload.path;\n\t\tthis.timestamp = payload.timestamp;\n\t}\n}\n\n/**\n * Configuration options for the API client\n */\nexport type ApiClientConfig =\n\t| {\n\t\t\t// Standard configuration.\n\t\t\t// Intended for external clients using an API key issued via API Gateway.\n\t\t\tbaseUrl: string;\n\t\t\tapiKey: string;\n\t\t\tapiToken?: never;\n\t\t\tfetch?: typeof fetch;\n\t }\n\t| {\n\t\t\t// Alternative configuration.\n\t\t\t// Reserved for client with access to a bearer token (e.g. The e2e tests).\n\t\t\tbaseUrl: string;\n\t\t\tapiKey?: never;\n\t\t\tapiToken: string;\n\t\t\tfetch?: typeof fetch;\n\t };\n\nexport class BaseApiClient {\n\tprotected config: ApiClientConfig;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\tfetch: config.fetch || fetch,\n\t\t};\n\t\tthis.config.baseUrl = this.config.baseUrl.replace(/\\/+$/, \"\"); // strip trailing slashes\n\t}\n\n\t/**\n\t * Generic HTTP request to a JSON API\n\t */\n\tprotected async request<\n\t\tReqSchema extends ZodTypeAny | undefined,\n\t\tResponseDataSchema extends ZodTypeAny,\n\t>(\n\t\tmethod: \"GET\" | \"PUT\" | \"POST\" | \"DELETE\",\n\t\tpath: string,\n\t\topts: {\n\t\t\trequestSchema?: ReqSchema;\n\t\t\tbody?: ReqSchema extends ZodTypeAny ? z.infer<ReqSchema> : unknown;\n\t\t\tresponseDataSchema: ResponseDataSchema;\n\t\t},\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\t// Validate request body if provided\n\t\tlet bodyPayload = opts.body;\n\t\tif (opts.requestSchema && opts.body !== undefined) {\n\t\t\tbodyPayload = opts.requestSchema.parse(opts.body);\n\t\t}\n\n\t\t// Build URL + query string\n\t\tconst url = new URL(this.config.baseUrl + path);\n\n\t\t// Perform fetch\n\t\tconst response = await this.config.fetch!(url.toString(), {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...(this.config.apiKey\n\t\t\t\t\t? { \"x-api-key\": this.config.apiKey }\n\t\t\t\t\t: { Authorization: `Bearer ${this.config.apiToken}` }),\n\t\t\t},\n\t\t\tbody: bodyPayload ? JSON.stringify(bodyPayload) : undefined,\n\t\t});\n\n\t\tconst json = await response.json();\n\t\tconst parsedJson = ApiResponseSchema(opts.responseDataSchema).parse(json);\n\n\t\tif (\"error\" in parsedJson) {\n\t\t\tthrow new ApiClientError(parsedJson.error, parsedJson.statusCode, parsedJson.requestId);\n\t\t} else if (!(\"data\" in parsedJson)) {\n\t\t\tthrow new ApiClientError(\n\t\t\t\t{\n\t\t\t\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\t\t\t\tmessage: \"Unexpected API response format\",\n\t\t\t\t\tdetails: 'Response did not contain expected \"data\" field',\n\t\t\t\t},\n\t\t\t\t500,\n\t\t\t\tparsedJson.requestId,\n\t\t\t);\n\t\t}\n\n\t\treturn parsedJson.data;\n\t}\n\n\t/**\n\t * GET convenience method inferring response type from schema\n\t */\n\tprotected get<ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"GET\", path, { responseDataSchema });\n\t}\n\n\t/**\n\t * PUT convenience method inferring both request and response types\n\t */\n\tprotected put<ReqSchema extends ZodTypeAny, ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tbody: z.infer<ReqSchema>,\n\t\trequestSchema: ReqSchema,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"PUT\", path, { body, requestSchema, responseDataSchema });\n\t}\n}\n","import { z } from \"zod\";\nimport { ProseMirrorDocSchema } from \"../../prosemirror\";\n\n//\n// 1) REUSABLE SCHEMAS FOR COMMON STRUCTURES\n//\n\n/**\n * A generic schema representing a heading used across various slices.\n * - `text`: The display text of the heading.\n * - `href`: An optional URL that the heading links to.\n */\nconst HeadingSchema = z.object({\n\ttext: z.string(),\n\thref: z.string().url().optional(),\n});\n\n/**\n * Base “properties” common to most page slices.\n * - `heading`: An optional heading object for slices that can display a title.\n */\nconst BasePageItemProps = z.object({\n\theading: HeadingSchema.optional(),\n});\n\n/**\n * Extended properties for any “graphics”-type slice.\n * In addition to base properties, these slices must specify how the graphic is displayed.\n * - `displayBehaviour`: Determines if the graphic stands alone or is associated with other content.\n */\nconst BaseGraphicsItemProps = BasePageItemProps.extend({\n\tdisplayBehaviour: z.enum([\"standalone\", \"associated\"]),\n});\n\n/**\n * A schema to validate that a string is valid JSON.\n */\nconst ValidJSONStringSchema = z.string().refine(\n\t(val) => {\n\t\ttry {\n\t\t\tJSON.parse(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t},\n\t{ message: \"Invalid JSON string\" },\n);\n\n//\n// 2) GENERIC HELPER TO DEFINE “SLICE” INPUT/OUTPUT SCHEMAS\n//\n\n/**\n * A union type to represent either a Zod object schema or an optional Zod object schema.\n */\ntype OptionalOrRequiredZodObject = z.AnyZodObject | z.ZodOptional<z.AnyZodObject>;\n\n/**\n * Helper function that, given:\n * - `typeName`: A string literal identifying the slice type.\n * - `propsShape`: A Zod schema describing the slice’s `properties`.\n *\n * Returns an object containing two schemas:\n * - `InputSchema`: For client-side input; `sliceId` is optional.\n * - `OutputSchema`: For server-side/output; `sliceId` is required.\n *\n * This is useful because when defining slices we often want to allow -\n * clients to submit slices without an ID (e.g., when creating new slices),\n */\nfunction defineSliceSchema<T extends string, P extends OptionalOrRequiredZodObject>(options: {\n\ttypeName: T;\n\tpropsShape: P;\n}) {\n\tconst { typeName, propsShape } = options;\n\n\t// Base schema shared by both input and output:\n\t// - `type`: Literal string identifying which slice this is.\n\t// - `hidden`: Optional flag to mark the slice as hidden.\n\t// - `properties`: The detailed properties shape for the slice.\n\tconst BaseSchema = z.object({\n\t\ttype: z.literal(typeName),\n\t\thidden: z.boolean().optional(),\n\t\tproperties: propsShape,\n\t});\n\n\t/**\n\t * Input schema: For client submissions.\n\t * - `sliceId` is optional because the client might not specify it yet.\n\t */\n\tconst InputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid().optional(),\n\t});\n\n\t/**\n\t * Output schema: For persisted or server-returned data.\n\t * - `sliceId` is required (each saved slice must have an ID).\n\t */\n\tconst OutputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid(),\n\t});\n\n\treturn { InputSchema, OutputSchema };\n}\n\n//\n// 3) DEFINE INDIVIDUAL SLICE TYPES (INPUT & OUTPUT) USING THE HELPER\n//\n\n// 3.A “HomepageSlice”\n// - A generic homepage slice that may include an optional heading.\n// - Input: Clients can pass `properties` or omit entirely.\n// - Output: Always includes a `properties` object (may be empty) and a required `sliceId`.\nconst HomepageSlice = defineSliceSchema({\n\ttypeName: \"HomepageSlice\",\n\tpropsShape: BasePageItemProps.optional(),\n});\n\n// 3.B “FlourishGraphicSlice”\n// - A slice to embed or reference a Flourish graphic by its ID.\n// - Extends graphic base properties with `flourishId`.\nconst FlourishGraphicSlice = defineSliceSchema({\n\ttypeName: \"FlourishGraphic\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tflourishDescription: z.string().optional(), // Optional description for the Flourish graphic\n\t\tflourishId: z.string().nonempty(),\n\t}),\n});\n\n// 3.C “CustomIframeSlice”\n// - A slice that renders a custom iframe.\n// - Extends graphic base properties with `iframeSrc`.\nconst CustomIframeSlice = defineSliceSchema({\n\ttypeName: \"CustomIframe\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tiframeSrc: z.string().url().nonempty(),\n\t}),\n});\n\n// 3.D “ExperimentSlice”\n// - A slice for embedding experimental content.\n// - Requires an `experimentId`, `experimentName`, and a JSON string (`contentJson`).\nconst ExperimentSlice = defineSliceSchema({\n\ttypeName: \"Experiment\",\n\tpropsShape: BasePageItemProps.extend({\n\t\texperimentId: z.string().nonempty(), // Unique ID for the experiment\n\t\texperimentName: z.string().nonempty(), // Human-readable name of the experiment\n\t\tcontentJson: ValidJSONStringSchema, // The experiment’s JSON payload as a valid JSON string\n\t}),\n});\n\n// 3.E \"Strip\"\n// - A slice that displays a strip of content.\nconst StripSlice = defineSliceSchema({\n\ttypeName: \"Strip\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the strip to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n// 3.F \"TopperSlice\"\n// - A slice that displays a topper section with description and optional strapline.\nconst TopperSlice = defineSliceSchema({\n\ttypeName: \"Topper\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tdescription: ProseMirrorDocSchema,\n\t\tstrapline: z.string().optional(),\n\t}),\n});\n\n// 3.F \"Hero\"\n// - A slice that represents a Hero on the page. It references a Spark List.\nconst HeroSlice = defineSliceSchema({\n\ttypeName: \"Hero\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the spark list to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n//\n// 4) COMPOSE DISCRIMINATED UNIONS FOR “SLICE API” INPUT & OUTPUT\n//\n\n/**\n * All possible slice inputs for the Page API.\n * This discriminated union allows Zod to pick the correct schema based on the `type` field.\n */\nexport const SliceApiInputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.InputSchema,\n\tFlourishGraphicSlice.InputSchema,\n\tCustomIframeSlice.InputSchema,\n\tExperimentSlice.InputSchema,\n\tStripSlice.InputSchema,\n\tTopperSlice.InputSchema,\n\tHeroSlice.InputSchema,\n] as const);\n\n/**\n * All possible slice outputs for the Page API.\n * The same discriminated union but with each slice requiring `sliceId`.\n */\nexport const SliceApiOutputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.OutputSchema,\n\tFlourishGraphicSlice.OutputSchema,\n\tCustomIframeSlice.OutputSchema,\n\tExperimentSlice.OutputSchema,\n\tStripSlice.OutputSchema,\n\tTopperSlice.OutputSchema,\n\tHeroSlice.OutputSchema,\n] as const);\n\n//\n// 5) WRAPPER SCHEMAS FOR THE ENTIRE PAGE STRUCTURE\n//\n\nconst BasePagePropertiesSchema = z.object({\n\ttitle: z.string(),\n\tpageId: z.string().uuid(),\n\tconceptId: z.string().optional(),\n\tmetaDescription: z.string().optional(),\n\tpageTheme: z.string().optional(),\n\tsponsorText: z.string().optional(),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const PageStructureInputSchema = z.object({\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiInputSchema),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page (title, list ID, page ID).\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const HomepageStructureInputSchema = PageStructureInputSchema.extend({\n\tproperties: BasePagePropertiesSchema.extend({\n\t\t// This is optional for the input. If clients don't send it, we generate a uuid.\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n/**\n * Page structure as stored or returned by the server.\n */\nexport const PageStructureOutputSchema = z.object({\n\ttype: z.literal(\"Page\"),\n\tschemaVersion: z.number(),\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiOutputSchema),\n});\n\nexport const HomepageStructureOutputSchema = PageStructureOutputSchema.extend({\n\ttype: z.literal(\"Homepage\"),\n\tproperties: BasePagePropertiesSchema.extend({\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n//\n// 6) EXPORT TYPES FOR CONSUMPTION IN CODE\n//\n\n/** Client-side type for page structure input */\nexport type PageStructureInput = z.infer<typeof PageStructureInputSchema>;\n\n/** Server-side type for page structure output */\nexport type PageStructureOutput = z.infer<typeof PageStructureOutputSchema>;\n\n/** Client-side type for homepage structure input */\nexport type HomepageStructureInput = z.infer<typeof HomepageStructureInputSchema>;\n\n/** Server-side type for homepage structure output */\nexport type HomepageStructureOutput = z.infer<typeof HomepageStructureOutputSchema>;\n\n/** Union of all possible slice outputs for type-checking convenience */\nexport type Slice = z.infer<typeof SliceApiOutputSchema>;\n\n/** Individual slice output types */\nexport type HomepageSliceType = z.infer<typeof HomepageSlice.OutputSchema>;\nexport type FlourishGraphicSliceType = z.infer<typeof FlourishGraphicSlice.OutputSchema>;\nexport type CustomIframeSliceType = z.infer<typeof CustomIframeSlice.OutputSchema>;\nexport type ExperimentSliceType = z.infer<typeof ExperimentSlice.OutputSchema>;\nexport type StripSliceType = z.infer<typeof StripSlice.OutputSchema>;\nexport type TopperSliceType = z.infer<typeof TopperSlice.OutputSchema>;\nexport type HeroSliceType = z.infer<typeof HeroSlice.OutputSchema>;\n\n/**\n * Union type for interactive slices (i.e., the ones rendering visual components).\n * Useful for code that cares specifically about slices with visual/interactive content.\n */\nexport type InteractiveSlice = FlourishGraphicSliceType | CustomIframeSliceType;\n","import { z } from \"zod\";\n\n/** Accept http(s) and mailto: (matches your editor config) */\nconst HrefSchema = z.string().refine((v) => /^(https?:\\/\\/|mailto:).+/.test(v), {\n\tmessage: \"Expected http(s):// or mailto: URL\",\n});\n\n/** Link mark. */\nconst ProseMirrorLinkMark = z.object({\n\ttype: z.literal(\"link\"),\n\tattrs: z.object({\n\t\thref: HrefSchema,\n\t}),\n});\n\n/** Supported text marks */\nconst ProseMirrorMark = z.discriminatedUnion(\"type\", [\n\tProseMirrorLinkMark,\n\tz.object({ type: z.literal(\"bold\") }),\n\tz.object({ type: z.literal(\"italic\") }),\n\tz.object({ type: z.literal(\"underline\") }),\n\tz.object({ type: z.literal(\"strike\") }),\n]);\n\n/** Text node */\nconst ProseMirrorTextNode = z.object({\n\ttype: z.literal(\"text\"),\n\ttext: z.string(),\n\tmarks: z.array(ProseMirrorMark).optional(),\n});\n\n/** Paragraph node — content can be empty/omitted */\nconst ProseMirrorParagraphNode = z.object({\n\ttype: z.literal(\"paragraph\"),\n\tcontent: z.array(ProseMirrorTextNode),\n});\n\n/** ProseMirror Node Union. */\nconst ProseMirrorNode = z.union([ProseMirrorParagraphNode, ProseMirrorTextNode]);\n\n/** Root node of a ProseMirror document - enforcing at least 1 paragraph */\nexport const ProseMirrorDocSchema = z.object({\n\ttype: z.literal(\"doc\"),\n\tcontent: z\n\t\t.array(ProseMirrorNode)\n\t\t.min(1, { message: \"Document must contain at least one paragraph\" }),\n});\n\n/** Rich text editor TS type. */\nexport type RichTextEditorType = z.infer<typeof ProseMirrorDocSchema>;\n\nexport {};\n","import { BaseApiClient } from \"./base\";\nimport {\n\tHomepageStructureInputSchema,\n\tHomepageStructureOutputSchema,\n\ttype HomepageStructureInput,\n\ttype HomepageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Homepage structure endpoints\n */\nexport class HomepageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<HomepageStructureOutput> {\n\t\treturn this.get(`/v1/homepage/${pageId}/structure`, HomepageStructureOutputSchema);\n\t}\n\n\tasync getStructuresByHomepageListId(homepageListId: string): Promise<HomepageStructureOutput[]> {\n\t\treturn this.get(\n\t\t\t`/v1/homepage/list/${homepageListId}/structures`,\n\t\t\tHomepageStructureOutputSchema.array(),\n\t\t);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<HomepageStructureInput, \"type\">,\n\t): Promise<HomepageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/homepage/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tHomepageStructureInputSchema,\n\t\t\tHomepageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import { z } from \"zod\";\n\n/**\n * -----------------------------------------\n * Legacy API Schemas & Types\n *\n * These schemas map to expected types for Hub Pages rendered by dotcom-pages.\n * -----------------------------------------\n */\n\nconst LegacyFlourishChildSchema = z.object({\n\tsource: z.literal(\"flourish\"),\n\tproperties: z.object({\n\t\tid: z.string().min(1), // e.g. \"visualisation/21901162\"\n\t}),\n});\n\nconst LegacyListChildSchema = z.object({\n\tsource: z.literal(\"list\"),\n\tproperties: z.object({\n\t\tid: z.string().uuid(),\n\t\tmaxItems: z.number().optional(),\n\t}),\n});\n\nconst LegacyContainerChildSchema = z.discriminatedUnion(\"source\", [\n\tLegacyFlourishChildSchema,\n\tLegacyListChildSchema,\n]);\n\nconst LegacyTopperSchema = z.object({\n\ttype: z.literal(\"topper-basic\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\ttitle: z.string(),\n\t\tsponsorText: z.string().default(\"\"),\n\t}),\n});\n\nconst LegacyInfoBoxSchema = z.object({\n\ttype: z.literal(\"info-box\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\tbodyHTML: z.string(),\n\t}),\n});\n\nconst LegacyContainerSchema = z.object({\n\ttype: z.literal(\"container\"),\n\tchildren: z.array(LegacyContainerChildSchema).min(1),\n\tproperties: z.object({\n\t\ttitle: z.string().optional(),\n\t\tdesign: z.enum([\"chart\", \"four-story\", \"freeform\", \"hero-lead\"]).default(\"freeform\"),\n\t\tbackgroundColor: z.string().optional(),\n\t}),\n});\n\nconst LegacyExperimentSchema = z.object({\n\ttype: z.literal(\"experiment\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\texperimentName: z.string(),\n\t\tid: z.string(),\n\t\ttitle: z.string().optional(),\n\t\tconfig: z\n\t\t\t.object({\n\t\t\t\tvalue: z.unknown().optional(),\n\t\t\t\t// Hub pages support experiments with HTML and Text.\n\t\t\t\t// For now we just support JSON. As we migrate pages, this may change.\n\t\t\t\tformat: z.enum([\"json\"]).default(\"json\"),\n\t\t\t})\n\t\t\t.partial()\n\t\t\t.optional(),\n\t}),\n});\n\nconst LegacyBlockSchema = z.discriminatedUnion(\"type\", [\n\tLegacyTopperSchema,\n\tLegacyInfoBoxSchema,\n\tLegacyContainerSchema,\n\tLegacyExperimentSchema,\n]);\n\nexport const LegacyPageStructureOutputSchema = z.object({\n\tblocks: z.array(LegacyBlockSchema),\n\tconceptId: z.string().uuid().optional(),\n\tthemeName: z.string().optional(),\n\tuuid: z.string().uuid(),\n});\n\nexport type LegacyPageStructureOutput = z.infer<typeof LegacyPageStructureOutputSchema>;\nexport type LegacyBlock = z.infer<typeof LegacyBlockSchema>;\n","import { BaseApiClient } from \"./base\";\nimport type { LegacyPageStructureOutput } from \"./schemas/ftpink/legacyHubPage\";\nimport { LegacyPageStructureOutputSchema } from \"./schemas/ftpink/legacyHubPage\";\nimport {\n\tPageStructureInputSchema,\n\tPageStructureOutputSchema,\n\ttype PageStructureInput,\n\ttype PageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Page structure endpoints\n */\nexport class PageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<PageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/structure`, PageStructureOutputSchema);\n\t}\n\n\tasync getLegacyHubPageStructure(pageId: string): Promise<LegacyPageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/legacyHubPageStructure`, LegacyPageStructureOutputSchema);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<PageStructureInput, \"type\">,\n\t): Promise<PageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/page/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tPageStructureInputSchema,\n\t\t\tPageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import type { ApiClientConfig } from \"./base\";\nimport { BaseApiClient } from \"./base\";\nimport { HomepageClient } from \"./homepage\";\nimport { PageClient } from \"./page\";\n\n/**\n * Main API client that provides access to all API endpoints\n */\nexport class ApiClient extends BaseApiClient {\n\t/**\n\t * Homepage API endpoints\n\t */\n\thomepage: HomepageClient;\n\tpage: PageClient;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tsuper(config);\n\n\t\t// Initialize sub-clients\n\t\tthis.homepage = new HomepageClient(config);\n\t\tthis.page = new PageClient(config);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/circleci/repo/packages/content-curation-client/dist/index.cjs","../src/schemas/response.ts","../src/base.ts","../src/schemas/ftpink/page/index.ts","../src/schemas/prosemirror.ts","../src/homepage.ts","../src/schemas/ftpink/legacyHubPage/index.ts","../src/page.ts","../src/client.ts"],"names":[],"mappings":"AAAA;ACAA,0BAAmC;AAK5B,IAAM,aAAA,EAAe,MAAA,CAAE,IAAA,CAAK;AAAA,EAClC,cAAA;AAAA,EACA,WAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACD,CAAC,CAAA;AAKD,IAAM,mBAAA,EAAqB,MAAA,CAAE,MAAA,CAAO;AAAA,EACnC,UAAA,EAAY,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACrB,SAAA,EAAW,MAAA,CAAE,MAAA,CAAO;AACrB,CAAC,CAAA;AAKM,IAAM,sBAAA,EAAwB,MAAA,CACnC,MAAA,CAAO;AAAA,EACP,IAAA,EAAM,YAAA;AAAA,EACN,OAAA,EAAS,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EAClB,OAAA,EAAS,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA,EAC7B,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA,EAC1B,SAAA,EAAW,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS;AAChC,CAAC,CAAA,CACA,MAAA,CAAO,C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IAAA;AACxC,EAAA;AACD;AAEoC;AACV,EAAA;AACL,EAAA;AACD,IAAA;AACnB,EAAA;AACD;AAEsC;AACX,EAAA;AACwB,EAAA;AAC9B,EAAA;AACO,IAAA;AACwD,IAAA;AAC9C,IAAA;AACrC,EAAA;AACD;AAEuC;AACX,EAAA;AACR,EAAA;AACC,EAAA;AACK,IAAA;AACZ,IAAA;AACc,IAAA;AAElB,IAAA;AACqB,MAAA;AAAA;AAAA;AAGW,MAAA;AAG9B,IAAA;AACX,EAAA;AACD;AAEsD;AACtD,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AAEuD;AACjC,EAAA;AACgB,EAAA;AACP,EAAA;AACM,EAAA;AACJ,EAAA;AACjC;ANmSqH;AACA;AO/WxE;AACoB,EAAA;AACS,IAAA;AAC1E,EAAA;AAEoF,EAAA;AACS,IAAA;AAC7F,EAAA;AAKgC,EAAA;AACnB,IAAA;AACO,MAAA;AAClB,MAAA;AACA,MAAA;AACA,MAAA;AACD,IAAA;AACD,EAAA;AACD;AP4WsH;AACA;AQtYzE;AAAA;AAAA;AAAA;AAI5C,EAAA;AACA,EAAA;AAEqC,EAAA;AACxB,IAAA;AAG6B,IAAA;AACR,IAAA;AAClC,EAAA;AACD;ARqYsH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/circleci/repo/packages/content-curation-client/dist/index.cjs","sourcesContent":[null,"import { z, type ZodTypeAny } from \"zod\";\n\n/**\n * Strongly‐typed enum for all possible API error codes.\n */\nexport const ApiErrorCode = z.enum([\n\t\"UNAUTHORIZED\",\n\t\"NOT_FOUND\",\n\t\"INTERNAL_SERVER_ERROR\",\n\t\"INVALID_INPUT_DATA\",\n]);\n\n/**\n * Fields shared by both success and error envelopes (but not the discriminant).\n */\nconst BaseEnvelopeFields = z.object({\n\tstatusCode: z.number(),\n\trequestId: z.string(),\n});\n\n/**\n * Specific details carried in an error payload.\n */\nexport const ApiErrorPayloadSchema = z\n\t.object({\n\t\tcode: ApiErrorCode,\n\t\tmessage: z.string(),\n\t\tdetails: z.string().optional(),\n\t\tpath: z.string().optional(),\n\t\ttimestamp: z.string().optional(),\n\t})\n\t.strict();\n\nexport type ApiErrorPayload = z.infer<typeof ApiErrorPayloadSchema>;\n\n/**\n * Full “envelope” when the API has failed.\n */\nexport const ApiErrorResponseSchema = BaseEnvelopeFields.extend({\n\tstatus: z.literal(\"error\"),\n\terror: ApiErrorPayloadSchema,\n}).strict();\n\nexport type ApiErrorResponse = z.infer<typeof ApiErrorResponseSchema>;\n\n/**\n * Schema for a successful API response, given some data schema T.\n */\nexport function ApiSuccessResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\treturn BaseEnvelopeFields.extend({\n\t\tstatus: z.literal(\"success\"),\n\t\tdata: dataSchema,\n\t}).strict();\n}\n\n/**\n * Union of success or error envelopes, discriminated on `status`.\n */\nexport function ApiResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\tconst successSchema = ApiSuccessResponseSchema(dataSchema);\n\tconst errorSchema = ApiErrorResponseSchema;\n\treturn z.discriminatedUnion(\"status\", [successSchema, errorSchema]);\n}\n","import type { z, ZodTypeAny } from \"zod\";\nimport type { ApiErrorPayloadSchema } from \"./schemas/response\";\nimport { ApiResponseSchema } from \"./schemas/response\";\n\n/**\n * API-level error thrown when { status: 'error' } is returned\n */\nexport class ApiClientError extends Error {\n\tpublic code: string;\n\tpublic details?: string;\n\tpublic path?: string;\n\tpublic timestamp?: string;\n\n\tconstructor(\n\t\tpublic payload: z.infer<typeof ApiErrorPayloadSchema>,\n\t\tpublic statusCode: number,\n\t\tpublic requestId?: string,\n\t) {\n\t\tsuper(payload.message);\n\t\tthis.name = \"ApiError\";\n\t\tthis.code = payload.code;\n\t\tthis.details = payload.details;\n\t\tthis.path = payload.path;\n\t\tthis.timestamp = payload.timestamp;\n\t}\n}\n\n/**\n * Configuration options for the API client\n */\nexport type ApiClientConfig =\n\t| {\n\t\t\t// Standard configuration.\n\t\t\t// Intended for external clients using an API key issued via API Gateway.\n\t\t\tbaseUrl: string;\n\t\t\tapiKey: string;\n\t\t\tapiToken?: never;\n\t\t\tfetch?: typeof fetch;\n\t }\n\t| {\n\t\t\t// Alternative configuration.\n\t\t\t// Reserved for client with access to a bearer token (e.g. The e2e tests).\n\t\t\tbaseUrl: string;\n\t\t\tapiKey?: never;\n\t\t\tapiToken: string;\n\t\t\tfetch?: typeof fetch;\n\t };\n\nexport class BaseApiClient {\n\tprotected config: ApiClientConfig;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\tfetch: config.fetch || fetch,\n\t\t};\n\t\tthis.config.baseUrl = this.config.baseUrl.replace(/\\/+$/, \"\"); // strip trailing slashes\n\t}\n\n\t/**\n\t * Generic HTTP request to a JSON API\n\t */\n\tprotected async request<\n\t\tReqSchema extends ZodTypeAny | undefined,\n\t\tResponseDataSchema extends ZodTypeAny,\n\t>(\n\t\tmethod: \"GET\" | \"PUT\" | \"POST\" | \"DELETE\",\n\t\tpath: string,\n\t\topts: {\n\t\t\trequestSchema?: ReqSchema;\n\t\t\tbody?: ReqSchema extends ZodTypeAny ? z.infer<ReqSchema> : unknown;\n\t\t\tresponseDataSchema: ResponseDataSchema;\n\t\t},\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\t// Validate request body if provided\n\t\tlet bodyPayload = opts.body;\n\t\tif (opts.requestSchema && opts.body !== undefined) {\n\t\t\tbodyPayload = opts.requestSchema.parse(opts.body);\n\t\t}\n\n\t\t// Build URL + query string\n\t\tconst url = new URL(this.config.baseUrl + path);\n\n\t\t// Perform fetch\n\t\tconst response = await this.config.fetch!(url.toString(), {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...(this.config.apiKey\n\t\t\t\t\t? { \"x-api-key\": this.config.apiKey }\n\t\t\t\t\t: { Authorization: `Bearer ${this.config.apiToken}` }),\n\t\t\t},\n\t\t\tbody: bodyPayload ? JSON.stringify(bodyPayload) : undefined,\n\t\t});\n\n\t\tconst json = await response.json();\n\t\tconst parsedJson = ApiResponseSchema(opts.responseDataSchema).parse(json);\n\n\t\tif (\"error\" in parsedJson) {\n\t\t\tthrow new ApiClientError(parsedJson.error, parsedJson.statusCode, parsedJson.requestId);\n\t\t} else if (!(\"data\" in parsedJson)) {\n\t\t\tthrow new ApiClientError(\n\t\t\t\t{\n\t\t\t\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\t\t\t\tmessage: \"Unexpected API response format\",\n\t\t\t\t\tdetails: 'Response did not contain expected \"data\" field',\n\t\t\t\t},\n\t\t\t\t500,\n\t\t\t\tparsedJson.requestId,\n\t\t\t);\n\t\t}\n\n\t\treturn parsedJson.data;\n\t}\n\n\t/**\n\t * GET convenience method inferring response type from schema\n\t */\n\tprotected get<ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"GET\", path, { responseDataSchema });\n\t}\n\n\t/**\n\t * PUT convenience method inferring both request and response types\n\t */\n\tprotected put<ReqSchema extends ZodTypeAny, ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tbody: z.infer<ReqSchema>,\n\t\trequestSchema: ReqSchema,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"PUT\", path, { body, requestSchema, responseDataSchema });\n\t}\n}\n","import { z } from \"zod\";\nimport { ProseMirrorDocSchema } from \"../../prosemirror\";\n\n//\n// 1) REUSABLE SCHEMAS FOR COMMON STRUCTURES\n//\n\n/**\n * A generic schema representing a heading used across various slices.\n * - `text`: The display text of the heading.\n * - `href`: An optional URL that the heading links to.\n */\nconst HeadingSchema = z.object({\n\ttext: z.string(),\n\thref: z.string().url().optional(),\n});\n\n/**\n * Base “properties” common to most page slices.\n * - `heading`: An optional heading object for slices that can display a title.\n */\nconst BasePageItemProps = z.object({\n\theading: HeadingSchema.optional(),\n});\n\n/**\n * Extended properties for any “graphics”-type slice.\n * In addition to base properties, these slices must specify how the graphic is displayed.\n * - `displayBehaviour`: Determines if the graphic stands alone or is associated with other content.\n */\nconst BaseGraphicsItemProps = BasePageItemProps.extend({\n\tdisplayBehaviour: z.enum([\"standalone\", \"associated\"]),\n});\n\n/**\n * A schema to validate that a string is valid JSON.\n */\nconst ValidJSONStringSchema = z.string().refine(\n\t(val) => {\n\t\ttry {\n\t\t\tJSON.parse(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t},\n\t{ message: \"Invalid JSON string\" },\n);\n\n//\n// 2) GENERIC HELPER TO DEFINE “SLICE” INPUT/OUTPUT SCHEMAS\n//\n\n/**\n * A union type to represent either a Zod object schema or an optional Zod object schema.\n */\ntype OptionalOrRequiredZodObject = z.AnyZodObject | z.ZodOptional<z.AnyZodObject>;\n\n/**\n * Helper function that, given:\n * - `typeName`: A string literal identifying the slice type.\n * - `propsShape`: A Zod schema describing the slice’s `properties`.\n *\n * Returns an object containing two schemas:\n * - `InputSchema`: For client-side input; `sliceId` is optional.\n * - `OutputSchema`: For server-side/output; `sliceId` is required.\n *\n * This is useful because when defining slices we often want to allow -\n * clients to submit slices without an ID (e.g., when creating new slices),\n */\nfunction defineSliceSchema<T extends string, P extends OptionalOrRequiredZodObject>(options: {\n\ttypeName: T;\n\tpropsShape: P;\n}) {\n\tconst { typeName, propsShape } = options;\n\n\t// Base schema shared by both input and output:\n\t// - `type`: Literal string identifying which slice this is.\n\t// - `hidden`: Optional flag to mark the slice as hidden.\n\t// - `properties`: The detailed properties shape for the slice.\n\tconst BaseSchema = z.object({\n\t\ttype: z.literal(typeName),\n\t\thidden: z.boolean().optional(),\n\t\tproperties: propsShape,\n\t});\n\n\t/**\n\t * Input schema: For client submissions.\n\t * - `sliceId` is optional because the client might not specify it yet.\n\t */\n\tconst InputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid().optional(),\n\t});\n\n\t/**\n\t * Output schema: For persisted or server-returned data.\n\t * - `sliceId` is required (each saved slice must have an ID).\n\t */\n\tconst OutputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid(),\n\t});\n\n\treturn { InputSchema, OutputSchema };\n}\n\n//\n// 3) DEFINE INDIVIDUAL SLICE TYPES (INPUT & OUTPUT) USING THE HELPER\n//\n\n// 3.A “HomepageSlice”\n// - A generic homepage slice that may include an optional heading.\n// - Input: Clients can pass `properties` or omit entirely.\n// - Output: Always includes a `properties` object (may be empty) and a required `sliceId`.\nconst HomepageSlice = defineSliceSchema({\n\ttypeName: \"HomepageSlice\",\n\tpropsShape: BasePageItemProps.optional(),\n});\n\n// 3.B “FlourishGraphicSlice”\n// - A slice to embed or reference a Flourish graphic by its ID.\n// - Extends graphic base properties with `flourishId`.\nconst FlourishGraphicSlice = defineSliceSchema({\n\ttypeName: \"FlourishGraphic\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tflourishDescription: z.string().optional(), // Optional description for the Flourish graphic\n\t\tflourishId: z.string().nonempty(),\n\t}),\n});\n\n// 3.C “CustomIframeSlice”\n// - A slice that renders a custom iframe.\n// - Extends graphic base properties with `iframeSrc`.\nconst CustomIframeSlice = defineSliceSchema({\n\ttypeName: \"CustomIframe\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tiframeSrc: z.string().url().nonempty(),\n\t}),\n});\n\n// 3.D “ExperimentSlice”\n// - A slice for embedding experimental content.\n// - Requires an `experimentId`, `experimentName`, and a JSON string (`contentJson`).\nconst ExperimentSlice = defineSliceSchema({\n\ttypeName: \"Experiment\",\n\tpropsShape: BasePageItemProps.extend({\n\t\texperimentId: z.string().nonempty(), // Unique ID for the experiment\n\t\texperimentName: z.string().nonempty(), // Human-readable name of the experiment\n\t\tcontentJson: ValidJSONStringSchema, // The experiment’s JSON payload as a valid JSON string\n\t}),\n});\n\n// 3.E \"Strip\"\n// - A slice that displays a strip of content.\nconst StripSlice = defineSliceSchema({\n\ttypeName: \"Strip\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the strip to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n// 3.F \"TopperSlice\"\n// - A slice that displays a topper section with description and optional strapline.\nconst TopperSlice = defineSliceSchema({\n\ttypeName: \"Topper\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tdescription: ProseMirrorDocSchema,\n\t\tstrapline: z.string().optional(),\n\t}),\n});\n\n// 3.F \"Hero\"\n// - A slice that represents a Hero on the page. It references a Spark List.\nconst HeroSlice = defineSliceSchema({\n\ttypeName: \"Hero\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the spark list to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n//\n// 4) COMPOSE DISCRIMINATED UNIONS FOR “SLICE API” INPUT & OUTPUT\n//\n\n/**\n * All possible slice inputs for the Page API.\n * This discriminated union allows Zod to pick the correct schema based on the `type` field.\n */\nexport const SliceApiInputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.InputSchema,\n\tFlourishGraphicSlice.InputSchema,\n\tCustomIframeSlice.InputSchema,\n\tExperimentSlice.InputSchema,\n\tStripSlice.InputSchema,\n\tTopperSlice.InputSchema,\n\tHeroSlice.InputSchema,\n] as const);\n\n/**\n * All possible slice outputs for the Page API.\n * The same discriminated union but with each slice requiring `sliceId`.\n */\nexport const SliceApiOutputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.OutputSchema,\n\tFlourishGraphicSlice.OutputSchema,\n\tCustomIframeSlice.OutputSchema,\n\tExperimentSlice.OutputSchema,\n\tStripSlice.OutputSchema,\n\tTopperSlice.OutputSchema,\n\tHeroSlice.OutputSchema,\n] as const);\n\n//\n// 5) WRAPPER SCHEMAS FOR THE ENTIRE PAGE STRUCTURE\n//\n\nconst BasePagePropertiesSchema = z.object({\n\ttitle: z.string(),\n\tpageId: z.string().uuid(),\n\tconceptId: z.string().optional(),\n\tmetaDescription: z.string().optional(),\n\tpageTheme: z.string().optional(),\n\tsponsorText: z.string().optional(),\n\tsponsorImage: z.string().url().optional(),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const PageStructureInputSchema = z.object({\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiInputSchema),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page (title, list ID, page ID).\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const HomepageStructureInputSchema = PageStructureInputSchema.extend({\n\tproperties: BasePagePropertiesSchema.extend({\n\t\t// This is optional for the input. If clients don't send it, we generate a uuid.\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n/**\n * Page structure as stored or returned by the server.\n */\nexport const PageStructureOutputSchema = z.object({\n\ttype: z.literal(\"Page\"),\n\tschemaVersion: z.number(),\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiOutputSchema),\n});\n\nexport const HomepageStructureOutputSchema = PageStructureOutputSchema.extend({\n\ttype: z.literal(\"Homepage\"),\n\tproperties: BasePagePropertiesSchema.extend({\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n//\n// 6) EXPORT TYPES FOR CONSUMPTION IN CODE\n//\n\n/** Client-side type for page structure input */\nexport type PageStructureInput = z.infer<typeof PageStructureInputSchema>;\n\n/** Server-side type for page structure output */\nexport type PageStructureOutput = z.infer<typeof PageStructureOutputSchema>;\n\n/** Client-side type for homepage structure input */\nexport type HomepageStructureInput = z.infer<typeof HomepageStructureInputSchema>;\n\n/** Server-side type for homepage structure output */\nexport type HomepageStructureOutput = z.infer<typeof HomepageStructureOutputSchema>;\n\n/** Union of all possible slice outputs for type-checking convenience */\nexport type Slice = z.infer<typeof SliceApiOutputSchema>;\n\n/** Individual slice output types */\nexport type HomepageSliceType = z.infer<typeof HomepageSlice.OutputSchema>;\nexport type FlourishGraphicSliceType = z.infer<typeof FlourishGraphicSlice.OutputSchema>;\nexport type CustomIframeSliceType = z.infer<typeof CustomIframeSlice.OutputSchema>;\nexport type ExperimentSliceType = z.infer<typeof ExperimentSlice.OutputSchema>;\nexport type StripSliceType = z.infer<typeof StripSlice.OutputSchema>;\nexport type TopperSliceType = z.infer<typeof TopperSlice.OutputSchema>;\nexport type HeroSliceType = z.infer<typeof HeroSlice.OutputSchema>;\n\n/**\n * Union type for interactive slices (i.e., the ones rendering visual components).\n * Useful for code that cares specifically about slices with visual/interactive content.\n */\nexport type InteractiveSlice = FlourishGraphicSliceType | CustomIframeSliceType;\n","import { z } from \"zod\";\n\n/** Accept http(s) and mailto: (matches your editor config) */\nconst HrefSchema = z.string().refine((v) => /^(https?:\\/\\/|mailto:).+/.test(v), {\n\tmessage: \"Expected http(s):// or mailto: URL\",\n});\n\n/** Link mark. */\nconst ProseMirrorLinkMark = z.object({\n\ttype: z.literal(\"link\"),\n\tattrs: z.object({\n\t\thref: HrefSchema,\n\t}),\n});\n\n/** Supported text marks */\nconst ProseMirrorMark = z.discriminatedUnion(\"type\", [\n\tProseMirrorLinkMark,\n\tz.object({ type: z.literal(\"bold\") }),\n\tz.object({ type: z.literal(\"italic\") }),\n\tz.object({ type: z.literal(\"underline\") }),\n\tz.object({ type: z.literal(\"strike\") }),\n]);\n\n/** Text node */\nconst ProseMirrorTextNode = z.object({\n\ttype: z.literal(\"text\"),\n\ttext: z.string(),\n\tmarks: z.array(ProseMirrorMark).optional(),\n});\n\n/** Paragraph node — content can be empty/omitted */\nconst ProseMirrorParagraphNode = z.object({\n\ttype: z.literal(\"paragraph\"),\n\tcontent: z.array(ProseMirrorTextNode),\n});\n\n/** ProseMirror Node Union. */\nconst ProseMirrorNode = z.union([ProseMirrorParagraphNode, ProseMirrorTextNode]);\n\n/** Root node of a ProseMirror document - enforcing at least 1 paragraph */\nexport const ProseMirrorDocSchema = z.object({\n\ttype: z.literal(\"doc\"),\n\tcontent: z\n\t\t.array(ProseMirrorNode)\n\t\t.min(1, { message: \"Document must contain at least one paragraph\" }),\n});\n\n/** Rich text editor TS type. */\nexport type RichTextEditorType = z.infer<typeof ProseMirrorDocSchema>;\n\nexport {};\n","import { BaseApiClient } from \"./base\";\nimport {\n\tHomepageStructureInputSchema,\n\tHomepageStructureOutputSchema,\n\ttype HomepageStructureInput,\n\ttype HomepageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Homepage structure endpoints\n */\nexport class HomepageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<HomepageStructureOutput> {\n\t\treturn this.get(`/v1/homepage/${pageId}/structure`, HomepageStructureOutputSchema);\n\t}\n\n\tasync getStructuresByHomepageListId(homepageListId: string): Promise<HomepageStructureOutput[]> {\n\t\treturn this.get(\n\t\t\t`/v1/homepage/list/${homepageListId}/structures`,\n\t\t\tHomepageStructureOutputSchema.array(),\n\t\t);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<HomepageStructureInput, \"type\">,\n\t): Promise<HomepageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/homepage/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tHomepageStructureInputSchema,\n\t\t\tHomepageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import { z } from \"zod\";\n\n/**\n * -----------------------------------------\n * Legacy API Schemas & Types\n *\n * These schemas map to expected types for Hub Pages rendered by dotcom-pages.\n * -----------------------------------------\n */\n\nconst LegacyFlourishChildSchema = z.object({\n\tsource: z.literal(\"flourish\"),\n\tproperties: z.object({\n\t\tid: z.string().min(1), // e.g. \"visualisation/21901162\"\n\t}),\n});\n\nconst LegacyListChildSchema = z.object({\n\tsource: z.literal(\"list\"),\n\tproperties: z.object({\n\t\tid: z.string().uuid(),\n\t\tmaxItems: z.number().optional(),\n\t}),\n});\n\nconst LegacyContainerChildSchema = z.discriminatedUnion(\"source\", [\n\tLegacyFlourishChildSchema,\n\tLegacyListChildSchema,\n]);\n\nconst LegacyTopperSchema = z.object({\n\ttype: z.literal(\"topper-basic\"),\n\tproperties: z.object({\n\t\ttitle: z.string(),\n\t\tsponsorText: z.string().optional(),\n\t\tsponsorImage: z.string().url().optional(),\n\t}),\n});\n\nconst LegacyInfoBoxSchema = z.object({\n\ttype: z.literal(\"info-box\"),\n\tproperties: z.object({\n\t\tbodyHTML: z.string(),\n\t}),\n});\n\nconst LegacyContainerSchema = z.object({\n\ttype: z.literal(\"container\"),\n\tchildren: z.array(LegacyContainerChildSchema).min(1),\n\tproperties: z.object({\n\t\ttitle: z.string().optional(),\n\t\tdesign: z.enum([\"chart\", \"four-story\", \"freeform\", \"hero-lead\"]).default(\"freeform\"),\n\t\tbackgroundColor: z.string().optional(),\n\t}),\n});\n\nconst LegacyExperimentSchema = z.object({\n\ttype: z.literal(\"experiment\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\texperimentName: z.string(),\n\t\tid: z.string(),\n\t\ttitle: z.string().optional(),\n\t\tconfig: z\n\t\t\t.object({\n\t\t\t\tvalue: z.unknown().optional(),\n\t\t\t\t// Hub pages support experiments with HTML and Text.\n\t\t\t\t// For now we just support JSON. As we migrate pages, this may change.\n\t\t\t\tformat: z.enum([\"json\"]).default(\"json\"),\n\t\t\t})\n\t\t\t.partial()\n\t\t\t.optional(),\n\t}),\n});\n\nconst LegacyBlockSchema = z.discriminatedUnion(\"type\", [\n\tLegacyTopperSchema,\n\tLegacyInfoBoxSchema,\n\tLegacyContainerSchema,\n\tLegacyExperimentSchema,\n]);\n\nexport const LegacyPageStructureOutputSchema = z.object({\n\tuuid: z.string().uuid(),\n\tconceptId: z.string().uuid().optional(),\n\tthemeName: z.string().optional(),\n\tmetaDescription: z.string().optional(),\n\tblocks: z.array(LegacyBlockSchema),\n});\n\nexport type LegacyPageStructureOutput = z.infer<typeof LegacyPageStructureOutputSchema>;\nexport type LegacyBlock = z.infer<typeof LegacyBlockSchema>;\n","import { BaseApiClient } from \"./base\";\nimport type { LegacyPageStructureOutput } from \"./schemas/ftpink/legacyHubPage\";\nimport { LegacyPageStructureOutputSchema } from \"./schemas/ftpink/legacyHubPage\";\nimport {\n\tPageStructureInputSchema,\n\tPageStructureOutputSchema,\n\ttype PageStructureInput,\n\ttype PageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Page structure endpoints\n */\nexport class PageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<PageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/structure`, PageStructureOutputSchema);\n\t}\n\n\tasync getLegacyHubPageStructure(pageId: string): Promise<LegacyPageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/legacyHubPageStructure`, LegacyPageStructureOutputSchema);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<PageStructureInput, \"type\">,\n\t): Promise<PageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/page/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tPageStructureInputSchema,\n\t\t\tPageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import type { ApiClientConfig } from \"./base\";\nimport { BaseApiClient } from \"./base\";\nimport { HomepageClient } from \"./homepage\";\nimport { PageClient } from \"./page\";\n\n/**\n * Main API client that provides access to all API endpoints\n */\nexport class ApiClient extends BaseApiClient {\n\t/**\n\t * Homepage API endpoints\n\t */\n\thomepage: HomepageClient;\n\tpage: PageClient;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tsuper(config);\n\n\t\t// Initialize sub-clients\n\t\tthis.homepage = new HomepageClient(config);\n\t\tthis.page = new PageClient(config);\n\t}\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -259,7 +259,8 @@ var BasePagePropertiesSchema = z3.object({
|
|
|
259
259
|
conceptId: z3.string().optional(),
|
|
260
260
|
metaDescription: z3.string().optional(),
|
|
261
261
|
pageTheme: z3.string().optional(),
|
|
262
|
-
sponsorText: z3.string().optional()
|
|
262
|
+
sponsorText: z3.string().optional(),
|
|
263
|
+
sponsorImage: z3.string().url().optional()
|
|
263
264
|
});
|
|
264
265
|
var PageStructureInputSchema = z3.object({
|
|
265
266
|
properties: BasePagePropertiesSchema,
|
|
@@ -327,15 +328,14 @@ var LegacyContainerChildSchema = z4.discriminatedUnion("source", [
|
|
|
327
328
|
]);
|
|
328
329
|
var LegacyTopperSchema = z4.object({
|
|
329
330
|
type: z4.literal("topper-basic"),
|
|
330
|
-
children: z4.tuple([]),
|
|
331
331
|
properties: z4.object({
|
|
332
332
|
title: z4.string(),
|
|
333
|
-
sponsorText: z4.string().
|
|
333
|
+
sponsorText: z4.string().optional(),
|
|
334
|
+
sponsorImage: z4.string().url().optional()
|
|
334
335
|
})
|
|
335
336
|
});
|
|
336
337
|
var LegacyInfoBoxSchema = z4.object({
|
|
337
338
|
type: z4.literal("info-box"),
|
|
338
|
-
children: z4.tuple([]),
|
|
339
339
|
properties: z4.object({
|
|
340
340
|
bodyHTML: z4.string()
|
|
341
341
|
})
|
|
@@ -371,10 +371,11 @@ var LegacyBlockSchema = z4.discriminatedUnion("type", [
|
|
|
371
371
|
LegacyExperimentSchema
|
|
372
372
|
]);
|
|
373
373
|
var LegacyPageStructureOutputSchema = z4.object({
|
|
374
|
-
|
|
374
|
+
uuid: z4.string().uuid(),
|
|
375
375
|
conceptId: z4.string().uuid().optional(),
|
|
376
376
|
themeName: z4.string().optional(),
|
|
377
|
-
|
|
377
|
+
metaDescription: z4.string().optional(),
|
|
378
|
+
blocks: z4.array(LegacyBlockSchema)
|
|
378
379
|
});
|
|
379
380
|
|
|
380
381
|
// src/page.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/response.ts","../src/base.ts","../src/schemas/ftpink/page/index.ts","../src/schemas/prosemirror.ts","../src/homepage.ts","../src/schemas/ftpink/legacyHubPage/index.ts","../src/page.ts","../src/client.ts"],"sourcesContent":["import { z, type ZodTypeAny } from \"zod\";\n\n/**\n * Strongly‐typed enum for all possible API error codes.\n */\nexport const ApiErrorCode = z.enum([\n\t\"UNAUTHORIZED\",\n\t\"NOT_FOUND\",\n\t\"INTERNAL_SERVER_ERROR\",\n\t\"INVALID_INPUT_DATA\",\n]);\n\n/**\n * Fields shared by both success and error envelopes (but not the discriminant).\n */\nconst BaseEnvelopeFields = z.object({\n\tstatusCode: z.number(),\n\trequestId: z.string(),\n});\n\n/**\n * Specific details carried in an error payload.\n */\nexport const ApiErrorPayloadSchema = z\n\t.object({\n\t\tcode: ApiErrorCode,\n\t\tmessage: z.string(),\n\t\tdetails: z.string().optional(),\n\t\tpath: z.string().optional(),\n\t\ttimestamp: z.string().optional(),\n\t})\n\t.strict();\n\nexport type ApiErrorPayload = z.infer<typeof ApiErrorPayloadSchema>;\n\n/**\n * Full “envelope” when the API has failed.\n */\nexport const ApiErrorResponseSchema = BaseEnvelopeFields.extend({\n\tstatus: z.literal(\"error\"),\n\terror: ApiErrorPayloadSchema,\n}).strict();\n\nexport type ApiErrorResponse = z.infer<typeof ApiErrorResponseSchema>;\n\n/**\n * Schema for a successful API response, given some data schema T.\n */\nexport function ApiSuccessResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\treturn BaseEnvelopeFields.extend({\n\t\tstatus: z.literal(\"success\"),\n\t\tdata: dataSchema,\n\t}).strict();\n}\n\n/**\n * Union of success or error envelopes, discriminated on `status`.\n */\nexport function ApiResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\tconst successSchema = ApiSuccessResponseSchema(dataSchema);\n\tconst errorSchema = ApiErrorResponseSchema;\n\treturn z.discriminatedUnion(\"status\", [successSchema, errorSchema]);\n}\n","import type { z, ZodTypeAny } from \"zod\";\nimport type { ApiErrorPayloadSchema } from \"./schemas/response\";\nimport { ApiResponseSchema } from \"./schemas/response\";\n\n/**\n * API-level error thrown when { status: 'error' } is returned\n */\nexport class ApiClientError extends Error {\n\tpublic code: string;\n\tpublic details?: string;\n\tpublic path?: string;\n\tpublic timestamp?: string;\n\n\tconstructor(\n\t\tpublic payload: z.infer<typeof ApiErrorPayloadSchema>,\n\t\tpublic statusCode: number,\n\t\tpublic requestId?: string,\n\t) {\n\t\tsuper(payload.message);\n\t\tthis.name = \"ApiError\";\n\t\tthis.code = payload.code;\n\t\tthis.details = payload.details;\n\t\tthis.path = payload.path;\n\t\tthis.timestamp = payload.timestamp;\n\t}\n}\n\n/**\n * Configuration options for the API client\n */\nexport type ApiClientConfig =\n\t| {\n\t\t\t// Standard configuration.\n\t\t\t// Intended for external clients using an API key issued via API Gateway.\n\t\t\tbaseUrl: string;\n\t\t\tapiKey: string;\n\t\t\tapiToken?: never;\n\t\t\tfetch?: typeof fetch;\n\t }\n\t| {\n\t\t\t// Alternative configuration.\n\t\t\t// Reserved for client with access to a bearer token (e.g. The e2e tests).\n\t\t\tbaseUrl: string;\n\t\t\tapiKey?: never;\n\t\t\tapiToken: string;\n\t\t\tfetch?: typeof fetch;\n\t };\n\nexport class BaseApiClient {\n\tprotected config: ApiClientConfig;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\tfetch: config.fetch || fetch,\n\t\t};\n\t\tthis.config.baseUrl = this.config.baseUrl.replace(/\\/+$/, \"\"); // strip trailing slashes\n\t}\n\n\t/**\n\t * Generic HTTP request to a JSON API\n\t */\n\tprotected async request<\n\t\tReqSchema extends ZodTypeAny | undefined,\n\t\tResponseDataSchema extends ZodTypeAny,\n\t>(\n\t\tmethod: \"GET\" | \"PUT\" | \"POST\" | \"DELETE\",\n\t\tpath: string,\n\t\topts: {\n\t\t\trequestSchema?: ReqSchema;\n\t\t\tbody?: ReqSchema extends ZodTypeAny ? z.infer<ReqSchema> : unknown;\n\t\t\tresponseDataSchema: ResponseDataSchema;\n\t\t},\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\t// Validate request body if provided\n\t\tlet bodyPayload = opts.body;\n\t\tif (opts.requestSchema && opts.body !== undefined) {\n\t\t\tbodyPayload = opts.requestSchema.parse(opts.body);\n\t\t}\n\n\t\t// Build URL + query string\n\t\tconst url = new URL(this.config.baseUrl + path);\n\n\t\t// Perform fetch\n\t\tconst response = await this.config.fetch!(url.toString(), {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...(this.config.apiKey\n\t\t\t\t\t? { \"x-api-key\": this.config.apiKey }\n\t\t\t\t\t: { Authorization: `Bearer ${this.config.apiToken}` }),\n\t\t\t},\n\t\t\tbody: bodyPayload ? JSON.stringify(bodyPayload) : undefined,\n\t\t});\n\n\t\tconst json = await response.json();\n\t\tconst parsedJson = ApiResponseSchema(opts.responseDataSchema).parse(json);\n\n\t\tif (\"error\" in parsedJson) {\n\t\t\tthrow new ApiClientError(parsedJson.error, parsedJson.statusCode, parsedJson.requestId);\n\t\t} else if (!(\"data\" in parsedJson)) {\n\t\t\tthrow new ApiClientError(\n\t\t\t\t{\n\t\t\t\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\t\t\t\tmessage: \"Unexpected API response format\",\n\t\t\t\t\tdetails: 'Response did not contain expected \"data\" field',\n\t\t\t\t},\n\t\t\t\t500,\n\t\t\t\tparsedJson.requestId,\n\t\t\t);\n\t\t}\n\n\t\treturn parsedJson.data;\n\t}\n\n\t/**\n\t * GET convenience method inferring response type from schema\n\t */\n\tprotected get<ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"GET\", path, { responseDataSchema });\n\t}\n\n\t/**\n\t * PUT convenience method inferring both request and response types\n\t */\n\tprotected put<ReqSchema extends ZodTypeAny, ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tbody: z.infer<ReqSchema>,\n\t\trequestSchema: ReqSchema,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"PUT\", path, { body, requestSchema, responseDataSchema });\n\t}\n}\n","import { z } from \"zod\";\nimport { ProseMirrorDocSchema } from \"../../prosemirror\";\n\n//\n// 1) REUSABLE SCHEMAS FOR COMMON STRUCTURES\n//\n\n/**\n * A generic schema representing a heading used across various slices.\n * - `text`: The display text of the heading.\n * - `href`: An optional URL that the heading links to.\n */\nconst HeadingSchema = z.object({\n\ttext: z.string(),\n\thref: z.string().url().optional(),\n});\n\n/**\n * Base “properties” common to most page slices.\n * - `heading`: An optional heading object for slices that can display a title.\n */\nconst BasePageItemProps = z.object({\n\theading: HeadingSchema.optional(),\n});\n\n/**\n * Extended properties for any “graphics”-type slice.\n * In addition to base properties, these slices must specify how the graphic is displayed.\n * - `displayBehaviour`: Determines if the graphic stands alone or is associated with other content.\n */\nconst BaseGraphicsItemProps = BasePageItemProps.extend({\n\tdisplayBehaviour: z.enum([\"standalone\", \"associated\"]),\n});\n\n/**\n * A schema to validate that a string is valid JSON.\n */\nconst ValidJSONStringSchema = z.string().refine(\n\t(val) => {\n\t\ttry {\n\t\t\tJSON.parse(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t},\n\t{ message: \"Invalid JSON string\" },\n);\n\n//\n// 2) GENERIC HELPER TO DEFINE “SLICE” INPUT/OUTPUT SCHEMAS\n//\n\n/**\n * A union type to represent either a Zod object schema or an optional Zod object schema.\n */\ntype OptionalOrRequiredZodObject = z.AnyZodObject | z.ZodOptional<z.AnyZodObject>;\n\n/**\n * Helper function that, given:\n * - `typeName`: A string literal identifying the slice type.\n * - `propsShape`: A Zod schema describing the slice’s `properties`.\n *\n * Returns an object containing two schemas:\n * - `InputSchema`: For client-side input; `sliceId` is optional.\n * - `OutputSchema`: For server-side/output; `sliceId` is required.\n *\n * This is useful because when defining slices we often want to allow -\n * clients to submit slices without an ID (e.g., when creating new slices),\n */\nfunction defineSliceSchema<T extends string, P extends OptionalOrRequiredZodObject>(options: {\n\ttypeName: T;\n\tpropsShape: P;\n}) {\n\tconst { typeName, propsShape } = options;\n\n\t// Base schema shared by both input and output:\n\t// - `type`: Literal string identifying which slice this is.\n\t// - `hidden`: Optional flag to mark the slice as hidden.\n\t// - `properties`: The detailed properties shape for the slice.\n\tconst BaseSchema = z.object({\n\t\ttype: z.literal(typeName),\n\t\thidden: z.boolean().optional(),\n\t\tproperties: propsShape,\n\t});\n\n\t/**\n\t * Input schema: For client submissions.\n\t * - `sliceId` is optional because the client might not specify it yet.\n\t */\n\tconst InputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid().optional(),\n\t});\n\n\t/**\n\t * Output schema: For persisted or server-returned data.\n\t * - `sliceId` is required (each saved slice must have an ID).\n\t */\n\tconst OutputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid(),\n\t});\n\n\treturn { InputSchema, OutputSchema };\n}\n\n//\n// 3) DEFINE INDIVIDUAL SLICE TYPES (INPUT & OUTPUT) USING THE HELPER\n//\n\n// 3.A “HomepageSlice”\n// - A generic homepage slice that may include an optional heading.\n// - Input: Clients can pass `properties` or omit entirely.\n// - Output: Always includes a `properties` object (may be empty) and a required `sliceId`.\nconst HomepageSlice = defineSliceSchema({\n\ttypeName: \"HomepageSlice\",\n\tpropsShape: BasePageItemProps.optional(),\n});\n\n// 3.B “FlourishGraphicSlice”\n// - A slice to embed or reference a Flourish graphic by its ID.\n// - Extends graphic base properties with `flourishId`.\nconst FlourishGraphicSlice = defineSliceSchema({\n\ttypeName: \"FlourishGraphic\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tflourishDescription: z.string().optional(), // Optional description for the Flourish graphic\n\t\tflourishId: z.string().nonempty(),\n\t}),\n});\n\n// 3.C “CustomIframeSlice”\n// - A slice that renders a custom iframe.\n// - Extends graphic base properties with `iframeSrc`.\nconst CustomIframeSlice = defineSliceSchema({\n\ttypeName: \"CustomIframe\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tiframeSrc: z.string().url().nonempty(),\n\t}),\n});\n\n// 3.D “ExperimentSlice”\n// - A slice for embedding experimental content.\n// - Requires an `experimentId`, `experimentName`, and a JSON string (`contentJson`).\nconst ExperimentSlice = defineSliceSchema({\n\ttypeName: \"Experiment\",\n\tpropsShape: BasePageItemProps.extend({\n\t\texperimentId: z.string().nonempty(), // Unique ID for the experiment\n\t\texperimentName: z.string().nonempty(), // Human-readable name of the experiment\n\t\tcontentJson: ValidJSONStringSchema, // The experiment’s JSON payload as a valid JSON string\n\t}),\n});\n\n// 3.E \"Strip\"\n// - A slice that displays a strip of content.\nconst StripSlice = defineSliceSchema({\n\ttypeName: \"Strip\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the strip to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n// 3.F \"TopperSlice\"\n// - A slice that displays a topper section with description and optional strapline.\nconst TopperSlice = defineSliceSchema({\n\ttypeName: \"Topper\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tdescription: ProseMirrorDocSchema,\n\t\tstrapline: z.string().optional(),\n\t}),\n});\n\n// 3.F \"Hero\"\n// - A slice that represents a Hero on the page. It references a Spark List.\nconst HeroSlice = defineSliceSchema({\n\ttypeName: \"Hero\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the spark list to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n//\n// 4) COMPOSE DISCRIMINATED UNIONS FOR “SLICE API” INPUT & OUTPUT\n//\n\n/**\n * All possible slice inputs for the Page API.\n * This discriminated union allows Zod to pick the correct schema based on the `type` field.\n */\nexport const SliceApiInputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.InputSchema,\n\tFlourishGraphicSlice.InputSchema,\n\tCustomIframeSlice.InputSchema,\n\tExperimentSlice.InputSchema,\n\tStripSlice.InputSchema,\n\tTopperSlice.InputSchema,\n\tHeroSlice.InputSchema,\n] as const);\n\n/**\n * All possible slice outputs for the Page API.\n * The same discriminated union but with each slice requiring `sliceId`.\n */\nexport const SliceApiOutputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.OutputSchema,\n\tFlourishGraphicSlice.OutputSchema,\n\tCustomIframeSlice.OutputSchema,\n\tExperimentSlice.OutputSchema,\n\tStripSlice.OutputSchema,\n\tTopperSlice.OutputSchema,\n\tHeroSlice.OutputSchema,\n] as const);\n\n//\n// 5) WRAPPER SCHEMAS FOR THE ENTIRE PAGE STRUCTURE\n//\n\nconst BasePagePropertiesSchema = z.object({\n\ttitle: z.string(),\n\tpageId: z.string().uuid(),\n\tconceptId: z.string().optional(),\n\tmetaDescription: z.string().optional(),\n\tpageTheme: z.string().optional(),\n\tsponsorText: z.string().optional(),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const PageStructureInputSchema = z.object({\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiInputSchema),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page (title, list ID, page ID).\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const HomepageStructureInputSchema = PageStructureInputSchema.extend({\n\tproperties: BasePagePropertiesSchema.extend({\n\t\t// This is optional for the input. If clients don't send it, we generate a uuid.\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n/**\n * Page structure as stored or returned by the server.\n */\nexport const PageStructureOutputSchema = z.object({\n\ttype: z.literal(\"Page\"),\n\tschemaVersion: z.number(),\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiOutputSchema),\n});\n\nexport const HomepageStructureOutputSchema = PageStructureOutputSchema.extend({\n\ttype: z.literal(\"Homepage\"),\n\tproperties: BasePagePropertiesSchema.extend({\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n//\n// 6) EXPORT TYPES FOR CONSUMPTION IN CODE\n//\n\n/** Client-side type for page structure input */\nexport type PageStructureInput = z.infer<typeof PageStructureInputSchema>;\n\n/** Server-side type for page structure output */\nexport type PageStructureOutput = z.infer<typeof PageStructureOutputSchema>;\n\n/** Client-side type for homepage structure input */\nexport type HomepageStructureInput = z.infer<typeof HomepageStructureInputSchema>;\n\n/** Server-side type for homepage structure output */\nexport type HomepageStructureOutput = z.infer<typeof HomepageStructureOutputSchema>;\n\n/** Union of all possible slice outputs for type-checking convenience */\nexport type Slice = z.infer<typeof SliceApiOutputSchema>;\n\n/** Individual slice output types */\nexport type HomepageSliceType = z.infer<typeof HomepageSlice.OutputSchema>;\nexport type FlourishGraphicSliceType = z.infer<typeof FlourishGraphicSlice.OutputSchema>;\nexport type CustomIframeSliceType = z.infer<typeof CustomIframeSlice.OutputSchema>;\nexport type ExperimentSliceType = z.infer<typeof ExperimentSlice.OutputSchema>;\nexport type StripSliceType = z.infer<typeof StripSlice.OutputSchema>;\nexport type TopperSliceType = z.infer<typeof TopperSlice.OutputSchema>;\nexport type HeroSliceType = z.infer<typeof HeroSlice.OutputSchema>;\n\n/**\n * Union type for interactive slices (i.e., the ones rendering visual components).\n * Useful for code that cares specifically about slices with visual/interactive content.\n */\nexport type InteractiveSlice = FlourishGraphicSliceType | CustomIframeSliceType;\n","import { z } from \"zod\";\n\n/** Accept http(s) and mailto: (matches your editor config) */\nconst HrefSchema = z.string().refine((v) => /^(https?:\\/\\/|mailto:).+/.test(v), {\n\tmessage: \"Expected http(s):// or mailto: URL\",\n});\n\n/** Link mark. */\nconst ProseMirrorLinkMark = z.object({\n\ttype: z.literal(\"link\"),\n\tattrs: z.object({\n\t\thref: HrefSchema,\n\t}),\n});\n\n/** Supported text marks */\nconst ProseMirrorMark = z.discriminatedUnion(\"type\", [\n\tProseMirrorLinkMark,\n\tz.object({ type: z.literal(\"bold\") }),\n\tz.object({ type: z.literal(\"italic\") }),\n\tz.object({ type: z.literal(\"underline\") }),\n\tz.object({ type: z.literal(\"strike\") }),\n]);\n\n/** Text node */\nconst ProseMirrorTextNode = z.object({\n\ttype: z.literal(\"text\"),\n\ttext: z.string(),\n\tmarks: z.array(ProseMirrorMark).optional(),\n});\n\n/** Paragraph node — content can be empty/omitted */\nconst ProseMirrorParagraphNode = z.object({\n\ttype: z.literal(\"paragraph\"),\n\tcontent: z.array(ProseMirrorTextNode),\n});\n\n/** ProseMirror Node Union. */\nconst ProseMirrorNode = z.union([ProseMirrorParagraphNode, ProseMirrorTextNode]);\n\n/** Root node of a ProseMirror document - enforcing at least 1 paragraph */\nexport const ProseMirrorDocSchema = z.object({\n\ttype: z.literal(\"doc\"),\n\tcontent: z\n\t\t.array(ProseMirrorNode)\n\t\t.min(1, { message: \"Document must contain at least one paragraph\" }),\n});\n\n/** Rich text editor TS type. */\nexport type RichTextEditorType = z.infer<typeof ProseMirrorDocSchema>;\n\nexport {};\n","import { BaseApiClient } from \"./base\";\nimport {\n\tHomepageStructureInputSchema,\n\tHomepageStructureOutputSchema,\n\ttype HomepageStructureInput,\n\ttype HomepageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Homepage structure endpoints\n */\nexport class HomepageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<HomepageStructureOutput> {\n\t\treturn this.get(`/v1/homepage/${pageId}/structure`, HomepageStructureOutputSchema);\n\t}\n\n\tasync getStructuresByHomepageListId(homepageListId: string): Promise<HomepageStructureOutput[]> {\n\t\treturn this.get(\n\t\t\t`/v1/homepage/list/${homepageListId}/structures`,\n\t\t\tHomepageStructureOutputSchema.array(),\n\t\t);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<HomepageStructureInput, \"type\">,\n\t): Promise<HomepageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/homepage/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tHomepageStructureInputSchema,\n\t\t\tHomepageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import { z } from \"zod\";\n\n/**\n * -----------------------------------------\n * Legacy API Schemas & Types\n *\n * These schemas map to expected types for Hub Pages rendered by dotcom-pages.\n * -----------------------------------------\n */\n\nconst LegacyFlourishChildSchema = z.object({\n\tsource: z.literal(\"flourish\"),\n\tproperties: z.object({\n\t\tid: z.string().min(1), // e.g. \"visualisation/21901162\"\n\t}),\n});\n\nconst LegacyListChildSchema = z.object({\n\tsource: z.literal(\"list\"),\n\tproperties: z.object({\n\t\tid: z.string().uuid(),\n\t\tmaxItems: z.number().optional(),\n\t}),\n});\n\nconst LegacyContainerChildSchema = z.discriminatedUnion(\"source\", [\n\tLegacyFlourishChildSchema,\n\tLegacyListChildSchema,\n]);\n\nconst LegacyTopperSchema = z.object({\n\ttype: z.literal(\"topper-basic\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\ttitle: z.string(),\n\t\tsponsorText: z.string().default(\"\"),\n\t}),\n});\n\nconst LegacyInfoBoxSchema = z.object({\n\ttype: z.literal(\"info-box\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\tbodyHTML: z.string(),\n\t}),\n});\n\nconst LegacyContainerSchema = z.object({\n\ttype: z.literal(\"container\"),\n\tchildren: z.array(LegacyContainerChildSchema).min(1),\n\tproperties: z.object({\n\t\ttitle: z.string().optional(),\n\t\tdesign: z.enum([\"chart\", \"four-story\", \"freeform\", \"hero-lead\"]).default(\"freeform\"),\n\t\tbackgroundColor: z.string().optional(),\n\t}),\n});\n\nconst LegacyExperimentSchema = z.object({\n\ttype: z.literal(\"experiment\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\texperimentName: z.string(),\n\t\tid: z.string(),\n\t\ttitle: z.string().optional(),\n\t\tconfig: z\n\t\t\t.object({\n\t\t\t\tvalue: z.unknown().optional(),\n\t\t\t\t// Hub pages support experiments with HTML and Text.\n\t\t\t\t// For now we just support JSON. As we migrate pages, this may change.\n\t\t\t\tformat: z.enum([\"json\"]).default(\"json\"),\n\t\t\t})\n\t\t\t.partial()\n\t\t\t.optional(),\n\t}),\n});\n\nconst LegacyBlockSchema = z.discriminatedUnion(\"type\", [\n\tLegacyTopperSchema,\n\tLegacyInfoBoxSchema,\n\tLegacyContainerSchema,\n\tLegacyExperimentSchema,\n]);\n\nexport const LegacyPageStructureOutputSchema = z.object({\n\tblocks: z.array(LegacyBlockSchema),\n\tconceptId: z.string().uuid().optional(),\n\tthemeName: z.string().optional(),\n\tuuid: z.string().uuid(),\n});\n\nexport type LegacyPageStructureOutput = z.infer<typeof LegacyPageStructureOutputSchema>;\nexport type LegacyBlock = z.infer<typeof LegacyBlockSchema>;\n","import { BaseApiClient } from \"./base\";\nimport type { LegacyPageStructureOutput } from \"./schemas/ftpink/legacyHubPage\";\nimport { LegacyPageStructureOutputSchema } from \"./schemas/ftpink/legacyHubPage\";\nimport {\n\tPageStructureInputSchema,\n\tPageStructureOutputSchema,\n\ttype PageStructureInput,\n\ttype PageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Page structure endpoints\n */\nexport class PageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<PageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/structure`, PageStructureOutputSchema);\n\t}\n\n\tasync getLegacyHubPageStructure(pageId: string): Promise<LegacyPageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/legacyHubPageStructure`, LegacyPageStructureOutputSchema);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<PageStructureInput, \"type\">,\n\t): Promise<PageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/page/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tPageStructureInputSchema,\n\t\t\tPageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import type { ApiClientConfig } from \"./base\";\nimport { BaseApiClient } from \"./base\";\nimport { HomepageClient } from \"./homepage\";\nimport { PageClient } from \"./page\";\n\n/**\n * Main API client that provides access to all API endpoints\n */\nexport class ApiClient extends BaseApiClient {\n\t/**\n\t * Homepage API endpoints\n\t */\n\thomepage: HomepageClient;\n\tpage: PageClient;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tsuper(config);\n\n\t\t// Initialize sub-clients\n\t\tthis.homepage = new HomepageClient(config);\n\t\tthis.page = new PageClient(config);\n\t}\n}\n"],"mappings":";AAAA,SAAS,SAA0B;AAK5B,IAAM,eAAe,EAAE,KAAK;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAKD,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACnC,YAAY,EAAE,OAAO;AAAA,EACrB,WAAW,EAAE,OAAO;AACrB,CAAC;AAKM,IAAM,wBAAwB,EACnC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS,EAAE,OAAO;AAAA,EAClB,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,WAAW,EAAE,OAAO,EAAE,SAAS;AAChC,CAAC,EACA,OAAO;AAOF,IAAM,yBAAyB,mBAAmB,OAAO;AAAA,EAC/D,QAAQ,EAAE,QAAQ,OAAO;AAAA,EACzB,OAAO;AACR,CAAC,EAAE,OAAO;AAOH,SAAS,yBAA+C,YAAe;AAC7E,SAAO,mBAAmB,OAAO;AAAA,IAChC,QAAQ,EAAE,QAAQ,SAAS;AAAA,IAC3B,MAAM;AAAA,EACP,CAAC,EAAE,OAAO;AACX;AAKO,SAAS,kBAAwC,YAAe;AACtE,QAAM,gBAAgB,yBAAyB,UAAU;AACzD,QAAM,cAAc;AACpB,SAAO,EAAE,mBAAmB,UAAU,CAAC,eAAe,WAAW,CAAC;AACnE;;;ACvDO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAMzC,YACQ,SACA,YACA,WACN;AACD,UAAM,QAAQ,OAAO;AAJd;AACA;AACA;AAGP,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M,IAAM,kCAAkCA,GAAE,OAAO;AAAA,EACvD,QAAQA,GAAE,MAAM,iBAAiB;AAAA,EACjC,WAAWA,GAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA,EACtC,WAAWA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,MAAMA,GAAE,OAAO,EAAE,KAAK;AACvB,CAAC;;;AC3EM,IAAM,aAAN,cAAyB,cAAc;AAAA,EAC7C,MAAM,aAAa,QAA8C;AAChE,WAAO,KAAK,IAAI,YAAY,MAAM,cAAc,yBAAyB;AAAA,EAC1E;AAAA,EAEA,MAAM,0BAA0B,QAAoD;AACnF,WAAO,KAAK,IAAI,YAAY,MAAM,2BAA2B,+BAA+B;AAAA,EAC7F;AAAA,EAEA,MAAM,gBACL,QACA,MAC+B;AAC/B,WAAO,KAAK;AAAA,MACX,YAAY,MAAM;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;;;ACzBO,IAAM,YAAN,cAAwB,cAAc;AAAA;AAAA;AAAA;AAAA,EAI5C;AAAA,EACA;AAAA,EAEA,YAAY,QAAyB;AACpC,UAAM,MAAM;AAGZ,SAAK,WAAW,IAAI,eAAe,MAAM;AACzC,SAAK,OAAO,IAAI,WAAW,MAAM;AAAA,EAClC;AACD;","names":["z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/response.ts","../src/base.ts","../src/schemas/ftpink/page/index.ts","../src/schemas/prosemirror.ts","../src/homepage.ts","../src/schemas/ftpink/legacyHubPage/index.ts","../src/page.ts","../src/client.ts"],"sourcesContent":["import { z, type ZodTypeAny } from \"zod\";\n\n/**\n * Strongly‐typed enum for all possible API error codes.\n */\nexport const ApiErrorCode = z.enum([\n\t\"UNAUTHORIZED\",\n\t\"NOT_FOUND\",\n\t\"INTERNAL_SERVER_ERROR\",\n\t\"INVALID_INPUT_DATA\",\n]);\n\n/**\n * Fields shared by both success and error envelopes (but not the discriminant).\n */\nconst BaseEnvelopeFields = z.object({\n\tstatusCode: z.number(),\n\trequestId: z.string(),\n});\n\n/**\n * Specific details carried in an error payload.\n */\nexport const ApiErrorPayloadSchema = z\n\t.object({\n\t\tcode: ApiErrorCode,\n\t\tmessage: z.string(),\n\t\tdetails: z.string().optional(),\n\t\tpath: z.string().optional(),\n\t\ttimestamp: z.string().optional(),\n\t})\n\t.strict();\n\nexport type ApiErrorPayload = z.infer<typeof ApiErrorPayloadSchema>;\n\n/**\n * Full “envelope” when the API has failed.\n */\nexport const ApiErrorResponseSchema = BaseEnvelopeFields.extend({\n\tstatus: z.literal(\"error\"),\n\terror: ApiErrorPayloadSchema,\n}).strict();\n\nexport type ApiErrorResponse = z.infer<typeof ApiErrorResponseSchema>;\n\n/**\n * Schema for a successful API response, given some data schema T.\n */\nexport function ApiSuccessResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\treturn BaseEnvelopeFields.extend({\n\t\tstatus: z.literal(\"success\"),\n\t\tdata: dataSchema,\n\t}).strict();\n}\n\n/**\n * Union of success or error envelopes, discriminated on `status`.\n */\nexport function ApiResponseSchema<T extends ZodTypeAny>(dataSchema: T) {\n\tconst successSchema = ApiSuccessResponseSchema(dataSchema);\n\tconst errorSchema = ApiErrorResponseSchema;\n\treturn z.discriminatedUnion(\"status\", [successSchema, errorSchema]);\n}\n","import type { z, ZodTypeAny } from \"zod\";\nimport type { ApiErrorPayloadSchema } from \"./schemas/response\";\nimport { ApiResponseSchema } from \"./schemas/response\";\n\n/**\n * API-level error thrown when { status: 'error' } is returned\n */\nexport class ApiClientError extends Error {\n\tpublic code: string;\n\tpublic details?: string;\n\tpublic path?: string;\n\tpublic timestamp?: string;\n\n\tconstructor(\n\t\tpublic payload: z.infer<typeof ApiErrorPayloadSchema>,\n\t\tpublic statusCode: number,\n\t\tpublic requestId?: string,\n\t) {\n\t\tsuper(payload.message);\n\t\tthis.name = \"ApiError\";\n\t\tthis.code = payload.code;\n\t\tthis.details = payload.details;\n\t\tthis.path = payload.path;\n\t\tthis.timestamp = payload.timestamp;\n\t}\n}\n\n/**\n * Configuration options for the API client\n */\nexport type ApiClientConfig =\n\t| {\n\t\t\t// Standard configuration.\n\t\t\t// Intended for external clients using an API key issued via API Gateway.\n\t\t\tbaseUrl: string;\n\t\t\tapiKey: string;\n\t\t\tapiToken?: never;\n\t\t\tfetch?: typeof fetch;\n\t }\n\t| {\n\t\t\t// Alternative configuration.\n\t\t\t// Reserved for client with access to a bearer token (e.g. The e2e tests).\n\t\t\tbaseUrl: string;\n\t\t\tapiKey?: never;\n\t\t\tapiToken: string;\n\t\t\tfetch?: typeof fetch;\n\t };\n\nexport class BaseApiClient {\n\tprotected config: ApiClientConfig;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\tfetch: config.fetch || fetch,\n\t\t};\n\t\tthis.config.baseUrl = this.config.baseUrl.replace(/\\/+$/, \"\"); // strip trailing slashes\n\t}\n\n\t/**\n\t * Generic HTTP request to a JSON API\n\t */\n\tprotected async request<\n\t\tReqSchema extends ZodTypeAny | undefined,\n\t\tResponseDataSchema extends ZodTypeAny,\n\t>(\n\t\tmethod: \"GET\" | \"PUT\" | \"POST\" | \"DELETE\",\n\t\tpath: string,\n\t\topts: {\n\t\t\trequestSchema?: ReqSchema;\n\t\t\tbody?: ReqSchema extends ZodTypeAny ? z.infer<ReqSchema> : unknown;\n\t\t\tresponseDataSchema: ResponseDataSchema;\n\t\t},\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\t// Validate request body if provided\n\t\tlet bodyPayload = opts.body;\n\t\tif (opts.requestSchema && opts.body !== undefined) {\n\t\t\tbodyPayload = opts.requestSchema.parse(opts.body);\n\t\t}\n\n\t\t// Build URL + query string\n\t\tconst url = new URL(this.config.baseUrl + path);\n\n\t\t// Perform fetch\n\t\tconst response = await this.config.fetch!(url.toString(), {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...(this.config.apiKey\n\t\t\t\t\t? { \"x-api-key\": this.config.apiKey }\n\t\t\t\t\t: { Authorization: `Bearer ${this.config.apiToken}` }),\n\t\t\t},\n\t\t\tbody: bodyPayload ? JSON.stringify(bodyPayload) : undefined,\n\t\t});\n\n\t\tconst json = await response.json();\n\t\tconst parsedJson = ApiResponseSchema(opts.responseDataSchema).parse(json);\n\n\t\tif (\"error\" in parsedJson) {\n\t\t\tthrow new ApiClientError(parsedJson.error, parsedJson.statusCode, parsedJson.requestId);\n\t\t} else if (!(\"data\" in parsedJson)) {\n\t\t\tthrow new ApiClientError(\n\t\t\t\t{\n\t\t\t\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\t\t\t\tmessage: \"Unexpected API response format\",\n\t\t\t\t\tdetails: 'Response did not contain expected \"data\" field',\n\t\t\t\t},\n\t\t\t\t500,\n\t\t\t\tparsedJson.requestId,\n\t\t\t);\n\t\t}\n\n\t\treturn parsedJson.data;\n\t}\n\n\t/**\n\t * GET convenience method inferring response type from schema\n\t */\n\tprotected get<ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"GET\", path, { responseDataSchema });\n\t}\n\n\t/**\n\t * PUT convenience method inferring both request and response types\n\t */\n\tprotected put<ReqSchema extends ZodTypeAny, ResponseDataSchema extends ZodTypeAny>(\n\t\tpath: string,\n\t\tbody: z.infer<ReqSchema>,\n\t\trequestSchema: ReqSchema,\n\t\tresponseDataSchema: ResponseDataSchema,\n\t): Promise<z.infer<ResponseDataSchema>> {\n\t\treturn this.request(\"PUT\", path, { body, requestSchema, responseDataSchema });\n\t}\n}\n","import { z } from \"zod\";\nimport { ProseMirrorDocSchema } from \"../../prosemirror\";\n\n//\n// 1) REUSABLE SCHEMAS FOR COMMON STRUCTURES\n//\n\n/**\n * A generic schema representing a heading used across various slices.\n * - `text`: The display text of the heading.\n * - `href`: An optional URL that the heading links to.\n */\nconst HeadingSchema = z.object({\n\ttext: z.string(),\n\thref: z.string().url().optional(),\n});\n\n/**\n * Base “properties” common to most page slices.\n * - `heading`: An optional heading object for slices that can display a title.\n */\nconst BasePageItemProps = z.object({\n\theading: HeadingSchema.optional(),\n});\n\n/**\n * Extended properties for any “graphics”-type slice.\n * In addition to base properties, these slices must specify how the graphic is displayed.\n * - `displayBehaviour`: Determines if the graphic stands alone or is associated with other content.\n */\nconst BaseGraphicsItemProps = BasePageItemProps.extend({\n\tdisplayBehaviour: z.enum([\"standalone\", \"associated\"]),\n});\n\n/**\n * A schema to validate that a string is valid JSON.\n */\nconst ValidJSONStringSchema = z.string().refine(\n\t(val) => {\n\t\ttry {\n\t\t\tJSON.parse(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t},\n\t{ message: \"Invalid JSON string\" },\n);\n\n//\n// 2) GENERIC HELPER TO DEFINE “SLICE” INPUT/OUTPUT SCHEMAS\n//\n\n/**\n * A union type to represent either a Zod object schema or an optional Zod object schema.\n */\ntype OptionalOrRequiredZodObject = z.AnyZodObject | z.ZodOptional<z.AnyZodObject>;\n\n/**\n * Helper function that, given:\n * - `typeName`: A string literal identifying the slice type.\n * - `propsShape`: A Zod schema describing the slice’s `properties`.\n *\n * Returns an object containing two schemas:\n * - `InputSchema`: For client-side input; `sliceId` is optional.\n * - `OutputSchema`: For server-side/output; `sliceId` is required.\n *\n * This is useful because when defining slices we often want to allow -\n * clients to submit slices without an ID (e.g., when creating new slices),\n */\nfunction defineSliceSchema<T extends string, P extends OptionalOrRequiredZodObject>(options: {\n\ttypeName: T;\n\tpropsShape: P;\n}) {\n\tconst { typeName, propsShape } = options;\n\n\t// Base schema shared by both input and output:\n\t// - `type`: Literal string identifying which slice this is.\n\t// - `hidden`: Optional flag to mark the slice as hidden.\n\t// - `properties`: The detailed properties shape for the slice.\n\tconst BaseSchema = z.object({\n\t\ttype: z.literal(typeName),\n\t\thidden: z.boolean().optional(),\n\t\tproperties: propsShape,\n\t});\n\n\t/**\n\t * Input schema: For client submissions.\n\t * - `sliceId` is optional because the client might not specify it yet.\n\t */\n\tconst InputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid().optional(),\n\t});\n\n\t/**\n\t * Output schema: For persisted or server-returned data.\n\t * - `sliceId` is required (each saved slice must have an ID).\n\t */\n\tconst OutputSchema = BaseSchema.extend({\n\t\tsliceId: z.string().uuid(),\n\t});\n\n\treturn { InputSchema, OutputSchema };\n}\n\n//\n// 3) DEFINE INDIVIDUAL SLICE TYPES (INPUT & OUTPUT) USING THE HELPER\n//\n\n// 3.A “HomepageSlice”\n// - A generic homepage slice that may include an optional heading.\n// - Input: Clients can pass `properties` or omit entirely.\n// - Output: Always includes a `properties` object (may be empty) and a required `sliceId`.\nconst HomepageSlice = defineSliceSchema({\n\ttypeName: \"HomepageSlice\",\n\tpropsShape: BasePageItemProps.optional(),\n});\n\n// 3.B “FlourishGraphicSlice”\n// - A slice to embed or reference a Flourish graphic by its ID.\n// - Extends graphic base properties with `flourishId`.\nconst FlourishGraphicSlice = defineSliceSchema({\n\ttypeName: \"FlourishGraphic\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tflourishDescription: z.string().optional(), // Optional description for the Flourish graphic\n\t\tflourishId: z.string().nonempty(),\n\t}),\n});\n\n// 3.C “CustomIframeSlice”\n// - A slice that renders a custom iframe.\n// - Extends graphic base properties with `iframeSrc`.\nconst CustomIframeSlice = defineSliceSchema({\n\ttypeName: \"CustomIframe\",\n\tpropsShape: BaseGraphicsItemProps.extend({\n\t\tiframeSrc: z.string().url().nonempty(),\n\t}),\n});\n\n// 3.D “ExperimentSlice”\n// - A slice for embedding experimental content.\n// - Requires an `experimentId`, `experimentName`, and a JSON string (`contentJson`).\nconst ExperimentSlice = defineSliceSchema({\n\ttypeName: \"Experiment\",\n\tpropsShape: BasePageItemProps.extend({\n\t\texperimentId: z.string().nonempty(), // Unique ID for the experiment\n\t\texperimentName: z.string().nonempty(), // Human-readable name of the experiment\n\t\tcontentJson: ValidJSONStringSchema, // The experiment’s JSON payload as a valid JSON string\n\t}),\n});\n\n// 3.E \"Strip\"\n// - A slice that displays a strip of content.\nconst StripSlice = defineSliceSchema({\n\ttypeName: \"Strip\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the strip to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n// 3.F \"TopperSlice\"\n// - A slice that displays a topper section with description and optional strapline.\nconst TopperSlice = defineSliceSchema({\n\ttypeName: \"Topper\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tdescription: ProseMirrorDocSchema,\n\t\tstrapline: z.string().optional(),\n\t}),\n});\n\n// 3.F \"Hero\"\n// - A slice that represents a Hero on the page. It references a Spark List.\nconst HeroSlice = defineSliceSchema({\n\ttypeName: \"Hero\",\n\tpropsShape: BasePageItemProps.extend({\n\t\tlistId: z.string().uuid(), // The ID of the spark list to display\n\t\tmaxStories: z.number().int().min(1), // Maximum number of stories to display in the strip\n\t}),\n});\n\n//\n// 4) COMPOSE DISCRIMINATED UNIONS FOR “SLICE API” INPUT & OUTPUT\n//\n\n/**\n * All possible slice inputs for the Page API.\n * This discriminated union allows Zod to pick the correct schema based on the `type` field.\n */\nexport const SliceApiInputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.InputSchema,\n\tFlourishGraphicSlice.InputSchema,\n\tCustomIframeSlice.InputSchema,\n\tExperimentSlice.InputSchema,\n\tStripSlice.InputSchema,\n\tTopperSlice.InputSchema,\n\tHeroSlice.InputSchema,\n] as const);\n\n/**\n * All possible slice outputs for the Page API.\n * The same discriminated union but with each slice requiring `sliceId`.\n */\nexport const SliceApiOutputSchema = z.discriminatedUnion(\"type\", [\n\tHomepageSlice.OutputSchema,\n\tFlourishGraphicSlice.OutputSchema,\n\tCustomIframeSlice.OutputSchema,\n\tExperimentSlice.OutputSchema,\n\tStripSlice.OutputSchema,\n\tTopperSlice.OutputSchema,\n\tHeroSlice.OutputSchema,\n] as const);\n\n//\n// 5) WRAPPER SCHEMAS FOR THE ENTIRE PAGE STRUCTURE\n//\n\nconst BasePagePropertiesSchema = z.object({\n\ttitle: z.string(),\n\tpageId: z.string().uuid(),\n\tconceptId: z.string().optional(),\n\tmetaDescription: z.string().optional(),\n\tpageTheme: z.string().optional(),\n\tsponsorText: z.string().optional(),\n\tsponsorImage: z.string().url().optional(),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const PageStructureInputSchema = z.object({\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiInputSchema),\n});\n\n/**\n * Page structure as submitted by clients.\n * - `properties`: Metadata about the page (title, list ID, page ID).\n * - `children`: Array of slice inputs (each with an optional `sliceId`).\n */\nexport const HomepageStructureInputSchema = PageStructureInputSchema.extend({\n\tproperties: BasePagePropertiesSchema.extend({\n\t\t// This is optional for the input. If clients don't send it, we generate a uuid.\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n/**\n * Page structure as stored or returned by the server.\n */\nexport const PageStructureOutputSchema = z.object({\n\ttype: z.literal(\"Page\"),\n\tschemaVersion: z.number(),\n\tproperties: BasePagePropertiesSchema,\n\tchildren: z.array(SliceApiOutputSchema),\n});\n\nexport const HomepageStructureOutputSchema = PageStructureOutputSchema.extend({\n\ttype: z.literal(\"Homepage\"),\n\tproperties: BasePagePropertiesSchema.extend({\n\t\thomepageListId: z.string().uuid(),\n\t}),\n});\n\n//\n// 6) EXPORT TYPES FOR CONSUMPTION IN CODE\n//\n\n/** Client-side type for page structure input */\nexport type PageStructureInput = z.infer<typeof PageStructureInputSchema>;\n\n/** Server-side type for page structure output */\nexport type PageStructureOutput = z.infer<typeof PageStructureOutputSchema>;\n\n/** Client-side type for homepage structure input */\nexport type HomepageStructureInput = z.infer<typeof HomepageStructureInputSchema>;\n\n/** Server-side type for homepage structure output */\nexport type HomepageStructureOutput = z.infer<typeof HomepageStructureOutputSchema>;\n\n/** Union of all possible slice outputs for type-checking convenience */\nexport type Slice = z.infer<typeof SliceApiOutputSchema>;\n\n/** Individual slice output types */\nexport type HomepageSliceType = z.infer<typeof HomepageSlice.OutputSchema>;\nexport type FlourishGraphicSliceType = z.infer<typeof FlourishGraphicSlice.OutputSchema>;\nexport type CustomIframeSliceType = z.infer<typeof CustomIframeSlice.OutputSchema>;\nexport type ExperimentSliceType = z.infer<typeof ExperimentSlice.OutputSchema>;\nexport type StripSliceType = z.infer<typeof StripSlice.OutputSchema>;\nexport type TopperSliceType = z.infer<typeof TopperSlice.OutputSchema>;\nexport type HeroSliceType = z.infer<typeof HeroSlice.OutputSchema>;\n\n/**\n * Union type for interactive slices (i.e., the ones rendering visual components).\n * Useful for code that cares specifically about slices with visual/interactive content.\n */\nexport type InteractiveSlice = FlourishGraphicSliceType | CustomIframeSliceType;\n","import { z } from \"zod\";\n\n/** Accept http(s) and mailto: (matches your editor config) */\nconst HrefSchema = z.string().refine((v) => /^(https?:\\/\\/|mailto:).+/.test(v), {\n\tmessage: \"Expected http(s):// or mailto: URL\",\n});\n\n/** Link mark. */\nconst ProseMirrorLinkMark = z.object({\n\ttype: z.literal(\"link\"),\n\tattrs: z.object({\n\t\thref: HrefSchema,\n\t}),\n});\n\n/** Supported text marks */\nconst ProseMirrorMark = z.discriminatedUnion(\"type\", [\n\tProseMirrorLinkMark,\n\tz.object({ type: z.literal(\"bold\") }),\n\tz.object({ type: z.literal(\"italic\") }),\n\tz.object({ type: z.literal(\"underline\") }),\n\tz.object({ type: z.literal(\"strike\") }),\n]);\n\n/** Text node */\nconst ProseMirrorTextNode = z.object({\n\ttype: z.literal(\"text\"),\n\ttext: z.string(),\n\tmarks: z.array(ProseMirrorMark).optional(),\n});\n\n/** Paragraph node — content can be empty/omitted */\nconst ProseMirrorParagraphNode = z.object({\n\ttype: z.literal(\"paragraph\"),\n\tcontent: z.array(ProseMirrorTextNode),\n});\n\n/** ProseMirror Node Union. */\nconst ProseMirrorNode = z.union([ProseMirrorParagraphNode, ProseMirrorTextNode]);\n\n/** Root node of a ProseMirror document - enforcing at least 1 paragraph */\nexport const ProseMirrorDocSchema = z.object({\n\ttype: z.literal(\"doc\"),\n\tcontent: z\n\t\t.array(ProseMirrorNode)\n\t\t.min(1, { message: \"Document must contain at least one paragraph\" }),\n});\n\n/** Rich text editor TS type. */\nexport type RichTextEditorType = z.infer<typeof ProseMirrorDocSchema>;\n\nexport {};\n","import { BaseApiClient } from \"./base\";\nimport {\n\tHomepageStructureInputSchema,\n\tHomepageStructureOutputSchema,\n\ttype HomepageStructureInput,\n\ttype HomepageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Homepage structure endpoints\n */\nexport class HomepageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<HomepageStructureOutput> {\n\t\treturn this.get(`/v1/homepage/${pageId}/structure`, HomepageStructureOutputSchema);\n\t}\n\n\tasync getStructuresByHomepageListId(homepageListId: string): Promise<HomepageStructureOutput[]> {\n\t\treturn this.get(\n\t\t\t`/v1/homepage/list/${homepageListId}/structures`,\n\t\t\tHomepageStructureOutputSchema.array(),\n\t\t);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<HomepageStructureInput, \"type\">,\n\t): Promise<HomepageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/homepage/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tHomepageStructureInputSchema,\n\t\t\tHomepageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import { z } from \"zod\";\n\n/**\n * -----------------------------------------\n * Legacy API Schemas & Types\n *\n * These schemas map to expected types for Hub Pages rendered by dotcom-pages.\n * -----------------------------------------\n */\n\nconst LegacyFlourishChildSchema = z.object({\n\tsource: z.literal(\"flourish\"),\n\tproperties: z.object({\n\t\tid: z.string().min(1), // e.g. \"visualisation/21901162\"\n\t}),\n});\n\nconst LegacyListChildSchema = z.object({\n\tsource: z.literal(\"list\"),\n\tproperties: z.object({\n\t\tid: z.string().uuid(),\n\t\tmaxItems: z.number().optional(),\n\t}),\n});\n\nconst LegacyContainerChildSchema = z.discriminatedUnion(\"source\", [\n\tLegacyFlourishChildSchema,\n\tLegacyListChildSchema,\n]);\n\nconst LegacyTopperSchema = z.object({\n\ttype: z.literal(\"topper-basic\"),\n\tproperties: z.object({\n\t\ttitle: z.string(),\n\t\tsponsorText: z.string().optional(),\n\t\tsponsorImage: z.string().url().optional(),\n\t}),\n});\n\nconst LegacyInfoBoxSchema = z.object({\n\ttype: z.literal(\"info-box\"),\n\tproperties: z.object({\n\t\tbodyHTML: z.string(),\n\t}),\n});\n\nconst LegacyContainerSchema = z.object({\n\ttype: z.literal(\"container\"),\n\tchildren: z.array(LegacyContainerChildSchema).min(1),\n\tproperties: z.object({\n\t\ttitle: z.string().optional(),\n\t\tdesign: z.enum([\"chart\", \"four-story\", \"freeform\", \"hero-lead\"]).default(\"freeform\"),\n\t\tbackgroundColor: z.string().optional(),\n\t}),\n});\n\nconst LegacyExperimentSchema = z.object({\n\ttype: z.literal(\"experiment\"),\n\tchildren: z.tuple([]),\n\tproperties: z.object({\n\t\texperimentName: z.string(),\n\t\tid: z.string(),\n\t\ttitle: z.string().optional(),\n\t\tconfig: z\n\t\t\t.object({\n\t\t\t\tvalue: z.unknown().optional(),\n\t\t\t\t// Hub pages support experiments with HTML and Text.\n\t\t\t\t// For now we just support JSON. As we migrate pages, this may change.\n\t\t\t\tformat: z.enum([\"json\"]).default(\"json\"),\n\t\t\t})\n\t\t\t.partial()\n\t\t\t.optional(),\n\t}),\n});\n\nconst LegacyBlockSchema = z.discriminatedUnion(\"type\", [\n\tLegacyTopperSchema,\n\tLegacyInfoBoxSchema,\n\tLegacyContainerSchema,\n\tLegacyExperimentSchema,\n]);\n\nexport const LegacyPageStructureOutputSchema = z.object({\n\tuuid: z.string().uuid(),\n\tconceptId: z.string().uuid().optional(),\n\tthemeName: z.string().optional(),\n\tmetaDescription: z.string().optional(),\n\tblocks: z.array(LegacyBlockSchema),\n});\n\nexport type LegacyPageStructureOutput = z.infer<typeof LegacyPageStructureOutputSchema>;\nexport type LegacyBlock = z.infer<typeof LegacyBlockSchema>;\n","import { BaseApiClient } from \"./base\";\nimport type { LegacyPageStructureOutput } from \"./schemas/ftpink/legacyHubPage\";\nimport { LegacyPageStructureOutputSchema } from \"./schemas/ftpink/legacyHubPage\";\nimport {\n\tPageStructureInputSchema,\n\tPageStructureOutputSchema,\n\ttype PageStructureInput,\n\ttype PageStructureOutput,\n} from \"./schemas/ftpink/page\";\n\n/**\n * Client for Page structure endpoints\n */\nexport class PageClient extends BaseApiClient {\n\tasync getStructure(pageId: string): Promise<PageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/structure`, PageStructureOutputSchema);\n\t}\n\n\tasync getLegacyHubPageStructure(pageId: string): Promise<LegacyPageStructureOutput> {\n\t\treturn this.get(`/v1/page/${pageId}/legacyHubPageStructure`, LegacyPageStructureOutputSchema);\n\t}\n\n\tasync upsertStructure(\n\t\tpageId: string,\n\t\tdata: Omit<PageStructureInput, \"type\">,\n\t): Promise<PageStructureOutput> {\n\t\treturn this.put(\n\t\t\t`/v1/page/${pageId}/structure`,\n\t\t\tdata,\n\t\t\tPageStructureInputSchema,\n\t\t\tPageStructureOutputSchema,\n\t\t);\n\t}\n}\n","import type { ApiClientConfig } from \"./base\";\nimport { BaseApiClient } from \"./base\";\nimport { HomepageClient } from \"./homepage\";\nimport { PageClient } from \"./page\";\n\n/**\n * Main API client that provides access to all API endpoints\n */\nexport class ApiClient extends BaseApiClient {\n\t/**\n\t * Homepage API endpoints\n\t */\n\thomepage: HomepageClient;\n\tpage: PageClient;\n\n\tconstructor(config: ApiClientConfig) {\n\t\tsuper(config);\n\n\t\t// Initialize sub-clients\n\t\tthis.homepage = new HomepageClient(config);\n\t\tthis.page = new PageClient(config);\n\t}\n}\n"],"mappings":";AAAA,SAAS,SAA0B;AAK5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