@ecogood/e-calculator-schemas 2.7.14 → 2.7.16
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.
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GeneralInformationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const shared_schemas_1 = require("./shared.schemas");
|
|
5
6
|
const CompanySchema = zod_1.z.object({
|
|
6
|
-
name:
|
|
7
|
+
name: shared_schemas_1.isNonEmptyString,
|
|
7
8
|
});
|
|
8
9
|
const isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;
|
|
9
10
|
const IsoDateString = zod_1.z.string().regex(isoDateRegex, 'Invalid ISO date format');
|
|
@@ -13,7 +14,7 @@ const PeriodSchema = zod_1.z.object({
|
|
|
13
14
|
});
|
|
14
15
|
const ContactPersonSchema = zod_1.z.object({
|
|
15
16
|
email: zod_1.z.string().email(),
|
|
16
|
-
name:
|
|
17
|
+
name: shared_schemas_1.isNonEmptyString,
|
|
17
18
|
});
|
|
18
19
|
exports.GeneralInformationSchema = zod_1.z.object({
|
|
19
20
|
company: CompanySchema,
|
package/dist/organization.dto.js
CHANGED
|
@@ -2,17 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrganizationItemsResponseSchema = exports.OrganizationResponseSchema = exports.OrganizationRequestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const isNonEmptyString = zod_1.z
|
|
7
|
-
.string({ required_error: errorMsg })
|
|
8
|
-
.min(1, { message: errorMsg });
|
|
5
|
+
const shared_schemas_1 = require("./shared.schemas");
|
|
9
6
|
exports.OrganizationRequestSchema = zod_1.z.object({
|
|
10
|
-
name: isNonEmptyString,
|
|
7
|
+
name: shared_schemas_1.isNonEmptyString,
|
|
11
8
|
address: zod_1.z.object({
|
|
12
|
-
city: isNonEmptyString,
|
|
13
|
-
houseNumber: isNonEmptyString,
|
|
14
|
-
street: isNonEmptyString,
|
|
15
|
-
zip: isNonEmptyString,
|
|
9
|
+
city: shared_schemas_1.isNonEmptyString,
|
|
10
|
+
houseNumber: shared_schemas_1.isNonEmptyString,
|
|
11
|
+
street: shared_schemas_1.isNonEmptyString,
|
|
12
|
+
zip: shared_schemas_1.isNonEmptyString,
|
|
16
13
|
}),
|
|
17
14
|
});
|
|
18
15
|
exports.OrganizationResponseSchema = exports.OrganizationRequestSchema.extend({
|
|
@@ -20,5 +17,5 @@ exports.OrganizationResponseSchema = exports.OrganizationRequestSchema.extend({
|
|
|
20
17
|
invitations: zod_1.z.string().email().array(),
|
|
21
18
|
});
|
|
22
19
|
exports.OrganizationItemsResponseSchema = zod_1.z
|
|
23
|
-
.object({ id: zod_1.z.number(), name: isNonEmptyString })
|
|
20
|
+
.object({ id: zod_1.z.number(), name: shared_schemas_1.isNonEmptyString })
|
|
24
21
|
.array();
|
package/dist/shared.schemas.d.ts
CHANGED
|
@@ -19,3 +19,4 @@ export declare const isPositiveNumber: z.ZodDefault<z.ZodNumber>;
|
|
|
19
19
|
export declare const isPositiveNumberNotZero: z.ZodDefault<z.ZodNumber>;
|
|
20
20
|
export declare const isPercentage: z.ZodNumber;
|
|
21
21
|
export declare const isPercentageNotZero: z.ZodNumber;
|
|
22
|
+
export declare const isNonEmptyString: z.ZodString;
|
package/dist/shared.schemas.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPercentageNotZero = exports.isPercentage = exports.isPositiveNumberNotZero = exports.isPositiveNumber = exports.isNumberWithDefaultZero = exports.isWeightOptional = exports.isWeight = exports.WEIGHT_VALUES = exports.BalanceSheetVersion = exports.BalanceSheetType = exports.isIndustryCode = exports.isCountryCode = void 0;
|
|
3
|
+
exports.isNonEmptyString = exports.isPercentageNotZero = exports.isPercentage = exports.isPositiveNumberNotZero = exports.isPositiveNumber = exports.isNumberWithDefaultZero = exports.isWeightOptional = exports.isWeight = exports.WEIGHT_VALUES = 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);
|
|
@@ -48,3 +48,7 @@ exports.isPercentageNotZero = zod_1.z
|
|
|
48
48
|
})
|
|
49
49
|
.min(1, 'Percentage should be between 1 and 100')
|
|
50
50
|
.max(100, 'Percentage should be between 0 and 100');
|
|
51
|
+
const errorMsg = 'Must not be blank';
|
|
52
|
+
exports.isNonEmptyString = zod_1.z
|
|
53
|
+
.string({ required_error: errorMsg })
|
|
54
|
+
.min(1, { message: errorMsg });
|
package/package.json
CHANGED