@remnawave/subscription-page-types 0.0.2 → 0.0.4
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/build/backend/models/subscription-page-config/subscription-page-config.schema.d.ts +113 -106
- package/build/backend/models/subscription-page-config/subscription-page-config.schema.d.ts.map +1 -1
- package/build/backend/models/subscription-page-config/subscription-page-config.schema.js +6 -3
- package/build/backend/models/subscription-page-config/subscription-page-config.validator.d.ts +5 -0
- package/build/backend/models/subscription-page-config/subscription-page-config.validator.d.ts.map +1 -1
- package/build/backend/models/subscription-page-config/subscription-page-config.validator.js +53 -1
- package/build/frontend/models/subscription-page-config/subscription-page-config.schema.js +6 -3
- package/build/frontend/models/subscription-page-config/subscription-page-config.validator.js +53 -1
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export declare const LocalizedTextSchema: z.ZodObject<{
|
|
|
18
18
|
fa?: string | undefined;
|
|
19
19
|
fr?: string | undefined;
|
|
20
20
|
}>;
|
|
21
|
+
declare const SvgLibrarySchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
21
22
|
declare const ButtonSchema: z.ZodObject<{
|
|
22
23
|
link: z.ZodString;
|
|
23
24
|
type: z.ZodEnum<["external", "subscriptionLink"]>;
|
|
@@ -40,7 +41,7 @@ declare const ButtonSchema: z.ZodObject<{
|
|
|
40
41
|
fa?: string | undefined;
|
|
41
42
|
fr?: string | undefined;
|
|
42
43
|
}>;
|
|
43
|
-
|
|
44
|
+
svgIconKey: z.ZodString;
|
|
44
45
|
}, "strip", z.ZodTypeAny, {
|
|
45
46
|
type: "external" | "subscriptionLink";
|
|
46
47
|
link: string;
|
|
@@ -51,7 +52,7 @@ declare const ButtonSchema: z.ZodObject<{
|
|
|
51
52
|
fa?: string | undefined;
|
|
52
53
|
fr?: string | undefined;
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
+
svgIconKey: string;
|
|
55
56
|
}, {
|
|
56
57
|
type: "external" | "subscriptionLink";
|
|
57
58
|
link: string;
|
|
@@ -62,10 +63,10 @@ declare const ButtonSchema: z.ZodObject<{
|
|
|
62
63
|
fa?: string | undefined;
|
|
63
64
|
fr?: string | undefined;
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
+
svgIconKey: string;
|
|
66
67
|
}>;
|
|
67
68
|
declare const BlockSchema: z.ZodObject<{
|
|
68
|
-
|
|
69
|
+
svgIconKey: z.ZodString;
|
|
69
70
|
svgIconColor: z.ZodEffects<z.ZodString, string, string>;
|
|
70
71
|
title: z.ZodObject<{
|
|
71
72
|
en: z.ZodString;
|
|
@@ -127,7 +128,7 @@ declare const BlockSchema: z.ZodObject<{
|
|
|
127
128
|
fa?: string | undefined;
|
|
128
129
|
fr?: string | undefined;
|
|
129
130
|
}>;
|
|
130
|
-
|
|
131
|
+
svgIconKey: z.ZodString;
|
|
131
132
|
}, "strip", z.ZodTypeAny, {
|
|
132
133
|
type: "external" | "subscriptionLink";
|
|
133
134
|
link: string;
|
|
@@ -138,7 +139,7 @@ declare const BlockSchema: z.ZodObject<{
|
|
|
138
139
|
fa?: string | undefined;
|
|
139
140
|
fr?: string | undefined;
|
|
140
141
|
};
|
|
141
|
-
|
|
142
|
+
svgIconKey: string;
|
|
142
143
|
}, {
|
|
143
144
|
type: "external" | "subscriptionLink";
|
|
144
145
|
link: string;
|
|
@@ -149,10 +150,10 @@ declare const BlockSchema: z.ZodObject<{
|
|
|
149
150
|
fa?: string | undefined;
|
|
150
151
|
fr?: string | undefined;
|
|
151
152
|
};
|
|
152
|
-
|
|
153
|
+
svgIconKey: string;
|
|
153
154
|
}>, "many">;
|
|
154
155
|
}, "strip", z.ZodTypeAny, {
|
|
155
|
-
|
|
156
|
+
svgIconKey: string;
|
|
156
157
|
svgIconColor: string;
|
|
157
158
|
title: {
|
|
158
159
|
en: string;
|
|
@@ -178,10 +179,10 @@ declare const BlockSchema: z.ZodObject<{
|
|
|
178
179
|
fa?: string | undefined;
|
|
179
180
|
fr?: string | undefined;
|
|
180
181
|
};
|
|
181
|
-
|
|
182
|
+
svgIconKey: string;
|
|
182
183
|
}[];
|
|
183
184
|
}, {
|
|
184
|
-
|
|
185
|
+
svgIconKey: string;
|
|
185
186
|
svgIconColor: string;
|
|
186
187
|
title: {
|
|
187
188
|
en: string;
|
|
@@ -207,14 +208,14 @@ declare const BlockSchema: z.ZodObject<{
|
|
|
207
208
|
fa?: string | undefined;
|
|
208
209
|
fr?: string | undefined;
|
|
209
210
|
};
|
|
210
|
-
|
|
211
|
+
svgIconKey: string;
|
|
211
212
|
}[];
|
|
212
213
|
}>;
|
|
213
214
|
declare const PlatformAppSchema: z.ZodObject<{
|
|
214
215
|
name: z.ZodString;
|
|
215
216
|
featured: z.ZodBoolean;
|
|
216
217
|
blocks: z.ZodArray<z.ZodObject<{
|
|
217
|
-
|
|
218
|
+
svgIconKey: z.ZodString;
|
|
218
219
|
svgIconColor: z.ZodEffects<z.ZodString, string, string>;
|
|
219
220
|
title: z.ZodObject<{
|
|
220
221
|
en: z.ZodString;
|
|
@@ -276,7 +277,7 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
276
277
|
fa?: string | undefined;
|
|
277
278
|
fr?: string | undefined;
|
|
278
279
|
}>;
|
|
279
|
-
|
|
280
|
+
svgIconKey: z.ZodString;
|
|
280
281
|
}, "strip", z.ZodTypeAny, {
|
|
281
282
|
type: "external" | "subscriptionLink";
|
|
282
283
|
link: string;
|
|
@@ -287,7 +288,7 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
287
288
|
fa?: string | undefined;
|
|
288
289
|
fr?: string | undefined;
|
|
289
290
|
};
|
|
290
|
-
|
|
291
|
+
svgIconKey: string;
|
|
291
292
|
}, {
|
|
292
293
|
type: "external" | "subscriptionLink";
|
|
293
294
|
link: string;
|
|
@@ -298,10 +299,10 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
298
299
|
fa?: string | undefined;
|
|
299
300
|
fr?: string | undefined;
|
|
300
301
|
};
|
|
301
|
-
|
|
302
|
+
svgIconKey: string;
|
|
302
303
|
}>, "many">;
|
|
303
304
|
}, "strip", z.ZodTypeAny, {
|
|
304
|
-
|
|
305
|
+
svgIconKey: string;
|
|
305
306
|
svgIconColor: string;
|
|
306
307
|
title: {
|
|
307
308
|
en: string;
|
|
@@ -327,10 +328,10 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
327
328
|
fa?: string | undefined;
|
|
328
329
|
fr?: string | undefined;
|
|
329
330
|
};
|
|
330
|
-
|
|
331
|
+
svgIconKey: string;
|
|
331
332
|
}[];
|
|
332
333
|
}, {
|
|
333
|
-
|
|
334
|
+
svgIconKey: string;
|
|
334
335
|
svgIconColor: string;
|
|
335
336
|
title: {
|
|
336
337
|
en: string;
|
|
@@ -356,14 +357,14 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
356
357
|
fa?: string | undefined;
|
|
357
358
|
fr?: string | undefined;
|
|
358
359
|
};
|
|
359
|
-
|
|
360
|
+
svgIconKey: string;
|
|
360
361
|
}[];
|
|
361
362
|
}>, "many">;
|
|
362
363
|
}, "strip", z.ZodTypeAny, {
|
|
363
364
|
name: string;
|
|
364
365
|
featured: boolean;
|
|
365
366
|
blocks: {
|
|
366
|
-
|
|
367
|
+
svgIconKey: string;
|
|
367
368
|
svgIconColor: string;
|
|
368
369
|
title: {
|
|
369
370
|
en: string;
|
|
@@ -389,14 +390,14 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
389
390
|
fa?: string | undefined;
|
|
390
391
|
fr?: string | undefined;
|
|
391
392
|
};
|
|
392
|
-
|
|
393
|
+
svgIconKey: string;
|
|
393
394
|
}[];
|
|
394
395
|
}[];
|
|
395
396
|
}, {
|
|
396
397
|
name: string;
|
|
397
398
|
featured: boolean;
|
|
398
399
|
blocks: {
|
|
399
|
-
|
|
400
|
+
svgIconKey: string;
|
|
400
401
|
svgIconColor: string;
|
|
401
402
|
title: {
|
|
402
403
|
en: string;
|
|
@@ -422,7 +423,7 @@ declare const PlatformAppSchema: z.ZodObject<{
|
|
|
422
423
|
fa?: string | undefined;
|
|
423
424
|
fr?: string | undefined;
|
|
424
425
|
};
|
|
425
|
-
|
|
426
|
+
svgIconKey: string;
|
|
426
427
|
}[];
|
|
427
428
|
}[];
|
|
428
429
|
}>;
|
|
@@ -446,12 +447,12 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
446
447
|
fa?: string | undefined;
|
|
447
448
|
fr?: string | undefined;
|
|
448
449
|
}>;
|
|
449
|
-
|
|
450
|
+
svgIconKey: z.ZodString;
|
|
450
451
|
apps: z.ZodArray<z.ZodObject<{
|
|
451
452
|
name: z.ZodString;
|
|
452
453
|
featured: z.ZodBoolean;
|
|
453
454
|
blocks: z.ZodArray<z.ZodObject<{
|
|
454
|
-
|
|
455
|
+
svgIconKey: z.ZodString;
|
|
455
456
|
svgIconColor: z.ZodEffects<z.ZodString, string, string>;
|
|
456
457
|
title: z.ZodObject<{
|
|
457
458
|
en: z.ZodString;
|
|
@@ -513,7 +514,7 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
513
514
|
fa?: string | undefined;
|
|
514
515
|
fr?: string | undefined;
|
|
515
516
|
}>;
|
|
516
|
-
|
|
517
|
+
svgIconKey: z.ZodString;
|
|
517
518
|
}, "strip", z.ZodTypeAny, {
|
|
518
519
|
type: "external" | "subscriptionLink";
|
|
519
520
|
link: string;
|
|
@@ -524,7 +525,7 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
524
525
|
fa?: string | undefined;
|
|
525
526
|
fr?: string | undefined;
|
|
526
527
|
};
|
|
527
|
-
|
|
528
|
+
svgIconKey: string;
|
|
528
529
|
}, {
|
|
529
530
|
type: "external" | "subscriptionLink";
|
|
530
531
|
link: string;
|
|
@@ -535,10 +536,10 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
535
536
|
fa?: string | undefined;
|
|
536
537
|
fr?: string | undefined;
|
|
537
538
|
};
|
|
538
|
-
|
|
539
|
+
svgIconKey: string;
|
|
539
540
|
}>, "many">;
|
|
540
541
|
}, "strip", z.ZodTypeAny, {
|
|
541
|
-
|
|
542
|
+
svgIconKey: string;
|
|
542
543
|
svgIconColor: string;
|
|
543
544
|
title: {
|
|
544
545
|
en: string;
|
|
@@ -564,10 +565,10 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
564
565
|
fa?: string | undefined;
|
|
565
566
|
fr?: string | undefined;
|
|
566
567
|
};
|
|
567
|
-
|
|
568
|
+
svgIconKey: string;
|
|
568
569
|
}[];
|
|
569
570
|
}, {
|
|
570
|
-
|
|
571
|
+
svgIconKey: string;
|
|
571
572
|
svgIconColor: string;
|
|
572
573
|
title: {
|
|
573
574
|
en: string;
|
|
@@ -593,14 +594,14 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
593
594
|
fa?: string | undefined;
|
|
594
595
|
fr?: string | undefined;
|
|
595
596
|
};
|
|
596
|
-
|
|
597
|
+
svgIconKey: string;
|
|
597
598
|
}[];
|
|
598
599
|
}>, "many">;
|
|
599
600
|
}, "strip", z.ZodTypeAny, {
|
|
600
601
|
name: string;
|
|
601
602
|
featured: boolean;
|
|
602
603
|
blocks: {
|
|
603
|
-
|
|
604
|
+
svgIconKey: string;
|
|
604
605
|
svgIconColor: string;
|
|
605
606
|
title: {
|
|
606
607
|
en: string;
|
|
@@ -626,14 +627,14 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
626
627
|
fa?: string | undefined;
|
|
627
628
|
fr?: string | undefined;
|
|
628
629
|
};
|
|
629
|
-
|
|
630
|
+
svgIconKey: string;
|
|
630
631
|
}[];
|
|
631
632
|
}[];
|
|
632
633
|
}, {
|
|
633
634
|
name: string;
|
|
634
635
|
featured: boolean;
|
|
635
636
|
blocks: {
|
|
636
|
-
|
|
637
|
+
svgIconKey: string;
|
|
637
638
|
svgIconColor: string;
|
|
638
639
|
title: {
|
|
639
640
|
en: string;
|
|
@@ -659,12 +660,12 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
659
660
|
fa?: string | undefined;
|
|
660
661
|
fr?: string | undefined;
|
|
661
662
|
};
|
|
662
|
-
|
|
663
|
+
svgIconKey: string;
|
|
663
664
|
}[];
|
|
664
665
|
}[];
|
|
665
666
|
}>, "many">;
|
|
666
667
|
}, "strip", z.ZodTypeAny, {
|
|
667
|
-
|
|
668
|
+
svgIconKey: string;
|
|
668
669
|
displayName: {
|
|
669
670
|
en: string;
|
|
670
671
|
ru?: string | undefined;
|
|
@@ -676,7 +677,7 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
676
677
|
name: string;
|
|
677
678
|
featured: boolean;
|
|
678
679
|
blocks: {
|
|
679
|
-
|
|
680
|
+
svgIconKey: string;
|
|
680
681
|
svgIconColor: string;
|
|
681
682
|
title: {
|
|
682
683
|
en: string;
|
|
@@ -702,12 +703,12 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
702
703
|
fa?: string | undefined;
|
|
703
704
|
fr?: string | undefined;
|
|
704
705
|
};
|
|
705
|
-
|
|
706
|
+
svgIconKey: string;
|
|
706
707
|
}[];
|
|
707
708
|
}[];
|
|
708
709
|
}[];
|
|
709
710
|
}, {
|
|
710
|
-
|
|
711
|
+
svgIconKey: string;
|
|
711
712
|
displayName: {
|
|
712
713
|
en: string;
|
|
713
714
|
ru?: string | undefined;
|
|
@@ -719,7 +720,7 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
719
720
|
name: string;
|
|
720
721
|
featured: boolean;
|
|
721
722
|
blocks: {
|
|
722
|
-
|
|
723
|
+
svgIconKey: string;
|
|
723
724
|
svgIconColor: string;
|
|
724
725
|
title: {
|
|
725
726
|
en: string;
|
|
@@ -745,7 +746,7 @@ declare const PlatformSchema: z.ZodObject<{
|
|
|
745
746
|
fa?: string | undefined;
|
|
746
747
|
fr?: string | undefined;
|
|
747
748
|
};
|
|
748
|
-
|
|
749
|
+
svgIconKey: string;
|
|
749
750
|
}[];
|
|
750
751
|
}[];
|
|
751
752
|
}[];
|
|
@@ -1035,6 +1036,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1035
1036
|
};
|
|
1036
1037
|
};
|
|
1037
1038
|
}>;
|
|
1039
|
+
svgLibrary: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1038
1040
|
platforms: z.ZodRecord<z.ZodNativeEnum<{
|
|
1039
1041
|
readonly IOS: "ios";
|
|
1040
1042
|
readonly ANDROID: "android";
|
|
@@ -1063,12 +1065,12 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1063
1065
|
fa?: string | undefined;
|
|
1064
1066
|
fr?: string | undefined;
|
|
1065
1067
|
}>;
|
|
1066
|
-
|
|
1068
|
+
svgIconKey: z.ZodString;
|
|
1067
1069
|
apps: z.ZodArray<z.ZodObject<{
|
|
1068
1070
|
name: z.ZodString;
|
|
1069
1071
|
featured: z.ZodBoolean;
|
|
1070
1072
|
blocks: z.ZodArray<z.ZodObject<{
|
|
1071
|
-
|
|
1073
|
+
svgIconKey: z.ZodString;
|
|
1072
1074
|
svgIconColor: z.ZodEffects<z.ZodString, string, string>;
|
|
1073
1075
|
title: z.ZodObject<{
|
|
1074
1076
|
en: z.ZodString;
|
|
@@ -1130,7 +1132,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1130
1132
|
fa?: string | undefined;
|
|
1131
1133
|
fr?: string | undefined;
|
|
1132
1134
|
}>;
|
|
1133
|
-
|
|
1135
|
+
svgIconKey: z.ZodString;
|
|
1134
1136
|
}, "strip", z.ZodTypeAny, {
|
|
1135
1137
|
type: "external" | "subscriptionLink";
|
|
1136
1138
|
link: string;
|
|
@@ -1141,7 +1143,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1141
1143
|
fa?: string | undefined;
|
|
1142
1144
|
fr?: string | undefined;
|
|
1143
1145
|
};
|
|
1144
|
-
|
|
1146
|
+
svgIconKey: string;
|
|
1145
1147
|
}, {
|
|
1146
1148
|
type: "external" | "subscriptionLink";
|
|
1147
1149
|
link: string;
|
|
@@ -1152,10 +1154,10 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1152
1154
|
fa?: string | undefined;
|
|
1153
1155
|
fr?: string | undefined;
|
|
1154
1156
|
};
|
|
1155
|
-
|
|
1157
|
+
svgIconKey: string;
|
|
1156
1158
|
}>, "many">;
|
|
1157
1159
|
}, "strip", z.ZodTypeAny, {
|
|
1158
|
-
|
|
1160
|
+
svgIconKey: string;
|
|
1159
1161
|
svgIconColor: string;
|
|
1160
1162
|
title: {
|
|
1161
1163
|
en: string;
|
|
@@ -1181,10 +1183,10 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1181
1183
|
fa?: string | undefined;
|
|
1182
1184
|
fr?: string | undefined;
|
|
1183
1185
|
};
|
|
1184
|
-
|
|
1186
|
+
svgIconKey: string;
|
|
1185
1187
|
}[];
|
|
1186
1188
|
}, {
|
|
1187
|
-
|
|
1189
|
+
svgIconKey: string;
|
|
1188
1190
|
svgIconColor: string;
|
|
1189
1191
|
title: {
|
|
1190
1192
|
en: string;
|
|
@@ -1210,14 +1212,14 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1210
1212
|
fa?: string | undefined;
|
|
1211
1213
|
fr?: string | undefined;
|
|
1212
1214
|
};
|
|
1213
|
-
|
|
1215
|
+
svgIconKey: string;
|
|
1214
1216
|
}[];
|
|
1215
1217
|
}>, "many">;
|
|
1216
1218
|
}, "strip", z.ZodTypeAny, {
|
|
1217
1219
|
name: string;
|
|
1218
1220
|
featured: boolean;
|
|
1219
1221
|
blocks: {
|
|
1220
|
-
|
|
1222
|
+
svgIconKey: string;
|
|
1221
1223
|
svgIconColor: string;
|
|
1222
1224
|
title: {
|
|
1223
1225
|
en: string;
|
|
@@ -1243,14 +1245,14 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1243
1245
|
fa?: string | undefined;
|
|
1244
1246
|
fr?: string | undefined;
|
|
1245
1247
|
};
|
|
1246
|
-
|
|
1248
|
+
svgIconKey: string;
|
|
1247
1249
|
}[];
|
|
1248
1250
|
}[];
|
|
1249
1251
|
}, {
|
|
1250
1252
|
name: string;
|
|
1251
1253
|
featured: boolean;
|
|
1252
1254
|
blocks: {
|
|
1253
|
-
|
|
1255
|
+
svgIconKey: string;
|
|
1254
1256
|
svgIconColor: string;
|
|
1255
1257
|
title: {
|
|
1256
1258
|
en: string;
|
|
@@ -1276,12 +1278,12 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1276
1278
|
fa?: string | undefined;
|
|
1277
1279
|
fr?: string | undefined;
|
|
1278
1280
|
};
|
|
1279
|
-
|
|
1281
|
+
svgIconKey: string;
|
|
1280
1282
|
}[];
|
|
1281
1283
|
}[];
|
|
1282
1284
|
}>, "many">;
|
|
1283
1285
|
}, "strip", z.ZodTypeAny, {
|
|
1284
|
-
|
|
1286
|
+
svgIconKey: string;
|
|
1285
1287
|
displayName: {
|
|
1286
1288
|
en: string;
|
|
1287
1289
|
ru?: string | undefined;
|
|
@@ -1293,7 +1295,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1293
1295
|
name: string;
|
|
1294
1296
|
featured: boolean;
|
|
1295
1297
|
blocks: {
|
|
1296
|
-
|
|
1298
|
+
svgIconKey: string;
|
|
1297
1299
|
svgIconColor: string;
|
|
1298
1300
|
title: {
|
|
1299
1301
|
en: string;
|
|
@@ -1319,12 +1321,12 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1319
1321
|
fa?: string | undefined;
|
|
1320
1322
|
fr?: string | undefined;
|
|
1321
1323
|
};
|
|
1322
|
-
|
|
1324
|
+
svgIconKey: string;
|
|
1323
1325
|
}[];
|
|
1324
1326
|
}[];
|
|
1325
1327
|
}[];
|
|
1326
1328
|
}, {
|
|
1327
|
-
|
|
1329
|
+
svgIconKey: string;
|
|
1328
1330
|
displayName: {
|
|
1329
1331
|
en: string;
|
|
1330
1332
|
ru?: string | undefined;
|
|
@@ -1336,7 +1338,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1336
1338
|
name: string;
|
|
1337
1339
|
featured: boolean;
|
|
1338
1340
|
blocks: {
|
|
1339
|
-
|
|
1341
|
+
svgIconKey: string;
|
|
1340
1342
|
svgIconColor: string;
|
|
1341
1343
|
title: {
|
|
1342
1344
|
en: string;
|
|
@@ -1362,44 +1364,14 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1362
1364
|
fa?: string | undefined;
|
|
1363
1365
|
fr?: string | undefined;
|
|
1364
1366
|
};
|
|
1365
|
-
|
|
1367
|
+
svgIconKey: string;
|
|
1366
1368
|
}[];
|
|
1367
1369
|
}[];
|
|
1368
1370
|
}[];
|
|
1369
1371
|
}>>;
|
|
1370
1372
|
}, "strip", z.ZodTypeAny, {
|
|
1371
|
-
version: "1";
|
|
1372
|
-
additionalLocales: ("ru" | "zh" | "fa" | "fr")[];
|
|
1373
|
-
brandingSettings: {
|
|
1374
|
-
title: string;
|
|
1375
|
-
logoUrl: string;
|
|
1376
|
-
supportUrl: string;
|
|
1377
|
-
};
|
|
1378
|
-
uiConfig: {
|
|
1379
|
-
subscriptionInfo: {
|
|
1380
|
-
block: "collapsed" | "expanded";
|
|
1381
|
-
};
|
|
1382
|
-
installationGuides: {
|
|
1383
|
-
headerText: {
|
|
1384
|
-
en: string;
|
|
1385
|
-
ru?: string | undefined;
|
|
1386
|
-
zh?: string | undefined;
|
|
1387
|
-
fa?: string | undefined;
|
|
1388
|
-
fr?: string | undefined;
|
|
1389
|
-
};
|
|
1390
|
-
};
|
|
1391
|
-
connectionKeys: {
|
|
1392
|
-
headerText: {
|
|
1393
|
-
en: string;
|
|
1394
|
-
ru?: string | undefined;
|
|
1395
|
-
zh?: string | undefined;
|
|
1396
|
-
fa?: string | undefined;
|
|
1397
|
-
fr?: string | undefined;
|
|
1398
|
-
};
|
|
1399
|
-
};
|
|
1400
|
-
};
|
|
1401
1373
|
platforms: Partial<Record<"ios" | "android" | "linux" | "macos" | "windows" | "androidTV" | "appleTV", {
|
|
1402
|
-
|
|
1374
|
+
svgIconKey: string;
|
|
1403
1375
|
displayName: {
|
|
1404
1376
|
en: string;
|
|
1405
1377
|
ru?: string | undefined;
|
|
@@ -1411,7 +1383,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1411
1383
|
name: string;
|
|
1412
1384
|
featured: boolean;
|
|
1413
1385
|
blocks: {
|
|
1414
|
-
|
|
1386
|
+
svgIconKey: string;
|
|
1415
1387
|
svgIconColor: string;
|
|
1416
1388
|
title: {
|
|
1417
1389
|
en: string;
|
|
@@ -1437,12 +1409,11 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1437
1409
|
fa?: string | undefined;
|
|
1438
1410
|
fr?: string | undefined;
|
|
1439
1411
|
};
|
|
1440
|
-
|
|
1412
|
+
svgIconKey: string;
|
|
1441
1413
|
}[];
|
|
1442
1414
|
}[];
|
|
1443
1415
|
}[];
|
|
1444
1416
|
}>>;
|
|
1445
|
-
}, {
|
|
1446
1417
|
version: "1";
|
|
1447
1418
|
additionalLocales: ("ru" | "zh" | "fa" | "fr")[];
|
|
1448
1419
|
brandingSettings: {
|
|
@@ -1473,8 +1444,10 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1473
1444
|
};
|
|
1474
1445
|
};
|
|
1475
1446
|
};
|
|
1447
|
+
svgLibrary: Record<string, string>;
|
|
1448
|
+
}, {
|
|
1476
1449
|
platforms: Partial<Record<"ios" | "android" | "linux" | "macos" | "windows" | "androidTV" | "appleTV", {
|
|
1477
|
-
|
|
1450
|
+
svgIconKey: string;
|
|
1478
1451
|
displayName: {
|
|
1479
1452
|
en: string;
|
|
1480
1453
|
ru?: string | undefined;
|
|
@@ -1486,7 +1459,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1486
1459
|
name: string;
|
|
1487
1460
|
featured: boolean;
|
|
1488
1461
|
blocks: {
|
|
1489
|
-
|
|
1462
|
+
svgIconKey: string;
|
|
1490
1463
|
svgIconColor: string;
|
|
1491
1464
|
title: {
|
|
1492
1465
|
en: string;
|
|
@@ -1512,12 +1485,11 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1512
1485
|
fa?: string | undefined;
|
|
1513
1486
|
fr?: string | undefined;
|
|
1514
1487
|
};
|
|
1515
|
-
|
|
1488
|
+
svgIconKey: string;
|
|
1516
1489
|
}[];
|
|
1517
1490
|
}[];
|
|
1518
1491
|
}[];
|
|
1519
1492
|
}>>;
|
|
1520
|
-
}>, {
|
|
1521
1493
|
version: "1";
|
|
1522
1494
|
additionalLocales: ("ru" | "zh" | "fa" | "fr")[];
|
|
1523
1495
|
brandingSettings: {
|
|
@@ -1548,8 +1520,10 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1548
1520
|
};
|
|
1549
1521
|
};
|
|
1550
1522
|
};
|
|
1523
|
+
svgLibrary: Record<string, string>;
|
|
1524
|
+
}>, {
|
|
1551
1525
|
platforms: Partial<Record<"ios" | "android" | "linux" | "macos" | "windows" | "androidTV" | "appleTV", {
|
|
1552
|
-
|
|
1526
|
+
svgIconKey: string;
|
|
1553
1527
|
displayName: {
|
|
1554
1528
|
en: string;
|
|
1555
1529
|
ru?: string | undefined;
|
|
@@ -1561,7 +1535,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1561
1535
|
name: string;
|
|
1562
1536
|
featured: boolean;
|
|
1563
1537
|
blocks: {
|
|
1564
|
-
|
|
1538
|
+
svgIconKey: string;
|
|
1565
1539
|
svgIconColor: string;
|
|
1566
1540
|
title: {
|
|
1567
1541
|
en: string;
|
|
@@ -1587,12 +1561,11 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1587
1561
|
fa?: string | undefined;
|
|
1588
1562
|
fr?: string | undefined;
|
|
1589
1563
|
};
|
|
1590
|
-
|
|
1564
|
+
svgIconKey: string;
|
|
1591
1565
|
}[];
|
|
1592
1566
|
}[];
|
|
1593
1567
|
}[];
|
|
1594
1568
|
}>>;
|
|
1595
|
-
}, {
|
|
1596
1569
|
version: "1";
|
|
1597
1570
|
additionalLocales: ("ru" | "zh" | "fa" | "fr")[];
|
|
1598
1571
|
brandingSettings: {
|
|
@@ -1623,8 +1596,10 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1623
1596
|
};
|
|
1624
1597
|
};
|
|
1625
1598
|
};
|
|
1599
|
+
svgLibrary: Record<string, string>;
|
|
1600
|
+
}, {
|
|
1626
1601
|
platforms: Partial<Record<"ios" | "android" | "linux" | "macos" | "windows" | "androidTV" | "appleTV", {
|
|
1627
|
-
|
|
1602
|
+
svgIconKey: string;
|
|
1628
1603
|
displayName: {
|
|
1629
1604
|
en: string;
|
|
1630
1605
|
ru?: string | undefined;
|
|
@@ -1636,7 +1611,7 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1636
1611
|
name: string;
|
|
1637
1612
|
featured: boolean;
|
|
1638
1613
|
blocks: {
|
|
1639
|
-
|
|
1614
|
+
svgIconKey: string;
|
|
1640
1615
|
svgIconColor: string;
|
|
1641
1616
|
title: {
|
|
1642
1617
|
en: string;
|
|
@@ -1662,12 +1637,44 @@ export declare const SubscriptionPageRawConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1662
1637
|
fa?: string | undefined;
|
|
1663
1638
|
fr?: string | undefined;
|
|
1664
1639
|
};
|
|
1665
|
-
|
|
1640
|
+
svgIconKey: string;
|
|
1666
1641
|
}[];
|
|
1667
1642
|
}[];
|
|
1668
1643
|
}[];
|
|
1669
1644
|
}>>;
|
|
1645
|
+
version: "1";
|
|
1646
|
+
additionalLocales: ("ru" | "zh" | "fa" | "fr")[];
|
|
1647
|
+
brandingSettings: {
|
|
1648
|
+
title: string;
|
|
1649
|
+
logoUrl: string;
|
|
1650
|
+
supportUrl: string;
|
|
1651
|
+
};
|
|
1652
|
+
uiConfig: {
|
|
1653
|
+
subscriptionInfo: {
|
|
1654
|
+
block: "collapsed" | "expanded";
|
|
1655
|
+
};
|
|
1656
|
+
installationGuides: {
|
|
1657
|
+
headerText: {
|
|
1658
|
+
en: string;
|
|
1659
|
+
ru?: string | undefined;
|
|
1660
|
+
zh?: string | undefined;
|
|
1661
|
+
fa?: string | undefined;
|
|
1662
|
+
fr?: string | undefined;
|
|
1663
|
+
};
|
|
1664
|
+
};
|
|
1665
|
+
connectionKeys: {
|
|
1666
|
+
headerText: {
|
|
1667
|
+
en: string;
|
|
1668
|
+
ru?: string | undefined;
|
|
1669
|
+
zh?: string | undefined;
|
|
1670
|
+
fa?: string | undefined;
|
|
1671
|
+
fr?: string | undefined;
|
|
1672
|
+
};
|
|
1673
|
+
};
|
|
1674
|
+
};
|
|
1675
|
+
svgLibrary: Record<string, string>;
|
|
1670
1676
|
}>;
|
|
1677
|
+
export type TSubscriptionPageSvgLibrary = z.infer<typeof SvgLibrarySchema>;
|
|
1671
1678
|
export type TSubscriptionPageRawConfig = z.infer<typeof SubscriptionPageRawConfigSchema>;
|
|
1672
1679
|
export type TSubscriptionPageBrandingSettings = z.infer<typeof BrandingSettingsSchema>;
|
|
1673
1680
|
export type TSubscriptionPagePlatformSchema = z.infer<typeof PlatformSchema>;
|
package/build/backend/models/subscription-page-config/subscription-page-config.schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-page-config.schema.d.ts","sourceRoot":"","sources":["../../../../models/subscription-page-config/subscription-page-config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"subscription-page-config.schema.d.ts","sourceRoot":"","sources":["../../../../models/subscription-page-config/subscription-page-config.schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -11,14 +11,15 @@ exports.LocalizedTextSchema = zod_1.z.object({
|
|
|
11
11
|
fa: zod_1.z.string().optional(),
|
|
12
12
|
fr: zod_1.z.string().optional(),
|
|
13
13
|
});
|
|
14
|
+
const SvgLibrarySchema = zod_1.z.record(zod_1.z.string().regex(/^[A-Za-z]+$/, { message: 'Only latin characters, no spaces allowed' }), zod_1.z.string());
|
|
14
15
|
const ButtonSchema = zod_1.z.object({
|
|
15
16
|
link: zod_1.z.string(),
|
|
16
17
|
type: zod_1.z.enum(['external', 'subscriptionLink']),
|
|
17
18
|
text: exports.LocalizedTextSchema,
|
|
18
|
-
|
|
19
|
+
svgIconKey: zod_1.z.string(),
|
|
19
20
|
});
|
|
20
21
|
const BlockSchema = zod_1.z.object({
|
|
21
|
-
|
|
22
|
+
svgIconKey: zod_1.z.string(),
|
|
22
23
|
svgIconColor: zod_1.z
|
|
23
24
|
.string()
|
|
24
25
|
.refine((value) => [
|
|
@@ -50,7 +51,7 @@ const PlatformAppSchema = zod_1.z.object({
|
|
|
50
51
|
});
|
|
51
52
|
const PlatformSchema = zod_1.z.object({
|
|
52
53
|
displayName: exports.LocalizedTextSchema,
|
|
53
|
-
|
|
54
|
+
svgIconKey: zod_1.z.string(),
|
|
54
55
|
apps: zod_1.z.array(PlatformAppSchema),
|
|
55
56
|
});
|
|
56
57
|
const BrandingSettingsSchema = zod_1.z.object({
|
|
@@ -75,8 +76,10 @@ exports.SubscriptionPageRawConfigSchema = zod_1.z
|
|
|
75
76
|
additionalLocales: zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_PAGE_CONFIG_ADDITIONAL_LOCALES)),
|
|
76
77
|
brandingSettings: BrandingSettingsSchema,
|
|
77
78
|
uiConfig: UiConfigSchema,
|
|
79
|
+
svgLibrary: SvgLibrarySchema,
|
|
78
80
|
platforms: zod_1.z.record(zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_PAGE_CONFIG_PLATFORM_TYPES), PlatformSchema),
|
|
79
81
|
})
|
|
80
82
|
.superRefine((data, ctx) => {
|
|
81
83
|
(0, subscription_page_config_validator_1.validateLocalizedTexts)(data.platforms, data.additionalLocales, 'platforms', ctx);
|
|
84
|
+
(0, subscription_page_config_validator_1.validateSvgReferences)(data, ctx);
|
|
82
85
|
});
|
package/build/backend/models/subscription-page-config/subscription-page-config.validator.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { TSubscriptionPageConfigAdditionalLocales } from '../../constants';
|
|
3
3
|
export declare const validateLocalizedTexts: (obj: unknown, requiredLocales: TSubscriptionPageConfigAdditionalLocales[], path: string, ctx: z.RefinementCtx) => void;
|
|
4
|
+
export declare const validateSvgReferences: (data: {
|
|
5
|
+
svgLibrary: Record<string, string>;
|
|
6
|
+
platforms: Record<string, unknown>;
|
|
7
|
+
}, ctx: z.RefinementCtx) => void;
|
|
8
|
+
export declare const cleanLocalizedTexts: <T>(obj: T, activeLocales: TSubscriptionPageConfigAdditionalLocales[]) => T;
|
|
4
9
|
//# sourceMappingURL=subscription-page-config.validator.d.ts.map
|
package/build/backend/models/subscription-page-config/subscription-page-config.validator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-page-config.validator.d.ts","sourceRoot":"","sources":["../../../../models/subscription-page-config/subscription-page-config.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAG3E,eAAO,MAAM,sBAAsB,GAC/B,KAAK,OAAO,EACZ,iBAAiB,wCAAwC,EAAE,EAC3D,MAAM,MAAM,EACZ,KAAK,CAAC,CAAC,aAAa,KACrB,IA0BF,CAAC"}
|
|
1
|
+
{"version":3,"file":"subscription-page-config.validator.d.ts","sourceRoot":"","sources":["../../../../models/subscription-page-config/subscription-page-config.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAG3E,eAAO,MAAM,sBAAsB,GAC/B,KAAK,OAAO,EACZ,iBAAiB,wCAAwC,EAAE,EAC3D,MAAM,MAAM,EACZ,KAAK,CAAC,CAAC,aAAa,KACrB,IA0BF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAC9B,MAAM;IAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAChF,KAAK,CAAC,CAAC,aAAa,KACrB,IAwBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,EACjC,KAAK,CAAC,EACN,eAAe,wCAAwC,EAAE,KAC1D,CA2BF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateLocalizedTexts = void 0;
|
|
3
|
+
exports.cleanLocalizedTexts = exports.validateSvgReferences = exports.validateLocalizedTexts = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const validateLocalizedTexts = (obj, requiredLocales, path, ctx) => {
|
|
6
6
|
if (obj === null || typeof obj !== 'object')
|
|
@@ -30,3 +30,55 @@ const validateLocalizedTexts = (obj, requiredLocales, path, ctx) => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
exports.validateLocalizedTexts = validateLocalizedTexts;
|
|
33
|
+
const validateSvgReferences = (data, ctx) => {
|
|
34
|
+
const validKeys = new Set(Object.keys(data.svgLibrary));
|
|
35
|
+
const checkSvgRef = (obj, path) => {
|
|
36
|
+
if (obj === null || typeof obj !== 'object')
|
|
37
|
+
return;
|
|
38
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
39
|
+
if (key === 'svgIcon' && typeof value === 'string') {
|
|
40
|
+
if (!validKeys.has(value)) {
|
|
41
|
+
ctx.addIssue({
|
|
42
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
43
|
+
message: `Unknown svgIcon '${value}' at ${path}.${key}. Available: ${[...validKeys].join(', ')}`,
|
|
44
|
+
path: [path, key],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (Array.isArray(value)) {
|
|
49
|
+
value.forEach((item, index) => checkSvgRef(item, `${path}.${key}[${index}]`));
|
|
50
|
+
}
|
|
51
|
+
else if (typeof value === 'object' && value !== null) {
|
|
52
|
+
checkSvgRef(value, `${path}.${key}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
checkSvgRef(data.platforms, 'platforms');
|
|
57
|
+
};
|
|
58
|
+
exports.validateSvgReferences = validateSvgReferences;
|
|
59
|
+
const cleanLocalizedTexts = (obj, activeLocales) => {
|
|
60
|
+
if (obj === null || typeof obj !== 'object')
|
|
61
|
+
return obj;
|
|
62
|
+
if ('en' in obj && typeof obj.en === 'string') {
|
|
63
|
+
const allowedKeys = new Set(['en', ...activeLocales]);
|
|
64
|
+
const cleaned = {};
|
|
65
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
66
|
+
if (typeof value === 'string' && allowedKeys.has(key)) {
|
|
67
|
+
const trimmed = value.trim();
|
|
68
|
+
if (trimmed || key === 'en') {
|
|
69
|
+
cleaned[key] = trimmed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return cleaned;
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(obj)) {
|
|
76
|
+
return obj.map((item) => (0, exports.cleanLocalizedTexts)(item, activeLocales));
|
|
77
|
+
}
|
|
78
|
+
const result = {};
|
|
79
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
80
|
+
result[key] = (0, exports.cleanLocalizedTexts)(value, activeLocales);
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
};
|
|
84
|
+
exports.cleanLocalizedTexts = cleanLocalizedTexts;
|
|
@@ -11,14 +11,15 @@ exports.LocalizedTextSchema = zod_1.z.object({
|
|
|
11
11
|
fa: zod_1.z.string().optional(),
|
|
12
12
|
fr: zod_1.z.string().optional(),
|
|
13
13
|
});
|
|
14
|
+
const SvgLibrarySchema = zod_1.z.record(zod_1.z.string().regex(/^[A-Za-z]+$/, { message: 'Only latin characters, no spaces allowed' }), zod_1.z.string());
|
|
14
15
|
const ButtonSchema = zod_1.z.object({
|
|
15
16
|
link: zod_1.z.string(),
|
|
16
17
|
type: zod_1.z.enum(['external', 'subscriptionLink']),
|
|
17
18
|
text: exports.LocalizedTextSchema,
|
|
18
|
-
|
|
19
|
+
svgIconKey: zod_1.z.string(),
|
|
19
20
|
});
|
|
20
21
|
const BlockSchema = zod_1.z.object({
|
|
21
|
-
|
|
22
|
+
svgIconKey: zod_1.z.string(),
|
|
22
23
|
svgIconColor: zod_1.z
|
|
23
24
|
.string()
|
|
24
25
|
.refine((value) => [
|
|
@@ -50,7 +51,7 @@ const PlatformAppSchema = zod_1.z.object({
|
|
|
50
51
|
});
|
|
51
52
|
const PlatformSchema = zod_1.z.object({
|
|
52
53
|
displayName: exports.LocalizedTextSchema,
|
|
53
|
-
|
|
54
|
+
svgIconKey: zod_1.z.string(),
|
|
54
55
|
apps: zod_1.z.array(PlatformAppSchema),
|
|
55
56
|
});
|
|
56
57
|
const BrandingSettingsSchema = zod_1.z.object({
|
|
@@ -75,8 +76,10 @@ exports.SubscriptionPageRawConfigSchema = zod_1.z
|
|
|
75
76
|
additionalLocales: zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_PAGE_CONFIG_ADDITIONAL_LOCALES)),
|
|
76
77
|
brandingSettings: BrandingSettingsSchema,
|
|
77
78
|
uiConfig: UiConfigSchema,
|
|
79
|
+
svgLibrary: SvgLibrarySchema,
|
|
78
80
|
platforms: zod_1.z.record(zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_PAGE_CONFIG_PLATFORM_TYPES), PlatformSchema),
|
|
79
81
|
})
|
|
80
82
|
.superRefine((data, ctx) => {
|
|
81
83
|
(0, subscription_page_config_validator_1.validateLocalizedTexts)(data.platforms, data.additionalLocales, 'platforms', ctx);
|
|
84
|
+
(0, subscription_page_config_validator_1.validateSvgReferences)(data, ctx);
|
|
82
85
|
});
|
package/build/frontend/models/subscription-page-config/subscription-page-config.validator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateLocalizedTexts = void 0;
|
|
3
|
+
exports.cleanLocalizedTexts = exports.validateSvgReferences = exports.validateLocalizedTexts = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const validateLocalizedTexts = (obj, requiredLocales, path, ctx) => {
|
|
6
6
|
if (obj === null || typeof obj !== 'object')
|
|
@@ -30,3 +30,55 @@ const validateLocalizedTexts = (obj, requiredLocales, path, ctx) => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
exports.validateLocalizedTexts = validateLocalizedTexts;
|
|
33
|
+
const validateSvgReferences = (data, ctx) => {
|
|
34
|
+
const validKeys = new Set(Object.keys(data.svgLibrary));
|
|
35
|
+
const checkSvgRef = (obj, path) => {
|
|
36
|
+
if (obj === null || typeof obj !== 'object')
|
|
37
|
+
return;
|
|
38
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
39
|
+
if (key === 'svgIcon' && typeof value === 'string') {
|
|
40
|
+
if (!validKeys.has(value)) {
|
|
41
|
+
ctx.addIssue({
|
|
42
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
43
|
+
message: `Unknown svgIcon '${value}' at ${path}.${key}. Available: ${[...validKeys].join(', ')}`,
|
|
44
|
+
path: [path, key],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (Array.isArray(value)) {
|
|
49
|
+
value.forEach((item, index) => checkSvgRef(item, `${path}.${key}[${index}]`));
|
|
50
|
+
}
|
|
51
|
+
else if (typeof value === 'object' && value !== null) {
|
|
52
|
+
checkSvgRef(value, `${path}.${key}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
checkSvgRef(data.platforms, 'platforms');
|
|
57
|
+
};
|
|
58
|
+
exports.validateSvgReferences = validateSvgReferences;
|
|
59
|
+
const cleanLocalizedTexts = (obj, activeLocales) => {
|
|
60
|
+
if (obj === null || typeof obj !== 'object')
|
|
61
|
+
return obj;
|
|
62
|
+
if ('en' in obj && typeof obj.en === 'string') {
|
|
63
|
+
const allowedKeys = new Set(['en', ...activeLocales]);
|
|
64
|
+
const cleaned = {};
|
|
65
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
66
|
+
if (typeof value === 'string' && allowedKeys.has(key)) {
|
|
67
|
+
const trimmed = value.trim();
|
|
68
|
+
if (trimmed || key === 'en') {
|
|
69
|
+
cleaned[key] = trimmed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return cleaned;
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(obj)) {
|
|
76
|
+
return obj.map((item) => (0, exports.cleanLocalizedTexts)(item, activeLocales));
|
|
77
|
+
}
|
|
78
|
+
const result = {};
|
|
79
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
80
|
+
result[key] = (0, exports.cleanLocalizedTexts)(value, activeLocales);
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
};
|
|
84
|
+
exports.cleanLocalizedTexts = cleanLocalizedTexts;
|