1
1
import { defineContentConfig , defineCollection , z } from '@nuxt/content'
2
2
3
- const pricingPlan = z . object ( {
3
+ const createPricingPlanSchema = ( ) => z . object ( {
4
4
title : z . string ( ) ,
5
5
description : z . string ( ) ,
6
6
price : z . string ( ) ,
@@ -16,7 +16,7 @@ const pricingPlan = z.object({
16
16
} ) ,
17
17
} )
18
18
19
- const pricingFeature = z . object ( {
19
+ const createPricingFeatureSchema = ( ) => z . object ( {
20
20
title : z . string ( ) ,
21
21
plans : z . array ( z . enum ( [ 'solo' , 'team' , 'unlimited' ] ) ) . optional ( ) ,
22
22
value : z . array ( z . string ( ) ) . optional ( ) ,
@@ -67,65 +67,65 @@ export default defineContentConfig({
67
67
} ) ,
68
68
} ) ,
69
69
plans : z . object ( {
70
- solo : pricingPlan ,
71
- team : pricingPlan ,
72
- unlimited : pricingPlan ,
70
+ solo : createPricingPlanSchema ( ) ,
71
+ team : createPricingPlanSchema ( ) ,
72
+ unlimited : createPricingPlanSchema ( ) ,
73
73
} ) ,
74
74
features : z . object ( {
75
75
title : z . string ( ) ,
76
76
description : z . string ( ) ,
77
77
includes : z . object ( {
78
- projects : pricingFeature ,
79
- members : pricingFeature ,
80
- media : pricingFeature ,
81
- support : pricingFeature ,
82
- dedicated : pricingFeature ,
83
- roles : pricingFeature ,
84
- collaboration : pricingFeature ,
78
+ projects : createPricingFeatureSchema ( ) ,
79
+ members : createPricingFeatureSchema ( ) ,
80
+ media : createPricingFeatureSchema ( ) ,
81
+ support : createPricingFeatureSchema ( ) ,
82
+ dedicated : createPricingFeatureSchema ( ) ,
83
+ roles : createPricingFeatureSchema ( ) ,
84
+ collaboration : createPricingFeatureSchema ( ) ,
85
85
sync : z . object ( {
86
86
title : z . string ( ) ,
87
87
includes : z . object ( {
88
- repositories : pricingFeature ,
89
- workflow : pricingFeature ,
88
+ repositories : createPricingFeatureSchema ( ) ,
89
+ workflow : createPricingFeatureSchema ( ) ,
90
90
} ) ,
91
91
} ) ,
92
92
project : z . object ( {
93
93
title : z . string ( ) ,
94
94
includes : z . object ( {
95
- clone : pricingFeature ,
96
- import : pricingFeature ,
95
+ clone : createPricingFeatureSchema ( ) ,
96
+ import : createPricingFeatureSchema ( ) ,
97
97
} ) ,
98
98
} ) ,
99
99
editors : z . object ( {
100
100
title : z . string ( ) ,
101
101
includes : z . object ( {
102
- markdown : pricingFeature ,
103
- json : pricingFeature ,
104
- appconfig : pricingFeature ,
105
- drag : pricingFeature ,
102
+ markdown : createPricingFeatureSchema ( ) ,
103
+ json : createPricingFeatureSchema ( ) ,
104
+ appconfig : createPricingFeatureSchema ( ) ,
105
+ drag : createPricingFeatureSchema ( ) ,
106
106
} ) ,
107
107
} ) ,
108
108
preview : z . object ( {
109
109
title : z . string ( ) ,
110
110
includes : z . object ( {
111
- draft : pricingFeature ,
112
- branches : pricingFeature ,
113
- prs : pricingFeature ,
111
+ draft : createPricingFeatureSchema ( ) ,
112
+ branches : createPricingFeatureSchema ( ) ,
113
+ prs : createPricingFeatureSchema ( ) ,
114
114
} ) ,
115
115
} ) ,
116
116
deploy : z . object ( {
117
117
title : z . string ( ) ,
118
118
includes : z . object ( {
119
- gh : pricingFeature ,
120
- self : pricingFeature ,
119
+ gh : createPricingFeatureSchema ( ) ,
120
+ self : createPricingFeatureSchema ( ) ,
121
121
} ) ,
122
122
} ) ,
123
123
publish : z . object ( {
124
124
title : z . string ( ) ,
125
125
includes : z . object ( {
126
- preview : pricingFeature ,
127
- branch : pricingFeature ,
128
- commit : pricingFeature ,
126
+ preview : createPricingFeatureSchema ( ) ,
127
+ branch : createPricingFeatureSchema ( ) ,
128
+ commit : createPricingFeatureSchema ( ) ,
129
129
} ) ,
130
130
} ) ,
131
131
} ) ,
0 commit comments