@open-dpp/dto 0.1.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/LICENSE +661 -0
- package/dist/aas/administrative-information-json-schema.d.ts +6 -0
- package/dist/aas/administrative-information-json-schema.d.ts.map +1 -0
- package/dist/aas/administrative-information-json-schema.js +8 -0
- package/dist/aas/asset-administration-shell-json-schema.d.ts +1032 -0
- package/dist/aas/asset-administration-shell-json-schema.d.ts.map +1 -0
- package/dist/aas/asset-administration-shell-json-schema.js +42 -0
- package/dist/aas/asset-information-json-schema.d.ts +29 -0
- package/dist/aas/asset-information-json-schema.d.ts.map +1 -0
- package/dist/aas/asset-information-json-schema.js +15 -0
- package/dist/aas/common/basic-json-schema.d.ts +51 -0
- package/dist/aas/common/basic-json-schema.d.ts.map +1 -0
- package/dist/aas/common/basic-json-schema.js +23 -0
- package/dist/aas/common/key-json-schema.d.ts +60 -0
- package/dist/aas/common/key-json-schema.d.ts.map +1 -0
- package/dist/aas/common/key-json-schema.js +10 -0
- package/dist/aas/common/language-text-json-schema.d.ts +10 -0
- package/dist/aas/common/language-text-json-schema.d.ts.map +1 -0
- package/dist/aas/common/language-text-json-schema.js +9 -0
- package/dist/aas/common/qualifier-json-schema.d.ts +46 -0
- package/dist/aas/common/qualifier-json-schema.d.ts.map +1 -0
- package/dist/aas/common/qualifier-json-schema.js +16 -0
- package/dist/aas/common/reference-json-schema.d.ts +22 -0
- package/dist/aas/common/reference-json-schema.d.ts.map +1 -0
- package/dist/aas/common/reference-json-schema.js +16 -0
- package/dist/aas/concept-description-json-schema.d.ts +69 -0
- package/dist/aas/concept-description-json-schema.d.ts.map +1 -0
- package/dist/aas/concept-description-json-schema.js +21 -0
- package/dist/aas/dto/value-response.dto.d.ts +5 -0
- package/dist/aas/dto/value-response.dto.d.ts.map +1 -0
- package/dist/aas/dto/value-response.dto.js +5 -0
- package/dist/aas/embedded-data-specification-json-schema.d.ts +5 -0
- package/dist/aas/embedded-data-specification-json-schema.d.ts.map +1 -0
- package/dist/aas/embedded-data-specification-json-schema.js +8 -0
- package/dist/aas/enums/aas-submodel-elements.d.ts +43 -0
- package/dist/aas/enums/aas-submodel-elements.d.ts.map +1 -0
- package/dist/aas/enums/aas-submodel-elements.js +25 -0
- package/dist/aas/enums/asset-kind-enum.d.ts +11 -0
- package/dist/aas/enums/asset-kind-enum.d.ts.map +1 -0
- package/dist/aas/enums/asset-kind-enum.js +9 -0
- package/dist/aas/enums/data-type-def.d.ts +67 -0
- package/dist/aas/enums/data-type-def.d.ts.map +1 -0
- package/dist/aas/enums/data-type-def.js +37 -0
- package/dist/aas/enums/entity-type-enum.d.ts +11 -0
- package/dist/aas/enums/entity-type-enum.d.ts.map +1 -0
- package/dist/aas/enums/entity-type-enum.js +9 -0
- package/dist/aas/enums/key-types-enum.d.ts +55 -0
- package/dist/aas/enums/key-types-enum.d.ts.map +1 -0
- package/dist/aas/enums/key-types-enum.js +31 -0
- package/dist/aas/enums/language-enum.d.ts +11 -0
- package/dist/aas/enums/language-enum.d.ts.map +1 -0
- package/dist/aas/enums/language-enum.js +9 -0
- package/dist/aas/enums/modelling-kind-enum.d.ts +11 -0
- package/dist/aas/enums/modelling-kind-enum.d.ts.map +1 -0
- package/dist/aas/enums/modelling-kind-enum.js +9 -0
- package/dist/aas/enums/permission-enum.d.ts +15 -0
- package/dist/aas/enums/permission-enum.d.ts.map +1 -0
- package/dist/aas/enums/permission-enum.js +13 -0
- package/dist/aas/enums/permission-kind-enum.d.ts +9 -0
- package/dist/aas/enums/permission-kind-enum.d.ts.map +1 -0
- package/dist/aas/enums/permission-kind-enum.js +8 -0
- package/dist/aas/enums/qualifier-kind-enum.d.ts +13 -0
- package/dist/aas/enums/qualifier-kind-enum.d.ts.map +1 -0
- package/dist/aas/enums/qualifier-kind-enum.js +10 -0
- package/dist/aas/enums/reference-types-enum.d.ts +11 -0
- package/dist/aas/enums/reference-types-enum.d.ts.map +1 -0
- package/dist/aas/enums/reference-types-enum.js +9 -0
- package/dist/aas/environment-json-schema.d.ts +22 -0
- package/dist/aas/environment-json-schema.d.ts.map +1 -0
- package/dist/aas/environment-json-schema.js +15 -0
- package/dist/aas/extension-json-schema.d.ts +41 -0
- package/dist/aas/extension-json-schema.d.ts.map +1 -0
- package/dist/aas/extension-json-schema.js +14 -0
- package/dist/aas/resource-json-schema.d.ts +6 -0
- package/dist/aas/resource-json-schema.d.ts.map +1 -0
- package/dist/aas/resource-json-schema.js +8 -0
- package/dist/aas/security/access-permission-rule.dto.d.ts +542 -0
- package/dist/aas/security/access-permission-rule.dto.d.ts.map +1 -0
- package/dist/aas/security/access-permission-rule.dto.js +23 -0
- package/dist/aas/security/security.dto.d.ts +683 -0
- package/dist/aas/security/security.dto.d.ts.map +1 -0
- package/dist/aas/security/security.dto.js +15 -0
- package/dist/aas/specific-asset-id-json-schema.d.ts +9 -0
- package/dist/aas/specific-asset-id-json-schema.d.ts.map +1 -0
- package/dist/aas/specific-asset-id-json-schema.js +12 -0
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts +328 -0
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/annotated-relationship-element-json-schema.js +20 -0
- package/dist/aas/submodel-base/blob-json-schema.d.ts +110 -0
- package/dist/aas/submodel-base/blob-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/blob-json-schema.js +12 -0
- package/dist/aas/submodel-base/entity-type-json-schema.d.ts +348 -0
- package/dist/aas/submodel-base/entity-type-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/entity-type-json-schema.js +22 -0
- package/dist/aas/submodel-base/file-json-schema.d.ts +132 -0
- package/dist/aas/submodel-base/file-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/file-json-schema.js +17 -0
- package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts +116 -0
- package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/multi-language-property-json-schema.js +14 -0
- package/dist/aas/submodel-base/property-json-schema.d.ts +163 -0
- package/dist/aas/submodel-base/property-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/property-json-schema.js +19 -0
- package/dist/aas/submodel-base/range-json-schema.d.ts +142 -0
- package/dist/aas/submodel-base/range-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/range-json-schema.js +14 -0
- package/dist/aas/submodel-base/reference-element-json-schema.d.ts +132 -0
- package/dist/aas/submodel-base/reference-element-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/reference-element-json-schema.js +16 -0
- package/dist/aas/submodel-base/relationship-element-json-schema.d.ts +110 -0
- package/dist/aas/submodel-base/relationship-element-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/relationship-element-json-schema.js +13 -0
- package/dist/aas/submodel-base/submodel-base-json-schema.d.ts +86 -0
- package/dist/aas/submodel-base/submodel-base-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/submodel-base-json-schema.js +20 -0
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts +361 -0
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/submodel-element-collection-json-schema.js +22 -0
- package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts +469 -0
- package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/submodel-element-list-json-schema.js +29 -0
- package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts +20 -0
- package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/submodel-element-modification-schema.js +6 -0
- package/dist/aas/submodel-base/submodel-element-schema.d.ts +1674 -0
- package/dist/aas/submodel-base/submodel-element-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/submodel-element-schema.js +62 -0
- package/dist/aas/submodel-base/submodel-json-schema.d.ts +538 -0
- package/dist/aas/submodel-base/submodel-json-schema.d.ts.map +1 -0
- package/dist/aas/submodel-base/submodel-json-schema.js +29 -0
- package/dist/branding/branding.dto.d.ts +6 -0
- package/dist/branding/branding.dto.d.ts.map +1 -0
- package/dist/branding/branding.dto.js +7 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/organizations/member.dto.d.ts +11 -0
- package/dist/organizations/member.dto.d.ts.map +1 -0
- package/dist/organizations/member.dto.js +2 -0
- package/dist/passports/passport.dto.d.ts +84 -0
- package/dist/passports/passport.dto.d.ts.map +1 -0
- package/dist/passports/passport.dto.js +26 -0
- package/dist/shared/dpp.schemas.d.ts +28 -0
- package/dist/shared/dpp.schemas.d.ts.map +1 -0
- package/dist/shared/dpp.schemas.js +13 -0
- package/dist/shared/pagination.dto.d.ts +14 -0
- package/dist/shared/pagination.dto.d.ts.map +1 -0
- package/dist/shared/pagination.dto.js +15 -0
- package/dist/shared/populate.dto.d.ts +7 -0
- package/dist/shared/populate.dto.d.ts.map +1 -0
- package/dist/shared/populate.dto.js +15 -0
- package/dist/shared/table.dto.d.ts +6 -0
- package/dist/shared/table.dto.d.ts.map +1 -0
- package/dist/shared/table.dto.js +7 -0
- package/dist/templates/template.dto.d.ts +78 -0
- package/dist/templates/template.dto.d.ts.map +1 -0
- package/dist/templates/template.dto.js +17 -0
- package/dist/users/create-user.dto.d.ts +8 -0
- package/dist/users/create-user.dto.d.ts.map +1 -0
- package/dist/users/create-user.dto.js +9 -0
- package/dist/users/set-user-role.dto.d.ts +9 -0
- package/dist/users/set-user-role.dto.d.ts.map +1 -0
- package/dist/users/set-user-role.dto.js +7 -0
- package/dist/users/user.dto.d.ts +31 -0
- package/dist/users/user.dto.d.ts.map +1 -0
- package/dist/users/user.dto.js +15 -0
- package/package.json +48 -0
- package/src/aas/aas-json-schemas.spec.ts +145 -0
- package/src/aas/administrative-information-json-schema.ts +6 -0
- package/src/aas/asset-administration-shell-json-schema.ts +52 -0
- package/src/aas/asset-information-json-schema.ts +18 -0
- package/src/aas/common/basic-json-schema.ts +27 -0
- package/src/aas/common/key-json-schema.ts +10 -0
- package/src/aas/common/language-text-json-schema.ts +10 -0
- package/src/aas/common/qualifier-json-schema.ts +14 -0
- package/src/aas/common/reference-json-schema.ts +33 -0
- package/src/aas/concept-description-json-schema.ts +19 -0
- package/src/aas/dto/value-response.dto.spec.ts +17 -0
- package/src/aas/dto/value-response.dto.ts +7 -0
- package/src/aas/embedded-data-specification-json-schema.ts +6 -0
- package/src/aas/enums/aas-submodel-elements.ts +25 -0
- package/src/aas/enums/asset-kind-enum.ts +8 -0
- package/src/aas/enums/data-type-def.ts +37 -0
- package/src/aas/enums/entity-type-enum.ts +9 -0
- package/src/aas/enums/key-types-enum.ts +30 -0
- package/src/aas/enums/language-enum.ts +8 -0
- package/src/aas/enums/modelling-kind-enum.ts +8 -0
- package/src/aas/enums/permission-enum.ts +14 -0
- package/src/aas/enums/permission-kind-enum.ts +7 -0
- package/src/aas/enums/qualifier-kind-enum.ts +9 -0
- package/src/aas/enums/reference-types-enum.ts +8 -0
- package/src/aas/environment-json-schema.ts +16 -0
- package/src/aas/extension-json-schema.ts +12 -0
- package/src/aas/resource-json-schema.ts +6 -0
- package/src/aas/security/access-permission-rule.dto.ts +30 -0
- package/src/aas/security/security.dto.ts +18 -0
- package/src/aas/specific-asset-id-json-schema.ts +10 -0
- package/src/aas/submodel-base/annotated-relationship-element-json-schema.ts +19 -0
- package/src/aas/submodel-base/blob-json-schema.ts +10 -0
- package/src/aas/submodel-base/entity-type-json-schema.ts +21 -0
- package/src/aas/submodel-base/file-json-schema.ts +21 -0
- package/src/aas/submodel-base/multi-language-property-json-schema.ts +12 -0
- package/src/aas/submodel-base/property-json-schema.ts +22 -0
- package/src/aas/submodel-base/range-json-schema.ts +12 -0
- package/src/aas/submodel-base/reference-element-json-schema.ts +20 -0
- package/src/aas/submodel-base/relationship-element-json-schema.ts +11 -0
- package/src/aas/submodel-base/submodel-base-json-schema.ts +19 -0
- package/src/aas/submodel-base/submodel-element-collection-json-schema.ts +27 -0
- package/src/aas/submodel-base/submodel-element-list-json-schema.ts +34 -0
- package/src/aas/submodel-base/submodel-element-modification-schema.ts +6 -0
- package/src/aas/submodel-base/submodel-element-schema.ts +71 -0
- package/src/aas/submodel-base/submodel-json-schema.ts +33 -0
- package/src/branding/branding.dto.ts +7 -0
- package/src/index.ts +59 -0
- package/src/organizations/member.dto.ts +11 -0
- package/src/passports/passport.dto.ts +32 -0
- package/src/shared/dpp.schemas.ts +16 -0
- package/src/shared/pagination.dto.ts +17 -0
- package/src/shared/populate.dto.ts +18 -0
- package/src/shared/table.dto.ts +7 -0
- package/src/templates/template.dto.ts +22 -0
- package/src/users/create-user.dto.ts +9 -0
- package/src/users/set-user-role.dto.ts +7 -0
- package/src/users/user.dto.ts +28 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { PermissionEnum } from '../enums/permission-enum'
|
|
3
|
+
import { PermissionKindEnum } from '../enums/permission-kind-enum'
|
|
4
|
+
import { PropertyJsonSchema } from '../submodel-base/property-json-schema'
|
|
5
|
+
import { ReferenceElementJsonSchema } from '../submodel-base/reference-element-json-schema'
|
|
6
|
+
|
|
7
|
+
export const SubjectAttributesDtoSchema = z.object({
|
|
8
|
+
subjectAttribute: PropertyJsonSchema.array(),
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export type SubjectAttributesDto = z.infer<typeof SubjectAttributesDtoSchema>
|
|
12
|
+
|
|
13
|
+
export const PermissionDtoSchema = z.object({
|
|
14
|
+
permission: PermissionEnum,
|
|
15
|
+
kindOfPermission: PermissionKindEnum,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export type PermissionDto = z.infer<typeof PermissionDtoSchema>
|
|
19
|
+
|
|
20
|
+
export const PermissionPerObjectDtoSchema = z.object({
|
|
21
|
+
object: ReferenceElementJsonSchema,
|
|
22
|
+
permissions: z.array(PermissionDtoSchema),
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export const AccessPermissionRuleDtoSchema = z.object({
|
|
26
|
+
targetSubjectAttributes: SubjectAttributesDtoSchema,
|
|
27
|
+
permissionsPerObject: z.array(PermissionPerObjectDtoSchema),
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export type AccessPermissionRuleResponseDto = z.infer<typeof AccessPermissionRuleDtoSchema>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { AccessPermissionRuleDtoSchema, SubjectAttributesDtoSchema } from './access-permission-rule.dto'
|
|
3
|
+
|
|
4
|
+
export const AccessControlDtoSchema = z.object({
|
|
5
|
+
accessPermissionRules: AccessPermissionRuleDtoSchema.array(),
|
|
6
|
+
})
|
|
7
|
+
export const SecurityDtoSchema = z.object({
|
|
8
|
+
localAccessControl: AccessControlDtoSchema,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export type SecurityResponseDto = z.infer<typeof SecurityDtoSchema>
|
|
12
|
+
|
|
13
|
+
export const DeletePolicyDtoSchema = z.object({
|
|
14
|
+
subject: SubjectAttributesDtoSchema,
|
|
15
|
+
object: z.string(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export type DeletePolicyDto = z.infer<typeof DeletePolicyDtoSchema>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ReferenceJsonSchema } from './common/reference-json-schema'
|
|
3
|
+
|
|
4
|
+
export const SpecificAssetIdJsonSchema = z.object({
|
|
5
|
+
name: z.string(),
|
|
6
|
+
value: z.string(),
|
|
7
|
+
semanticId: ReferenceJsonSchema.nullish(),
|
|
8
|
+
supplementalSemanticIds: z.array(ReferenceJsonSchema).default([]),
|
|
9
|
+
externalSubjectId: ReferenceJsonSchema.nullish(),
|
|
10
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ReferenceJsonSchema } from '../common/reference-json-schema'
|
|
3
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
4
|
+
import { SubmodelBaseJsonSchema } from './submodel-base-json-schema'
|
|
5
|
+
import { SubmodelElementSchema } from './submodel-element-schema'
|
|
6
|
+
|
|
7
|
+
export const AnnotatedRelationshipElementJsonSchema = z.lazy(() =>
|
|
8
|
+
AnnotatedRelationshipElementJsonSchemaImpl(),
|
|
9
|
+
).meta({ id: 'AnnotatedRelationshipElement' })
|
|
10
|
+
|
|
11
|
+
export function AnnotatedRelationshipElementJsonSchemaImpl() {
|
|
12
|
+
return z.object({
|
|
13
|
+
...SubmodelBaseJsonSchema.shape,
|
|
14
|
+
first: ReferenceJsonSchema,
|
|
15
|
+
second: ReferenceJsonSchema,
|
|
16
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
17
|
+
annotations: SubmodelElementSchema.array().default([]),
|
|
18
|
+
})
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
3
|
+
import { SubmodelBaseJsonSchema } from './submodel-base-json-schema'
|
|
4
|
+
|
|
5
|
+
export const BlobJsonSchema = z.object({
|
|
6
|
+
...SubmodelBaseJsonSchema.shape,
|
|
7
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
8
|
+
contentType: z.string(),
|
|
9
|
+
value: z.base64().nullish(),
|
|
10
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { EntityTypeEnum } from '../enums/entity-type-enum'
|
|
3
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
4
|
+
import { SpecificAssetIdJsonSchema } from '../specific-asset-id-json-schema'
|
|
5
|
+
import { SubmodelBaseJsonSchema } from './submodel-base-json-schema'
|
|
6
|
+
import { SubmodelElementSchema } from './submodel-element-schema'
|
|
7
|
+
|
|
8
|
+
export const EntityTypeJsonSchema = z.lazy(() =>
|
|
9
|
+
EntityTypeJsonSchemaImpl(),
|
|
10
|
+
).meta({ id: 'Entity' })
|
|
11
|
+
|
|
12
|
+
export function EntityTypeJsonSchemaImpl() {
|
|
13
|
+
return z.object({
|
|
14
|
+
...SubmodelBaseJsonSchema.shape,
|
|
15
|
+
entityType: EntityTypeEnum,
|
|
16
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
17
|
+
statements: SubmodelElementSchema.array().default([]),
|
|
18
|
+
globalAssetId: z.nullish(z.string()),
|
|
19
|
+
specificAssetIds: SpecificAssetIdJsonSchema.array().default([]),
|
|
20
|
+
})
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
3
|
+
import { SubmodelBaseJsonSchema, SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
4
|
+
|
|
5
|
+
export const FileJsonSchema = z.object({
|
|
6
|
+
...SubmodelBaseJsonSchema.shape,
|
|
7
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
8
|
+
contentType: z.string(),
|
|
9
|
+
value: z.nullish(z.string()),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export type FileResponseDto = z.infer<typeof FileJsonSchema>
|
|
13
|
+
export type FileRequestDto = z.input<typeof FileJsonSchema>
|
|
14
|
+
|
|
15
|
+
export const FileModificationSchema = z.object({
|
|
16
|
+
...SubmodelBaseModificationSchema.shape,
|
|
17
|
+
value: z.nullish(z.string()),
|
|
18
|
+
contentType: z.nullish(z.string()),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export type FileModificationDto = z.input<typeof FileModificationSchema>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { LanguageTextJsonSchema } from '../common/language-text-json-schema'
|
|
3
|
+
import { ReferenceJsonSchema } from '../common/reference-json-schema'
|
|
4
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
5
|
+
import { SubmodelBaseJsonSchema } from './submodel-base-json-schema'
|
|
6
|
+
|
|
7
|
+
export const MultiLanguagePropertyJsonSchema = z.object({
|
|
8
|
+
...SubmodelBaseJsonSchema.shape,
|
|
9
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
10
|
+
value: LanguageTextJsonSchema.array().default([]),
|
|
11
|
+
valueId: z.nullish(ReferenceJsonSchema),
|
|
12
|
+
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ValueTypeSchema } from '../common/basic-json-schema'
|
|
3
|
+
import { ReferenceJsonSchema } from '../common/reference-json-schema'
|
|
4
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
5
|
+
import { SubmodelBaseJsonSchema, SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
6
|
+
|
|
7
|
+
export const PropertyJsonSchema = z.object({
|
|
8
|
+
...SubmodelBaseJsonSchema.shape,
|
|
9
|
+
valueType: ValueTypeSchema,
|
|
10
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
11
|
+
value: z.nullish(z.string()),
|
|
12
|
+
valueId: z.nullish(ReferenceJsonSchema),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const PropertyModificationSchema = z.object({
|
|
16
|
+
...SubmodelBaseModificationSchema.shape,
|
|
17
|
+
value: z.nullish(z.string()),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export type PropertyResponseDto = z.infer<typeof PropertyJsonSchema>
|
|
21
|
+
export type PropertyRequestDto = z.input<typeof PropertyJsonSchema>
|
|
22
|
+
export type PropertyModificationDto = z.input<typeof PropertyModificationSchema>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ValueTypeSchema } from '../common/basic-json-schema'
|
|
3
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
4
|
+
import { SubmodelBaseJsonSchema } from './submodel-base-json-schema'
|
|
5
|
+
|
|
6
|
+
export const RangeJsonSchema = z.object({
|
|
7
|
+
...SubmodelBaseJsonSchema.shape,
|
|
8
|
+
valueType: ValueTypeSchema,
|
|
9
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
10
|
+
min: z.nullish(z.string()),
|
|
11
|
+
max: z.nullish(z.string()),
|
|
12
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ReferenceJsonSchema, ReferenceModificationSchema } from '../common/reference-json-schema'
|
|
3
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
4
|
+
import { SubmodelBaseJsonSchema, SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
5
|
+
|
|
6
|
+
export const ReferenceElementJsonSchema = z.object({
|
|
7
|
+
...SubmodelBaseJsonSchema.shape,
|
|
8
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
9
|
+
value: z.nullish(ReferenceJsonSchema),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export const ReferenceElementModificationSchema = z.object({
|
|
13
|
+
...SubmodelBaseModificationSchema.shape,
|
|
14
|
+
value: z.nullish(ReferenceModificationSchema),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export type ReferenceElementValue = z.infer<typeof ReferenceJsonSchema>
|
|
18
|
+
export type ReferenceElementResponseDto = z.infer<typeof ReferenceElementJsonSchema>
|
|
19
|
+
export type ReferenceElementRequestDto = z.input<typeof ReferenceElementJsonSchema>
|
|
20
|
+
export type ReferenceElementModificationDto = z.input<typeof ReferenceElementModificationSchema>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ReferenceJsonSchema } from '../common/reference-json-schema'
|
|
3
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
4
|
+
import { SubmodelBaseJsonSchema } from './submodel-base-json-schema'
|
|
5
|
+
|
|
6
|
+
export const RelationshipElementJsonSchema = z.object({
|
|
7
|
+
...SubmodelBaseJsonSchema.shape,
|
|
8
|
+
first: ReferenceJsonSchema,
|
|
9
|
+
second: ReferenceJsonSchema,
|
|
10
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
11
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
|
|
8
|
+
export const SubmodelBaseJsonSchema = z.object({
|
|
9
|
+
category: z.nullish(z.string()),
|
|
10
|
+
idShort: z.string(),
|
|
11
|
+
displayName: z.array(LanguageTextJsonSchema).default([]),
|
|
12
|
+
description: z.array(LanguageTextJsonSchema).default([]),
|
|
13
|
+
semanticId: z.nullish(ReferenceJsonSchema),
|
|
14
|
+
supplementalSemanticIds: z.array(ReferenceJsonSchema).default([]),
|
|
15
|
+
qualifiers: z.array(QualifierJsonSchema).default([]),
|
|
16
|
+
embeddedDataSpecifications: z.array(EmbeddedDataSpecificationJsonSchema).default([]),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export const SubmodelBaseModificationSchema = NameAndDescriptionModificationSchema.extend({ idShort: z.string() })
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { ExtensionJsonSchema } from '../extension-json-schema'
|
|
3
|
+
import { SubmodelBaseJsonSchema, SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
4
|
+
import { SubmodelElementModificationSchema } from './submodel-element-modification-schema'
|
|
5
|
+
import { SubmodelElementSchema } from './submodel-element-schema'
|
|
6
|
+
|
|
7
|
+
export const SubmodelElementCollectionJsonSchema = z.lazy(() =>
|
|
8
|
+
SubmodelElementCollectionJsonSchemaImpl(),
|
|
9
|
+
).meta({ id: 'SubmodelElementCollection' })
|
|
10
|
+
|
|
11
|
+
export function SubmodelElementCollectionJsonSchemaImpl() {
|
|
12
|
+
return z.object({
|
|
13
|
+
...SubmodelBaseJsonSchema.shape,
|
|
14
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
15
|
+
value: SubmodelElementSchema.array().default([]),
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SubmodelElementCollectionRequestDto = z.input<typeof SubmodelElementCollectionJsonSchema>
|
|
20
|
+
export type SubmodelElementCollectionResponseDto = z.infer<typeof SubmodelElementCollectionJsonSchema>
|
|
21
|
+
|
|
22
|
+
export const SubmodelElementCollectionModificationSchema = z.object({
|
|
23
|
+
...SubmodelBaseModificationSchema.shape,
|
|
24
|
+
value: SubmodelElementModificationSchema.array().optional(),
|
|
25
|
+
}).meta({ id: 'SubmodelElementCollectionModification' })
|
|
26
|
+
|
|
27
|
+
export type SubmodelElementCollectionModificationDto = z.infer<typeof SubmodelElementCollectionModificationSchema>
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { SubmodelBaseJsonSchema, SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
7
|
+
import { SubmodelElementModificationSchema } from './submodel-element-modification-schema'
|
|
8
|
+
import { SubmodelElementSchema } from './submodel-element-schema'
|
|
9
|
+
|
|
10
|
+
export const SubmodelElementListJsonSchema = z.lazy(() =>
|
|
11
|
+
SubmodelElementListJsonSchemaImpl(),
|
|
12
|
+
).meta({ id: 'SubmodelElementList' })
|
|
13
|
+
|
|
14
|
+
export function SubmodelElementListJsonSchemaImpl() {
|
|
15
|
+
return z.object({
|
|
16
|
+
...SubmodelBaseJsonSchema.shape,
|
|
17
|
+
typeValueListElement: AasSubmodelElementsEnum,
|
|
18
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
19
|
+
orderRelevant: z.nullish(z.boolean()),
|
|
20
|
+
semanticIdListElement: z.nullish(ReferenceJsonSchema),
|
|
21
|
+
valueTypeListElement: z.nullish(ValueTypeSchema),
|
|
22
|
+
value: SubmodelElementSchema.array().default([]),
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type SubmodelElementListRequestDto = z.input<typeof SubmodelElementListJsonSchema>
|
|
27
|
+
export type SubmodelElementListResponseDto = z.infer<typeof SubmodelElementListJsonSchema>
|
|
28
|
+
|
|
29
|
+
export const SubmodelElementListModificationSchema = z.object({
|
|
30
|
+
...SubmodelBaseModificationSchema.shape,
|
|
31
|
+
value: SubmodelElementModificationSchema.array().optional(),
|
|
32
|
+
}).meta({ id: 'SubmodelElementListModification' })
|
|
33
|
+
|
|
34
|
+
export type SubmodelElementListModificationDto = z.input<typeof SubmodelElementListModificationSchema>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
3
|
+
|
|
4
|
+
export const SubmodelElementModificationSchema = z.looseObject({ ...SubmodelBaseModificationSchema.shape })
|
|
5
|
+
|
|
6
|
+
export type SubmodelElementModificationDto = z.infer<typeof SubmodelElementModificationSchema>
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
|
|
17
|
+
export const SubmodelElementSharedSchema = z.looseObject({ ...SubmodelBaseJsonSchema.shape, modelType: z.string() })
|
|
18
|
+
export type SubmodelElementSharedResponseDto = z.infer<typeof SubmodelElementSharedSchema>
|
|
19
|
+
|
|
20
|
+
export const SubmodelElementSchema: z.ZodTypeAny<SubmodelElementSharedResponseDto> = z.lazy(() =>
|
|
21
|
+
SubmodelElementSchemaJsonImpl(),
|
|
22
|
+
).meta({ id: 'SubmodelElement' })
|
|
23
|
+
|
|
24
|
+
export type SubmodelElementSharedRequestDto = z.input<typeof SubmodelElementSharedSchema>
|
|
25
|
+
|
|
26
|
+
export function SubmodelElementSchemaJsonImpl() {
|
|
27
|
+
return z.discriminatedUnion('modelType', [
|
|
28
|
+
AnnotatedRelationshipElementJsonSchemaImpl().extend({
|
|
29
|
+
modelType: z.literal(KeyTypes.AnnotatedRelationshipElement),
|
|
30
|
+
}),
|
|
31
|
+
BlobJsonSchema.extend({
|
|
32
|
+
modelType: z.literal(KeyTypes.Blob),
|
|
33
|
+
}),
|
|
34
|
+
EntityTypeJsonSchemaImpl().extend({
|
|
35
|
+
modelType: z.literal(KeyTypes.Entity),
|
|
36
|
+
}),
|
|
37
|
+
FileJsonSchema.extend({
|
|
38
|
+
modelType: z.literal(KeyTypes.File),
|
|
39
|
+
}),
|
|
40
|
+
MultiLanguagePropertyJsonSchema.extend({
|
|
41
|
+
modelType: z.literal(KeyTypes.MultiLanguageProperty),
|
|
42
|
+
}),
|
|
43
|
+
PropertyJsonSchema.extend({
|
|
44
|
+
modelType: z.literal(KeyTypes.Property),
|
|
45
|
+
}),
|
|
46
|
+
RangeJsonSchema.extend({
|
|
47
|
+
modelType: z.literal(KeyTypes.Range),
|
|
48
|
+
}),
|
|
49
|
+
ReferenceElementJsonSchema.extend({
|
|
50
|
+
modelType: z.literal(KeyTypes.ReferenceElement),
|
|
51
|
+
}),
|
|
52
|
+
RelationshipElementJsonSchema.extend({
|
|
53
|
+
modelType: z.literal(KeyTypes.RelationshipElement),
|
|
54
|
+
}),
|
|
55
|
+
SubmodelElementCollectionJsonSchemaImpl().extend({
|
|
56
|
+
modelType: z.literal(KeyTypes.SubmodelElementCollection),
|
|
57
|
+
}),
|
|
58
|
+
SubmodelElementListJsonSchemaImpl().extend({
|
|
59
|
+
modelType: z.literal(KeyTypes.SubmodelElementList),
|
|
60
|
+
}),
|
|
61
|
+
])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const SubmodelElementPaginationResponseDtoSchema = z.object({
|
|
65
|
+
...PagingMetadataDtoSchema.shape,
|
|
66
|
+
result: SubmodelElementSchema.array(),
|
|
67
|
+
}).meta({ id: 'SubmodelElements' })
|
|
68
|
+
|
|
69
|
+
export type SubmodelElementPaginationResponseDto = z.infer<typeof SubmodelElementPaginationResponseDtoSchema>
|
|
70
|
+
export type SubmodelElementRequestDto = z.infer<typeof SubmodelElementSchema>
|
|
71
|
+
export type SubmodelElementResponseDto = z.infer<typeof SubmodelElementSchema>
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { SubmodelBaseJsonSchema, SubmodelBaseModificationSchema } from './submodel-base-json-schema'
|
|
8
|
+
import { SubmodelElementSchema } from './submodel-element-schema'
|
|
9
|
+
|
|
10
|
+
export const SubmodelJsonSchema = z.object({
|
|
11
|
+
...SubmodelBaseJsonSchema.shape,
|
|
12
|
+
id: z.string(),
|
|
13
|
+
extensions: ExtensionJsonSchema.array().default([]),
|
|
14
|
+
administration: z.nullish(AdministrativeInformationJsonSchema),
|
|
15
|
+
kind: z.nullish(ModellingKindEnum),
|
|
16
|
+
submodelElements: SubmodelElementSchema.array().default([]),
|
|
17
|
+
}).meta({ id: 'Submodel' })
|
|
18
|
+
export const SubmodelPaginationResponseDtoSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
...PagingMetadataDtoSchema.shape,
|
|
21
|
+
result: SubmodelJsonSchema.array(),
|
|
22
|
+
})
|
|
23
|
+
.meta({ id: 'Submodels' })
|
|
24
|
+
export type SubmodelPaginationResponseDto = z.infer<
|
|
25
|
+
typeof SubmodelPaginationResponseDtoSchema
|
|
26
|
+
>
|
|
27
|
+
export const SubmodelRequestDtoSchema = SubmodelJsonSchema.extend({
|
|
28
|
+
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>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
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
|
+
|
|
31
|
+
export * from './aas/specific-asset-id-json-schema'
|
|
32
|
+
export * from './aas/submodel-base/annotated-relationship-element-json-schema'
|
|
33
|
+
|
|
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
|
+
|
|
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 './templates/template.dto'
|
|
57
|
+
export * from './users/create-user.dto'
|
|
58
|
+
export * from './users/set-user-role.dto'
|
|
59
|
+
export * from './users/user.dto'
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
|
|
6
|
+
export const PassportDtoSchema = SharedDppDtoSchema.extend({
|
|
7
|
+
templateId: z.string().nullable(),
|
|
8
|
+
/** UPI uuid for presentation/chat links; set when listing passports */
|
|
9
|
+
uniqueProductIdentifierUuid: z.uuid().optional(),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export type PassportDto = z.infer<typeof PassportDtoSchema>
|
|
13
|
+
|
|
14
|
+
export const PassportPaginationDtoSchema = z.object({
|
|
15
|
+
...PagingMetadataDtoSchema.shape,
|
|
16
|
+
result: PassportDtoSchema.array(),
|
|
17
|
+
}).meta({ id: 'Passports' })
|
|
18
|
+
|
|
19
|
+
export type PassportPaginationDto = z.infer<typeof PassportPaginationDtoSchema>
|
|
20
|
+
|
|
21
|
+
export const PassportRequestCreateDtoSchema = z.xor([
|
|
22
|
+
z.object({
|
|
23
|
+
templateId: z.string(),
|
|
24
|
+
}),
|
|
25
|
+
z.object({
|
|
26
|
+
environment: z.object({
|
|
27
|
+
assetAdministrationShells: AssetAdministrationShellCreateDtoSchema.array().max(1),
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
])
|
|
31
|
+
|
|
32
|
+
export type PassportRequestCreateDto = z.input<typeof PassportRequestCreateDtoSchema>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { EnvironmentJsonSchema, ExtendedEnvironmentJsonSchema } from '../aas/environment-json-schema'
|
|
3
|
+
|
|
4
|
+
export const DateTimeSchema = z.union(
|
|
5
|
+
[z.iso.datetime(), z.date()],
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
export const SharedDppDtoSchema = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
organizationId: z.string(),
|
|
11
|
+
environment: z.union([EnvironmentJsonSchema, ExtendedEnvironmentJsonSchema]),
|
|
12
|
+
createdAt: DateTimeSchema,
|
|
13
|
+
updatedAt: DateTimeSchema,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export type SharedDppDto = z.infer<typeof SharedDppDtoSchema>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { PopulateSchema } from './populate.dto'
|
|
3
|
+
|
|
4
|
+
export const PagingMetadataDtoSchema = z.object({
|
|
5
|
+
paging_metadata: z.object({
|
|
6
|
+
cursor: z.string().nullable(),
|
|
7
|
+
}),
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const PagingParamsDtoSchema = z.object({
|
|
11
|
+
limit: z.number().optional(),
|
|
12
|
+
cursor: z.string().optional(),
|
|
13
|
+
populate: PopulateSchema.optional(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export type PagingParamsDto = z.infer<typeof PagingParamsDtoSchema>
|
|
17
|
+
export type PagingMetadataDto = z.infer<typeof PagingMetadataDtoSchema>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const Populates = {
|
|
4
|
+
assetAdministrationShells: 'environment.assetAdministrationShells',
|
|
5
|
+
} as const
|
|
6
|
+
|
|
7
|
+
export const AllowedPopulates = [
|
|
8
|
+
Populates.assetAdministrationShells,
|
|
9
|
+
] as const
|
|
10
|
+
|
|
11
|
+
export const PopulateSchema = z
|
|
12
|
+
.union([z.string(), z.array(z.string())])
|
|
13
|
+
.optional()
|
|
14
|
+
.transform(val => (val ? (Array.isArray(val) ? val : [val]) : []))
|
|
15
|
+
.refine(
|
|
16
|
+
paths => paths.every(p => AllowedPopulates.includes(p as any)),
|
|
17
|
+
{ message: `Invalid populate path. Allowed paths: ${AllowedPopulates.join(', ')}.` },
|
|
18
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
|
|
6
|
+
export const TemplateDtoSchema = SharedDppDtoSchema
|
|
7
|
+
|
|
8
|
+
export type TemplateDto = z.infer<typeof TemplateDtoSchema>
|
|
9
|
+
|
|
10
|
+
export const TemplatePaginationDtoSchema = z.object({
|
|
11
|
+
...PagingMetadataDtoSchema.shape,
|
|
12
|
+
result: TemplateDtoSchema.array(),
|
|
13
|
+
}).meta({ id: 'Templates' })
|
|
14
|
+
|
|
15
|
+
export type TemplatePaginationDto = z.infer<typeof TemplatePaginationDtoSchema>
|
|
16
|
+
|
|
17
|
+
export const TemplateCreateDtoSchema = z.object({
|
|
18
|
+
environment: z.object({
|
|
19
|
+
assetAdministrationShells: AssetAdministrationShellCreateDtoSchema.array().max(1),
|
|
20
|
+
}),
|
|
21
|
+
})
|
|
22
|
+
export type TemplateCreateDto = z.input<typeof TemplateCreateDtoSchema>
|