@open-dpp/dto 0.1.2 → 0.1.4
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/aas/administrative-information-json-schema.d.ts +1 -1
- package/dist/aas/administrative-information-json-schema.d.ts.map +1 -1
- package/dist/aas/asset-administration-shell-json-schema.d.ts +1 -1
- package/dist/aas/asset-administration-shell-json-schema.d.ts.map +1 -1
- package/dist/aas/asset-administration-shell-json-schema.js +2 -2
- package/dist/aas/asset-information-json-schema.d.ts +1 -1
- package/dist/aas/asset-information-json-schema.d.ts.map +1 -1
- package/dist/aas/asset-information-json-schema.js +3 -1
- package/dist/aas/common/basic-json-schema.d.ts +1 -1
- package/dist/aas/common/basic-json-schema.d.ts.map +1 -1
- package/dist/aas/common/basic-json-schema.js +7 -4
- package/dist/aas/common/key-json-schema.d.ts +1 -1
- package/dist/aas/common/key-json-schema.d.ts.map +1 -1
- package/dist/aas/common/language-text-json-schema.d.ts +1 -1
- package/dist/aas/common/language-text-json-schema.d.ts.map +1 -1
- package/dist/aas/common/qualifier-json-schema.d.ts +1 -1
- package/dist/aas/common/qualifier-json-schema.d.ts.map +1 -1
- package/dist/aas/common/reference-json-schema.d.ts +3 -3
- package/dist/aas/common/reference-json-schema.d.ts.map +1 -1
- package/dist/aas/concept-description-json-schema.d.ts +1 -1
- package/dist/aas/concept-description-json-schema.d.ts.map +1 -1
- package/dist/aas/dto/value-response.dto.d.ts +1 -1
- package/dist/aas/dto/value-response.dto.d.ts.map +1 -1
- package/dist/aas/embedded-data-specification-json-schema.d.ts +1 -1
- package/dist/aas/embedded-data-specification-json-schema.d.ts.map +1 -1
- package/dist/aas/enums/aas-submodel-elements.d.ts +1 -1
- package/dist/aas/enums/aas-submodel-elements.d.ts.map +1 -1
- package/dist/aas/enums/aas-submodel-elements.js +18 -18
- package/dist/aas/enums/asset-kind-enum.d.ts +1 -1
- package/dist/aas/enums/asset-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/asset-kind-enum.js +2 -2
- package/dist/aas/enums/data-type-def.d.ts +1 -1
- package/dist/aas/enums/data-type-def.d.ts.map +1 -1
- package/dist/aas/enums/data-type-def.js +30 -30
- package/dist/aas/enums/entity-type-enum.d.ts +1 -1
- package/dist/aas/enums/entity-type-enum.d.ts.map +1 -1
- package/dist/aas/enums/entity-type-enum.js +2 -2
- package/dist/aas/enums/key-types-enum.d.ts +1 -1
- package/dist/aas/enums/key-types-enum.d.ts.map +1 -1
- package/dist/aas/enums/key-types-enum.js +24 -24
- package/dist/aas/enums/language-enum.d.ts +1 -1
- package/dist/aas/enums/language-enum.d.ts.map +1 -1
- package/dist/aas/enums/language-enum.js +2 -2
- package/dist/aas/enums/modelling-kind-enum.d.ts +1 -1
- package/dist/aas/enums/modelling-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/modelling-kind-enum.js +2 -2
- package/dist/aas/enums/permission-enum.d.ts +1 -1
- package/dist/aas/enums/permission-enum.d.ts.map +1 -1
- package/dist/aas/enums/permission-enum.js +4 -4
- package/dist/aas/enums/permission-kind-enum.d.ts +1 -1
- package/dist/aas/enums/permission-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/permission-kind-enum.js +1 -1
- package/dist/aas/enums/qualifier-kind-enum.d.ts +1 -1
- package/dist/aas/enums/qualifier-kind-enum.d.ts.map +1 -1
- package/dist/aas/enums/qualifier-kind-enum.js +3 -3
- package/dist/aas/enums/reference-types-enum.d.ts +1 -1
- package/dist/aas/enums/reference-types-enum.d.ts.map +1 -1
- package/dist/aas/enums/reference-types-enum.js +2 -2
- package/dist/aas/environment-json-schema.d.ts +1 -1
- package/dist/aas/environment-json-schema.d.ts.map +1 -1
- package/dist/aas/environment-json-schema.js +3 -1
- package/dist/aas/extension-json-schema.d.ts +1 -1
- package/dist/aas/extension-json-schema.d.ts.map +1 -1
- package/dist/aas/resource-json-schema.d.ts +1 -1
- package/dist/aas/resource-json-schema.d.ts.map +1 -1
- package/dist/aas/security/access-permission-rule.dto.d.ts +1 -1
- package/dist/aas/security/access-permission-rule.dto.d.ts.map +1 -1
- package/dist/aas/security/security.dto.d.ts +1 -1
- package/dist/aas/security/security.dto.d.ts.map +1 -1
- package/dist/aas/specific-asset-id-json-schema.d.ts +1 -1
- package/dist/aas/specific-asset-id-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.js +3 -2
- package/dist/aas/submodel-base/blob-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/blob-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/entity-type-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/entity-type-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/entity-type-json-schema.js +1 -2
- package/dist/aas/submodel-base/file-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/file-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/property-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/property-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/range-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/range-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/reference-element-json-schema.d.ts +2 -2
- package/dist/aas/submodel-base/reference-element-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/relationship-element-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/relationship-element-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-base-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-base-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-base-json-schema.js +3 -1
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.js +7 -4
- package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-list-json-schema.js +7 -4
- package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-modification-schema.js +3 -1
- package/dist/aas/submodel-base/submodel-element-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-element-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-element-schema.js +12 -5
- package/dist/aas/submodel-base/submodel-json-schema.d.ts +1 -1
- package/dist/aas/submodel-base/submodel-json-schema.d.ts.map +1 -1
- package/dist/aas/submodel-base/submodel-json-schema.js +5 -3
- package/dist/branding/branding.dto.d.ts +1 -1
- package/dist/branding/branding.dto.d.ts.map +1 -1
- package/dist/index.d.ts +56 -56
- package/dist/index.d.ts.map +1 -1
- package/dist/organizations/member.dto.d.ts +1 -1
- package/dist/organizations/member.dto.d.ts.map +1 -1
- package/dist/passports/passport.dto.d.ts +1 -1
- package/dist/passports/passport.dto.d.ts.map +1 -1
- package/dist/passports/passport.dto.js +4 -2
- package/dist/shared/dpp.schemas.d.ts +1 -1
- package/dist/shared/dpp.schemas.d.ts.map +1 -1
- package/dist/shared/pagination.dto.d.ts +1 -1
- package/dist/shared/pagination.dto.d.ts.map +1 -1
- package/dist/shared/populate.dto.d.ts +1 -1
- package/dist/shared/populate.dto.d.ts.map +1 -1
- package/dist/shared/populate.dto.js +6 -6
- package/dist/shared/table.dto.d.ts +1 -1
- package/dist/shared/table.dto.d.ts.map +1 -1
- package/dist/status/status.dto.d.ts +1 -1
- package/dist/status/status.dto.d.ts.map +1 -1
- package/dist/templates/template.dto.d.ts +1 -1
- package/dist/templates/template.dto.d.ts.map +1 -1
- package/dist/templates/template.dto.js +4 -2
- package/dist/users/create-user.dto.d.ts +1 -1
- package/dist/users/create-user.dto.d.ts.map +1 -1
- package/dist/users/set-user-role.dto.d.ts +1 -1
- package/dist/users/set-user-role.dto.d.ts.map +1 -1
- package/dist/users/set-user-role.dto.js +1 -1
- package/dist/users/user.dto.d.ts +1 -1
- package/dist/users/user.dto.d.ts.map +1 -1
- package/dist/users/user.dto.js +5 -5
- package/package.json +14 -19
- package/src/aas/aas-json-schemas.spec.ts +68 -67
- package/src/aas/administrative-information-json-schema.ts +2 -2
- package/src/aas/asset-administration-shell-json-schema.ts +32 -24
- package/src/aas/asset-information-json-schema.ts +10 -8
- package/src/aas/common/basic-json-schema.ts +18 -15
- package/src/aas/common/key-json-schema.ts +4 -4
- package/src/aas/common/language-text-json-schema.ts +4 -4
- package/src/aas/common/qualifier-json-schema.ts +5 -5
- package/src/aas/common/reference-json-schema.ts +13 -13
- package/src/aas/concept-description-json-schema.ts +7 -7
- package/src/aas/dto/value-response.dto.spec.ts +21 -15
- package/src/aas/dto/value-response.dto.ts +4 -4
- package/src/aas/embedded-data-specification-json-schema.ts +3 -3
- package/src/aas/enums/aas-submodel-elements.ts +22 -22
- package/src/aas/enums/asset-kind-enum.ts +6 -6
- package/src/aas/enums/data-type-def.ts +34 -34
- package/src/aas/enums/entity-type-enum.ts +6 -6
- package/src/aas/enums/key-types-enum.ts +28 -28
- package/src/aas/enums/language-enum.ts +6 -6
- package/src/aas/enums/modelling-kind-enum.ts +6 -6
- package/src/aas/enums/permission-enum.ts +8 -8
- package/src/aas/enums/permission-kind-enum.ts +5 -5
- package/src/aas/enums/qualifier-kind-enum.ts +7 -7
- package/src/aas/enums/reference-types-enum.ts +6 -6
- package/src/aas/environment-json-schema.ts +8 -6
- package/src/aas/extension-json-schema.ts +4 -4
- package/src/aas/resource-json-schema.ts +2 -2
- package/src/aas/security/access-permission-rule.dto.ts +12 -12
- package/src/aas/security/security.dto.ts +10 -7
- package/src/aas/specific-asset-id-json-schema.ts +3 -3
- package/src/aas/submodel-base/annotated-relationship-element-json-schema.ts +10 -10
- package/src/aas/submodel-base/blob-json-schema.ts +4 -4
- package/src/aas/submodel-base/entity-type-json-schema.ts +9 -11
- package/src/aas/submodel-base/file-json-schema.ts +11 -8
- package/src/aas/submodel-base/multi-language-property-json-schema.ts +6 -6
- package/src/aas/submodel-base/property-json-schema.ts +13 -10
- package/src/aas/submodel-base/range-json-schema.ts +5 -5
- package/src/aas/submodel-base/reference-element-json-schema.ts +13 -10
- package/src/aas/submodel-base/relationship-element-json-schema.ts +5 -5
- package/src/aas/submodel-base/submodel-base-json-schema.ts +10 -8
- package/src/aas/submodel-base/submodel-element-collection-json-schema.ts +28 -17
- package/src/aas/submodel-base/submodel-element-list-json-schema.ts +27 -20
- package/src/aas/submodel-base/submodel-element-modification-schema.ts +6 -4
- package/src/aas/submodel-base/submodel-element-schema.ts +37 -30
- package/src/aas/submodel-base/submodel-json-schema.ts +28 -25
- package/src/branding/branding.dto.ts +3 -3
- package/src/index.ts +56 -56
- package/src/organizations/member.dto.ts +8 -8
- package/src/passports/passport.dto.ts +15 -13
- package/src/shared/dpp.schemas.ts +8 -7
- package/src/shared/pagination.dto.ts +6 -6
- package/src/shared/populate.dto.ts +8 -11
- package/src/shared/table.dto.ts +3 -3
- package/src/status/status.dto.ts +3 -3
- package/src/templates/template.dto.ts +15 -13
- package/src/users/create-user.dto.ts +3 -3
- package/src/users/set-user-role.dto.ts +4 -4
- package/src/users/user.dto.ts +19 -19
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { NameAndDescriptionModificationSchema } from
|
|
3
|
-
import { LanguageTextJsonSchema } from
|
|
4
|
-
import { QualifierJsonSchema } from
|
|
5
|
-
import { ReferenceJsonSchema } from
|
|
6
|
-
import { EmbeddedDataSpecificationJsonSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NameAndDescriptionModificationSchema } from "../common/basic-json-schema";
|
|
3
|
+
import { LanguageTextJsonSchema } from "../common/language-text-json-schema";
|
|
4
|
+
import { QualifierJsonSchema } from "../common/qualifier-json-schema";
|
|
5
|
+
import { ReferenceJsonSchema } from "../common/reference-json-schema";
|
|
6
|
+
import { EmbeddedDataSpecificationJsonSchema } from "../embedded-data-specification-json-schema";
|
|
7
7
|
|
|
8
8
|
export const SubmodelBaseJsonSchema = z.object({
|
|
9
9
|
category: z.nullish(z.string()),
|
|
@@ -14,6 +14,8 @@ export const SubmodelBaseJsonSchema = z.object({
|
|
|
14
14
|
supplementalSemanticIds: z.array(ReferenceJsonSchema).default([]),
|
|
15
15
|
qualifiers: z.array(QualifierJsonSchema).default([]),
|
|
16
16
|
embeddedDataSpecifications: z.array(EmbeddedDataSpecificationJsonSchema).default([]),
|
|
17
|
-
})
|
|
17
|
+
});
|
|
18
18
|
|
|
19
|
-
export const SubmodelBaseModificationSchema = NameAndDescriptionModificationSchema.extend({
|
|
19
|
+
export const SubmodelBaseModificationSchema = NameAndDescriptionModificationSchema.extend({
|
|
20
|
+
idShort: z.string(),
|
|
21
|
+
});
|
|
@@ -1,27 +1,38 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { ExtensionJsonSchema } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ExtensionJsonSchema } from "../extension-json-schema";
|
|
3
|
+
import {
|
|
4
|
+
SubmodelBaseJsonSchema,
|
|
5
|
+
SubmodelBaseModificationSchema,
|
|
6
|
+
} from "./submodel-base-json-schema";
|
|
7
|
+
import { SubmodelElementModificationSchema } from "./submodel-element-modification-schema";
|
|
8
|
+
import { SubmodelElementSchema } from "./submodel-element-schema";
|
|
6
9
|
|
|
7
|
-
export const SubmodelElementCollectionJsonSchema = z
|
|
8
|
-
SubmodelElementCollectionJsonSchemaImpl()
|
|
9
|
-
|
|
10
|
+
export const SubmodelElementCollectionJsonSchema = z
|
|
11
|
+
.lazy(() => SubmodelElementCollectionJsonSchemaImpl())
|
|
12
|
+
.meta({ id: "SubmodelElementCollection" });
|
|
10
13
|
|
|
11
14
|
export function SubmodelElementCollectionJsonSchemaImpl() {
|
|
12
15
|
return z.object({
|
|
13
16
|
...SubmodelBaseJsonSchema.shape,
|
|
14
17
|
extensions: ExtensionJsonSchema.array().default([]),
|
|
15
18
|
value: SubmodelElementSchema.array().default([]),
|
|
16
|
-
})
|
|
17
|
-
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
18
21
|
|
|
19
|
-
export type SubmodelElementCollectionRequestDto = z.input<
|
|
20
|
-
|
|
22
|
+
export type SubmodelElementCollectionRequestDto = z.input<
|
|
23
|
+
typeof SubmodelElementCollectionJsonSchema
|
|
24
|
+
>;
|
|
25
|
+
export type SubmodelElementCollectionResponseDto = z.infer<
|
|
26
|
+
typeof SubmodelElementCollectionJsonSchema
|
|
27
|
+
>;
|
|
21
28
|
|
|
22
|
-
export const SubmodelElementCollectionModificationSchema = z
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
export const SubmodelElementCollectionModificationSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
...SubmodelBaseModificationSchema.shape,
|
|
32
|
+
value: SubmodelElementModificationSchema.array().optional(),
|
|
33
|
+
})
|
|
34
|
+
.meta({ id: "SubmodelElementCollectionModification" });
|
|
26
35
|
|
|
27
|
-
export type SubmodelElementCollectionModificationDto = z.infer<
|
|
36
|
+
export type SubmodelElementCollectionModificationDto = z.infer<
|
|
37
|
+
typeof SubmodelElementCollectionModificationSchema
|
|
38
|
+
>;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { ValueTypeSchema } from
|
|
3
|
-
import { ReferenceJsonSchema } from
|
|
4
|
-
import { AasSubmodelElementsEnum } from
|
|
5
|
-
import { ExtensionJsonSchema } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ValueTypeSchema } from "../common/basic-json-schema";
|
|
3
|
+
import { ReferenceJsonSchema } from "../common/reference-json-schema";
|
|
4
|
+
import { AasSubmodelElementsEnum } from "../enums/aas-submodel-elements";
|
|
5
|
+
import { ExtensionJsonSchema } from "../extension-json-schema";
|
|
6
|
+
import {
|
|
7
|
+
SubmodelBaseJsonSchema,
|
|
8
|
+
SubmodelBaseModificationSchema,
|
|
9
|
+
} from "./submodel-base-json-schema";
|
|
10
|
+
import { SubmodelElementModificationSchema } from "./submodel-element-modification-schema";
|
|
11
|
+
import { SubmodelElementSchema } from "./submodel-element-schema";
|
|
9
12
|
|
|
10
|
-
export const SubmodelElementListJsonSchema = z
|
|
11
|
-
SubmodelElementListJsonSchemaImpl()
|
|
12
|
-
|
|
13
|
+
export const SubmodelElementListJsonSchema = z
|
|
14
|
+
.lazy(() => SubmodelElementListJsonSchemaImpl())
|
|
15
|
+
.meta({ id: "SubmodelElementList" });
|
|
13
16
|
|
|
14
17
|
export function SubmodelElementListJsonSchemaImpl() {
|
|
15
18
|
return z.object({
|
|
@@ -20,15 +23,19 @@ export function SubmodelElementListJsonSchemaImpl() {
|
|
|
20
23
|
semanticIdListElement: z.nullish(ReferenceJsonSchema),
|
|
21
24
|
valueTypeListElement: z.nullish(ValueTypeSchema),
|
|
22
25
|
value: SubmodelElementSchema.array().default([]),
|
|
23
|
-
})
|
|
24
|
-
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
25
28
|
|
|
26
|
-
export type SubmodelElementListRequestDto = z.input<typeof SubmodelElementListJsonSchema
|
|
27
|
-
export type SubmodelElementListResponseDto = z.infer<typeof SubmodelElementListJsonSchema
|
|
29
|
+
export type SubmodelElementListRequestDto = z.input<typeof SubmodelElementListJsonSchema>;
|
|
30
|
+
export type SubmodelElementListResponseDto = z.infer<typeof SubmodelElementListJsonSchema>;
|
|
28
31
|
|
|
29
|
-
export const SubmodelElementListModificationSchema = z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
export const SubmodelElementListModificationSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
...SubmodelBaseModificationSchema.shape,
|
|
35
|
+
value: SubmodelElementModificationSchema.array().optional(),
|
|
36
|
+
})
|
|
37
|
+
.meta({ id: "SubmodelElementListModification" });
|
|
33
38
|
|
|
34
|
-
export type SubmodelElementListModificationDto = z.input<
|
|
39
|
+
export type SubmodelElementListModificationDto = z.input<
|
|
40
|
+
typeof SubmodelElementListModificationSchema
|
|
41
|
+
>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { SubmodelBaseModificationSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SubmodelBaseModificationSchema } from "./submodel-base-json-schema";
|
|
3
3
|
|
|
4
|
-
export const SubmodelElementModificationSchema = z.looseObject({
|
|
4
|
+
export const SubmodelElementModificationSchema = z.looseObject({
|
|
5
|
+
...SubmodelBaseModificationSchema.shape,
|
|
6
|
+
});
|
|
5
7
|
|
|
6
|
-
export type SubmodelElementModificationDto = z.infer<typeof SubmodelElementModificationSchema
|
|
8
|
+
export type SubmodelElementModificationDto = z.infer<typeof SubmodelElementModificationSchema>;
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { PagingMetadataDtoSchema } from
|
|
3
|
-
import { KeyTypes } from
|
|
4
|
-
import { AnnotatedRelationshipElementJsonSchemaImpl } from
|
|
5
|
-
import { BlobJsonSchema } from
|
|
6
|
-
import { EntityTypeJsonSchemaImpl } from
|
|
7
|
-
import { FileJsonSchema } from
|
|
8
|
-
import { MultiLanguagePropertyJsonSchema } from
|
|
9
|
-
import { PropertyJsonSchema } from
|
|
10
|
-
import { RangeJsonSchema } from
|
|
11
|
-
import { ReferenceElementJsonSchema } from
|
|
12
|
-
import { RelationshipElementJsonSchema } from
|
|
13
|
-
import { SubmodelBaseJsonSchema } from
|
|
14
|
-
import { SubmodelElementCollectionJsonSchemaImpl } from
|
|
15
|
-
import { SubmodelElementListJsonSchemaImpl } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PagingMetadataDtoSchema } from "../../shared/pagination.dto";
|
|
3
|
+
import { KeyTypes } from "../enums/key-types-enum";
|
|
4
|
+
import { AnnotatedRelationshipElementJsonSchemaImpl } from "./annotated-relationship-element-json-schema";
|
|
5
|
+
import { BlobJsonSchema } from "./blob-json-schema";
|
|
6
|
+
import { EntityTypeJsonSchemaImpl } from "./entity-type-json-schema";
|
|
7
|
+
import { FileJsonSchema } from "./file-json-schema";
|
|
8
|
+
import { MultiLanguagePropertyJsonSchema } from "./multi-language-property-json-schema";
|
|
9
|
+
import { PropertyJsonSchema } from "./property-json-schema";
|
|
10
|
+
import { RangeJsonSchema } from "./range-json-schema";
|
|
11
|
+
import { ReferenceElementJsonSchema } from "./reference-element-json-schema";
|
|
12
|
+
import { RelationshipElementJsonSchema } from "./relationship-element-json-schema";
|
|
13
|
+
import { SubmodelBaseJsonSchema } from "./submodel-base-json-schema";
|
|
14
|
+
import { SubmodelElementCollectionJsonSchemaImpl } from "./submodel-element-collection-json-schema";
|
|
15
|
+
import { SubmodelElementListJsonSchemaImpl } from "./submodel-element-list-json-schema";
|
|
16
16
|
|
|
17
|
-
export const SubmodelElementSharedSchema = z.looseObject({
|
|
18
|
-
|
|
17
|
+
export const SubmodelElementSharedSchema = z.looseObject({
|
|
18
|
+
...SubmodelBaseJsonSchema.shape,
|
|
19
|
+
modelType: z.string(),
|
|
20
|
+
});
|
|
21
|
+
export type SubmodelElementSharedResponseDto = z.infer<typeof SubmodelElementSharedSchema>;
|
|
19
22
|
|
|
20
|
-
export const SubmodelElementSchema: z.ZodTypeAny<SubmodelElementSharedResponseDto> = z
|
|
21
|
-
SubmodelElementSchemaJsonImpl()
|
|
22
|
-
|
|
23
|
+
export const SubmodelElementSchema: z.ZodTypeAny<SubmodelElementSharedResponseDto> = z
|
|
24
|
+
.lazy(() => SubmodelElementSchemaJsonImpl())
|
|
25
|
+
.meta({ id: "SubmodelElement" });
|
|
23
26
|
|
|
24
|
-
export type SubmodelElementSharedRequestDto = z.input<typeof SubmodelElementSharedSchema
|
|
27
|
+
export type SubmodelElementSharedRequestDto = z.input<typeof SubmodelElementSharedSchema>;
|
|
25
28
|
|
|
26
29
|
export function SubmodelElementSchemaJsonImpl() {
|
|
27
|
-
return z.discriminatedUnion(
|
|
30
|
+
return z.discriminatedUnion("modelType", [
|
|
28
31
|
AnnotatedRelationshipElementJsonSchemaImpl().extend({
|
|
29
32
|
modelType: z.literal(KeyTypes.AnnotatedRelationshipElement),
|
|
30
33
|
}),
|
|
@@ -58,14 +61,18 @@ export function SubmodelElementSchemaJsonImpl() {
|
|
|
58
61
|
SubmodelElementListJsonSchemaImpl().extend({
|
|
59
62
|
modelType: z.literal(KeyTypes.SubmodelElementList),
|
|
60
63
|
}),
|
|
61
|
-
])
|
|
64
|
+
]);
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
export const SubmodelElementPaginationResponseDtoSchema = z
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
export const SubmodelElementPaginationResponseDtoSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
...PagingMetadataDtoSchema.shape,
|
|
70
|
+
result: SubmodelElementSchema.array(),
|
|
71
|
+
})
|
|
72
|
+
.meta({ id: "SubmodelElements" });
|
|
68
73
|
|
|
69
|
-
export type SubmodelElementPaginationResponseDto = z.infer<
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
export type SubmodelElementPaginationResponseDto = z.infer<
|
|
75
|
+
typeof SubmodelElementPaginationResponseDtoSchema
|
|
76
|
+
>;
|
|
77
|
+
export type SubmodelElementRequestDto = z.infer<typeof SubmodelElementSchema>;
|
|
78
|
+
export type SubmodelElementResponseDto = z.infer<typeof SubmodelElementSchema>;
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from
|
|
2
|
-
import { z } from
|
|
3
|
-
import { PagingMetadataDtoSchema } from
|
|
4
|
-
import { AdministrativeInformationJsonSchema } from
|
|
5
|
-
import { ModellingKindEnum } from
|
|
6
|
-
import { ExtensionJsonSchema } from
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { v4 as uuidv4 } from "uuid";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PagingMetadataDtoSchema } from "../../shared/pagination.dto";
|
|
4
|
+
import { AdministrativeInformationJsonSchema } from "../administrative-information-json-schema";
|
|
5
|
+
import { ModellingKindEnum } from "../enums/modelling-kind-enum";
|
|
6
|
+
import { ExtensionJsonSchema } from "../extension-json-schema";
|
|
7
|
+
import {
|
|
8
|
+
SubmodelBaseJsonSchema,
|
|
9
|
+
SubmodelBaseModificationSchema,
|
|
10
|
+
} from "./submodel-base-json-schema";
|
|
11
|
+
import { SubmodelElementSchema } from "./submodel-element-schema";
|
|
9
12
|
|
|
10
|
-
export const SubmodelJsonSchema = z
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export const SubmodelJsonSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
...SubmodelBaseJsonSchema.shape,
|
|
16
|
+
id: z.string(),
|
|
17
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
18
|
+
administration: z.nullish(AdministrativeInformationJsonSchema),
|
|
19
|
+
kind: z.nullish(ModellingKindEnum),
|
|
20
|
+
submodelElements: SubmodelElementSchema.array().default([]),
|
|
21
|
+
})
|
|
22
|
+
.meta({ id: "Submodel" });
|
|
18
23
|
export const SubmodelPaginationResponseDtoSchema = z
|
|
19
24
|
.object({
|
|
20
25
|
...PagingMetadataDtoSchema.shape,
|
|
21
26
|
result: SubmodelJsonSchema.array(),
|
|
22
27
|
})
|
|
23
|
-
.meta({ id:
|
|
24
|
-
export type SubmodelPaginationResponseDto = z.infer<
|
|
25
|
-
typeof SubmodelPaginationResponseDtoSchema
|
|
26
|
-
>
|
|
28
|
+
.meta({ id: "Submodels" });
|
|
29
|
+
export type SubmodelPaginationResponseDto = z.infer<typeof SubmodelPaginationResponseDtoSchema>;
|
|
27
30
|
export const SubmodelRequestDtoSchema = SubmodelJsonSchema.extend({
|
|
28
31
|
id: z.string().default(() => uuidv4()),
|
|
29
|
-
})
|
|
30
|
-
export const SubmodelModificationSchema = SubmodelBaseModificationSchema
|
|
31
|
-
export type SubmodelModificationDto = z.infer<typeof SubmodelModificationSchema
|
|
32
|
-
export type SubmodelRequestDto = z.input<typeof SubmodelRequestDtoSchema
|
|
33
|
-
export type SubmodelResponseDto = z.infer<typeof SubmodelJsonSchema
|
|
32
|
+
});
|
|
33
|
+
export const SubmodelModificationSchema = SubmodelBaseModificationSchema;
|
|
34
|
+
export type SubmodelModificationDto = z.infer<typeof SubmodelModificationSchema>;
|
|
35
|
+
export type SubmodelRequestDto = z.input<typeof SubmodelRequestDtoSchema>;
|
|
36
|
+
export type SubmodelResponseDto = z.infer<typeof SubmodelJsonSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const BrandingDtoSchema = z.object({
|
|
4
4
|
logo: z.string().nullish(),
|
|
5
|
-
})
|
|
5
|
+
});
|
|
6
6
|
|
|
7
|
-
export type BrandingDto = z.infer<typeof BrandingDtoSchema
|
|
7
|
+
export type BrandingDto = z.infer<typeof BrandingDtoSchema>;
|
package/src/index.ts
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./aas/administrative-information-json-schema";
|
|
2
|
+
export * from "./aas/asset-administration-shell-json-schema";
|
|
3
|
+
export * from "./aas/asset-information-json-schema";
|
|
4
|
+
export * from "./aas/common/basic-json-schema";
|
|
5
|
+
export * from "./aas/common/key-json-schema";
|
|
6
|
+
export * from "./aas/common/language-text-json-schema";
|
|
7
7
|
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
8
|
+
export * from "./aas/common/qualifier-json-schema";
|
|
9
|
+
export * from "./aas/common/reference-json-schema";
|
|
10
|
+
export * from "./aas/concept-description-json-schema";
|
|
11
|
+
export * from "./aas/concept-description-json-schema";
|
|
12
|
+
export * from "./aas/dto/value-response.dto";
|
|
13
|
+
export * from "./aas/embedded-data-specification-json-schema";
|
|
14
|
+
export * from "./aas/enums/aas-submodel-elements";
|
|
15
|
+
export * from "./aas/enums/asset-kind-enum";
|
|
16
|
+
export * from "./aas/enums/data-type-def";
|
|
17
|
+
export * from "./aas/enums/entity-type-enum";
|
|
18
|
+
export * from "./aas/enums/key-types-enum";
|
|
19
|
+
export * from "./aas/enums/language-enum";
|
|
20
|
+
export * from "./aas/enums/modelling-kind-enum";
|
|
21
|
+
export * from "./aas/enums/permission-enum";
|
|
22
|
+
export * from "./aas/enums/permission-kind-enum";
|
|
23
|
+
export * from "./aas/enums/qualifier-kind-enum";
|
|
24
|
+
export * from "./aas/enums/reference-types-enum";
|
|
25
|
+
export * from "./aas/environment-json-schema";
|
|
26
|
+
export * from "./aas/extension-json-schema";
|
|
27
|
+
export * from "./aas/resource-json-schema";
|
|
28
|
+
export * from "./aas/security/access-permission-rule.dto";
|
|
29
|
+
export * from "./aas/security/security.dto";
|
|
30
30
|
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
31
|
+
export * from "./aas/specific-asset-id-json-schema";
|
|
32
|
+
export * from "./aas/submodel-base/annotated-relationship-element-json-schema";
|
|
33
33
|
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export * from
|
|
44
|
-
export * from
|
|
45
|
-
export * from
|
|
34
|
+
export * from "./aas/submodel-base/blob-json-schema";
|
|
35
|
+
export * from "./aas/submodel-base/entity-type-json-schema";
|
|
36
|
+
export * from "./aas/submodel-base/file-json-schema";
|
|
37
|
+
export * from "./aas/submodel-base/multi-language-property-json-schema";
|
|
38
|
+
export * from "./aas/submodel-base/property-json-schema";
|
|
39
|
+
export * from "./aas/submodel-base/range-json-schema";
|
|
40
|
+
export * from "./aas/submodel-base/reference-element-json-schema";
|
|
41
|
+
export * from "./aas/submodel-base/relationship-element-json-schema";
|
|
42
|
+
export * from "./aas/submodel-base/submodel-base-json-schema";
|
|
43
|
+
export * from "./aas/submodel-base/submodel-element-collection-json-schema";
|
|
44
|
+
export * from "./aas/submodel-base/submodel-element-list-json-schema";
|
|
45
|
+
export * from "./aas/submodel-base/submodel-element-modification-schema";
|
|
46
46
|
|
|
47
|
-
export * from
|
|
48
|
-
export * from
|
|
49
|
-
export * from
|
|
50
|
-
export * from
|
|
51
|
-
export * from
|
|
52
|
-
export * from
|
|
53
|
-
export * from
|
|
54
|
-
export * from
|
|
55
|
-
export * from
|
|
56
|
-
export * from
|
|
57
|
-
export * from
|
|
58
|
-
export * from
|
|
59
|
-
export * from
|
|
60
|
-
export * from
|
|
47
|
+
export * from "./aas/submodel-base/submodel-element-schema";
|
|
48
|
+
export * from "./aas/submodel-base/submodel-json-schema";
|
|
49
|
+
export * from "./branding/branding.dto";
|
|
50
|
+
export * from "./organizations/member.dto";
|
|
51
|
+
export * from "./passports/passport.dto";
|
|
52
|
+
export * from "./shared/dpp.schemas";
|
|
53
|
+
export * from "./shared/pagination.dto";
|
|
54
|
+
export * from "./shared/populate.dto";
|
|
55
|
+
export * from "./shared/table.dto";
|
|
56
|
+
export * from "./status/status.dto";
|
|
57
|
+
export * from "./templates/template.dto";
|
|
58
|
+
export * from "./users/create-user.dto";
|
|
59
|
+
export * from "./users/set-user-role.dto";
|
|
60
|
+
export * from "./users/user.dto";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { UserDto } from
|
|
1
|
+
import type { UserDto } from "../users/user.dto";
|
|
2
2
|
|
|
3
3
|
export interface MemberDto {
|
|
4
|
-
id: string
|
|
5
|
-
organizationId: string
|
|
6
|
-
userId: string
|
|
7
|
-
role: string
|
|
8
|
-
createdAt: Date
|
|
9
|
-
updatedAt: Date
|
|
10
|
-
user?: UserDto
|
|
4
|
+
id: string;
|
|
5
|
+
organizationId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
role: string;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
user?: UserDto;
|
|
11
11
|
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { AssetAdministrationShellCreateDtoSchema } from
|
|
3
|
-
import { SharedDppDtoSchema } from
|
|
4
|
-
import { PagingMetadataDtoSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AssetAdministrationShellCreateDtoSchema } from "../aas/asset-administration-shell-json-schema";
|
|
3
|
+
import { SharedDppDtoSchema } from "../shared/dpp.schemas";
|
|
4
|
+
import { PagingMetadataDtoSchema } from "../shared/pagination.dto";
|
|
5
5
|
|
|
6
6
|
export const PassportDtoSchema = SharedDppDtoSchema.extend({
|
|
7
7
|
templateId: z.string().nullable(),
|
|
8
8
|
/** UPI uuid for presentation/chat links; set when listing passports */
|
|
9
9
|
uniqueProductIdentifierUuid: z.uuid().optional(),
|
|
10
|
-
})
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
export type PassportDto = z.infer<typeof PassportDtoSchema
|
|
12
|
+
export type PassportDto = z.infer<typeof PassportDtoSchema>;
|
|
13
13
|
|
|
14
|
-
export const PassportPaginationDtoSchema = z
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export const PassportPaginationDtoSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
...PagingMetadataDtoSchema.shape,
|
|
17
|
+
result: PassportDtoSchema.array(),
|
|
18
|
+
})
|
|
19
|
+
.meta({ id: "Passports" });
|
|
18
20
|
|
|
19
|
-
export type PassportPaginationDto = z.infer<typeof PassportPaginationDtoSchema
|
|
21
|
+
export type PassportPaginationDto = z.infer<typeof PassportPaginationDtoSchema>;
|
|
20
22
|
|
|
21
23
|
export const PassportRequestCreateDtoSchema = z.xor([
|
|
22
24
|
z.object({
|
|
@@ -27,6 +29,6 @@ export const PassportRequestCreateDtoSchema = z.xor([
|
|
|
27
29
|
assetAdministrationShells: AssetAdministrationShellCreateDtoSchema.array().max(1),
|
|
28
30
|
}),
|
|
29
31
|
}),
|
|
30
|
-
])
|
|
32
|
+
]);
|
|
31
33
|
|
|
32
|
-
export type PassportRequestCreateDto = z.input<typeof PassportRequestCreateDtoSchema
|
|
34
|
+
export type PassportRequestCreateDto = z.input<typeof PassportRequestCreateDtoSchema>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
EnvironmentJsonSchema,
|
|
4
|
+
ExtendedEnvironmentJsonSchema,
|
|
5
|
+
} from "../aas/environment-json-schema";
|
|
3
6
|
|
|
4
|
-
export const DateTimeSchema = z.union(
|
|
5
|
-
[z.iso.datetime(), z.date()],
|
|
6
|
-
)
|
|
7
|
+
export const DateTimeSchema = z.union([z.iso.datetime(), z.date()]);
|
|
7
8
|
|
|
8
9
|
export const SharedDppDtoSchema = z.object({
|
|
9
10
|
id: z.string(),
|
|
@@ -11,6 +12,6 @@ export const SharedDppDtoSchema = z.object({
|
|
|
11
12
|
environment: z.union([EnvironmentJsonSchema, ExtendedEnvironmentJsonSchema]),
|
|
12
13
|
createdAt: DateTimeSchema,
|
|
13
14
|
updatedAt: DateTimeSchema,
|
|
14
|
-
})
|
|
15
|
+
});
|
|
15
16
|
|
|
16
|
-
export type SharedDppDto = z.infer<typeof SharedDppDtoSchema
|
|
17
|
+
export type SharedDppDto = z.infer<typeof SharedDppDtoSchema>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { PopulateSchema } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PopulateSchema } from "./populate.dto";
|
|
3
3
|
|
|
4
4
|
export const PagingMetadataDtoSchema = z.object({
|
|
5
5
|
paging_metadata: z.object({
|
|
6
6
|
cursor: z.string().nullable(),
|
|
7
7
|
}),
|
|
8
|
-
})
|
|
8
|
+
});
|
|
9
9
|
|
|
10
10
|
export const PagingParamsDtoSchema = z.object({
|
|
11
11
|
limit: z.number().optional(),
|
|
12
12
|
cursor: z.string().optional(),
|
|
13
13
|
populate: PopulateSchema.optional(),
|
|
14
|
-
})
|
|
14
|
+
});
|
|
15
15
|
|
|
16
|
-
export type PagingParamsDto = z.infer<typeof PagingParamsDtoSchema
|
|
17
|
-
export type PagingMetadataDto = z.infer<typeof PagingMetadataDtoSchema
|
|
16
|
+
export type PagingParamsDto = z.infer<typeof PagingParamsDtoSchema>;
|
|
17
|
+
export type PagingMetadataDto = z.infer<typeof PagingMetadataDtoSchema>;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const Populates = {
|
|
4
|
-
assetAdministrationShells:
|
|
5
|
-
} as const
|
|
4
|
+
assetAdministrationShells: "environment.assetAdministrationShells",
|
|
5
|
+
} as const;
|
|
6
6
|
|
|
7
|
-
export const AllowedPopulates = [
|
|
8
|
-
Populates.assetAdministrationShells,
|
|
9
|
-
] as const
|
|
7
|
+
export const AllowedPopulates = [Populates.assetAdministrationShells] as const;
|
|
10
8
|
|
|
11
9
|
export const PopulateSchema = z
|
|
12
10
|
.union([z.string(), z.array(z.string())])
|
|
13
11
|
.optional()
|
|
14
|
-
.transform(val => (val ? (Array.isArray(val) ? val : [val]) : []))
|
|
15
|
-
.refine(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
12
|
+
.transform((val) => (val ? (Array.isArray(val) ? val : [val]) : []))
|
|
13
|
+
.refine((paths) => paths.every((p) => AllowedPopulates.includes(p as any)), {
|
|
14
|
+
message: `Invalid populate path. Allowed paths: ${AllowedPopulates.join(", ")}.`,
|
|
15
|
+
});
|
package/src/shared/table.dto.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const TableModificationParamsDtoSchema = z.object({
|
|
4
4
|
position: z.number().optional(),
|
|
5
|
-
})
|
|
5
|
+
});
|
|
6
6
|
|
|
7
|
-
export type TableModificationParamsDto = z.infer<typeof TableModificationParamsDtoSchema
|
|
7
|
+
export type TableModificationParamsDto = z.infer<typeof TableModificationParamsDtoSchema>;
|
package/src/status/status.dto.ts
CHANGED