@ecogood/e-calculator-schemas 1.2.0 → 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.
|
@@ -127,14 +127,14 @@ export declare const BalanceSheetCreateRequestBodySchema: z.ZodObject<{
|
|
|
127
127
|
estimations?: number | undefined;
|
|
128
128
|
}>, "many">>;
|
|
129
129
|
stakeholderWeights: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
130
|
-
shortName: z.ZodString
|
|
131
|
-
weight: z.
|
|
130
|
+
shortName: z.ZodEffects<z.ZodString, string, string>;
|
|
131
|
+
weight: z.ZodEffects<z.ZodNumber, number, number>;
|
|
132
132
|
}, "strip", z.ZodTypeAny, {
|
|
133
133
|
shortName: string;
|
|
134
|
-
weight
|
|
134
|
+
weight: number;
|
|
135
135
|
}, {
|
|
136
136
|
shortName: string;
|
|
137
|
-
weight
|
|
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
|
|
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
|
|
221
|
+
weight: number;
|
|
222
222
|
}[] | undefined;
|
|
223
223
|
}>;
|
|
224
224
|
export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
|
|
@@ -346,14 +346,14 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
|
|
|
346
346
|
estimations?: number | undefined;
|
|
347
347
|
}>, "many">>;
|
|
348
348
|
stakeholderWeights: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
349
|
-
shortName: z.ZodString
|
|
350
|
-
weight: z.
|
|
349
|
+
shortName: z.ZodEffects<z.ZodString, string, string>;
|
|
350
|
+
weight: z.ZodEffects<z.ZodNumber, number, number>;
|
|
351
351
|
}, "strip", z.ZodTypeAny, {
|
|
352
352
|
shortName: string;
|
|
353
|
-
weight
|
|
353
|
+
weight: number;
|
|
354
354
|
}, {
|
|
355
355
|
shortName: string;
|
|
356
|
-
weight
|
|
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
|
|
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
|
|
436
|
+
weight: number;
|
|
437
437
|
}[] | undefined;
|
|
438
438
|
}>;
|
|
439
439
|
export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
|
|
@@ -612,14 +612,14 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
|
|
|
612
612
|
averageJourneyToWorkForStaffInKm?: number | undefined;
|
|
613
613
|
}>;
|
|
614
614
|
stakeholderWeights: z.ZodArray<z.ZodObject<{
|
|
615
|
-
shortName: z.ZodString
|
|
616
|
-
weight: z.
|
|
615
|
+
shortName: z.ZodEffects<z.ZodString, string, string>;
|
|
616
|
+
weight: z.ZodEffects<z.ZodNumber, number, number>;
|
|
617
617
|
}, "strip", z.ZodTypeAny, {
|
|
618
618
|
shortName: string;
|
|
619
|
-
weight
|
|
619
|
+
weight: number;
|
|
620
620
|
}, {
|
|
621
621
|
shortName: string;
|
|
622
|
-
weight
|
|
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
|
|
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
|
|
723
|
+
weight: number;
|
|
724
724
|
}[];
|
|
725
725
|
id?: number | undefined;
|
|
726
726
|
}>;
|
package/dist/rating.dto.js
CHANGED
|
@@ -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.
|
|
8
|
+
weight: shared_schemas_1.isWeightOptional,
|
|
9
9
|
estimations: zod_1.z.number().min(-200).max(10).optional(),
|
|
10
10
|
});
|
|
11
11
|
var RatingType;
|
package/dist/shared.schemas.d.ts
CHANGED
|
@@ -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.
|
|
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;
|
package/dist/shared.schemas.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
shortName: z.ZodString
|
|
4
|
-
weight: z.
|
|
3
|
+
shortName: z.ZodEffects<z.ZodString, string, string>;
|
|
4
|
+
weight: z.ZodEffects<z.ZodNumber, number, number>;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
6
6
|
shortName: string;
|
|
7
|
-
weight
|
|
7
|
+
weight: number;
|
|
8
8
|
}, {
|
|
9
9
|
shortName: string;
|
|
10
|
-
weight
|
|
10
|
+
weight: number;
|
|
11
11
|
}>;
|
|
@@ -3,7 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StakeholderWeightSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const shared_schemas_1 = require("./shared.schemas");
|
|
6
|
+
const STAKEHOLDER_NAMES = ['A', 'B', 'C', 'D', 'E'];
|
|
7
|
+
const isStakeholderShortName = zod_1.z
|
|
8
|
+
.string()
|
|
9
|
+
.refine((v) => STAKEHOLDER_NAMES.some((w) => w === v), {
|
|
10
|
+
message: `Short name has to be one of the following values ${STAKEHOLDER_NAMES}`,
|
|
11
|
+
});
|
|
6
12
|
exports.StakeholderWeightSchema = zod_1.z.object({
|
|
7
|
-
shortName:
|
|
13
|
+
shortName: isStakeholderShortName,
|
|
8
14
|
weight: shared_schemas_1.isWeight,
|
|
9
15
|
});
|
package/package.json
CHANGED