@milaboratories/pl-model-middle-layer 1.7.48 → 1.7.50
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/block_meta/block_description.d.ts +10 -0
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +15 -0
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_meta.d.ts +38 -0
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_registry/overview.d.ts +26 -0
- package/dist/block_registry/overview.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/block_meta/block_meta.ts +4 -0
|
@@ -229,6 +229,7 @@ export declare const BlockPackDescriptionFromPackageJsonRaw: z.ZodObject<{
|
|
|
229
229
|
} | undefined;
|
|
230
230
|
}>;
|
|
231
231
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
232
233
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
233
234
|
}, "strip", z.ZodTypeAny, {
|
|
234
235
|
organization: {
|
|
@@ -284,6 +285,7 @@ export declare const BlockPackDescriptionFromPackageJsonRaw: z.ZodObject<{
|
|
|
284
285
|
support?: string | undefined;
|
|
285
286
|
tags?: string[] | undefined;
|
|
286
287
|
marketplaceRanking?: number | undefined;
|
|
288
|
+
deprecated?: boolean | undefined;
|
|
287
289
|
termsOfServiceUrl?: string | undefined;
|
|
288
290
|
}, {
|
|
289
291
|
organization: {
|
|
@@ -339,6 +341,7 @@ export declare const BlockPackDescriptionFromPackageJsonRaw: z.ZodObject<{
|
|
|
339
341
|
support?: string | undefined;
|
|
340
342
|
tags?: string[] | undefined;
|
|
341
343
|
marketplaceRanking?: number | undefined;
|
|
344
|
+
deprecated?: boolean | undefined;
|
|
342
345
|
termsOfServiceUrl?: string | undefined;
|
|
343
346
|
}>;
|
|
344
347
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -404,6 +407,7 @@ export declare const BlockPackDescriptionFromPackageJsonRaw: z.ZodObject<{
|
|
|
404
407
|
support?: string | undefined;
|
|
405
408
|
tags?: string[] | undefined;
|
|
406
409
|
marketplaceRanking?: number | undefined;
|
|
410
|
+
deprecated?: boolean | undefined;
|
|
407
411
|
termsOfServiceUrl?: string | undefined;
|
|
408
412
|
};
|
|
409
413
|
}, {
|
|
@@ -469,6 +473,7 @@ export declare const BlockPackDescriptionFromPackageJsonRaw: z.ZodObject<{
|
|
|
469
473
|
support?: string | undefined;
|
|
470
474
|
tags?: string[] | undefined;
|
|
471
475
|
marketplaceRanking?: number | undefined;
|
|
476
|
+
deprecated?: boolean | undefined;
|
|
472
477
|
termsOfServiceUrl?: string | undefined;
|
|
473
478
|
};
|
|
474
479
|
}>;
|
|
@@ -797,6 +802,7 @@ export declare const BlockPackDescriptionRaw: z.ZodObject<{
|
|
|
797
802
|
} | undefined;
|
|
798
803
|
}>;
|
|
799
804
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
805
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
800
806
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
801
807
|
}, "strip", z.ZodTypeAny, {
|
|
802
808
|
organization: {
|
|
@@ -852,6 +858,7 @@ export declare const BlockPackDescriptionRaw: z.ZodObject<{
|
|
|
852
858
|
support?: string | undefined;
|
|
853
859
|
tags?: string[] | undefined;
|
|
854
860
|
marketplaceRanking?: number | undefined;
|
|
861
|
+
deprecated?: boolean | undefined;
|
|
855
862
|
termsOfServiceUrl?: string | undefined;
|
|
856
863
|
}, {
|
|
857
864
|
organization: {
|
|
@@ -907,6 +914,7 @@ export declare const BlockPackDescriptionRaw: z.ZodObject<{
|
|
|
907
914
|
support?: string | undefined;
|
|
908
915
|
tags?: string[] | undefined;
|
|
909
916
|
marketplaceRanking?: number | undefined;
|
|
917
|
+
deprecated?: boolean | undefined;
|
|
910
918
|
termsOfServiceUrl?: string | undefined;
|
|
911
919
|
}>;
|
|
912
920
|
featureFlags: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>, BlockCodeKnownFeatureFlags, Record<string, number | boolean>>>;
|
|
@@ -973,6 +981,7 @@ export declare const BlockPackDescriptionRaw: z.ZodObject<{
|
|
|
973
981
|
support?: string | undefined;
|
|
974
982
|
tags?: string[] | undefined;
|
|
975
983
|
marketplaceRanking?: number | undefined;
|
|
984
|
+
deprecated?: boolean | undefined;
|
|
976
985
|
termsOfServiceUrl?: string | undefined;
|
|
977
986
|
};
|
|
978
987
|
id: {
|
|
@@ -1044,6 +1053,7 @@ export declare const BlockPackDescriptionRaw: z.ZodObject<{
|
|
|
1044
1053
|
support?: string | undefined;
|
|
1045
1054
|
tags?: string[] | undefined;
|
|
1046
1055
|
marketplaceRanking?: number | undefined;
|
|
1056
|
+
deprecated?: boolean | undefined;
|
|
1047
1057
|
termsOfServiceUrl?: string | undefined;
|
|
1048
1058
|
};
|
|
1049
1059
|
id: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_description.d.ts","sourceRoot":"","sources":["../../src/block_meta/block_description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;qDAEqD;AACrD,eAAO,MAAM,sCAAsC
|
|
1
|
+
{"version":3,"file":"block_description.d.ts","sourceRoot":"","sources":["../../src/block_meta/block_description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGpC,OAAO,EAAE,WAAW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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,wBAAgB,0BAA0B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,WAAW,CAAA;CAAE,EACtE,QAAQ,EAAE,CAAC,EACX,UAAU,EAAE,MAAM,GACjB,CAAC,CAEH"}
|
|
@@ -242,6 +242,7 @@ export declare const BlockPackMetaManifest: z.ZodObject<{
|
|
|
242
242
|
} | undefined;
|
|
243
243
|
}>;
|
|
244
244
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
245
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
245
246
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
246
247
|
}, "strip", z.ZodTypeAny, {
|
|
247
248
|
organization: {
|
|
@@ -285,6 +286,7 @@ export declare const BlockPackMetaManifest: z.ZodObject<{
|
|
|
285
286
|
support?: string | undefined;
|
|
286
287
|
tags?: string[] | undefined;
|
|
287
288
|
marketplaceRanking?: number | undefined;
|
|
289
|
+
deprecated?: boolean | undefined;
|
|
288
290
|
termsOfServiceUrl?: string | undefined;
|
|
289
291
|
}, {
|
|
290
292
|
organization: {
|
|
@@ -328,6 +330,7 @@ export declare const BlockPackMetaManifest: z.ZodObject<{
|
|
|
328
330
|
support?: string | undefined;
|
|
329
331
|
tags?: string[] | undefined;
|
|
330
332
|
marketplaceRanking?: number | undefined;
|
|
333
|
+
deprecated?: boolean | undefined;
|
|
331
334
|
termsOfServiceUrl?: string | undefined;
|
|
332
335
|
}>;
|
|
333
336
|
export type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;
|
|
@@ -586,6 +589,7 @@ export declare const BlockPackDescriptionManifest: z.ZodObject<{
|
|
|
586
589
|
} | undefined;
|
|
587
590
|
}>;
|
|
588
591
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
592
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
589
593
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
590
594
|
}, "strip", z.ZodTypeAny, {
|
|
591
595
|
organization: {
|
|
@@ -629,6 +633,7 @@ export declare const BlockPackDescriptionManifest: z.ZodObject<{
|
|
|
629
633
|
support?: string | undefined;
|
|
630
634
|
tags?: string[] | undefined;
|
|
631
635
|
marketplaceRanking?: number | undefined;
|
|
636
|
+
deprecated?: boolean | undefined;
|
|
632
637
|
termsOfServiceUrl?: string | undefined;
|
|
633
638
|
}, {
|
|
634
639
|
organization: {
|
|
@@ -672,6 +677,7 @@ export declare const BlockPackDescriptionManifest: z.ZodObject<{
|
|
|
672
677
|
support?: string | undefined;
|
|
673
678
|
tags?: string[] | undefined;
|
|
674
679
|
marketplaceRanking?: number | undefined;
|
|
680
|
+
deprecated?: boolean | undefined;
|
|
675
681
|
termsOfServiceUrl?: string | undefined;
|
|
676
682
|
}>;
|
|
677
683
|
featureFlags: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>, BlockCodeKnownFeatureFlags, Record<string, number | boolean>>>;
|
|
@@ -735,6 +741,7 @@ export declare const BlockPackDescriptionManifest: z.ZodObject<{
|
|
|
735
741
|
support?: string | undefined;
|
|
736
742
|
tags?: string[] | undefined;
|
|
737
743
|
marketplaceRanking?: number | undefined;
|
|
744
|
+
deprecated?: boolean | undefined;
|
|
738
745
|
termsOfServiceUrl?: string | undefined;
|
|
739
746
|
};
|
|
740
747
|
id: {
|
|
@@ -806,6 +813,7 @@ export declare const BlockPackDescriptionManifest: z.ZodObject<{
|
|
|
806
813
|
support?: string | undefined;
|
|
807
814
|
tags?: string[] | undefined;
|
|
808
815
|
marketplaceRanking?: number | undefined;
|
|
816
|
+
deprecated?: boolean | undefined;
|
|
809
817
|
termsOfServiceUrl?: string | undefined;
|
|
810
818
|
};
|
|
811
819
|
id: {
|
|
@@ -1087,6 +1095,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1087
1095
|
} | undefined;
|
|
1088
1096
|
}>;
|
|
1089
1097
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
1098
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
1090
1099
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
1091
1100
|
}, "strip", z.ZodTypeAny, {
|
|
1092
1101
|
organization: {
|
|
@@ -1130,6 +1139,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1130
1139
|
support?: string | undefined;
|
|
1131
1140
|
tags?: string[] | undefined;
|
|
1132
1141
|
marketplaceRanking?: number | undefined;
|
|
1142
|
+
deprecated?: boolean | undefined;
|
|
1133
1143
|
termsOfServiceUrl?: string | undefined;
|
|
1134
1144
|
}, {
|
|
1135
1145
|
organization: {
|
|
@@ -1173,6 +1183,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1173
1183
|
support?: string | undefined;
|
|
1174
1184
|
tags?: string[] | undefined;
|
|
1175
1185
|
marketplaceRanking?: number | undefined;
|
|
1186
|
+
deprecated?: boolean | undefined;
|
|
1176
1187
|
termsOfServiceUrl?: string | undefined;
|
|
1177
1188
|
}>;
|
|
1178
1189
|
featureFlags: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>, BlockCodeKnownFeatureFlags, Record<string, number | boolean>>>;
|
|
@@ -1236,6 +1247,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1236
1247
|
support?: string | undefined;
|
|
1237
1248
|
tags?: string[] | undefined;
|
|
1238
1249
|
marketplaceRanking?: number | undefined;
|
|
1250
|
+
deprecated?: boolean | undefined;
|
|
1239
1251
|
termsOfServiceUrl?: string | undefined;
|
|
1240
1252
|
};
|
|
1241
1253
|
id: {
|
|
@@ -1307,6 +1319,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1307
1319
|
support?: string | undefined;
|
|
1308
1320
|
tags?: string[] | undefined;
|
|
1309
1321
|
marketplaceRanking?: number | undefined;
|
|
1322
|
+
deprecated?: boolean | undefined;
|
|
1310
1323
|
termsOfServiceUrl?: string | undefined;
|
|
1311
1324
|
};
|
|
1312
1325
|
id: {
|
|
@@ -1391,6 +1404,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1391
1404
|
support?: string | undefined;
|
|
1392
1405
|
tags?: string[] | undefined;
|
|
1393
1406
|
marketplaceRanking?: number | undefined;
|
|
1407
|
+
deprecated?: boolean | undefined;
|
|
1394
1408
|
termsOfServiceUrl?: string | undefined;
|
|
1395
1409
|
};
|
|
1396
1410
|
id: {
|
|
@@ -1471,6 +1485,7 @@ export declare const BlockPackManifest: z.ZodObject<{
|
|
|
1471
1485
|
support?: string | undefined;
|
|
1472
1486
|
tags?: string[] | undefined;
|
|
1473
1487
|
marketplaceRanking?: number | undefined;
|
|
1488
|
+
deprecated?: boolean | undefined;
|
|
1474
1489
|
termsOfServiceUrl?: string | undefined;
|
|
1475
1490
|
};
|
|
1476
1491
|
id: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_manifest.d.ts","sourceRoot":"","sources":["../../src/block_meta/block_manifest.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAAE,WAAW,EAAE,MAAM,YAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,WAAW,EAAE;QAAE,EAAE,EAAE,WAAW,CAAA;KAAE,CAAA;CAAE,EACpF,QAAQ,EAAE,CAAC,EACX,UAAU,EAAE,MAAM,GACjB,CAAC,CAEH"}
|
|
@@ -35,6 +35,10 @@ export declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny,
|
|
|
35
35
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
36
36
|
*/
|
|
37
37
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
/**
|
|
39
|
+
* If true, the block is deprecated and should not be used.
|
|
40
|
+
*/
|
|
41
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
38
42
|
/**
|
|
39
43
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
40
44
|
*/
|
|
@@ -75,6 +79,10 @@ export declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny,
|
|
|
75
79
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
76
80
|
*/
|
|
77
81
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
/**
|
|
83
|
+
* If true, the block is deprecated and should not be used.
|
|
84
|
+
*/
|
|
85
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
78
86
|
/**
|
|
79
87
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
80
88
|
*/
|
|
@@ -115,6 +123,10 @@ export declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny,
|
|
|
115
123
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
116
124
|
*/
|
|
117
125
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
/**
|
|
127
|
+
* If true, the block is deprecated and should not be used.
|
|
128
|
+
*/
|
|
129
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
118
130
|
/**
|
|
119
131
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
120
132
|
*/
|
|
@@ -155,6 +167,10 @@ export declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny,
|
|
|
155
167
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
156
168
|
*/
|
|
157
169
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
/**
|
|
171
|
+
* If true, the block is deprecated and should not be used.
|
|
172
|
+
*/
|
|
173
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
158
174
|
/**
|
|
159
175
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
160
176
|
*/
|
|
@@ -195,6 +211,10 @@ export declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny,
|
|
|
195
211
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
196
212
|
*/
|
|
197
213
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
/**
|
|
215
|
+
* If true, the block is deprecated and should not be used.
|
|
216
|
+
*/
|
|
217
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
198
218
|
/**
|
|
199
219
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
200
220
|
*/
|
|
@@ -388,6 +408,10 @@ export declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
388
408
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
389
409
|
*/
|
|
390
410
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
411
|
+
/**
|
|
412
|
+
* If true, the block is deprecated and should not be used.
|
|
413
|
+
*/
|
|
414
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
391
415
|
/**
|
|
392
416
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
393
417
|
*/
|
|
@@ -446,6 +470,7 @@ export declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
446
470
|
support?: string | undefined;
|
|
447
471
|
tags?: string[] | undefined;
|
|
448
472
|
marketplaceRanking?: number | undefined;
|
|
473
|
+
deprecated?: boolean | undefined;
|
|
449
474
|
termsOfServiceUrl?: string | undefined;
|
|
450
475
|
}, {
|
|
451
476
|
organization: {
|
|
@@ -501,6 +526,7 @@ export declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
501
526
|
support?: string | undefined;
|
|
502
527
|
tags?: string[] | undefined;
|
|
503
528
|
marketplaceRanking?: number | undefined;
|
|
529
|
+
deprecated?: boolean | undefined;
|
|
504
530
|
termsOfServiceUrl?: string | undefined;
|
|
505
531
|
}>;
|
|
506
532
|
export type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;
|
|
@@ -564,6 +590,10 @@ export declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
564
590
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
565
591
|
*/
|
|
566
592
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
593
|
+
/**
|
|
594
|
+
* If true, the block is deprecated and should not be used.
|
|
595
|
+
*/
|
|
596
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
567
597
|
/**
|
|
568
598
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
569
599
|
*/
|
|
@@ -592,6 +622,7 @@ export declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
592
622
|
support?: string | undefined;
|
|
593
623
|
tags?: string[] | undefined;
|
|
594
624
|
marketplaceRanking?: number | undefined;
|
|
625
|
+
deprecated?: boolean | undefined;
|
|
595
626
|
termsOfServiceUrl?: string | undefined;
|
|
596
627
|
}, {
|
|
597
628
|
organization: {
|
|
@@ -617,6 +648,7 @@ export declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
617
648
|
support?: string | undefined;
|
|
618
649
|
tags?: string[] | undefined;
|
|
619
650
|
marketplaceRanking?: number | undefined;
|
|
651
|
+
deprecated?: boolean | undefined;
|
|
620
652
|
termsOfServiceUrl?: string | undefined;
|
|
621
653
|
}>;
|
|
622
654
|
export type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;
|
|
@@ -680,6 +712,10 @@ export declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
680
712
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
681
713
|
*/
|
|
682
714
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
715
|
+
/**
|
|
716
|
+
* If true, the block is deprecated and should not be used.
|
|
717
|
+
*/
|
|
718
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
683
719
|
/**
|
|
684
720
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
685
721
|
*/
|
|
@@ -708,6 +744,7 @@ export declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
708
744
|
support?: string | undefined;
|
|
709
745
|
tags?: string[] | undefined;
|
|
710
746
|
marketplaceRanking?: number | undefined;
|
|
747
|
+
deprecated?: boolean | undefined;
|
|
711
748
|
termsOfServiceUrl?: string | undefined;
|
|
712
749
|
}, {
|
|
713
750
|
organization: {
|
|
@@ -733,6 +770,7 @@ export declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
733
770
|
support?: string | undefined;
|
|
734
771
|
tags?: string[] | undefined;
|
|
735
772
|
marketplaceRanking?: number | undefined;
|
|
773
|
+
deprecated?: boolean | undefined;
|
|
736
774
|
termsOfServiceUrl?: string | undefined;
|
|
737
775
|
}>;
|
|
738
776
|
export type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_meta.d.ts","sourceRoot":"","sources":["../../src/block_meta/block_meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,wBAAgB,aAAa,CAC3B,KAAK,CAAC,cAAc,SAAS,CAAC,CAAC,UAAU,EACzC,KAAK,CAAC,UAAU,SAAS,CAAC,CAAC,UAAU,EACrC,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgB5C;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"block_meta.d.ts","sourceRoot":"","sources":["../../src/block_meta/block_meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,wBAAgB,aAAa,CAC3B,KAAK,CAAC,cAAc,SAAS,CAAC,CAAC,UAAU,EACzC,KAAK,CAAC,UAAU,SAAS,CAAC,CAAC,UAAU,EACrC,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgB5C;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;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;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBN,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -74,6 +74,7 @@ export declare const BlockPackOverviewLegacy: z.ZodObject<{
|
|
|
74
74
|
} | undefined;
|
|
75
75
|
}>;
|
|
76
76
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
77
78
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
78
79
|
}, "strip", z.ZodTypeAny, {
|
|
79
80
|
organization: {
|
|
@@ -99,6 +100,7 @@ export declare const BlockPackOverviewLegacy: z.ZodObject<{
|
|
|
99
100
|
support?: string | undefined;
|
|
100
101
|
tags?: string[] | undefined;
|
|
101
102
|
marketplaceRanking?: number | undefined;
|
|
103
|
+
deprecated?: boolean | undefined;
|
|
102
104
|
termsOfServiceUrl?: string | undefined;
|
|
103
105
|
}, {
|
|
104
106
|
organization: {
|
|
@@ -124,6 +126,7 @@ export declare const BlockPackOverviewLegacy: z.ZodObject<{
|
|
|
124
126
|
support?: string | undefined;
|
|
125
127
|
tags?: string[] | undefined;
|
|
126
128
|
marketplaceRanking?: number | undefined;
|
|
129
|
+
deprecated?: boolean | undefined;
|
|
127
130
|
termsOfServiceUrl?: string | undefined;
|
|
128
131
|
}>;
|
|
129
132
|
spec: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -244,6 +247,7 @@ export declare const BlockPackOverviewLegacy: z.ZodObject<{
|
|
|
244
247
|
support?: string | undefined;
|
|
245
248
|
tags?: string[] | undefined;
|
|
246
249
|
marketplaceRanking?: number | undefined;
|
|
250
|
+
deprecated?: boolean | undefined;
|
|
247
251
|
termsOfServiceUrl?: string | undefined;
|
|
248
252
|
};
|
|
249
253
|
id: {
|
|
@@ -304,6 +308,7 @@ export declare const BlockPackOverviewLegacy: z.ZodObject<{
|
|
|
304
308
|
support?: string | undefined;
|
|
305
309
|
tags?: string[] | undefined;
|
|
306
310
|
marketplaceRanking?: number | undefined;
|
|
311
|
+
deprecated?: boolean | undefined;
|
|
307
312
|
termsOfServiceUrl?: string | undefined;
|
|
308
313
|
};
|
|
309
314
|
id: {
|
|
@@ -426,6 +431,7 @@ export declare const SingleBlockPackOverview: z.ZodObject<{
|
|
|
426
431
|
} | undefined;
|
|
427
432
|
}>;
|
|
428
433
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
434
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
429
435
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
430
436
|
}, "strip", z.ZodTypeAny, {
|
|
431
437
|
organization: {
|
|
@@ -451,6 +457,7 @@ export declare const SingleBlockPackOverview: z.ZodObject<{
|
|
|
451
457
|
support?: string | undefined;
|
|
452
458
|
tags?: string[] | undefined;
|
|
453
459
|
marketplaceRanking?: number | undefined;
|
|
460
|
+
deprecated?: boolean | undefined;
|
|
454
461
|
termsOfServiceUrl?: string | undefined;
|
|
455
462
|
}, {
|
|
456
463
|
organization: {
|
|
@@ -476,6 +483,7 @@ export declare const SingleBlockPackOverview: z.ZodObject<{
|
|
|
476
483
|
support?: string | undefined;
|
|
477
484
|
tags?: string[] | undefined;
|
|
478
485
|
marketplaceRanking?: number | undefined;
|
|
486
|
+
deprecated?: boolean | undefined;
|
|
479
487
|
termsOfServiceUrl?: string | undefined;
|
|
480
488
|
}>;
|
|
481
489
|
featureFlags: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>, BlockCodeKnownFeatureFlags, Record<string, number | boolean>>>;
|
|
@@ -596,6 +604,7 @@ export declare const SingleBlockPackOverview: z.ZodObject<{
|
|
|
596
604
|
support?: string | undefined;
|
|
597
605
|
tags?: string[] | undefined;
|
|
598
606
|
marketplaceRanking?: number | undefined;
|
|
607
|
+
deprecated?: boolean | undefined;
|
|
599
608
|
termsOfServiceUrl?: string | undefined;
|
|
600
609
|
};
|
|
601
610
|
id: {
|
|
@@ -655,6 +664,7 @@ export declare const SingleBlockPackOverview: z.ZodObject<{
|
|
|
655
664
|
support?: string | undefined;
|
|
656
665
|
tags?: string[] | undefined;
|
|
657
666
|
marketplaceRanking?: number | undefined;
|
|
667
|
+
deprecated?: boolean | undefined;
|
|
658
668
|
termsOfServiceUrl?: string | undefined;
|
|
659
669
|
};
|
|
660
670
|
id: {
|
|
@@ -776,6 +786,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
776
786
|
} | undefined;
|
|
777
787
|
}>;
|
|
778
788
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
789
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
779
790
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
780
791
|
}, "strip", z.ZodTypeAny, {
|
|
781
792
|
organization: {
|
|
@@ -801,6 +812,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
801
812
|
support?: string | undefined;
|
|
802
813
|
tags?: string[] | undefined;
|
|
803
814
|
marketplaceRanking?: number | undefined;
|
|
815
|
+
deprecated?: boolean | undefined;
|
|
804
816
|
termsOfServiceUrl?: string | undefined;
|
|
805
817
|
}, {
|
|
806
818
|
organization: {
|
|
@@ -826,6 +838,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
826
838
|
support?: string | undefined;
|
|
827
839
|
tags?: string[] | undefined;
|
|
828
840
|
marketplaceRanking?: number | undefined;
|
|
841
|
+
deprecated?: boolean | undefined;
|
|
829
842
|
termsOfServiceUrl?: string | undefined;
|
|
830
843
|
}>;
|
|
831
844
|
featureFlags: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>, BlockCodeKnownFeatureFlags, Record<string, number | boolean>>>;
|
|
@@ -946,6 +959,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
946
959
|
support?: string | undefined;
|
|
947
960
|
tags?: string[] | undefined;
|
|
948
961
|
marketplaceRanking?: number | undefined;
|
|
962
|
+
deprecated?: boolean | undefined;
|
|
949
963
|
termsOfServiceUrl?: string | undefined;
|
|
950
964
|
};
|
|
951
965
|
id: {
|
|
@@ -1005,6 +1019,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
1005
1019
|
support?: string | undefined;
|
|
1006
1020
|
tags?: string[] | undefined;
|
|
1007
1021
|
marketplaceRanking?: number | undefined;
|
|
1022
|
+
deprecated?: boolean | undefined;
|
|
1008
1023
|
termsOfServiceUrl?: string | undefined;
|
|
1009
1024
|
};
|
|
1010
1025
|
id: {
|
|
@@ -1082,6 +1097,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
1082
1097
|
support?: string | undefined;
|
|
1083
1098
|
tags?: string[] | undefined;
|
|
1084
1099
|
marketplaceRanking?: number | undefined;
|
|
1100
|
+
deprecated?: boolean | undefined;
|
|
1085
1101
|
termsOfServiceUrl?: string | undefined;
|
|
1086
1102
|
};
|
|
1087
1103
|
id: {
|
|
@@ -1152,6 +1168,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
1152
1168
|
support?: string | undefined;
|
|
1153
1169
|
tags?: string[] | undefined;
|
|
1154
1170
|
marketplaceRanking?: number | undefined;
|
|
1171
|
+
deprecated?: boolean | undefined;
|
|
1155
1172
|
termsOfServiceUrl?: string | undefined;
|
|
1156
1173
|
};
|
|
1157
1174
|
id: {
|
|
@@ -1401,6 +1418,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1401
1418
|
} | undefined;
|
|
1402
1419
|
}>;
|
|
1403
1420
|
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
1421
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
1404
1422
|
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
1405
1423
|
}, "strip", z.ZodTypeAny, {
|
|
1406
1424
|
organization: {
|
|
@@ -1426,6 +1444,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1426
1444
|
support?: string | undefined;
|
|
1427
1445
|
tags?: string[] | undefined;
|
|
1428
1446
|
marketplaceRanking?: number | undefined;
|
|
1447
|
+
deprecated?: boolean | undefined;
|
|
1429
1448
|
termsOfServiceUrl?: string | undefined;
|
|
1430
1449
|
}, {
|
|
1431
1450
|
organization: {
|
|
@@ -1451,6 +1470,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1451
1470
|
support?: string | undefined;
|
|
1452
1471
|
tags?: string[] | undefined;
|
|
1453
1472
|
marketplaceRanking?: number | undefined;
|
|
1473
|
+
deprecated?: boolean | undefined;
|
|
1454
1474
|
termsOfServiceUrl?: string | undefined;
|
|
1455
1475
|
}>;
|
|
1456
1476
|
featureFlags: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>, BlockCodeKnownFeatureFlags, Record<string, number | boolean>>>;
|
|
@@ -1571,6 +1591,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1571
1591
|
support?: string | undefined;
|
|
1572
1592
|
tags?: string[] | undefined;
|
|
1573
1593
|
marketplaceRanking?: number | undefined;
|
|
1594
|
+
deprecated?: boolean | undefined;
|
|
1574
1595
|
termsOfServiceUrl?: string | undefined;
|
|
1575
1596
|
};
|
|
1576
1597
|
id: {
|
|
@@ -1630,6 +1651,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1630
1651
|
support?: string | undefined;
|
|
1631
1652
|
tags?: string[] | undefined;
|
|
1632
1653
|
marketplaceRanking?: number | undefined;
|
|
1654
|
+
deprecated?: boolean | undefined;
|
|
1633
1655
|
termsOfServiceUrl?: string | undefined;
|
|
1634
1656
|
};
|
|
1635
1657
|
id: {
|
|
@@ -1707,6 +1729,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1707
1729
|
support?: string | undefined;
|
|
1708
1730
|
tags?: string[] | undefined;
|
|
1709
1731
|
marketplaceRanking?: number | undefined;
|
|
1732
|
+
deprecated?: boolean | undefined;
|
|
1710
1733
|
termsOfServiceUrl?: string | undefined;
|
|
1711
1734
|
};
|
|
1712
1735
|
id: {
|
|
@@ -1777,6 +1800,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1777
1800
|
support?: string | undefined;
|
|
1778
1801
|
tags?: string[] | undefined;
|
|
1779
1802
|
marketplaceRanking?: number | undefined;
|
|
1803
|
+
deprecated?: boolean | undefined;
|
|
1780
1804
|
termsOfServiceUrl?: string | undefined;
|
|
1781
1805
|
};
|
|
1782
1806
|
id: {
|
|
@@ -1864,6 +1888,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1864
1888
|
support?: string | undefined;
|
|
1865
1889
|
tags?: string[] | undefined;
|
|
1866
1890
|
marketplaceRanking?: number | undefined;
|
|
1891
|
+
deprecated?: boolean | undefined;
|
|
1867
1892
|
termsOfServiceUrl?: string | undefined;
|
|
1868
1893
|
};
|
|
1869
1894
|
id: {
|
|
@@ -1951,6 +1976,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
1951
1976
|
support?: string | undefined;
|
|
1952
1977
|
tags?: string[] | undefined;
|
|
1953
1978
|
marketplaceRanking?: number | undefined;
|
|
1979
|
+
deprecated?: boolean | undefined;
|
|
1954
1980
|
termsOfServiceUrl?: string | undefined;
|
|
1955
1981
|
};
|
|
1956
1982
|
id: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../src/block_registry/overview.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;KAEK;AACL,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,iBAAiB,GAAG,uBAAuB,CAazF"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),Y=require("remeda");function tt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const R=tt(Y),et={},s=t.z.object({type:t.z.literal("explicit-string"),content:t.z.string().describe("Actual string value")}).strict(),r=t.z.object({type:t.z.literal("explicit-base64"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.string().base64().describe("Base64 encoded binary value")}).strict(),i=t.z.object({type:t.z.literal("relative"),path:t.z.string().describe("Address of the file, in most cases relative to the file which this structure is a part of")}).strict(),A=new RegExp("^(/|[A-Z]:\\\\)"),c=t.z.object({type:t.z.literal("absolute-file"),file:t.z.string().regex(A,"path to file must be absolute").describe("Absolute address of the file in local file system")}).strict(),d=t.z.object({type:t.z.literal("absolute-url"),url:t.z.string().url().describe("Global URL to reach the requested file")}).strict(),S=t.z.object({type:t.z.literal("explicit-bytes"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.instanceof(Uint8Array).describe("Raw content")}).strict(),nt=t.z.object({type:t.z.literal("absolute-folder"),folder:t.z.string().regex(A,"path to folder must be absolute").describe("Absolute address of the folder in local file system")}).strict(),ot=t.z.discriminatedUnion("type",[s,r,i,c,d]),it=t.z.discriminatedUnion("type",[s,r,i]),rt=t.z.discriminatedUnion("type",[s,r,i,c]),st=t.z.discriminatedUnion("type",[s,r,i,d]),j=t.z.discriminatedUnion("type",[r,i,c]),w=t.z.discriminatedUnion("type",[s,i,c]),ct=t.z.discriminatedUnion("type",[r,d]),at=t.z.discriminatedUnion("type",[r,c]),lt=t.z.discriminatedUnion("type",[s,d]),dt=t.z.discriminatedUnion("type",[s,c]),g=t.z.discriminatedUnion("type",[r,i]),x=t.z.discriminatedUnion("type",[s,i]),V=t.z.union([t.z.string().startsWith("file:").transform((e,n)=>({type:"relative",path:e.slice(5)})),j]),M=t.z.union([t.z.string().transform((e,n)=>e.startsWith("file:")?{type:"relative",path:e.slice(5)}:{type:"explicit-string",content:e}),w]),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),Y=require("remeda");function tt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const R=tt(Y),et={},s=t.z.object({type:t.z.literal("explicit-string"),content:t.z.string().describe("Actual string value")}).strict(),r=t.z.object({type:t.z.literal("explicit-base64"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.string().base64().describe("Base64 encoded binary value")}).strict(),i=t.z.object({type:t.z.literal("relative"),path:t.z.string().describe("Address of the file, in most cases relative to the file which this structure is a part of")}).strict(),A=new RegExp("^(/|[A-Z]:\\\\)"),c=t.z.object({type:t.z.literal("absolute-file"),file:t.z.string().regex(A,"path to file must be absolute").describe("Absolute address of the file in local file system")}).strict(),d=t.z.object({type:t.z.literal("absolute-url"),url:t.z.string().url().describe("Global URL to reach the requested file")}).strict(),S=t.z.object({type:t.z.literal("explicit-bytes"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.instanceof(Uint8Array).describe("Raw content")}).strict(),nt=t.z.object({type:t.z.literal("absolute-folder"),folder:t.z.string().regex(A,"path to folder must be absolute").describe("Absolute address of the folder in local file system")}).strict(),ot=t.z.discriminatedUnion("type",[s,r,i,c,d]),it=t.z.discriminatedUnion("type",[s,r,i]),rt=t.z.discriminatedUnion("type",[s,r,i,c]),st=t.z.discriminatedUnion("type",[s,r,i,d]),j=t.z.discriminatedUnion("type",[r,i,c]),w=t.z.discriminatedUnion("type",[s,i,c]),ct=t.z.discriminatedUnion("type",[r,d]),at=t.z.discriminatedUnion("type",[r,c]),lt=t.z.discriminatedUnion("type",[s,d]),dt=t.z.discriminatedUnion("type",[s,c]),g=t.z.discriminatedUnion("type",[r,i]),x=t.z.discriminatedUnion("type",[s,i]),V=t.z.union([t.z.string().startsWith("file:").transform((e,n)=>({type:"relative",path:e.slice(5)})),j]),M=t.z.union([t.z.string().transform((e,n)=>e.startsWith("file:")?{type:"relative",path:e.slice(5)}:{type:"explicit-string",content:e}),w]),p=t.z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,"Wrong version format, please use valid semver");function m(e){const n=e.endsWith("/")?e:`${e}/`;return o=>o.type==="relative"?{type:"absolute-url",url:n+o.path}:o}function zt(e){const n=e.endsWith("/")?e:`${e}/`;return o=>o.type==="relative"?{type:"relative",path:n+o.path}:o}const a=t.z.object({organization:t.z.string(),name:t.z.string(),version:p}).strict(),D=a.omit({version:!0});function kt(e){if(e!==void 0)return`${e.organization}:${e.name}:${e.version}`}function gt(e){if(e!==void 0)return`${e.organization}:${e.name}`}function pt(e,n){return e===void 0&&n===void 0?!0:e===void 0||n===void 0?!1:e.name===n.name&&e.organization===n.organization&&e.version===n.version}function ut(e,n){return e===void 0&&n===void 0?!0:e===void 0||n===void 0?!1:e.name===n.name&&e.organization===n.organization}function y(e){return t.z.object({type:t.z.literal("workflow-v1"),main:e.describe("Main workflow")})}function F(e){return t.z.union([e.transform(n=>({type:"workflow-v1",main:n})).pipe(y(e)),t.z.discriminatedUnion("type",[y(e)])])}function u(e,n){return t.z.object({workflow:F(e),model:e,ui:n})}const f=u(t.z.string(),t.z.string());function mt(e){return u(g.transform(m(e)),g.transform(m(e)))}function z(e,n){return t.z.object({title:t.z.string(),description:t.z.string(),longDescription:e.optional(),changelog:e.optional(),logo:n.optional(),url:t.z.string().url().optional(),docs:t.z.string().url().optional(),support:t.z.union([t.z.string().url(),t.z.string().email()]).optional(),tags:t.z.array(t.z.string()).optional(),organization:t.z.object({name:t.z.string(),url:t.z.string().url(),logo:n.optional()}),marketplaceRanking:t.z.number().optional(),deprecated:t.z.boolean().optional(),termsOfServiceUrl:t.z.string().url().optional()})}const b=z(M,V),yt=z(t.z.string(),r),v=z(t.z.string(),S),ft=t.z.object({components:f,meta:b}),B=t.z.record(t.z.string(),t.z.union([t.z.boolean(),t.z.number()])).transform(e=>e);function P(e,n){return t.z.object({id:a,components:e,meta:n,featureFlags:B.optional()})}const bt=P(f,b);function vt(e,n){return R.mergeDeep(e,{id:{version:n}})}const I=u(i,i),T=z(x,g),U=P(I,T),E=t.z.string().regex(/[0-9a-fA-F]/).toUpperCase().length(64),L=t.z.object({name:t.z.string(),size:t.z.number().int(),sha256:E}),Bt=t.z.object({schema:t.z.literal("v2"),description:U,timestamp:t.z.number().optional(),files:t.z.array(L)}),Pt="manifest.json";function Ct(e,n){return R.mergeDeep(e,{description:{id:{version:n}}})}const O=t.z.object({type:t.z.literal("dev-v1"),folder:t.z.string(),mtime:t.z.string().optional()}),W=t.z.object({type:t.z.literal("dev-v2"),folder:t.z.string(),mtime:t.z.string().optional()}),$=t.z.object({type:t.z.literal("from-registry-v1"),registryUrl:t.z.string(),id:a}),q=t.z.object({type:t.z.literal("from-registry-v2"),registryUrl:t.z.string(),id:a,channel:t.z.string().optional()}),C=t.z.discriminatedUnion("type",[O,W,$,q]),N=t.z.object({type:t.z.literal("local-dev"),path:t.z.string()}),Z=t.z.object({type:t.z.literal("remote-v1"),url:t.z.string().url()}),_=t.z.object({type:t.z.literal("remote-v2"),url:t.z.string().url()}),J=t.z.discriminatedUnion("type",[Z,_,N]),h=t.z.object({id:t.z.string(),title:t.z.string().optional(),spec:J}),ht=t.z.array(h),Rt=t.z.object({registryId:t.z.string(),id:a,meta:v,spec:C,otherVersions:t.z.array(p)}),G="any",k="stable",H=t.z.object({version:p,channels:t.z.array(t.z.string())}),K=t.z.object({id:a,meta:v,featureFlags:B.optional(),spec:C}),Q=t.z.object({id:D,latestByChannel:t.z.record(t.z.string(),K),allVersions:t.z.array(H),registryId:t.z.string()}),X=h.extend({status:t.z.union([t.z.literal("online"),t.z.literal("offline")])}),At=t.z.object({registries:t.z.array(X),blockPacks:t.z.array(Q)});function St(e){const n=e.latestByChannel[k]!==void 0?k:G,o=e.latestByChannel[n];return{id:o.id,meta:o.meta,spec:{...o.spec,channel:k},otherVersions:e.allVersions.filter(l=>l.channels.indexOf(n)>=0).map(l=>l.version),registryId:e.registryId}}const jt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.AnyChannel=G;exports.BlockComponents=u;exports.BlockComponentsAbsoluteUrl=mt;exports.BlockComponentsDescriptionRaw=f;exports.BlockComponentsManifest=I;exports.BlockPackDescriptionFromPackageJsonRaw=ft;exports.BlockPackDescriptionManifest=U;exports.BlockPackDescriptionRaw=bt;exports.BlockPackDevV1=O;exports.BlockPackDevV2=W;exports.BlockPackFromRegistryV1=$;exports.BlockPackFromRegistryV2=q;exports.BlockPackId=a;exports.BlockPackIdNoVersion=D;exports.BlockPackListing=At;exports.BlockPackManifest=Bt;exports.BlockPackManifestFile=Pt;exports.BlockPackMeta=z;exports.BlockPackMetaDescriptionRaw=b;exports.BlockPackMetaEmbeddedBase64=yt;exports.BlockPackMetaEmbeddedBytes=v;exports.BlockPackMetaManifest=T;exports.BlockPackOverview=Q;exports.BlockPackOverviewLegacy=Rt;exports.BlockPackSpec=C;exports.ContentAbsoluteBinaryLocal=at;exports.ContentAbsoluteBinaryRemote=ct;exports.ContentAbsoluteFile=c;exports.ContentAbsoluteFolder=nt;exports.ContentAbsoluteTextLocal=dt;exports.ContentAbsoluteTextRemote=lt;exports.ContentAbsoluteUrl=d;exports.ContentAny=ot;exports.ContentAnyBinaryLocal=j;exports.ContentAnyLocal=rt;exports.ContentAnyRemote=st;exports.ContentAnyTextLocal=w;exports.ContentExplicitBase64=r;exports.ContentExplicitBytes=S;exports.ContentExplicitOrRelative=it;exports.ContentExplicitString=s;exports.ContentRelative=i;exports.ContentRelativeBinary=g;exports.ContentRelativeText=x;exports.CreateBlockPackDescriptionSchema=P;exports.DescriptionContentBinary=V;exports.DescriptionContentText=M;exports.FeatureFlags=B;exports.InitialBlockSettings=et;exports.LocalDevFolder=N;exports.ManifestFileInfo=L;exports.PFrameInternal=jt;exports.RegistryEntry=h;exports.RegistryList=ht;exports.RegistrySpec=J;exports.RegistryStatus=X;exports.RemoteRegistryV1Spec=Z;exports.RemoteRegistryV2Spec=_;exports.SemVer=p;exports.Sha256Schema=E;exports.SingleBlockPackOverview=K;exports.StableChannel=k;exports.VersionWithChannels=H;exports.Workflow=F;exports.WorkflowV1=y;exports.addPrefixToRelative=zt;exports.blockPackIdEquals=pt;exports.blockPackIdNoVersionEquals=ut;exports.blockPackIdNoVersionToString=gt;exports.blockPackIdToString=kt;exports.blockPackOverviewToLegacy=St;exports.mapRemoteToAbsolute=m;exports.overrideDescriptionVersion=vt;exports.overrideManifestVersion=Ct;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/block_settings.ts","../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version stricktly greater that this one will be suggested for auto-update. */\n skipVersion?: string;\n /**\n * If certain version locking policy is set, auto-updates will only be suggested,\n * if there is an update within the specified release line.\n * */\n versionLock?: VersionLock;\n};\n\nexport const InitialBlockSettings: BlockSettings = {};\n","import { z } from 'zod';\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal('explicit-string'),\n content: z.string().describe('Actual string value')\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal('explicit-base64'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.string().base64().describe('Base64 encoded binary value')\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal('relative'),\n path: z\n .string()\n .describe(\n 'Address of the file, in most cases relative to the file which this structure is a part of'\n )\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal('absolute-file'),\n file: z\n .string()\n .regex(absPathRegex, 'path to file must be absolute')\n .describe('Absolute address of the file in local file system')\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal('absolute-url'),\n url: z.string().url().describe('Global URL to reach the requested file')\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal('explicit-bytes'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.instanceof(Uint8Array).describe('Raw content')\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal('absolute-folder'),\n folder: z\n .string()\n .regex(absPathRegex, 'path to folder must be absolute')\n .describe('Absolute address of the folder in local file system')\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith('file:')\n .transform<ContentRelativeBinary>((value, ctx) => ({ type: 'relative', path: value.slice(5) })),\n ContentAnyBinaryLocal\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value, ctx) => {\n if (value.startsWith('file:')) return { type: 'relative', path: value.slice(5) };\n else return { type: 'explicit-string', content: value };\n }),\n ContentAnyTextLocal\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n","import { z } from 'zod';\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n 'Wrong version format, please use valid semver'\n );\n","import {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relaive path, slesh at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === 'relative'\n ? { type: 'relative', path: prefixWithSlash + value.path }\n : value) as T;\n}\n","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdToString(bp: BlockPackId): string;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}:${bp.version}`;\n}\n\nexport function blockPackIdNoVersionToString(bp: BlockPackIdNoVersion): string;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}`;\n}\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional()\n });\n}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\nimport * as R from 'remeda';\nimport { BlockCodeKnownFeatureFlags } from '@milaboratories/pl-model-common';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport const FeatureFlags = z.record(z.string(), z.union([z.boolean(), z.number()]))\n .transform((flags) => flags as BlockCodeKnownFeatureFlags);\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta,\n featureFlags: FeatureFlags.optional()\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n\nexport function overrideDescriptionVersion<T extends { id: BlockPackId }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { id: { version: newVersion } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockComponents } from './block_components';\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from './content_types';\nimport { CreateBlockPackDescriptionSchema } from './block_description';\nimport { BlockPackMeta } from './block_meta';\nimport * as R from 'remeda';\nimport { BlockPackId } from './block_id';\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId,\n channel: z.string().optional()\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport {\n BlockPackId,\n BlockPackIdNoVersion,\n BlockPackMetaEmbeddedBytes,\n FeatureFlags,\n SemVer\n} from '../block_meta';\nimport { BlockPackFromRegistryV2, BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverviewLegacy = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverviewLegacy = z.infer<typeof BlockPackOverviewLegacy>;\n\nexport const AnyChannel = 'any';\nexport const StableChannel = 'stable';\n\nexport const VersionWithChannels = z.object({\n version: SemVer,\n channels: z.array(z.string())\n});\n\n/**\n * Information about specific block pack version.\n * */\nexport const SingleBlockPackOverview = z.object({\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n featureFlags: FeatureFlags.optional(),\n spec: BlockPackSpec,\n});\nexport type SingleBlockPackOverview = z.infer<typeof SingleBlockPackOverview>;\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n id: BlockPackIdNoVersion,\n latestByChannel: z.record(z.string(), SingleBlockPackOverview),\n allVersions: z.array(VersionWithChannels),\n registryId: z.string()\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n\nexport function blockPackOverviewToLegacy(bpo: BlockPackOverview): BlockPackOverviewLegacy {\n const mainChannel = bpo.latestByChannel[StableChannel] !== undefined ? StableChannel : AnyChannel;\n const latestOverview = bpo.latestByChannel[mainChannel];\n return {\n id: latestOverview.id,\n meta: latestOverview.meta,\n // so we only add stable channel specs to projects, to smooth the transition\n spec: { ...(latestOverview.spec as BlockPackFromRegistryV2), channel: StableChannel },\n otherVersions: bpo.allVersions\n .filter((v) => v.channels.indexOf(mainChannel) >= 0)\n .map((v) => v.version),\n registryId: bpo.registryId\n };\n}\n"],"names":["InitialBlockSettings","ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdToString","bp","blockPackIdNoVersionToString","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","FeatureFlags","flags","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","overrideDescriptionVersion","manifest","newVersion","R","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","overrideManifestVersion","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverviewLegacy","AnyChannel","StableChannel","VersionWithChannels","SingleBlockPackOverview","BlockPackOverview","RegistryStatus","BlockPackListing","blockPackOverviewToLegacy","bpo","mainChannel","latestOverview","v"],"mappings":"uZA0BaA,GAAsC,CAAA,ECpBtCC,EAAwBC,IAClC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,iBAAiB,EACjC,QAASA,EAAA,EAAE,OAAO,EAAE,SAAS,qBAAqB,CACpD,CAAC,EACA,OAAO,EAGGC,EAAwBD,IAClC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,iBAAiB,EACjC,SAAUA,IACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC,EAC5C,QAASA,EAAE,EAAA,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B,CACrE,CAAC,EACA,OAAO,EAGGE,EAAkBF,IAC5B,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,UAAU,EAC1B,KAAMA,EAAAA,EACH,OAAA,EACA,SACC,2FAAA,CAEN,CAAC,EACA,OAAO,EAGJG,EAAe,IAAI,OAAO,iBAAiB,EAEpCC,EAAsBJ,IAChC,OAAO,CACN,KAAMA,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AMwB,CAAM,CAC/B,CAAC,EAGY6D,EAAa,MACbC,EAAgB,SAEhBC,EAAsBvF,IAAE,OAAO,CAC1C,QAASwB,EACT,SAAUxB,EAAA,EAAE,MAAMA,EAAAA,EAAE,OAAQ,CAAA,CAC9B,CAAC,EAKYwF,EAA0BxF,IAAE,OAAO,CAC9C,GAAI+B,EACJ,KAAMsB,EACN,aAAcE,EAAa,SAAS,EACpC,KAAMsB,CACR,CAAC,EAMYY,EAAoBzF,IAAE,OAAO,CACxC,GAAIgC,EACJ,gBAAiBhC,EAAE,EAAA,OAAOA,EAAE,EAAA,OAAA,EAAUwF,CAAuB,EAC7D,YAAaxF,EAAAA,EAAE,MAAMuF,CAAmB,EACxC,WAAYvF,IAAE,OAAO,CACvB,CAAC,EAGY0F,EAAiBR,EAAc,OAAO,CACjD,OAAQlF,EAAA,EAAE,MAAM,CAACA,IAAE,QAAQ,QAAQ,EAAGA,EAAE,EAAA,QAAQ,SAAS,CAAC,CAAC,CAC7D,CAAC,EAGY2F,GAAmB3F,IAAE,OAAO,CACvC,WAAYA,EAAAA,EAAE,MAAM0F,CAAc,EAClC,WAAY1F,EAAAA,EAAE,MAAMyF,CAAiB,CACvC,CAAC,EAGM,SAASG,GAA0BC,EAAiD,CACzF,MAAMC,EAAcD,EAAI,gBAAgBP,CAAa,IAAM,OAAYA,EAAgBD,EACjFU,EAAiBF,EAAI,gBAAgBC,CAAW,EAC/C,MAAA,CACL,GAAIC,EAAe,GACnB,KAAMA,EAAe,KAErB,KAAM,CAAE,GAAIA,EAAe,KAAkC,QAAST,CAAc,EACpF,cAAeO,EAAI,YAChB,OAAQG,GAAMA,EAAE,SAAS,QAAQF,CAAW,GAAK,CAAC,EAClD,IAAKE,GAAMA,EAAE,OAAO,EACvB,WAAYH,EAAI,UAClB,CACF"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/block_settings.ts","../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version stricktly greater that this one will be suggested for auto-update. */\n skipVersion?: string;\n /**\n * If certain version locking policy is set, auto-updates will only be suggested,\n * if there is an update within the specified release line.\n * */\n versionLock?: VersionLock;\n};\n\nexport const InitialBlockSettings: BlockSettings = {};\n","import { z } from 'zod';\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal('explicit-string'),\n content: z.string().describe('Actual string value')\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal('explicit-base64'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.string().base64().describe('Base64 encoded binary value')\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal('relative'),\n path: z\n .string()\n .describe(\n 'Address of the file, in most cases relative to the file which this structure is a part of'\n )\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal('absolute-file'),\n file: z\n .string()\n .regex(absPathRegex, 'path to file must be absolute')\n .describe('Absolute address of the file in local file system')\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal('absolute-url'),\n url: z.string().url().describe('Global URL to reach the requested file')\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal('explicit-bytes'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.instanceof(Uint8Array).describe('Raw content')\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal('absolute-folder'),\n folder: z\n .string()\n .regex(absPathRegex, 'path to folder must be absolute')\n .describe('Absolute address of the folder in local file system')\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith('file:')\n .transform<ContentRelativeBinary>((value, ctx) => ({ type: 'relative', path: value.slice(5) })),\n ContentAnyBinaryLocal\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value, ctx) => {\n if (value.startsWith('file:')) return { type: 'relative', path: value.slice(5) };\n else return { type: 'explicit-string', content: value };\n }),\n ContentAnyTextLocal\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n","import { z } from 'zod';\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n 'Wrong version format, please use valid semver'\n );\n","import {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relaive path, slesh at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === 'relative'\n ? { type: 'relative', path: prefixWithSlash + value.path }\n : value) as T;\n}\n","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdToString(bp: BlockPackId): string;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}:${bp.version}`;\n}\n\nexport function blockPackIdNoVersionToString(bp: BlockPackIdNoVersion): string;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}`;\n}\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional()\n });\n}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\nimport * as R from 'remeda';\nimport { BlockCodeKnownFeatureFlags } from '@milaboratories/pl-model-common';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport const FeatureFlags = z.record(z.string(), z.union([z.boolean(), z.number()]))\n .transform((flags) => flags as BlockCodeKnownFeatureFlags);\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta,\n featureFlags: FeatureFlags.optional()\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n\nexport function overrideDescriptionVersion<T extends { id: BlockPackId }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { id: { version: newVersion } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockComponents } from './block_components';\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from './content_types';\nimport { CreateBlockPackDescriptionSchema } from './block_description';\nimport { BlockPackMeta } from './block_meta';\nimport * as R from 'remeda';\nimport { BlockPackId } from './block_id';\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId,\n channel: z.string().optional()\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport {\n BlockPackId,\n BlockPackIdNoVersion,\n BlockPackMetaEmbeddedBytes,\n FeatureFlags,\n SemVer\n} from '../block_meta';\nimport { BlockPackFromRegistryV2, BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverviewLegacy = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverviewLegacy = z.infer<typeof BlockPackOverviewLegacy>;\n\nexport const AnyChannel = 'any';\nexport const StableChannel = 'stable';\n\nexport const VersionWithChannels = z.object({\n version: SemVer,\n channels: z.array(z.string())\n});\n\n/**\n * Information about specific block pack version.\n * */\nexport const SingleBlockPackOverview = z.object({\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n featureFlags: FeatureFlags.optional(),\n spec: BlockPackSpec,\n});\nexport type SingleBlockPackOverview = z.infer<typeof SingleBlockPackOverview>;\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n id: BlockPackIdNoVersion,\n latestByChannel: z.record(z.string(), SingleBlockPackOverview),\n allVersions: z.array(VersionWithChannels),\n registryId: z.string()\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n\nexport function blockPackOverviewToLegacy(bpo: BlockPackOverview): BlockPackOverviewLegacy {\n const mainChannel = bpo.latestByChannel[StableChannel] !== undefined ? StableChannel : AnyChannel;\n const latestOverview = bpo.latestByChannel[mainChannel];\n return {\n id: latestOverview.id,\n meta: latestOverview.meta,\n // so we only add stable channel specs to projects, to smooth the transition\n spec: { ...(latestOverview.spec as BlockPackFromRegistryV2), channel: StableChannel },\n otherVersions: bpo.allVersions\n .filter((v) => v.channels.indexOf(mainChannel) >= 0)\n .map((v) => v.version),\n registryId: bpo.registryId\n };\n}\n"],"names":["InitialBlockSettings","ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdToString","bp","blockPackIdNoVersionToString","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","FeatureFlags","flags","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","overrideDescriptionVersion","manifest","newVersion","R","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","overrideManifestVersion","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverviewLegacy","AnyChannel","StableChannel","VersionWithChannels","SingleBlockPackOverview","BlockPackOverview","RegistryStatus","BlockPackListing","blockPackOverviewToLegacy","bpo","m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EAAGA,EAAE,EAAA,QAAQ,SAAS,CAAC,CAAC,CAC7D,CAAC,EAGY2F,GAAmB3F,IAAE,OAAO,CACvC,WAAYA,EAAAA,EAAE,MAAM0F,CAAc,EAClC,WAAY1F,EAAAA,EAAE,MAAMyF,CAAiB,CACvC,CAAC,EAGM,SAASG,GAA0BC,EAAiD,CACzF,MAAMC,EAAcD,EAAI,gBAAgBP,CAAa,IAAM,OAAYA,EAAgBD,EACjFU,EAAiBF,EAAI,gBAAgBC,CAAW,EAC/C,MAAA,CACL,GAAIC,EAAe,GACnB,KAAMA,EAAe,KAErB,KAAM,CAAE,GAAIA,EAAe,KAAkC,QAAST,CAAc,EACpF,cAAeO,EAAI,YAChB,OAAQG,GAAMA,EAAE,SAAS,QAAQF,CAAW,GAAK,CAAC,EAClD,IAAKE,GAAMA,EAAE,OAAO,EACvB,WAAYH,EAAI,UAClB,CACF"}
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ const tt = {}, s = t.object({
|
|
|
7
7
|
type: t.literal("explicit-base64"),
|
|
8
8
|
mimeType: t.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
|
|
9
9
|
content: t.string().base64().describe("Base64 encoded binary value")
|
|
10
|
-
}).strict(),
|
|
10
|
+
}).strict(), i = t.object({
|
|
11
11
|
type: t.literal("relative"),
|
|
12
12
|
path: t.string().describe(
|
|
13
13
|
"Address of the file, in most cases relative to the file which this structure is a part of"
|
|
@@ -28,30 +28,30 @@ const tt = {}, s = t.object({
|
|
|
28
28
|
}).strict(), nt = t.discriminatedUnion("type", [
|
|
29
29
|
s,
|
|
30
30
|
r,
|
|
31
|
-
|
|
31
|
+
i,
|
|
32
32
|
a,
|
|
33
33
|
l
|
|
34
|
-
]),
|
|
34
|
+
]), ot = t.discriminatedUnion("type", [
|
|
35
35
|
s,
|
|
36
36
|
r,
|
|
37
|
-
|
|
38
|
-
]),
|
|
37
|
+
i
|
|
38
|
+
]), it = t.discriminatedUnion("type", [
|
|
39
39
|
s,
|
|
40
40
|
r,
|
|
41
|
-
|
|
41
|
+
i,
|
|
42
42
|
a
|
|
43
43
|
]), rt = t.discriminatedUnion("type", [
|
|
44
44
|
s,
|
|
45
45
|
r,
|
|
46
|
-
|
|
46
|
+
i,
|
|
47
47
|
l
|
|
48
48
|
]), w = t.discriminatedUnion("type", [
|
|
49
49
|
r,
|
|
50
|
-
|
|
50
|
+
i,
|
|
51
51
|
a
|
|
52
52
|
]), U = t.discriminatedUnion("type", [
|
|
53
53
|
s,
|
|
54
|
-
|
|
54
|
+
i,
|
|
55
55
|
a
|
|
56
56
|
]), st = t.discriminatedUnion("type", [
|
|
57
57
|
r,
|
|
@@ -65,12 +65,12 @@ const tt = {}, s = t.object({
|
|
|
65
65
|
]), lt = t.discriminatedUnion("type", [
|
|
66
66
|
s,
|
|
67
67
|
a
|
|
68
|
-
]),
|
|
68
|
+
]), m = t.discriminatedUnion("type", [
|
|
69
69
|
r,
|
|
70
|
-
|
|
70
|
+
i
|
|
71
71
|
]), S = t.discriminatedUnion("type", [
|
|
72
72
|
s,
|
|
73
|
-
|
|
73
|
+
i
|
|
74
74
|
]), V = t.union([
|
|
75
75
|
t.string().startsWith("file:").transform((e, n) => ({ type: "relative", path: e.slice(5) })),
|
|
76
76
|
w
|
|
@@ -83,11 +83,11 @@ const tt = {}, s = t.object({
|
|
|
83
83
|
);
|
|
84
84
|
function f(e) {
|
|
85
85
|
const n = e.endsWith("/") ? e : `${e}/`;
|
|
86
|
-
return (
|
|
86
|
+
return (o) => o.type === "relative" ? { type: "absolute-url", url: n + o.path } : o;
|
|
87
87
|
}
|
|
88
88
|
function dt(e) {
|
|
89
89
|
const n = e.endsWith("/") ? e : `${e}/`;
|
|
90
|
-
return (
|
|
90
|
+
return (o) => o.type === "relative" ? { type: "relative", path: n + o.path } : o;
|
|
91
91
|
}
|
|
92
92
|
const c = t.object({
|
|
93
93
|
organization: t.string(),
|
|
@@ -98,11 +98,11 @@ function gt(e) {
|
|
|
98
98
|
if (e !== void 0)
|
|
99
99
|
return `${e.organization}:${e.name}:${e.version}`;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function pt(e) {
|
|
102
102
|
if (e !== void 0)
|
|
103
103
|
return `${e.organization}:${e.name}`;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function mt(e, n) {
|
|
106
106
|
return e === void 0 && n === void 0 ? !0 : e === void 0 || n === void 0 ? !1 : e.name === n.name && e.organization === n.organization && e.version === n.version;
|
|
107
107
|
}
|
|
108
108
|
function ut(e, n) {
|
|
@@ -135,8 +135,8 @@ function y(e, n) {
|
|
|
135
135
|
const h = y(t.string(), t.string());
|
|
136
136
|
function yt(e) {
|
|
137
137
|
return y(
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
m.transform(f(e)),
|
|
139
|
+
m.transform(f(e))
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
function d(e, n) {
|
|
@@ -160,6 +160,10 @@ function d(e, n) {
|
|
|
160
160
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
161
161
|
*/
|
|
162
162
|
marketplaceRanking: t.number().optional(),
|
|
163
|
+
/**
|
|
164
|
+
* If true, the block is deprecated and should not be used.
|
|
165
|
+
*/
|
|
166
|
+
deprecated: t.boolean().optional(),
|
|
163
167
|
/**
|
|
164
168
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
165
169
|
*/
|
|
@@ -194,7 +198,7 @@ const vt = j(
|
|
|
194
198
|
function bt(e, n) {
|
|
195
199
|
return v.mergeDeep(e, { id: { version: n } });
|
|
196
200
|
}
|
|
197
|
-
const I = y(
|
|
201
|
+
const I = y(i, i), F = d(S, m), E = j(
|
|
198
202
|
I,
|
|
199
203
|
F
|
|
200
204
|
), L = t.string().regex(/[0-9a-fA-F]/).toUpperCase().length(64), T = t.object({
|
|
@@ -255,7 +259,7 @@ const O = t.object({
|
|
|
255
259
|
meta: C,
|
|
256
260
|
spec: R,
|
|
257
261
|
otherVersions: t.array(u)
|
|
258
|
-
}), J = "any",
|
|
262
|
+
}), J = "any", p = "stable", H = t.object({
|
|
259
263
|
version: u,
|
|
260
264
|
channels: t.array(t.string())
|
|
261
265
|
}), K = t.object({
|
|
@@ -275,12 +279,12 @@ const O = t.object({
|
|
|
275
279
|
blockPacks: t.array(Q)
|
|
276
280
|
});
|
|
277
281
|
function At(e) {
|
|
278
|
-
const n = e.latestByChannel[
|
|
282
|
+
const n = e.latestByChannel[p] !== void 0 ? p : J, o = e.latestByChannel[n];
|
|
279
283
|
return {
|
|
280
|
-
id:
|
|
281
|
-
meta:
|
|
284
|
+
id: o.id,
|
|
285
|
+
meta: o.meta,
|
|
282
286
|
// so we only add stable channel specs to projects, to smooth the transition
|
|
283
|
-
spec: { ...
|
|
287
|
+
spec: { ...o.spec, channel: p },
|
|
284
288
|
otherVersions: e.allVersions.filter((g) => g.channels.indexOf(n) >= 0).map((g) => g.version),
|
|
285
289
|
registryId: e.registryId
|
|
286
290
|
};
|
|
@@ -323,15 +327,15 @@ export {
|
|
|
323
327
|
l as ContentAbsoluteUrl,
|
|
324
328
|
nt as ContentAny,
|
|
325
329
|
w as ContentAnyBinaryLocal,
|
|
326
|
-
|
|
330
|
+
it as ContentAnyLocal,
|
|
327
331
|
rt as ContentAnyRemote,
|
|
328
332
|
U as ContentAnyTextLocal,
|
|
329
333
|
r as ContentExplicitBase64,
|
|
330
334
|
x as ContentExplicitBytes,
|
|
331
|
-
|
|
335
|
+
ot as ContentExplicitOrRelative,
|
|
332
336
|
s as ContentExplicitString,
|
|
333
|
-
|
|
334
|
-
|
|
337
|
+
i as ContentRelative,
|
|
338
|
+
m as ContentRelativeBinary,
|
|
335
339
|
S as ContentRelativeText,
|
|
336
340
|
j as CreateBlockPackDescriptionSchema,
|
|
337
341
|
V as DescriptionContentBinary,
|
|
@@ -350,14 +354,14 @@ export {
|
|
|
350
354
|
u as SemVer,
|
|
351
355
|
L as Sha256Schema,
|
|
352
356
|
K as SingleBlockPackOverview,
|
|
353
|
-
|
|
357
|
+
p as StableChannel,
|
|
354
358
|
H as VersionWithChannels,
|
|
355
359
|
D as Workflow,
|
|
356
360
|
k as WorkflowV1,
|
|
357
361
|
dt as addPrefixToRelative,
|
|
358
|
-
|
|
362
|
+
mt as blockPackIdEquals,
|
|
359
363
|
ut as blockPackIdNoVersionEquals,
|
|
360
|
-
|
|
364
|
+
pt as blockPackIdNoVersionToString,
|
|
361
365
|
gt as blockPackIdToString,
|
|
362
366
|
At as blockPackOverviewToLegacy,
|
|
363
367
|
f as mapRemoteToAbsolute,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/block_settings.ts","../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version stricktly greater that this one will be suggested for auto-update. */\n skipVersion?: string;\n /**\n * If certain version locking policy is set, auto-updates will only be suggested,\n * if there is an update within the specified release line.\n * */\n versionLock?: VersionLock;\n};\n\nexport const InitialBlockSettings: BlockSettings = {};\n","import { z } from 'zod';\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal('explicit-string'),\n content: z.string().describe('Actual string value')\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal('explicit-base64'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.string().base64().describe('Base64 encoded binary value')\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal('relative'),\n path: z\n .string()\n .describe(\n 'Address of the file, in most cases relative to the file which this structure is a part of'\n )\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal('absolute-file'),\n file: z\n .string()\n .regex(absPathRegex, 'path to file must be absolute')\n .describe('Absolute address of the file in local file system')\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal('absolute-url'),\n url: z.string().url().describe('Global URL to reach the requested file')\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal('explicit-bytes'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.instanceof(Uint8Array).describe('Raw content')\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal('absolute-folder'),\n folder: z\n .string()\n .regex(absPathRegex, 'path to folder must be absolute')\n .describe('Absolute address of the folder in local file system')\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith('file:')\n .transform<ContentRelativeBinary>((value, ctx) => ({ type: 'relative', path: value.slice(5) })),\n ContentAnyBinaryLocal\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value, ctx) => {\n if (value.startsWith('file:')) return { type: 'relative', path: value.slice(5) };\n else return { type: 'explicit-string', content: value };\n }),\n ContentAnyTextLocal\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n","import { z } from 'zod';\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n 'Wrong version format, please use valid semver'\n );\n","import {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relaive path, slesh at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === 'relative'\n ? { type: 'relative', path: prefixWithSlash + value.path }\n : value) as T;\n}\n","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdToString(bp: BlockPackId): string;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}:${bp.version}`;\n}\n\nexport function blockPackIdNoVersionToString(bp: BlockPackIdNoVersion): string;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}`;\n}\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional()\n });\n}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\nimport * as R from 'remeda';\nimport { BlockCodeKnownFeatureFlags } from '@milaboratories/pl-model-common';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport const FeatureFlags = z.record(z.string(), z.union([z.boolean(), z.number()]))\n .transform((flags) => flags as BlockCodeKnownFeatureFlags);\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta,\n featureFlags: FeatureFlags.optional()\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n\nexport function overrideDescriptionVersion<T extends { id: BlockPackId }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { id: { version: newVersion } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockComponents } from './block_components';\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from './content_types';\nimport { CreateBlockPackDescriptionSchema } from './block_description';\nimport { BlockPackMeta } from './block_meta';\nimport * as R from 'remeda';\nimport { BlockPackId } from './block_id';\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId,\n channel: z.string().optional()\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport {\n BlockPackId,\n BlockPackIdNoVersion,\n BlockPackMetaEmbeddedBytes,\n FeatureFlags,\n SemVer\n} from '../block_meta';\nimport { BlockPackFromRegistryV2, BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverviewLegacy = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverviewLegacy = z.infer<typeof BlockPackOverviewLegacy>;\n\nexport const AnyChannel = 'any';\nexport const StableChannel = 'stable';\n\nexport const VersionWithChannels = z.object({\n version: SemVer,\n channels: z.array(z.string())\n});\n\n/**\n * Information about specific block pack version.\n * */\nexport const SingleBlockPackOverview = z.object({\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n featureFlags: FeatureFlags.optional(),\n spec: BlockPackSpec,\n});\nexport type SingleBlockPackOverview = z.infer<typeof SingleBlockPackOverview>;\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n id: BlockPackIdNoVersion,\n latestByChannel: z.record(z.string(), SingleBlockPackOverview),\n allVersions: z.array(VersionWithChannels),\n registryId: z.string()\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n\nexport function blockPackOverviewToLegacy(bpo: BlockPackOverview): BlockPackOverviewLegacy {\n const mainChannel = bpo.latestByChannel[StableChannel] !== undefined ? StableChannel : AnyChannel;\n const latestOverview = bpo.latestByChannel[mainChannel];\n return {\n id: latestOverview.id,\n meta: latestOverview.meta,\n // so we only add stable channel specs to projects, to smooth the transition\n spec: { ...(latestOverview.spec as BlockPackFromRegistryV2), channel: StableChannel },\n otherVersions: bpo.allVersions\n .filter((v) => v.channels.indexOf(mainChannel) >= 0)\n .map((v) => v.version),\n registryId: bpo.registryId\n };\n}\n"],"names":["InitialBlockSettings","ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdToString","bp","blockPackIdNoVersionToString","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","FeatureFlags","flags","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","overrideDescriptionVersion","manifest","newVersion","R","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","overrideManifestVersion","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverviewLegacy","AnyChannel","StableChannel","VersionWithChannels","SingleBlockPackOverview","BlockPackOverview","RegistryStatus","BlockPackListing","blockPackOverviewToLegacy","bpo","mainChannel","latestOverview","v"],"mappings":";;AA0BO,MAAMA,KAAsC,CAAA,GCpBtCC,IAAwBC,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,SAASA,EAAE,OAAO,EAAE,SAAS,qBAAqB;AACpD,CAAC,EACA,OAAO,GAGGC,IAAwBD,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,UAAUA,EACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC;AAAA,EAC5C,SAASA,EAAE,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B;AACrE,CAAC,EACA,OAAO,GAGGE,IAAkBF,EAC5B,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,UAAU;AAAA,EAC1B,MAAMA,EACH,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC,EACA,OAAO,GAGJG,IAAe,IAAI,OAAO,iBAAiB,GAEpCC,IAAsBJ,EAChC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,eAAe;AAAA,EAC/B,MAAMA,EACH,SACA,MAAMG,GAAc,+BAA+B,EACnD,SAAS,mDAAmD;AACjE,CAAC,E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gBC,CAAW;AAC/C,SAAA;AAAA,IACL,IAAIC,EAAe;AAAA,IACnB,MAAMA,EAAe;AAAA;AAAA,IAErB,MAAM,EAAE,GAAIA,EAAe,MAAkC,SAAST,EAAc;AAAA,IACpF,eAAeO,EAAI,YAChB,OAAO,CAACG,MAAMA,EAAE,SAAS,QAAQF,CAAW,KAAK,CAAC,EAClD,IAAI,CAACE,MAAMA,EAAE,OAAO;AAAA,IACvB,YAAYH,EAAI;AAAA,EAClB;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/block_settings.ts","../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version stricktly greater that this one will be suggested for auto-update. */\n skipVersion?: string;\n /**\n * If certain version locking policy is set, auto-updates will only be suggested,\n * if there is an update within the specified release line.\n * */\n versionLock?: VersionLock;\n};\n\nexport const InitialBlockSettings: BlockSettings = {};\n","import { z } from 'zod';\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal('explicit-string'),\n content: z.string().describe('Actual string value')\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal('explicit-base64'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.string().base64().describe('Base64 encoded binary value')\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal('relative'),\n path: z\n .string()\n .describe(\n 'Address of the file, in most cases relative to the file which this structure is a part of'\n )\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal('absolute-file'),\n file: z\n .string()\n .regex(absPathRegex, 'path to file must be absolute')\n .describe('Absolute address of the file in local file system')\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal('absolute-url'),\n url: z.string().url().describe('Global URL to reach the requested file')\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal('explicit-bytes'),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe('MIME type to interpret content'),\n content: z.instanceof(Uint8Array).describe('Raw content')\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal('absolute-folder'),\n folder: z\n .string()\n .regex(absPathRegex, 'path to folder must be absolute')\n .describe('Absolute address of the folder in local file system')\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteUrl\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentAbsoluteFile\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion('type', [\n ContentExplicitBase64,\n ContentRelative\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion('type', [\n ContentExplicitString,\n ContentRelative\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith('file:')\n .transform<ContentRelativeBinary>((value, ctx) => ({ type: 'relative', path: value.slice(5) })),\n ContentAnyBinaryLocal\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value, ctx) => {\n if (value.startsWith('file:')) return { type: 'relative', path: value.slice(5) };\n else return { type: 'explicit-string', content: value };\n }),\n ContentAnyTextLocal\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n","import { z } from 'zod';\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n 'Wrong version format, please use valid semver'\n );\n","import {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relaive path, slesh at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === 'relative'\n ? { type: 'relative', path: prefixWithSlash + value.path }\n : value) as T;\n}\n","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdToString(bp: BlockPackId): string;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined;\nexport function blockPackIdToString(bp: BlockPackId | undefined): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}:${bp.version}`;\n}\n\nexport function blockPackIdNoVersionToString(bp: BlockPackIdNoVersion): string;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined;\nexport function blockPackIdNoVersionToString(\n bp: BlockPackIdNoVersion | undefined\n): string | undefined {\n if (bp === undefined) return undefined;\n return `${bp.organization}:${bp.name}`;\n}\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional()\n });\n}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\nimport * as R from 'remeda';\nimport { BlockCodeKnownFeatureFlags } from '@milaboratories/pl-model-common';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport const FeatureFlags = z.record(z.string(), z.union([z.boolean(), z.number()]))\n .transform((flags) => flags as BlockCodeKnownFeatureFlags);\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta,\n featureFlags: FeatureFlags.optional()\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n\nexport function overrideDescriptionVersion<T extends { id: BlockPackId }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { id: { version: newVersion } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockComponents } from './block_components';\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from './content_types';\nimport { CreateBlockPackDescriptionSchema } from './block_description';\nimport { BlockPackMeta } from './block_meta';\nimport * as R from 'remeda';\nimport { BlockPackId } from './block_id';\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string\n): T {\n return R.mergeDeep(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId,\n channel: z.string().optional()\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport {\n BlockPackId,\n BlockPackIdNoVersion,\n BlockPackMetaEmbeddedBytes,\n FeatureFlags,\n SemVer\n} from '../block_meta';\nimport { BlockPackFromRegistryV2, BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverviewLegacy = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverviewLegacy = z.infer<typeof BlockPackOverviewLegacy>;\n\nexport const AnyChannel = 'any';\nexport const StableChannel = 'stable';\n\nexport const VersionWithChannels = z.object({\n version: SemVer,\n channels: z.array(z.string())\n});\n\n/**\n * Information about specific block pack version.\n * */\nexport const SingleBlockPackOverview = z.object({\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n featureFlags: FeatureFlags.optional(),\n spec: BlockPackSpec,\n});\nexport type SingleBlockPackOverview = z.infer<typeof SingleBlockPackOverview>;\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n id: BlockPackIdNoVersion,\n latestByChannel: z.record(z.string(), SingleBlockPackOverview),\n allVersions: z.array(VersionWithChannels),\n registryId: z.string()\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n\nexport function blockPackOverviewToLegacy(bpo: BlockPackOverview): BlockPackOverviewLegacy {\n const mainChannel = bpo.latestByChannel[StableChannel] !== undefined ? StableChannel : AnyChannel;\n const latestOverview = bpo.latestByChannel[mainChannel];\n return {\n id: latestOverview.id,\n meta: latestOverview.meta,\n // so we only add stable channel specs to projects, to smooth the transition\n spec: { ...(latestOverview.spec as BlockPackFromRegistryV2), channel: StableChannel },\n otherVersions: bpo.allVersions\n .filter((v) => v.channels.indexOf(mainChannel) >= 0)\n .map((v) => v.version),\n registryId: bpo.registryId\n };\n}\n"],"names":["InitialBlockSettings","ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdToString","bp","blockPackIdNoVersionToString","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","FeatureFlags","flags","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","overrideDescriptionVersion","manifest","newVersion","R","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","overrideManifestVersion","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverviewLegacy","AnyChannel","StableChannel","VersionWithChannels","SingleBlockPackOverview","BlockPackOverview","RegistryStatus","BlockPackListing","blockPackOverviewToLegacy","bpo","mainChannel","latestOverview","v"],"mappings":";;AA0BO,MAAMA,KAAsC,CAAA,GCpBtCC,IAAwBC,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,SAASA,EAAE,OAAO,EAAE,SAAS,qBAAqB;AACpD,CAAC,EACA,OAAO,GAGGC,IAAwBD,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,UAAUA,EACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC;AAAA,EAC5C,SAASA,EAAE,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B;AACrE,CAAC,EACA,OAAO,GAGGE,IAAkBF,EAC5B,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,UAAU;AAAA,EAC1B,MAAMA,EACH,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC,EACA,OAAO,GAGJG,IAAe,IAAI,OAAO,iBAAiB,GAEpCC,IAAsBJ,EAChC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,eAAe;AAAA,EAC/B,MAAMA,EACH,SACA,MAAMG,GAAc,+BAA+B,EACnD,SAAS,mDAAmD;AACjE,CAAC,EACA,OAAO,GAGGE,IAAqBL,EAC/B,OAAO;AAAA,EACN,MAAM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AAI,gBAAgBC,CAAW;AAC/C,SAAA;AAAA,IACL,IAAIC,EAAe;AAAA,IACnB,MAAMA,EAAe;AAAA;AAAA,IAErB,MAAM,EAAE,GAAIA,EAAe,MAAkC,SAAST,EAAc;AAAA,IACpF,eAAeO,EAAI,YAChB,OAAO,CAACG,MAAMA,EAAE,SAAS,QAAQF,CAAW,KAAK,CAAC,EAClD,IAAI,CAACE,MAAMA,EAAE,OAAO;AAAA,IACvB,YAAYH,EAAI;AAAA,EAClB;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.50",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"remeda": "^2.22.6",
|
|
21
21
|
"zod": "~3.23.8",
|
|
22
22
|
"utility-types": "^3.11.0",
|
|
23
|
-
"@milaboratories/pl-model-common": "^1.16.
|
|
23
|
+
"@milaboratories/pl-model-common": "^1.16.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "~5.6.3",
|
|
@@ -30,6 +30,10 @@ export function BlockPackMeta<
|
|
|
30
30
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
31
31
|
*/
|
|
32
32
|
marketplaceRanking: z.number().optional(),
|
|
33
|
+
/**
|
|
34
|
+
* If true, the block is deprecated and should not be used.
|
|
35
|
+
*/
|
|
36
|
+
deprecated: z.boolean().optional(),
|
|
33
37
|
/**
|
|
34
38
|
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
35
39
|
*/
|