@open-dpp/dto 0.1.3 → 0.3.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.
Files changed (215) hide show
  1. package/dist/aas/administrative-information-json-schema.d.ts +1 -1
  2. package/dist/aas/administrative-information-json-schema.d.ts.map +1 -1
  3. package/dist/aas/asset-administration-shell-json-schema.d.ts +1 -1
  4. package/dist/aas/asset-administration-shell-json-schema.d.ts.map +1 -1
  5. package/dist/aas/asset-administration-shell-json-schema.js +2 -2
  6. package/dist/aas/asset-information-json-schema.d.ts +1 -1
  7. package/dist/aas/asset-information-json-schema.d.ts.map +1 -1
  8. package/dist/aas/asset-information-json-schema.js +3 -1
  9. package/dist/aas/common/basic-json-schema.d.ts +1 -1
  10. package/dist/aas/common/basic-json-schema.d.ts.map +1 -1
  11. package/dist/aas/common/basic-json-schema.js +7 -4
  12. package/dist/aas/common/key-json-schema.d.ts +1 -1
  13. package/dist/aas/common/key-json-schema.d.ts.map +1 -1
  14. package/dist/aas/common/language-text-json-schema.d.ts +1 -1
  15. package/dist/aas/common/language-text-json-schema.d.ts.map +1 -1
  16. package/dist/aas/common/qualifier-json-schema.d.ts +1 -1
  17. package/dist/aas/common/qualifier-json-schema.d.ts.map +1 -1
  18. package/dist/aas/common/reference-json-schema.d.ts +3 -3
  19. package/dist/aas/common/reference-json-schema.d.ts.map +1 -1
  20. package/dist/aas/concept-description-json-schema.d.ts +1 -1
  21. package/dist/aas/concept-description-json-schema.d.ts.map +1 -1
  22. package/dist/aas/dto/value-response.dto.d.ts +1 -1
  23. package/dist/aas/dto/value-response.dto.d.ts.map +1 -1
  24. package/dist/aas/embedded-data-specification-json-schema.d.ts +1 -1
  25. package/dist/aas/embedded-data-specification-json-schema.d.ts.map +1 -1
  26. package/dist/aas/enums/aas-submodel-elements.d.ts +1 -1
  27. package/dist/aas/enums/aas-submodel-elements.d.ts.map +1 -1
  28. package/dist/aas/enums/aas-submodel-elements.js +18 -18
  29. package/dist/aas/enums/asset-kind-enum.d.ts +1 -1
  30. package/dist/aas/enums/asset-kind-enum.d.ts.map +1 -1
  31. package/dist/aas/enums/asset-kind-enum.js +2 -2
  32. package/dist/aas/enums/data-type-def.d.ts +1 -1
  33. package/dist/aas/enums/data-type-def.d.ts.map +1 -1
  34. package/dist/aas/enums/data-type-def.js +30 -30
  35. package/dist/aas/enums/entity-type-enum.d.ts +1 -1
  36. package/dist/aas/enums/entity-type-enum.d.ts.map +1 -1
  37. package/dist/aas/enums/entity-type-enum.js +2 -2
  38. package/dist/aas/enums/key-types-enum.d.ts +1 -1
  39. package/dist/aas/enums/key-types-enum.d.ts.map +1 -1
  40. package/dist/aas/enums/key-types-enum.js +24 -24
  41. package/dist/aas/enums/language-enum.d.ts +1 -1
  42. package/dist/aas/enums/language-enum.d.ts.map +1 -1
  43. package/dist/aas/enums/language-enum.js +2 -2
  44. package/dist/aas/enums/modelling-kind-enum.d.ts +1 -1
  45. package/dist/aas/enums/modelling-kind-enum.d.ts.map +1 -1
  46. package/dist/aas/enums/modelling-kind-enum.js +2 -2
  47. package/dist/aas/enums/permission-enum.d.ts +1 -1
  48. package/dist/aas/enums/permission-enum.d.ts.map +1 -1
  49. package/dist/aas/enums/permission-enum.js +4 -4
  50. package/dist/aas/enums/permission-kind-enum.d.ts +1 -1
  51. package/dist/aas/enums/permission-kind-enum.d.ts.map +1 -1
  52. package/dist/aas/enums/permission-kind-enum.js +1 -1
  53. package/dist/aas/enums/qualifier-kind-enum.d.ts +1 -1
  54. package/dist/aas/enums/qualifier-kind-enum.d.ts.map +1 -1
  55. package/dist/aas/enums/qualifier-kind-enum.js +3 -3
  56. package/dist/aas/enums/reference-types-enum.d.ts +1 -1
  57. package/dist/aas/enums/reference-types-enum.d.ts.map +1 -1
  58. package/dist/aas/enums/reference-types-enum.js +2 -2
  59. package/dist/aas/environment-json-schema.d.ts +1 -1
  60. package/dist/aas/environment-json-schema.d.ts.map +1 -1
  61. package/dist/aas/environment-json-schema.js +3 -1
  62. package/dist/aas/extension-json-schema.d.ts +1 -1
  63. package/dist/aas/extension-json-schema.d.ts.map +1 -1
  64. package/dist/aas/resource-json-schema.d.ts +1 -1
  65. package/dist/aas/resource-json-schema.d.ts.map +1 -1
  66. package/dist/aas/security/access-permission-rule.dto.d.ts +1 -1
  67. package/dist/aas/security/access-permission-rule.dto.d.ts.map +1 -1
  68. package/dist/aas/security/security.dto.d.ts +1 -1
  69. package/dist/aas/security/security.dto.d.ts.map +1 -1
  70. package/dist/aas/specific-asset-id-json-schema.d.ts +1 -1
  71. package/dist/aas/specific-asset-id-json-schema.d.ts.map +1 -1
  72. package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts +1 -1
  73. package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts.map +1 -1
  74. package/dist/aas/submodel-base/annotated-relationship-element-json-schema.js +3 -2
  75. package/dist/aas/submodel-base/blob-json-schema.d.ts +1 -1
  76. package/dist/aas/submodel-base/blob-json-schema.d.ts.map +1 -1
  77. package/dist/aas/submodel-base/entity-type-json-schema.d.ts +1 -1
  78. package/dist/aas/submodel-base/entity-type-json-schema.d.ts.map +1 -1
  79. package/dist/aas/submodel-base/entity-type-json-schema.js +1 -2
  80. package/dist/aas/submodel-base/file-json-schema.d.ts +1 -1
  81. package/dist/aas/submodel-base/file-json-schema.d.ts.map +1 -1
  82. package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts +1 -1
  83. package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts.map +1 -1
  84. package/dist/aas/submodel-base/property-json-schema.d.ts +1 -1
  85. package/dist/aas/submodel-base/property-json-schema.d.ts.map +1 -1
  86. package/dist/aas/submodel-base/range-json-schema.d.ts +1 -1
  87. package/dist/aas/submodel-base/range-json-schema.d.ts.map +1 -1
  88. package/dist/aas/submodel-base/reference-element-json-schema.d.ts +2 -2
  89. package/dist/aas/submodel-base/reference-element-json-schema.d.ts.map +1 -1
  90. package/dist/aas/submodel-base/relationship-element-json-schema.d.ts +1 -1
  91. package/dist/aas/submodel-base/relationship-element-json-schema.d.ts.map +1 -1
  92. package/dist/aas/submodel-base/submodel-base-json-schema.d.ts +1 -1
  93. package/dist/aas/submodel-base/submodel-base-json-schema.d.ts.map +1 -1
  94. package/dist/aas/submodel-base/submodel-base-json-schema.js +3 -1
  95. package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts +1 -1
  96. package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts.map +1 -1
  97. package/dist/aas/submodel-base/submodel-element-collection-json-schema.js +7 -4
  98. package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts +1 -1
  99. package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts.map +1 -1
  100. package/dist/aas/submodel-base/submodel-element-list-json-schema.js +7 -4
  101. package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts +1 -1
  102. package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts.map +1 -1
  103. package/dist/aas/submodel-base/submodel-element-modification-schema.js +3 -1
  104. package/dist/aas/submodel-base/submodel-element-schema.d.ts +1 -1
  105. package/dist/aas/submodel-base/submodel-element-schema.d.ts.map +1 -1
  106. package/dist/aas/submodel-base/submodel-element-schema.js +12 -5
  107. package/dist/aas/submodel-base/submodel-json-schema.d.ts +1 -1
  108. package/dist/aas/submodel-base/submodel-json-schema.d.ts.map +1 -1
  109. package/dist/aas/submodel-base/submodel-json-schema.js +5 -3
  110. package/dist/branding/branding.dto.d.ts +2 -1
  111. package/dist/branding/branding.dto.d.ts.map +1 -1
  112. package/dist/branding/branding.dto.js +1 -0
  113. package/dist/index.d.ts +58 -56
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +3 -1
  116. package/dist/organizations/member.dto.d.ts +1 -1
  117. package/dist/organizations/member.dto.d.ts.map +1 -1
  118. package/dist/passports/passport.dto.d.ts +25 -1
  119. package/dist/passports/passport.dto.d.ts.map +1 -1
  120. package/dist/passports/passport.dto.js +6 -4
  121. package/dist/shared/digital-product-document.schemas.d.ts +81 -0
  122. package/dist/shared/digital-product-document.schemas.d.ts.map +1 -0
  123. package/dist/shared/digital-product-document.schemas.js +33 -0
  124. package/dist/shared/filter.dto.d.ts +10 -0
  125. package/dist/shared/filter.dto.d.ts.map +1 -0
  126. package/dist/shared/filter.dto.js +8 -0
  127. package/dist/shared/get-all-params.dto.d.ts +17 -0
  128. package/dist/shared/get-all-params.dto.d.ts.map +1 -0
  129. package/dist/shared/get-all-params.dto.js +12 -0
  130. package/dist/shared/pagination.dto.d.ts +1 -2
  131. package/dist/shared/pagination.dto.d.ts.map +1 -1
  132. package/dist/shared/pagination.dto.js +0 -2
  133. package/dist/shared/populate.dto.d.ts +1 -1
  134. package/dist/shared/populate.dto.d.ts.map +1 -1
  135. package/dist/shared/populate.dto.js +6 -6
  136. package/dist/shared/table.dto.d.ts +1 -1
  137. package/dist/shared/table.dto.d.ts.map +1 -1
  138. package/dist/status/status.dto.d.ts +1 -1
  139. package/dist/status/status.dto.d.ts.map +1 -1
  140. package/dist/templates/template.dto.d.ts +25 -1
  141. package/dist/templates/template.dto.d.ts.map +1 -1
  142. package/dist/templates/template.dto.js +6 -4
  143. package/dist/users/create-user.dto.d.ts +1 -1
  144. package/dist/users/create-user.dto.d.ts.map +1 -1
  145. package/dist/users/set-user-role.dto.d.ts +1 -1
  146. package/dist/users/set-user-role.dto.d.ts.map +1 -1
  147. package/dist/users/set-user-role.dto.js +1 -1
  148. package/dist/users/user.dto.d.ts +1 -1
  149. package/dist/users/user.dto.d.ts.map +1 -1
  150. package/dist/users/user.dto.js +5 -5
  151. package/package.json +23 -19
  152. package/src/aas/aas-json-schemas.spec.ts +68 -67
  153. package/src/aas/administrative-information-json-schema.ts +2 -2
  154. package/src/aas/asset-administration-shell-json-schema.ts +32 -24
  155. package/src/aas/asset-information-json-schema.ts +10 -8
  156. package/src/aas/common/basic-json-schema.ts +18 -15
  157. package/src/aas/common/key-json-schema.ts +4 -4
  158. package/src/aas/common/language-text-json-schema.ts +4 -4
  159. package/src/aas/common/qualifier-json-schema.ts +5 -5
  160. package/src/aas/common/reference-json-schema.ts +13 -13
  161. package/src/aas/concept-description-json-schema.ts +7 -7
  162. package/src/aas/dto/value-response.dto.spec.ts +21 -15
  163. package/src/aas/dto/value-response.dto.ts +4 -4
  164. package/src/aas/embedded-data-specification-json-schema.ts +3 -3
  165. package/src/aas/enums/aas-submodel-elements.ts +22 -22
  166. package/src/aas/enums/asset-kind-enum.ts +6 -6
  167. package/src/aas/enums/data-type-def.ts +34 -34
  168. package/src/aas/enums/entity-type-enum.ts +6 -6
  169. package/src/aas/enums/key-types-enum.ts +28 -28
  170. package/src/aas/enums/language-enum.ts +6 -6
  171. package/src/aas/enums/modelling-kind-enum.ts +6 -6
  172. package/src/aas/enums/permission-enum.ts +8 -8
  173. package/src/aas/enums/permission-kind-enum.ts +5 -5
  174. package/src/aas/enums/qualifier-kind-enum.ts +7 -7
  175. package/src/aas/enums/reference-types-enum.ts +6 -6
  176. package/src/aas/environment-json-schema.ts +8 -6
  177. package/src/aas/extension-json-schema.ts +4 -4
  178. package/src/aas/resource-json-schema.ts +2 -2
  179. package/src/aas/security/access-permission-rule.dto.ts +12 -12
  180. package/src/aas/security/security.dto.ts +10 -7
  181. package/src/aas/specific-asset-id-json-schema.ts +3 -3
  182. package/src/aas/submodel-base/annotated-relationship-element-json-schema.ts +10 -10
  183. package/src/aas/submodel-base/blob-json-schema.ts +4 -4
  184. package/src/aas/submodel-base/entity-type-json-schema.ts +9 -11
  185. package/src/aas/submodel-base/file-json-schema.ts +11 -8
  186. package/src/aas/submodel-base/multi-language-property-json-schema.ts +6 -6
  187. package/src/aas/submodel-base/property-json-schema.ts +13 -10
  188. package/src/aas/submodel-base/range-json-schema.ts +5 -5
  189. package/src/aas/submodel-base/reference-element-json-schema.ts +13 -10
  190. package/src/aas/submodel-base/relationship-element-json-schema.ts +5 -5
  191. package/src/aas/submodel-base/submodel-base-json-schema.ts +10 -8
  192. package/src/aas/submodel-base/submodel-element-collection-json-schema.ts +28 -17
  193. package/src/aas/submodel-base/submodel-element-list-json-schema.ts +27 -20
  194. package/src/aas/submodel-base/submodel-element-modification-schema.ts +6 -4
  195. package/src/aas/submodel-base/submodel-element-schema.ts +37 -30
  196. package/src/aas/submodel-base/submodel-json-schema.ts +28 -25
  197. package/src/branding/branding.dto.ts +4 -3
  198. package/src/index.ts +59 -56
  199. package/src/organizations/member.dto.ts +8 -8
  200. package/src/passports/passport.dto.ts +16 -14
  201. package/src/shared/digital-product-document.schemas.ts +52 -0
  202. package/src/shared/filter.dto.ts +8 -0
  203. package/src/shared/get-all-params.dto.ts +12 -0
  204. package/src/shared/pagination.dto.ts +5 -7
  205. package/src/shared/populate.dto.ts +8 -11
  206. package/src/shared/table.dto.ts +3 -3
  207. package/src/status/status.dto.ts +3 -3
  208. package/src/templates/template.dto.ts +15 -13
  209. package/src/users/create-user.dto.ts +3 -3
  210. package/src/users/set-user-role.dto.ts +4 -4
  211. package/src/users/user.dto.ts +19 -19
  212. package/dist/shared/dpp.schemas.d.ts +0 -28
  213. package/dist/shared/dpp.schemas.d.ts.map +0 -1
  214. package/dist/shared/dpp.schemas.js +0 -13
  215. package/src/shared/dpp.schemas.ts +0 -16
@@ -1 +1 @@
1
- {"version":3,"file":"set-user-role.dto.d.ts","sourceRoot":"","sources":["../../src/users/set-user-role.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,oBAAoB;;;;;iBAE/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
1
+ {"version":3,"file":"set-user-role.dto.d.ts","sourceRoot":"","sources":["../../src/users/set-user-role.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;iBAE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SetUserRoleDtoSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.SetUserRoleDtoSchema = zod_1.z.object({
6
- role: zod_1.z.enum(['admin', 'user']),
6
+ role: zod_1.z.enum(["admin", "user"]),
7
7
  });
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
  export interface UserDto {
3
3
  id: string;
4
4
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"user.dto.d.ts","sourceRoot":"","sources":["../../src/users/user.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,eAAO,MAAM,WAAW;;;;CAId,CAAA;AAEV,eAAO,MAAM,eAAe;;;;EAAsB,CAAA;AAClD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D,eAAO,MAAM,aAAa;;;CAGhB,CAAA;AAEV,eAAO,MAAM,iBAAiB;;;EAAwB,CAAA;AACtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
1
+ {"version":3,"file":"user.dto.d.ts","sourceRoot":"","sources":["../../src/users/user.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,eAAO,MAAM,eAAe;;;;EAAsB,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;EAAwB,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MemberRoleDtoEnum = exports.MemberRoleDto = exports.UserRoleDtoEnum = exports.UserRoleDto = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.UserRoleDto = {
6
- ADMIN: 'admin', // That is the super admin over all organizations
7
- USER: 'user',
8
- ANONYMOUS: 'anonymous',
6
+ ADMIN: "admin", // That is the super admin over all organizations
7
+ USER: "user",
8
+ ANONYMOUS: "anonymous",
9
9
  };
10
10
  exports.UserRoleDtoEnum = zod_1.z.enum(exports.UserRoleDto);
11
11
  exports.MemberRoleDto = {
12
- OWNER: 'owner',
13
- MEMBER: 'member',
12
+ OWNER: "owner",
13
+ MEMBER: "member",
14
14
  };
15
15
  exports.MemberRoleDtoEnum = zod_1.z.enum(exports.MemberRoleDto);
package/package.json CHANGED
@@ -1,13 +1,26 @@
1
1
  {
2
2
  "name": "@open-dpp/dto",
3
- "version": "0.1.3",
4
- "publishConfig": {
5
- "access": "public"
6
- },
3
+ "version": "0.3.0",
7
4
  "description": "",
8
- "author": "",
9
- "license": "ISC",
10
5
  "keywords": [],
6
+ "homepage": "https://github.com/open-dpp/open-dpp#readme",
7
+ "bugs": {
8
+ "url": "https://github.com/open-dpp/open-dpp/issues"
9
+ },
10
+ "license": "ISC",
11
+ "author": "",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/open-dpp/open-dpp.git",
15
+ "directory": "packages/dto"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "src"
20
+ ],
21
+ "main": "./dist/index.js",
22
+ "module": "./dist/index.js",
23
+ "types": "./src/index.ts",
11
24
  "exports": {
12
25
  ".": {
13
26
  "types": "./src/index.ts",
@@ -15,13 +28,9 @@
15
28
  },
16
29
  "./package.json": "./package.json"
17
30
  },
18
- "main": "./dist/index.js",
19
- "module": "./dist/index.js",
20
- "types": "./src/index.ts",
21
- "files": [
22
- "dist",
23
- "src"
24
- ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
25
34
  "dependencies": {
26
35
  "uuid": "^13.0.0",
27
36
  "zod": "^4.3.6"
@@ -32,17 +41,12 @@
32
41
  "@tsconfig/node-lts": "^24.0.0",
33
42
  "@tsconfig/node-ts": "^23.6.1",
34
43
  "@types/jest": "^30.0.0",
35
- "eslint": "^9.38.0",
36
- "globals": "^16.4.0",
37
44
  "jest": "^30.2.0",
38
- "typescript": "^5.9.3",
39
- "@open-dpp/config-eslint": "0.1.3"
45
+ "typescript": "^5.9.3"
40
46
  },
41
47
  "scripts": {
42
48
  "build": "tsc --project tsconfig.build.json",
43
49
  "check-ts": "tsc --noEmit",
44
- "lint": "eslint",
45
- "lint:fix": "eslint --fix",
46
50
  "test": "jest"
47
51
  }
48
52
  }
@@ -1,145 +1,146 @@
1
- import { expect } from '@jest/globals'
2
- import { z } from 'zod'
3
- import { DataTypeDef } from './enums/data-type-def'
1
+ import { expect } from "@jest/globals";
2
+ import { z } from "zod";
3
+ import { DataTypeDef } from "./enums/data-type-def";
4
4
 
5
- import { SubmodelElementSchema } from './submodel-base/submodel-element-schema'
5
+ import { SubmodelElementSchema } from "./submodel-base/submodel-element-schema";
6
6
 
7
- describe('zod-schemas', () => {
8
- it('should parse discriminated union correctly', () => {
7
+ describe("zod-schemas", () => {
8
+ it("should parse discriminated union correctly", () => {
9
9
  const schema = z.object({
10
10
  submodels: SubmodelElementSchema.array(),
11
- })
11
+ });
12
12
 
13
13
  const submodels = [
14
14
  {
15
- modelType: 'Property',
16
- idShort: 'test',
15
+ modelType: "Property",
16
+ idShort: "test",
17
17
  valueType: DataTypeDef.Double,
18
18
  },
19
19
  {
20
- modelType: 'Entity',
21
- entityType: 'CoManagedEntity',
20
+ modelType: "Entity",
21
+ entityType: "CoManagedEntity",
22
22
  statements: [
23
23
  {
24
- modelType: 'Entity',
25
- entityType: 'CoManagedEntity',
24
+ modelType: "Entity",
25
+ entityType: "CoManagedEntity",
26
26
  statements: [
27
27
  {
28
- modelType: 'Property',
29
- value: 'http://shells.smartfactory.de/aHR0cHM6Ly9zbWFydGZhY3RvcnkuZGUvc2hlbGxzLy1TUjdCYm5jSkc',
30
- valueType: 'xs:string',
31
- category: 'CONSTANT',
28
+ modelType: "Property",
29
+ value:
30
+ "http://shells.smartfactory.de/aHR0cHM6Ly9zbWFydGZhY3RvcnkuZGUvc2hlbGxzLy1TUjdCYm5jSkc",
31
+ valueType: "xs:string",
32
+ category: "CONSTANT",
32
33
  description: [
33
34
  {
34
- language: 'en',
35
- text: 'URL of the application',
35
+ language: "en",
36
+ text: "URL of the application",
36
37
  },
37
38
  {
38
- language: 'de',
39
- text: 'URL der Anwendung',
39
+ language: "de",
40
+ text: "URL der Anwendung",
40
41
  },
41
42
  ],
42
- idShort: 'ApplicationURL',
43
+ idShort: "ApplicationURL",
43
44
  },
44
45
  ],
45
46
  semanticId: {
46
47
  keys: [
47
48
  {
48
- type: 'GlobalReference',
49
- value: 'https://admin-shell.io/idta/HierarchicalStructures/Node/1/0',
49
+ type: "GlobalReference",
50
+ value: "https://admin-shell.io/idta/HierarchicalStructures/Node/1/0",
50
51
  },
51
52
  ],
52
- type: 'ExternalReference',
53
+ type: "ExternalReference",
53
54
  },
54
55
  description: [
55
56
  {
56
- language: 'en',
57
- text: 'SmartFactoryKL ShellScape',
57
+ language: "en",
58
+ text: "SmartFactoryKL ShellScape",
58
59
  },
59
60
  {
60
- language: 'de',
61
- text: 'SmartFactoryKL ShellScape',
61
+ language: "de",
62
+ text: "SmartFactoryKL ShellScape",
62
63
  },
63
64
  ],
64
- idShort: 'SmartFactoryShellScape',
65
+ idShort: "SmartFactoryShellScape",
65
66
  },
66
67
  {
67
- modelType: 'Entity',
68
- entityType: 'CoManagedEntity',
68
+ modelType: "Entity",
69
+ entityType: "CoManagedEntity",
69
70
  statements: [
70
71
  {
71
- modelType: 'Property',
72
- value: 'https://oncite.apps.c01.demo.oncite.io/core/productionview/#/workorder',
73
- valueType: 'xs:string',
74
- category: 'CONSTANT',
72
+ modelType: "Property",
73
+ value: "https://oncite.apps.c01.demo.oncite.io/core/productionview/#/workorder",
74
+ valueType: "xs:string",
75
+ category: "CONSTANT",
75
76
  description: [
76
77
  {
77
- language: 'en',
78
- text: 'URL of the application',
78
+ language: "en",
79
+ text: "URL of the application",
79
80
  },
80
81
  {
81
- language: 'de',
82
- text: 'URL der Anwendung',
82
+ language: "de",
83
+ text: "URL der Anwendung",
83
84
  },
84
85
  ],
85
- idShort: 'ApplicationURL',
86
+ idShort: "ApplicationURL",
86
87
  },
87
88
  {
88
- modelType: 'Property',
89
- value: 'https://oncite.apps.c01.demo.oncite.io/hmi/#/workorder-list',
90
- valueType: 'xs:string',
91
- category: 'CONSTANT',
89
+ modelType: "Property",
90
+ value: "https://oncite.apps.c01.demo.oncite.io/hmi/#/workorder-list",
91
+ valueType: "xs:string",
92
+ category: "CONSTANT",
92
93
  description: [
93
94
  {
94
- language: 'en',
95
- text: 'URL of the digital production system hmi client',
95
+ language: "en",
96
+ text: "URL of the digital production system hmi client",
96
97
  },
97
98
  {
98
- language: 'de',
99
- text: 'URL des HMI Clients des digitalen Produktionssystem',
99
+ language: "de",
100
+ text: "URL des HMI Clients des digitalen Produktionssystem",
100
101
  },
101
102
  ],
102
- idShort: 'HMI_Client',
103
+ idShort: "HMI_Client",
103
104
  },
104
105
  ],
105
106
  semanticId: {
106
107
  keys: [
107
108
  {
108
- type: 'GlobalReference',
109
- value: 'https://admin-shell.io/idta/HierarchicalStructures/Node/1/0',
109
+ type: "GlobalReference",
110
+ value: "https://admin-shell.io/idta/HierarchicalStructures/Node/1/0",
110
111
  },
111
112
  ],
112
- type: 'ExternalReference',
113
+ type: "ExternalReference",
113
114
  },
114
115
  description: [
115
116
  {
116
- language: 'en',
117
- text: 'DigitalProductionSystem (German Edge Cloud)',
117
+ language: "en",
118
+ text: "DigitalProductionSystem (German Edge Cloud)",
118
119
  },
119
120
  {
120
- language: 'de',
121
- text: 'DigitalProductionSystem (German Edge Cloud)',
121
+ language: "de",
122
+ text: "DigitalProductionSystem (German Edge Cloud)",
122
123
  },
123
124
  ],
124
- idShort: 'DigitalProductionSystem',
125
+ idShort: "DigitalProductionSystem",
125
126
  },
126
127
  ],
127
128
  semanticId: {
128
129
  keys: [
129
130
  {
130
- type: 'GlobalReference',
131
- value: 'https://admin-shell.io/idta/HierarchicalStructures/EntryNode/1/0',
131
+ type: "GlobalReference",
132
+ value: "https://admin-shell.io/idta/HierarchicalStructures/EntryNode/1/0",
132
133
  },
133
134
  ],
134
- type: 'ExternalReference',
135
+ type: "ExternalReference",
135
136
  },
136
- idShort: 'BillOfApplications',
137
+ idShort: "BillOfApplications",
137
138
  },
138
- ]
139
+ ];
139
140
 
140
141
  const parsed = schema.safeParse({
141
142
  submodels,
142
- })
143
- expect(parsed.success).toBeTruthy()
144
- })
145
- })
143
+ });
144
+ expect(parsed.success).toBeTruthy();
145
+ });
146
+ });
@@ -1,6 +1,6 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
3
  export const AdministrativeInformationJsonSchema = z.object({
4
4
  version: z.string(),
5
5
  revision: z.string(),
6
- })
6
+ });
@@ -1,17 +1,20 @@
1
- import { z } from 'zod'
2
- import { PagingMetadataDtoSchema } from '../shared/pagination.dto'
3
- import { AdministrativeInformationJsonSchema } from './administrative-information-json-schema'
4
- import { AssetInformationJsonSchema, AssetInformationModificationSchema } from './asset-information-json-schema'
5
- import { NameAndDescriptionModificationSchema } from './common/basic-json-schema'
6
- import { LanguageTextJsonSchema } from './common/language-text-json-schema'
7
- import { ReferenceJsonSchema } from './common/reference-json-schema'
8
- import { EmbeddedDataSpecificationJsonSchema } from './embedded-data-specification-json-schema'
9
- import { ExtensionJsonSchema } from './extension-json-schema'
10
- import { ResourceJsonSchema } from './resource-json-schema'
11
- import { SecurityDtoSchema } from './security/security.dto'
1
+ import { z } from "zod";
2
+ import { PagingMetadataDtoSchema } from "../shared/pagination.dto";
3
+ import { AdministrativeInformationJsonSchema } from "./administrative-information-json-schema";
4
+ import {
5
+ AssetInformationJsonSchema,
6
+ AssetInformationModificationSchema,
7
+ } from "./asset-information-json-schema";
8
+ import { NameAndDescriptionModificationSchema } from "./common/basic-json-schema";
9
+ import { LanguageTextJsonSchema } from "./common/language-text-json-schema";
10
+ import { ReferenceJsonSchema } from "./common/reference-json-schema";
11
+ import { EmbeddedDataSpecificationJsonSchema } from "./embedded-data-specification-json-schema";
12
+ import { ExtensionJsonSchema } from "./extension-json-schema";
13
+ import { ResourceJsonSchema } from "./resource-json-schema";
14
+ import { SecurityDtoSchema } from "./security/security.dto";
12
15
 
13
16
  export const AssetAdministrationShellJsonSchema = z.object({
14
- id: z.string().meta({ description: 'Id of the AAS' }),
17
+ id: z.string().meta({ description: "Id of the AAS" }),
15
18
  assetInformation: AssetInformationJsonSchema,
16
19
  extensions: ExtensionJsonSchema.array().default([]),
17
20
  category: z.nullish(z.string()),
@@ -23,30 +26,35 @@ export const AssetAdministrationShellJsonSchema = z.object({
23
26
  derivedFrom: z.nullish(ResourceJsonSchema),
24
27
  submodels: ReferenceJsonSchema.array().default([]),
25
28
  security: SecurityDtoSchema,
26
- })
29
+ });
27
30
  export const AssetAdministrationShellPaginationResponseDtoSchema = z
28
31
  .object({
29
32
  ...PagingMetadataDtoSchema.shape,
30
33
  result: AssetAdministrationShellJsonSchema.array(),
31
34
  })
32
- .meta({ id: 'AssetAdministrationShells' })
35
+ .meta({ id: "AssetAdministrationShells" });
33
36
  export type AssetAdministrationShellPaginationResponseDto = z.infer<
34
37
  typeof AssetAdministrationShellPaginationResponseDtoSchema
35
- >
38
+ >;
36
39
  export const AssetAdministrationShellCreateDtoSchema = AssetAdministrationShellJsonSchema.pick({
37
40
  displayName: true,
38
41
  description: true,
39
- })
40
- export type AssetAdministrationShellCreateDto = z.input<typeof AssetAdministrationShellCreateDtoSchema>
41
- export type AssetAdministrationShellResponseDto = z.infer<typeof AssetAdministrationShellJsonSchema>
42
+ });
43
+ export type AssetAdministrationShellCreateDto = z.input<
44
+ typeof AssetAdministrationShellCreateDtoSchema
45
+ >;
46
+ export type AssetAdministrationShellResponseDto = z.infer<
47
+ typeof AssetAdministrationShellJsonSchema
48
+ >;
42
49
 
43
- export type AssetAdministrationShellRequestDto = z.input<typeof AssetAdministrationShellJsonSchema>
50
+ export type AssetAdministrationShellRequestDto = z.input<typeof AssetAdministrationShellJsonSchema>;
44
51
 
45
- export const AssetAdministrationShellModificationSchema = NameAndDescriptionModificationSchema.extend({
46
- assetInformation: AssetInformationModificationSchema.optional(),
47
- security: SecurityDtoSchema.optional(),
48
- })
52
+ export const AssetAdministrationShellModificationSchema =
53
+ NameAndDescriptionModificationSchema.extend({
54
+ assetInformation: AssetInformationModificationSchema.optional(),
55
+ security: SecurityDtoSchema.optional(),
56
+ });
49
57
 
50
58
  export type AssetAdministrationShellModificationDto = z.infer<
51
59
  typeof AssetAdministrationShellModificationSchema
52
- >
60
+ >;
@@ -1,7 +1,7 @@
1
- import { z } from 'zod'
2
- import { AssetKindEnum } from './enums/asset-kind-enum'
3
- import { ResourceJsonSchema } from './resource-json-schema'
4
- import { SpecificAssetIdJsonSchema } from './specific-asset-id-json-schema'
1
+ import { z } from "zod";
2
+ import { AssetKindEnum } from "./enums/asset-kind-enum";
3
+ import { ResourceJsonSchema } from "./resource-json-schema";
4
+ import { SpecificAssetIdJsonSchema } from "./specific-asset-id-json-schema";
5
5
 
6
6
  export const AssetInformationJsonSchema = z.object({
7
7
  assetKind: AssetKindEnum,
@@ -9,10 +9,12 @@ export const AssetInformationJsonSchema = z.object({
9
9
  specificAssetIds: SpecificAssetIdJsonSchema.array().default([]),
10
10
  assetType: z.nullish(z.string()),
11
11
  defaultThumbnails: ResourceJsonSchema.array().default([]),
12
- })
12
+ });
13
13
 
14
- export type AssetInformationDto = z.infer<typeof AssetInformationJsonSchema>
14
+ export type AssetInformationDto = z.infer<typeof AssetInformationJsonSchema>;
15
15
 
16
- export const AssetInformationModificationSchema = AssetInformationJsonSchema.pick({ defaultThumbnails: true }).partial()
16
+ export const AssetInformationModificationSchema = AssetInformationJsonSchema.pick({
17
+ defaultThumbnails: true,
18
+ }).partial();
17
19
 
18
- export type AssetInformationModificationDto = z.input<typeof AssetInformationModificationSchema>
20
+ export type AssetInformationModificationDto = z.input<typeof AssetInformationModificationSchema>;
@@ -1,27 +1,30 @@
1
- import { z } from 'zod'
2
- import { DataTypeDef, DataTypeDefEnum } from '../enums/data-type-def'
3
- import { LanguageTextJsonSchema } from './language-text-json-schema'
1
+ import { z } from "zod";
2
+ import { DataTypeDef, DataTypeDefEnum } from "../enums/data-type-def";
3
+ import { LanguageTextJsonSchema } from "./language-text-json-schema";
4
4
 
5
- export const ValueTypeSchema = z.string().overwrite(
6
- (value) => {
5
+ export const ValueTypeSchema = z
6
+ .string()
7
+ .overwrite((value) => {
7
8
  // turn "positiveInteger" → "PositiveInteger"
8
- let key = value
9
- if (value.startsWith('xs:')) {
10
- const raw = value.replace(/^xs:/, '')
11
- key = raw.charAt(0).toUpperCase() + raw.slice(1)
9
+ let key = value;
10
+ if (value.startsWith("xs:")) {
11
+ const raw = value.replace(/^xs:/, "");
12
+ key = raw.charAt(0).toUpperCase() + raw.slice(1);
12
13
  }
13
14
 
14
15
  // validate against enum
15
16
  if (!(key in DataTypeDef)) {
16
- throw new Error(`Unknown number type: ${value}`)
17
+ throw new Error(`Unknown number type: ${value}`);
17
18
  }
18
- return key
19
- },
20
- ).pipe(DataTypeDefEnum)
19
+ return key;
20
+ })
21
+ .pipe(DataTypeDefEnum);
21
22
 
22
23
  export const NameAndDescriptionModificationSchema = z.object({
23
24
  displayName: LanguageTextJsonSchema.array().optional(),
24
25
  description: LanguageTextJsonSchema.array().optional(),
25
- })
26
+ });
26
27
 
27
- export type NameAndDescriptionModificationDto = z.infer<typeof NameAndDescriptionModificationSchema>
28
+ export type NameAndDescriptionModificationDto = z.infer<
29
+ typeof NameAndDescriptionModificationSchema
30
+ >;
@@ -1,10 +1,10 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- import { KeyTypesEnum } from '../enums/key-types-enum'
3
+ import { KeyTypesEnum } from "../enums/key-types-enum";
4
4
 
5
5
  export const KeyJsonSchema = z.object({
6
6
  type: KeyTypesEnum,
7
7
  value: z.string(),
8
- })
8
+ });
9
9
 
10
- export const KeyModificationSchema = KeyJsonSchema
10
+ export const KeyModificationSchema = KeyJsonSchema;
@@ -1,10 +1,10 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- import { LanguageEnum } from '../enums/language-enum'
3
+ import { LanguageEnum } from "../enums/language-enum";
4
4
 
5
5
  export const LanguageTextJsonSchema = z.object({
6
6
  language: LanguageEnum,
7
7
  text: z.string(),
8
- })
8
+ });
9
9
 
10
- export type LanguageTextDto = z.infer<typeof LanguageTextJsonSchema>
10
+ export type LanguageTextDto = z.infer<typeof LanguageTextJsonSchema>;
@@ -1,7 +1,7 @@
1
- import { z } from 'zod'
2
- import { QualifierKindEnum } from '../enums/qualifier-kind-enum'
3
- import { ValueTypeSchema } from './basic-json-schema'
4
- import { ReferenceJsonSchema } from './reference-json-schema'
1
+ import { z } from "zod";
2
+ import { QualifierKindEnum } from "../enums/qualifier-kind-enum";
3
+ import { ValueTypeSchema } from "./basic-json-schema";
4
+ import { ReferenceJsonSchema } from "./reference-json-schema";
5
5
 
6
6
  export const QualifierJsonSchema = z.object({
7
7
  type: z.string(),
@@ -11,4 +11,4 @@ export const QualifierJsonSchema = z.object({
11
11
  kind: QualifierKindEnum,
12
12
  value: z.string().nullish(),
13
13
  valueId: ReferenceJsonSchema.nullish(),
14
- })
14
+ });
@@ -1,8 +1,8 @@
1
- import type { KeyTypesType } from '../enums/key-types-enum'
2
- import type { ReferenceTypesType } from '../enums/reference-types-enum'
3
- import { z } from 'zod'
4
- import { ReferenceTypesEnum } from '../enums/reference-types-enum'
5
- import { KeyJsonSchema, KeyModificationSchema } from './key-json-schema'
1
+ import type { KeyTypesType } from "../enums/key-types-enum";
2
+ import type { ReferenceTypesType } from "../enums/reference-types-enum";
3
+ import { z } from "zod";
4
+ import { ReferenceTypesEnum } from "../enums/reference-types-enum";
5
+ import { KeyJsonSchema, KeyModificationSchema } from "./key-json-schema";
6
6
 
7
7
  export const ReferenceJsonSchema: z.ZodType<any> = z.lazy(() =>
8
8
  z.object({
@@ -10,18 +10,18 @@ export const ReferenceJsonSchema: z.ZodType<any> = z.lazy(() =>
10
10
  referredSemanticId: ReferenceJsonSchema.nullish(),
11
11
  keys: z.array(KeyJsonSchema),
12
12
  }),
13
- )
13
+ );
14
14
 
15
15
  export interface ReferenceValue {
16
- type: ReferenceTypesType
17
- referredSemanticId: ReferenceValue | null
18
- keys: { type: KeyTypesType, value: string }[]
16
+ type: ReferenceTypesType;
17
+ referredSemanticId: ReferenceValue | null;
18
+ keys: { type: KeyTypesType; value: string }[];
19
19
  }
20
20
 
21
21
  export interface ReferenceModification {
22
- type?: ReferenceTypesType
23
- referredSemanticId?: ReferenceModification | null
24
- keys?: { type: KeyTypesType, value: string }[]
22
+ type?: ReferenceTypesType;
23
+ referredSemanticId?: ReferenceModification | null;
24
+ keys?: { type: KeyTypesType; value: string }[];
25
25
  }
26
26
 
27
27
  export const ReferenceModificationSchema: z.ZodType<ReferenceModification> = z.lazy(() =>
@@ -30,4 +30,4 @@ export const ReferenceModificationSchema: z.ZodType<ReferenceModification> = z.l
30
30
  referredSemanticId: ReferenceModificationSchema.nullish(),
31
31
  keys: z.array(KeyModificationSchema).optional(),
32
32
  }),
33
- )
33
+ );
@@ -1,9 +1,9 @@
1
- import { z } from 'zod'
2
- import { AdministrativeInformationJsonSchema } from './administrative-information-json-schema'
3
- import { LanguageTextJsonSchema } from './common/language-text-json-schema'
4
- import { ReferenceJsonSchema } from './common/reference-json-schema'
5
- import { EmbeddedDataSpecificationJsonSchema } from './embedded-data-specification-json-schema'
6
- import { ExtensionJsonSchema } from './extension-json-schema'
1
+ import { z } from "zod";
2
+ import { AdministrativeInformationJsonSchema } from "./administrative-information-json-schema";
3
+ import { LanguageTextJsonSchema } from "./common/language-text-json-schema";
4
+ import { ReferenceJsonSchema } from "./common/reference-json-schema";
5
+ import { EmbeddedDataSpecificationJsonSchema } from "./embedded-data-specification-json-schema";
6
+ import { ExtensionJsonSchema } from "./extension-json-schema";
7
7
 
8
8
  export const ConceptDescriptionJsonSchema = z.object({
9
9
  id: z.string(),
@@ -16,4 +16,4 @@ export const ConceptDescriptionJsonSchema = z.object({
16
16
  administration: z.nullish(AdministrativeInformationJsonSchema),
17
17
  embeddedDataSpecifications: EmbeddedDataSpecificationJsonSchema.array().default([]),
18
18
  isCaseOf: ReferenceJsonSchema.array().default([]),
19
- })
19
+ });