@ecogood/e-calculator-schemas 1.2.1 → 1.2.2

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.
@@ -128,13 +128,13 @@ export declare const BalanceSheetCreateRequestBodySchema: z.ZodObject<{
128
128
  }>, "many">>;
129
129
  stakeholderWeights: z.ZodDefault<z.ZodArray<z.ZodObject<{
130
130
  shortName: z.ZodEffects<z.ZodString, string, string>;
131
- weight: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
131
+ weight: z.ZodEffects<z.ZodNumber, number, number>;
132
132
  }, "strip", z.ZodTypeAny, {
133
133
  shortName: string;
134
- weight?: number | undefined;
134
+ weight: number;
135
135
  }, {
136
136
  shortName: string;
137
- weight?: number | undefined;
137
+ weight: number;
138
138
  }>, "many">>;
139
139
  }, "strip", z.ZodTypeAny, {
140
140
  type: BalanceSheetType;
@@ -176,7 +176,7 @@ export declare const BalanceSheetCreateRequestBodySchema: z.ZodObject<{
176
176
  }[];
177
177
  stakeholderWeights: {
178
178
  shortName: string;
179
- weight?: number | undefined;
179
+ weight: number;
180
180
  }[];
181
181
  }, {
182
182
  type: BalanceSheetType;
@@ -218,7 +218,7 @@ export declare const BalanceSheetCreateRequestBodySchema: z.ZodObject<{
218
218
  }[] | undefined;
219
219
  stakeholderWeights?: {
220
220
  shortName: string;
221
- weight?: number | undefined;
221
+ weight: number;
222
222
  }[] | undefined;
223
223
  }>;
224
224
  export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
@@ -347,13 +347,13 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
347
347
  }>, "many">>;
348
348
  stakeholderWeights: z.ZodOptional<z.ZodArray<z.ZodObject<{
349
349
  shortName: z.ZodEffects<z.ZodString, string, string>;
350
- weight: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
350
+ weight: z.ZodEffects<z.ZodNumber, number, number>;
351
351
  }, "strip", z.ZodTypeAny, {
352
352
  shortName: string;
353
- weight?: number | undefined;
353
+ weight: number;
354
354
  }, {
355
355
  shortName: string;
356
- weight?: number | undefined;
356
+ weight: number;
357
357
  }>, "many">>;
358
358
  }, "strip", z.ZodTypeAny, {
359
359
  ratings: {
@@ -393,7 +393,7 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
393
393
  } | undefined;
394
394
  stakeholderWeights?: {
395
395
  shortName: string;
396
- weight?: number | undefined;
396
+ weight: number;
397
397
  }[] | undefined;
398
398
  }, {
399
399
  companyFacts?: {
@@ -433,7 +433,7 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
433
433
  }[] | undefined;
434
434
  stakeholderWeights?: {
435
435
  shortName: string;
436
- weight?: number | undefined;
436
+ weight: number;
437
437
  }[] | undefined;
438
438
  }>;
439
439
  export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
@@ -613,13 +613,13 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
613
613
  }>;
614
614
  stakeholderWeights: z.ZodArray<z.ZodObject<{
615
615
  shortName: z.ZodEffects<z.ZodString, string, string>;
616
- weight: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
616
+ weight: z.ZodEffects<z.ZodNumber, number, number>;
617
617
  }, "strip", z.ZodTypeAny, {
618
618
  shortName: string;
619
- weight?: number | undefined;
619
+ weight: number;
620
620
  }, {
621
621
  shortName: string;
622
- weight?: number | undefined;
622
+ weight: number;
623
623
  }>, "many">;
624
624
  }, "strip", z.ZodTypeAny, {
625
625
  type: BalanceSheetType;
@@ -669,7 +669,7 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
669
669
  }[];
670
670
  stakeholderWeights: {
671
671
  shortName: string;
672
- weight?: number | undefined;
672
+ weight: number;
673
673
  }[];
674
674
  id?: number | undefined;
675
675
  }, {
@@ -720,7 +720,7 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
720
720
  }[];
721
721
  stakeholderWeights: {
722
722
  shortName: string;
723
- weight?: number | undefined;
723
+ weight: number;
724
724
  }[];
725
725
  id?: number | undefined;
726
726
  }>;
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const shared_schemas_1 = require("./shared.schemas");
6
6
  exports.RatingRequestBodySchema = zod_1.z.object({
7
7
  shortName: zod_1.z.string(),
8
- weight: shared_schemas_1.isWeight,
8
+ weight: shared_schemas_1.isWeightOptional,
9
9
  estimations: zod_1.z.number().min(-200).max(10).optional(),
10
10
  });
11
11
  var RatingType;
@@ -9,7 +9,8 @@ export declare enum BalanceSheetVersion {
9
9
  v5_0_6 = "5.06",
10
10
  v5_0_8 = "5.08"
11
11
  }
12
- export declare const isWeight: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
12
+ export declare const isWeight: z.ZodEffects<z.ZodNumber, number, number>;
13
+ export declare const isWeightOptional: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
13
14
  export declare const isNumberWithDefaultZero: z.ZodDefault<z.ZodNumber>;
14
15
  export declare const isPositiveNumber: z.ZodDefault<z.ZodNumber>;
15
16
  export declare const isPercentage: z.ZodNumber;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPercentage = exports.isPositiveNumber = exports.isNumberWithDefaultZero = exports.isWeight = exports.BalanceSheetVersion = exports.BalanceSheetType = exports.isIndustryCode = exports.isCountryCode = void 0;
3
+ exports.isPercentage = exports.isPositiveNumber = exports.isNumberWithDefaultZero = exports.isWeightOptional = exports.isWeight = exports.BalanceSheetVersion = exports.BalanceSheetType = exports.isIndustryCode = exports.isCountryCode = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.isCountryCode = zod_1.z.string().min(3).max(3);
6
6
  exports.isIndustryCode = zod_1.z.string().min(1).max(4);
@@ -25,8 +25,8 @@ exports.isWeight = zod_1.z
25
25
  .number()
26
26
  .refine((v) => WEIGHT_VALUES.some((w) => w === v), {
27
27
  message: `Weight has to be one of the following values ${WEIGHT_VALUES}`,
28
- })
29
- .optional();
28
+ });
29
+ exports.isWeightOptional = exports.isWeight.optional();
30
30
  exports.isNumberWithDefaultZero = isNumberCustomError.default(0);
31
31
  exports.isPositiveNumber = isNumberCustomError
32
32
  .nonnegative('Number should be positive')
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  export declare const StakeholderWeightSchema: z.ZodObject<{
3
3
  shortName: z.ZodEffects<z.ZodString, string, string>;
4
- weight: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
4
+ weight: z.ZodEffects<z.ZodNumber, number, number>;
5
5
  }, "strip", z.ZodTypeAny, {
6
6
  shortName: string;
7
- weight?: number | undefined;
7
+ weight: number;
8
8
  }, {
9
9
  shortName: string;
10
- weight?: number | undefined;
10
+ weight: number;
11
11
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecogood/e-calculator-schemas",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "A package providing the schemas for the e-calculator application.",
5
5
  "main": "dist/e-calculator-schemas",
6
6
  "types": "dist/e-calculator-schemas",