@code-pushup/models 0.45.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -107,6 +107,7 @@ var fileNameSchema = z.string().trim().regex(filenameRegex, {
107
107
  }).min(1, { message: "file name is invalid" });
108
108
  var positiveIntSchema = z.number().int().positive();
109
109
  var nonnegativeIntSchema = z.number().int().nonnegative();
110
+ var nonnegativeNumberSchema = z.number().nonnegative();
110
111
  function packageVersionSchema(options) {
111
112
  const { versionDescription = "NPM version of the package", required } = options ?? {};
112
113
  const packageSchema = z.string({ description: "NPM package name" });
@@ -119,7 +120,7 @@ function packageVersionSchema(options) {
119
120
  { description: "NPM package name and version of a published package" }
120
121
  );
121
122
  }
122
- var weightSchema = nonnegativeIntSchema.describe(
123
+ var weightSchema = nonnegativeNumberSchema.describe(
123
124
  "Coefficient for the given score (use weight 0 if only for display)"
124
125
  );
125
126
  function weightedRefSchema(description, slugDescription) {
@@ -262,7 +263,7 @@ var tableObjectSchema = tableSharedSchema.merge(
262
263
  var tableSchema = (description = "Table information") => z4.union([tablePrimitiveSchema, tableObjectSchema], { description });
263
264
 
264
265
  // packages/models/src/lib/audit-output.ts
265
- var auditValueSchema = nonnegativeIntSchema.describe("Raw numeric value");
266
+ var auditValueSchema = nonnegativeNumberSchema.describe("Raw numeric value");
266
267
  var auditDisplayValueSchema = z5.string({ description: "Formatted value (e.g. '0.9 s', '2.1 MB')" }).optional();
267
268
  var auditDetailsSchema = z5.object(
268
269
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/models",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "zod": "^3.22.1",
@@ -42,7 +42,7 @@ export declare const auditDetailsSchema: z.ZodObject<{
42
42
  }>>;
43
43
  }, "strip", z.ZodTypeAny, {
44
44
  message: string;
45
- severity: "error" | "info" | "warning";
45
+ severity: "info" | "warning" | "error";
46
46
  source?: {
47
47
  file: string;
48
48
  position?: {
@@ -54,7 +54,7 @@ export declare const auditDetailsSchema: z.ZodObject<{
54
54
  } | undefined;
55
55
  }, {
56
56
  message: string;
57
- severity: "error" | "info" | "warning";
57
+ severity: "info" | "warning" | "error";
58
58
  source?: {
59
59
  file: string;
60
60
  position?: {
@@ -65,11 +65,12 @@ export declare const auditDetailsSchema: z.ZodObject<{
65
65
  } | undefined;
66
66
  } | undefined;
67
67
  }>, "many">>;
68
- table: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
68
+ table: z.ZodOptional<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
69
69
  title: z.ZodOptional<z.ZodString>;
70
+ }, {
70
71
  columns: z.ZodOptional<z.ZodArray<z.ZodEnum<["left", "center", "right"]>, "many">>;
71
72
  rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">, "many">;
72
- }, "strip", z.ZodTypeAny, {
73
+ }>, "strip", z.ZodTypeAny, {
73
74
  rows: (string | number)[][];
74
75
  title?: string | undefined;
75
76
  columns?: ("left" | "center" | "right")[] | undefined;
@@ -77,8 +78,9 @@ export declare const auditDetailsSchema: z.ZodObject<{
77
78
  rows: (string | number)[][];
78
79
  title?: string | undefined;
79
80
  columns?: ("left" | "center" | "right")[] | undefined;
80
- }>, z.ZodObject<{
81
+ }>, z.ZodObject<z.objectUtil.extendShape<{
81
82
  title: z.ZodOptional<z.ZodString>;
83
+ }, {
82
84
  columns: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["left", "center", "right"]>, "many">, z.ZodArray<z.ZodObject<{
83
85
  key: z.ZodString;
84
86
  label: z.ZodOptional<z.ZodString>;
@@ -93,7 +95,7 @@ export declare const auditDetailsSchema: z.ZodObject<{
93
95
  align?: "left" | "center" | "right" | undefined;
94
96
  }>, "many">]>>;
95
97
  rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>, "many">;
96
- }, "strip", z.ZodTypeAny, {
98
+ }>, "strip", z.ZodTypeAny, {
97
99
  rows: Record<string, string | number>[];
98
100
  title?: string | undefined;
99
101
  columns?: ("left" | "center" | "right")[] | {
@@ -113,7 +115,7 @@ export declare const auditDetailsSchema: z.ZodObject<{
113
115
  }, "strip", z.ZodTypeAny, {
114
116
  issues?: {
115
117
  message: string;
116
- severity: "error" | "info" | "warning";
118
+ severity: "info" | "warning" | "error";
117
119
  source?: {
118
120
  file: string;
119
121
  position?: {
@@ -140,7 +142,7 @@ export declare const auditDetailsSchema: z.ZodObject<{
140
142
  }, {
141
143
  issues?: {
142
144
  message: string;
143
- severity: "error" | "info" | "warning";
145
+ severity: "info" | "warning" | "error";
144
146
  source?: {
145
147
  file: string;
146
148
  position?: {
@@ -212,7 +214,7 @@ export declare const auditOutputSchema: z.ZodObject<{
212
214
  }>>;
213
215
  }, "strip", z.ZodTypeAny, {
214
216
  message: string;
215
- severity: "error" | "info" | "warning";
217
+ severity: "info" | "warning" | "error";
216
218
  source?: {
217
219
  file: string;
218
220
  position?: {
@@ -224,7 +226,7 @@ export declare const auditOutputSchema: z.ZodObject<{
224
226
  } | undefined;
225
227
  }, {
226
228
  message: string;
227
- severity: "error" | "info" | "warning";
229
+ severity: "info" | "warning" | "error";
228
230
  source?: {
229
231
  file: string;
230
232
  position?: {
@@ -235,11 +237,12 @@ export declare const auditOutputSchema: z.ZodObject<{
235
237
  } | undefined;
236
238
  } | undefined;
237
239
  }>, "many">>;
238
- table: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
240
+ table: z.ZodOptional<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
239
241
  title: z.ZodOptional<z.ZodString>;
242
+ }, {
240
243
  columns: z.ZodOptional<z.ZodArray<z.ZodEnum<["left", "center", "right"]>, "many">>;
241
244
  rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">, "many">;
242
- }, "strip", z.ZodTypeAny, {
245
+ }>, "strip", z.ZodTypeAny, {
243
246
  rows: (string | number)[][];
244
247
  title?: string | undefined;
245
248
  columns?: ("left" | "center" | "right")[] | undefined;
@@ -247,8 +250,9 @@ export declare const auditOutputSchema: z.ZodObject<{
247
250
  rows: (string | number)[][];
248
251
  title?: string | undefined;
249
252
  columns?: ("left" | "center" | "right")[] | undefined;
250
- }>, z.ZodObject<{
253
+ }>, z.ZodObject<z.objectUtil.extendShape<{
251
254
  title: z.ZodOptional<z.ZodString>;
255
+ }, {
252
256
  columns: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["left", "center", "right"]>, "many">, z.ZodArray<z.ZodObject<{
253
257
  key: z.ZodString;
254
258
  label: z.ZodOptional<z.ZodString>;
@@ -263,7 +267,7 @@ export declare const auditOutputSchema: z.ZodObject<{
263
267
  align?: "left" | "center" | "right" | undefined;
264
268
  }>, "many">]>>;
265
269
  rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>, "many">;
266
- }, "strip", z.ZodTypeAny, {
270
+ }>, "strip", z.ZodTypeAny, {
267
271
  rows: Record<string, string | number>[];
268
272
  title?: string | undefined;
269
273
  columns?: ("left" | "center" | "right")[] | {
@@ -283,7 +287,7 @@ export declare const auditOutputSchema: z.ZodObject<{
283
287
  }, "strip", z.ZodTypeAny, {
284
288
  issues?: {
285
289
  message: string;
286
- severity: "error" | "info" | "warning";
290
+ severity: "info" | "warning" | "error";
287
291
  source?: {
288
292
  file: string;
289
293
  position?: {
@@ -310,7 +314,7 @@ export declare const auditOutputSchema: z.ZodObject<{
310
314
  }, {
311
315
  issues?: {
312
316
  message: string;
313
- severity: "error" | "info" | "warning";
317
+ severity: "info" | "warning" | "error";
314
318
  source?: {
315
319
  file: string;
316
320
  position?: {
@@ -343,7 +347,7 @@ export declare const auditOutputSchema: z.ZodObject<{
343
347
  details?: {
344
348
  issues?: {
345
349
  message: string;
346
- severity: "error" | "info" | "warning";
350
+ severity: "info" | "warning" | "error";
347
351
  source?: {
348
352
  file: string;
349
353
  position?: {
@@ -376,7 +380,7 @@ export declare const auditOutputSchema: z.ZodObject<{
376
380
  details?: {
377
381
  issues?: {
378
382
  message: string;
379
- severity: "error" | "info" | "warning";
383
+ severity: "info" | "warning" | "error";
380
384
  source?: {
381
385
  file: string;
382
386
  position?: {
@@ -449,7 +453,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
449
453
  }>>;
450
454
  }, "strip", z.ZodTypeAny, {
451
455
  message: string;
452
- severity: "error" | "info" | "warning";
456
+ severity: "info" | "warning" | "error";
453
457
  source?: {
454
458
  file: string;
455
459
  position?: {
@@ -461,7 +465,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
461
465
  } | undefined;
462
466
  }, {
463
467
  message: string;
464
- severity: "error" | "info" | "warning";
468
+ severity: "info" | "warning" | "error";
465
469
  source?: {
466
470
  file: string;
467
471
  position?: {
@@ -472,11 +476,12 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
472
476
  } | undefined;
473
477
  } | undefined;
474
478
  }>, "many">>;
475
- table: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
479
+ table: z.ZodOptional<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
476
480
  title: z.ZodOptional<z.ZodString>;
481
+ }, {
477
482
  columns: z.ZodOptional<z.ZodArray<z.ZodEnum<["left", "center", "right"]>, "many">>;
478
483
  rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">, "many">;
479
- }, "strip", z.ZodTypeAny, {
484
+ }>, "strip", z.ZodTypeAny, {
480
485
  rows: (string | number)[][];
481
486
  title?: string | undefined;
482
487
  columns?: ("left" | "center" | "right")[] | undefined;
@@ -484,8 +489,9 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
484
489
  rows: (string | number)[][];
485
490
  title?: string | undefined;
486
491
  columns?: ("left" | "center" | "right")[] | undefined;
487
- }>, z.ZodObject<{
492
+ }>, z.ZodObject<z.objectUtil.extendShape<{
488
493
  title: z.ZodOptional<z.ZodString>;
494
+ }, {
489
495
  columns: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["left", "center", "right"]>, "many">, z.ZodArray<z.ZodObject<{
490
496
  key: z.ZodString;
491
497
  label: z.ZodOptional<z.ZodString>;
@@ -500,7 +506,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
500
506
  align?: "left" | "center" | "right" | undefined;
501
507
  }>, "many">]>>;
502
508
  rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>, "many">;
503
- }, "strip", z.ZodTypeAny, {
509
+ }>, "strip", z.ZodTypeAny, {
504
510
  rows: Record<string, string | number>[];
505
511
  title?: string | undefined;
506
512
  columns?: ("left" | "center" | "right")[] | {
@@ -520,7 +526,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
520
526
  }, "strip", z.ZodTypeAny, {
521
527
  issues?: {
522
528
  message: string;
523
- severity: "error" | "info" | "warning";
529
+ severity: "info" | "warning" | "error";
524
530
  source?: {
525
531
  file: string;
526
532
  position?: {
@@ -547,7 +553,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
547
553
  }, {
548
554
  issues?: {
549
555
  message: string;
550
- severity: "error" | "info" | "warning";
556
+ severity: "info" | "warning" | "error";
551
557
  source?: {
552
558
  file: string;
553
559
  position?: {
@@ -580,7 +586,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
580
586
  details?: {
581
587
  issues?: {
582
588
  message: string;
583
- severity: "error" | "info" | "warning";
589
+ severity: "info" | "warning" | "error";
584
590
  source?: {
585
591
  file: string;
586
592
  position?: {
@@ -613,7 +619,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
613
619
  details?: {
614
620
  issues?: {
615
621
  message: string;
616
- severity: "error" | "info" | "warning";
622
+ severity: "info" | "warning" | "error";
617
623
  source?: {
618
624
  file: string;
619
625
  position?: {
@@ -646,7 +652,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
646
652
  details?: {
647
653
  issues?: {
648
654
  message: string;
649
- severity: "error" | "info" | "warning";
655
+ severity: "info" | "warning" | "error";
650
656
  source?: {
651
657
  file: string;
652
658
  position?: {
@@ -679,7 +685,7 @@ export declare const auditOutputsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
679
685
  details?: {
680
686
  issues?: {
681
687
  message: string;
682
- severity: "error" | "info" | "warning";
688
+ severity: "info" | "warning" | "error";
683
689
  source?: {
684
690
  file: string;
685
691
  position?: {
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- export declare const auditSchema: z.ZodObject<{
2
+ export declare const auditSchema: z.ZodObject<z.objectUtil.extendShape<{
3
3
  slug: z.ZodString;
4
+ }, {
4
5
  title: z.ZodString;
5
6
  description: z.ZodOptional<z.ZodString>;
6
7
  docsUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
7
- }, "strip", z.ZodTypeAny, {
8
+ }>, "strip", z.ZodTypeAny, {
8
9
  slug: string;
9
10
  title: string;
10
11
  description?: string | undefined;
@@ -16,12 +17,13 @@ export declare const auditSchema: z.ZodObject<{
16
17
  docsUrl?: string | undefined;
17
18
  }>;
18
19
  export type Audit = z.infer<typeof auditSchema>;
19
- export declare const pluginAuditsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
20
+ export declare const pluginAuditsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
20
21
  slug: z.ZodString;
22
+ }, {
21
23
  title: z.ZodString;
22
24
  description: z.ZodOptional<z.ZodString>;
23
25
  docsUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
24
- }, "strip", z.ZodTypeAny, {
26
+ }>, "strip", z.ZodTypeAny, {
25
27
  slug: string;
26
28
  title: string;
27
29
  description?: string | undefined;
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- export declare const categoryRefSchema: z.ZodObject<{
2
+ export declare const categoryRefSchema: z.ZodObject<z.objectUtil.extendShape<{
3
3
  slug: z.ZodString;
4
4
  weight: z.ZodNumber;
5
+ }, {
5
6
  type: z.ZodEnum<["audit", "group"]>;
6
7
  plugin: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
+ }>, "strip", z.ZodTypeAny, {
8
9
  slug: string;
9
10
  weight: number;
10
11
  type: "audit" | "group";
@@ -16,15 +17,15 @@ export declare const categoryRefSchema: z.ZodObject<{
16
17
  plugin: string;
17
18
  }>;
18
19
  export type CategoryRef = z.infer<typeof categoryRefSchema>;
19
- export declare const categoryConfigSchema: z.ZodObject<{
20
- description: z.ZodOptional<z.ZodString>;
20
+ export declare const categoryConfigSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
21
21
  slug: z.ZodString;
22
- refs: z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodObject<{
22
+ refs: z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
23
23
  slug: z.ZodString;
24
24
  weight: z.ZodNumber;
25
+ }, {
25
26
  type: z.ZodEnum<["audit", "group"]>;
26
27
  plugin: z.ZodString;
27
- }, "strip", z.ZodTypeAny, {
28
+ }>, "strip", z.ZodTypeAny, {
28
29
  slug: string;
29
30
  weight: number;
30
31
  type: "audit" | "group";
@@ -55,10 +56,13 @@ export declare const categoryConfigSchema: z.ZodObject<{
55
56
  type: "audit" | "group";
56
57
  plugin: string;
57
58
  }[]>;
59
+ }, {
58
60
  title: z.ZodString;
61
+ description: z.ZodOptional<z.ZodString>;
59
62
  docsUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
63
+ }>, {
60
64
  isBinary: z.ZodOptional<z.ZodBoolean>;
61
- }, "strip", z.ZodTypeAny, {
65
+ }>, "strip", z.ZodTypeAny, {
62
66
  slug: string;
63
67
  refs: {
64
68
  slug: string;
@@ -85,15 +89,15 @@ export declare const categoryConfigSchema: z.ZodObject<{
85
89
  }>;
86
90
  export type CategoryConfig = z.infer<typeof categoryConfigSchema>;
87
91
  export declare function duplicateRefsInCategoryMetricsErrorMsg(metrics: CategoryRef[]): string;
88
- export declare const categoriesSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
89
- description: z.ZodOptional<z.ZodString>;
92
+ export declare const categoriesSchema: z.ZodEffects<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
90
93
  slug: z.ZodString;
91
- refs: z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodObject<{
94
+ refs: z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
92
95
  slug: z.ZodString;
93
96
  weight: z.ZodNumber;
97
+ }, {
94
98
  type: z.ZodEnum<["audit", "group"]>;
95
99
  plugin: z.ZodString;
96
- }, "strip", z.ZodTypeAny, {
100
+ }>, "strip", z.ZodTypeAny, {
97
101
  slug: string;
98
102
  weight: number;
99
103
  type: "audit" | "group";
@@ -124,10 +128,13 @@ export declare const categoriesSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
124
128
  type: "audit" | "group";
125
129
  plugin: string;
126
130
  }[]>;
131
+ }, {
127
132
  title: z.ZodString;
133
+ description: z.ZodOptional<z.ZodString>;
128
134
  docsUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
135
+ }>, {
129
136
  isBinary: z.ZodOptional<z.ZodBoolean>;
130
- }, "strip", z.ZodTypeAny, {
137
+ }>, "strip", z.ZodTypeAny, {
131
138
  slug: string;
132
139
  refs: {
133
140
  slug: string;