@open-dpp/dto 2.9.0 → 3.0.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 (109) hide show
  1. package/dist/aas/asset-administration-shell-json-schema.d.ts +560 -20
  2. package/dist/aas/asset-administration-shell-json-schema.d.ts.map +1 -1
  3. package/dist/aas/common/basic-json-schema.d.ts +56 -2
  4. package/dist/aas/common/basic-json-schema.d.ts.map +1 -1
  5. package/dist/aas/common/language-text-json-schema.d.ts +28 -1
  6. package/dist/aas/common/language-text-json-schema.d.ts.map +1 -1
  7. package/dist/aas/concept-description-json-schema.d.ts +56 -2
  8. package/dist/aas/concept-description-json-schema.d.ts.map +1 -1
  9. package/dist/aas/enums/language-enum.d.ts +58 -2
  10. package/dist/aas/enums/language-enum.d.ts.map +1 -1
  11. package/dist/aas/enums/language-enum.js +38 -3
  12. package/dist/aas/environment-json-schema.d.ts +28 -1
  13. package/dist/aas/environment-json-schema.d.ts.map +1 -1
  14. package/dist/aas/security/access-permission-rule.dto.d.ts +224 -8
  15. package/dist/aas/security/access-permission-rule.dto.d.ts.map +1 -1
  16. package/dist/aas/security/security.dto.d.ts +280 -10
  17. package/dist/aas/security/security.dto.d.ts.map +1 -1
  18. package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts +120 -12
  19. package/dist/aas/submodel-base/annotated-relationship-element-json-schema.d.ts.map +1 -1
  20. package/dist/aas/submodel-base/blob-json-schema.d.ts +56 -2
  21. package/dist/aas/submodel-base/blob-json-schema.d.ts.map +1 -1
  22. package/dist/aas/submodel-base/create-group-from-column-schema.d.ts +4 -4
  23. package/dist/aas/submodel-base/entity-type-json-schema.d.ts +120 -12
  24. package/dist/aas/submodel-base/entity-type-json-schema.d.ts.map +1 -1
  25. package/dist/aas/submodel-base/file-json-schema.d.ts +112 -4
  26. package/dist/aas/submodel-base/file-json-schema.d.ts.map +1 -1
  27. package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts +84 -3
  28. package/dist/aas/submodel-base/multi-language-property-json-schema.d.ts.map +1 -1
  29. package/dist/aas/submodel-base/property-json-schema.d.ts +112 -4
  30. package/dist/aas/submodel-base/property-json-schema.d.ts.map +1 -1
  31. package/dist/aas/submodel-base/range-json-schema.d.ts +56 -2
  32. package/dist/aas/submodel-base/range-json-schema.d.ts.map +1 -1
  33. package/dist/aas/submodel-base/reference-element-json-schema.d.ts +112 -4
  34. package/dist/aas/submodel-base/reference-element-json-schema.d.ts.map +1 -1
  35. package/dist/aas/submodel-base/relationship-element-json-schema.d.ts +56 -2
  36. package/dist/aas/submodel-base/relationship-element-json-schema.d.ts.map +1 -1
  37. package/dist/aas/submodel-base/submodel-base-json-schema.d.ts +112 -4
  38. package/dist/aas/submodel-base/submodel-base-json-schema.d.ts.map +1 -1
  39. package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts +232 -16
  40. package/dist/aas/submodel-base/submodel-element-collection-json-schema.d.ts.map +1 -1
  41. package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts +232 -16
  42. package/dist/aas/submodel-base/submodel-element-list-json-schema.d.ts.map +1 -1
  43. package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts +56 -2
  44. package/dist/aas/submodel-base/submodel-element-modification-schema.d.ts.map +1 -1
  45. package/dist/aas/submodel-base/submodel-element-schema.d.ts +720 -45
  46. package/dist/aas/submodel-base/submodel-element-schema.d.ts.map +1 -1
  47. package/dist/aas/submodel-base/submodel-json-schema.d.ts +236 -20
  48. package/dist/aas/submodel-base/submodel-json-schema.d.ts.map +1 -1
  49. package/dist/activity-history/activity-history.dto.d.ts +28 -1
  50. package/dist/activity-history/activity-history.dto.d.ts.map +1 -1
  51. package/dist/digital-product-document/digital-product-document.schemas.d.ts +28 -1
  52. package/dist/digital-product-document/digital-product-document.schemas.d.ts.map +1 -1
  53. package/dist/index.d.ts +5 -0
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +5 -0
  56. package/dist/passports/passport.dto.d.ts +112 -4
  57. package/dist/passports/passport.dto.d.ts.map +1 -1
  58. package/dist/permalinks/permalink.dto.d.ts +3718 -10
  59. package/dist/permalinks/permalink.dto.d.ts.map +1 -1
  60. package/dist/permalinks/permalink.dto.js +89 -6
  61. package/dist/shared/permalink-base-url.schema.d.ts +1 -0
  62. package/dist/shared/permalink-base-url.schema.d.ts.map +1 -1
  63. package/dist/shared/permalink-base-url.schema.js +9 -0
  64. package/dist/templates/template.dto.d.ts +112 -4
  65. package/dist/templates/template.dto.d.ts.map +1 -1
  66. package/dist/unique-product-identifiers/create-internal-unique-product-identifier.dto.d.ts +6 -0
  67. package/dist/unique-product-identifiers/create-internal-unique-product-identifier.dto.d.ts.map +1 -0
  68. package/dist/unique-product-identifiers/create-internal-unique-product-identifier.dto.js +9 -0
  69. package/dist/unique-product-identifiers/create-unique-product-identifier.dto.d.ts +9 -0
  70. package/dist/unique-product-identifiers/create-unique-product-identifier.dto.d.ts.map +1 -0
  71. package/dist/unique-product-identifiers/create-unique-product-identifier.dto.js +13 -0
  72. package/dist/unique-product-identifiers/gs1/gs1-ai-description.d.ts +6 -4
  73. package/dist/unique-product-identifiers/gs1/gs1-ai-description.d.ts.map +1 -1
  74. package/dist/unique-product-identifiers/gs1/gs1-ai-description.js +13 -3
  75. package/dist/unique-product-identifiers/gs1/gs1-digital-link.d.ts +10 -0
  76. package/dist/unique-product-identifiers/gs1/gs1-digital-link.d.ts.map +1 -1
  77. package/dist/unique-product-identifiers/gs1/gs1-digital-link.js +20 -6
  78. package/dist/unique-product-identifiers/unique-product-identifier-list-item.dto.d.ts +104 -0
  79. package/dist/unique-product-identifiers/unique-product-identifier-list-item.dto.d.ts.map +1 -0
  80. package/dist/unique-product-identifiers/unique-product-identifier-list-item.dto.js +42 -0
  81. package/dist/unique-product-identifiers/unique-product-identifier-type.d.ts +1 -1
  82. package/dist/unique-product-identifiers/update-unique-product-identifier.dto.d.ts +8 -0
  83. package/dist/unique-product-identifiers/update-unique-product-identifier.dto.d.ts.map +1 -0
  84. package/dist/unique-product-identifiers/update-unique-product-identifier.dto.js +12 -0
  85. package/dist/users/display-language.dto.d.ts +11 -0
  86. package/dist/users/display-language.dto.d.ts.map +1 -0
  87. package/dist/users/display-language.dto.js +9 -0
  88. package/dist/users/update-profile.dto.js +2 -2
  89. package/dist/users/user.dto.d.ts.map +1 -1
  90. package/dist/users/user.dto.js +2 -2
  91. package/package.json +1 -1
  92. package/src/aas/enums/language-enum.ts +41 -2
  93. package/src/index.ts +5 -0
  94. package/src/permalinks/permalink.dto.spec.ts +469 -0
  95. package/src/permalinks/permalink.dto.ts +103 -5
  96. package/src/shared/permalink-base-url.schema.spec.ts +17 -1
  97. package/src/shared/permalink-base-url.schema.ts +8 -0
  98. package/src/unique-product-identifiers/create-internal-unique-product-identifier.dto.ts +11 -0
  99. package/src/unique-product-identifiers/create-unique-product-identifier.dto.ts +15 -0
  100. package/src/unique-product-identifiers/gs1/gs1-ai-description.spec.ts +14 -0
  101. package/src/unique-product-identifiers/gs1/gs1-ai-description.ts +16 -5
  102. package/src/unique-product-identifiers/gs1/gs1-digital-link.spec.ts +16 -0
  103. package/src/unique-product-identifiers/gs1/gs1-digital-link.ts +22 -6
  104. package/src/unique-product-identifiers/unique-product-identifier-list-item.dto.ts +64 -0
  105. package/src/unique-product-identifiers/update-unique-product-identifier.dto.ts +14 -0
  106. package/src/users/display-language.dto.ts +9 -0
  107. package/src/users/update-profile.dto.spec.ts +1 -1
  108. package/src/users/update-profile.dto.ts +2 -2
  109. package/src/users/user.dto.ts +2 -2
@@ -0,0 +1,104 @@
1
+ import { z } from "zod";
2
+ export declare const UniqueProductIdentifierPermalinkSummaryDtoSchema: z.ZodObject<{
3
+ id: z.ZodUUID;
4
+ kind: z.ZodEnum<{
5
+ "open-dpp": "open-dpp";
6
+ "gs1-link": "gs1-link";
7
+ }>;
8
+ publicUrl: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export type UniqueProductIdentifierPermalinkSummaryDto = z.infer<typeof UniqueProductIdentifierPermalinkSummaryDtoSchema>;
11
+ export declare const UniqueProductIdentifierListItemDtoSchema: z.ZodObject<{
12
+ uuid: z.ZodUUID;
13
+ referenceId: z.ZodUUID;
14
+ type: z.ZodEnum<{
15
+ readonly OPEN_DPP_UUID: "OPEN_DPP_UUID";
16
+ readonly GS1: "GS1";
17
+ readonly GTIN: "GTIN";
18
+ readonly EAN: "EAN";
19
+ }>;
20
+ gtin: z.ZodNullable<z.ZodString>;
21
+ batch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ serial: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
23
+ granularity: z.ZodNullable<z.ZodEnum<{
24
+ batch: "batch";
25
+ model: "model";
26
+ item: "item";
27
+ }>>;
28
+ digitalLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ passportPublished: z.ZodBoolean;
30
+ permalink: z.ZodOptional<z.ZodNullable<z.ZodObject<{
31
+ id: z.ZodUUID;
32
+ kind: z.ZodEnum<{
33
+ "open-dpp": "open-dpp";
34
+ "gs1-link": "gs1-link";
35
+ }>;
36
+ publicUrl: z.ZodString;
37
+ }, z.core.$strip>>>;
38
+ }, z.core.$strip>;
39
+ export type UniqueProductIdentifierListItemDto = z.infer<typeof UniqueProductIdentifierListItemDtoSchema>;
40
+ export declare const UniqueProductIdentifierListDtoSchema: z.ZodArray<z.ZodObject<{
41
+ uuid: z.ZodUUID;
42
+ referenceId: z.ZodUUID;
43
+ type: z.ZodEnum<{
44
+ readonly OPEN_DPP_UUID: "OPEN_DPP_UUID";
45
+ readonly GS1: "GS1";
46
+ readonly GTIN: "GTIN";
47
+ readonly EAN: "EAN";
48
+ }>;
49
+ gtin: z.ZodNullable<z.ZodString>;
50
+ batch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ serial: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
52
+ granularity: z.ZodNullable<z.ZodEnum<{
53
+ batch: "batch";
54
+ model: "model";
55
+ item: "item";
56
+ }>>;
57
+ digitalLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
58
+ passportPublished: z.ZodBoolean;
59
+ permalink: z.ZodOptional<z.ZodNullable<z.ZodObject<{
60
+ id: z.ZodUUID;
61
+ kind: z.ZodEnum<{
62
+ "open-dpp": "open-dpp";
63
+ "gs1-link": "gs1-link";
64
+ }>;
65
+ publicUrl: z.ZodString;
66
+ }, z.core.$strip>>>;
67
+ }, z.core.$strip>>;
68
+ export type UniqueProductIdentifierListDto = z.infer<typeof UniqueProductIdentifierListDtoSchema>;
69
+ export declare const UniqueProductIdentifierPaginationDtoSchema: z.ZodObject<{
70
+ result: z.ZodArray<z.ZodObject<{
71
+ uuid: z.ZodUUID;
72
+ referenceId: z.ZodUUID;
73
+ type: z.ZodEnum<{
74
+ readonly OPEN_DPP_UUID: "OPEN_DPP_UUID";
75
+ readonly GS1: "GS1";
76
+ readonly GTIN: "GTIN";
77
+ readonly EAN: "EAN";
78
+ }>;
79
+ gtin: z.ZodNullable<z.ZodString>;
80
+ batch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ serial: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
82
+ granularity: z.ZodNullable<z.ZodEnum<{
83
+ batch: "batch";
84
+ model: "model";
85
+ item: "item";
86
+ }>>;
87
+ digitalLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ passportPublished: z.ZodBoolean;
89
+ permalink: z.ZodOptional<z.ZodNullable<z.ZodObject<{
90
+ id: z.ZodUUID;
91
+ kind: z.ZodEnum<{
92
+ "open-dpp": "open-dpp";
93
+ "gs1-link": "gs1-link";
94
+ }>;
95
+ publicUrl: z.ZodString;
96
+ }, z.core.$strip>>>;
97
+ }, z.core.$strip>>;
98
+ paging_metadata: z.ZodObject<{
99
+ cursor: z.ZodNullable<z.ZodString>;
100
+ total_count: z.ZodOptional<z.ZodNumber>;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ export type UniqueProductIdentifierPaginationDto = z.infer<typeof UniqueProductIdentifierPaginationDtoSchema>;
104
+ //# sourceMappingURL=unique-product-identifier-list-item.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unique-product-identifier-list-item.dto.d.ts","sourceRoot":"","sources":["../../src/unique-product-identifiers/unique-product-identifier-list-item.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gDAAgD;;;;;;;iBAMH,CAAC;AAE3D,MAAM,MAAM,0CAA0C,GAAG,CAAC,CAAC,KAAK,CAC9D,OAAO,gDAAgD,CACxD,CAAC;AAEF,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBH,CAAC;AAEnD,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,wCAAwC,CAChD,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEhD,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKZ,CAAC;AAE5C,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UniqueProductIdentifierPaginationDtoSchema = exports.UniqueProductIdentifierListDtoSchema = exports.UniqueProductIdentifierListItemDtoSchema = exports.UniqueProductIdentifierPermalinkSummaryDtoSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const unique_product_identifier_type_1 = require("./unique-product-identifier-type");
6
+ const gs1_digital_link_1 = require("./gs1/gs1-digital-link");
7
+ const permalink_dto_1 = require("../permalinks/permalink.dto");
8
+ const pagination_dto_1 = require("../shared/pagination.dto");
9
+ exports.UniqueProductIdentifierPermalinkSummaryDtoSchema = zod_1.z
10
+ .object({
11
+ id: zod_1.z.uuid(),
12
+ kind: permalink_dto_1.PermalinkKindSchema,
13
+ publicUrl: zod_1.z.string().url(),
14
+ })
15
+ .meta({ id: "UniqueProductIdentifierPermalinkSummary" });
16
+ exports.UniqueProductIdentifierListItemDtoSchema = zod_1.z
17
+ .object({
18
+ uuid: zod_1.z.uuid(),
19
+ referenceId: zod_1.z.uuid(),
20
+ type: unique_product_identifier_type_1.UniqueProductIdentifierTypeSchema,
21
+ gtin: gs1_digital_link_1.Gtin14Schema.nullable(),
22
+ batch: gs1_digital_link_1.Cset82ComponentSchema.nullish().overwrite((v) => v ?? null),
23
+ serial: gs1_digital_link_1.Cset82ComponentSchema.nullable()
24
+ .nullish()
25
+ .overwrite((v) => v ?? null),
26
+ granularity: unique_product_identifier_type_1.Gs1GranularitySchema.nullable(),
27
+ digitalLink: zod_1.z
28
+ .string()
29
+ .url()
30
+ .nullish()
31
+ .overwrite((v) => v ?? null),
32
+ passportPublished: zod_1.z.boolean(),
33
+ permalink: exports.UniqueProductIdentifierPermalinkSummaryDtoSchema.nullish().overwrite((v) => v ?? null),
34
+ })
35
+ .meta({ id: "UniqueProductIdentifierListItem" });
36
+ exports.UniqueProductIdentifierListDtoSchema = zod_1.z.array(exports.UniqueProductIdentifierListItemDtoSchema);
37
+ exports.UniqueProductIdentifierPaginationDtoSchema = zod_1.z
38
+ .object({
39
+ ...pagination_dto_1.PagingMetadataDtoSchema.shape,
40
+ result: exports.UniqueProductIdentifierListItemDtoSchema.array(),
41
+ })
42
+ .meta({ id: "UniqueProductIdentifiers" });
@@ -28,8 +28,8 @@ export type UniqueProductIdentifierTypeValue = z.infer<typeof UniqueProductIdent
28
28
  * - `item` — GTIN + serial (AI `21`), optionally also batch
29
29
  */
30
30
  export declare const Gs1GranularitySchema: z.ZodEnum<{
31
- model: "model";
32
31
  batch: "batch";
32
+ model: "model";
33
33
  item: "item";
34
34
  }>;
35
35
  export type Gs1Granularity = z.infer<typeof Gs1GranularitySchema>;
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export declare const UpdateGs1UniqueProductIdentifierRequestSchema: z.ZodObject<{
3
+ gtin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
+ batch: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodString>>>;
5
+ serial: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodString>>>;
6
+ }, z.core.$strip>;
7
+ export type UpdateGs1UniqueProductIdentifierRequest = z.infer<typeof UpdateGs1UniqueProductIdentifierRequestSchema>;
8
+ //# sourceMappingURL=update-unique-product-identifier.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-unique-product-identifier.dto.d.ts","sourceRoot":"","sources":["../../src/unique-product-identifiers/update-unique-product-identifier.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,6CAA6C;;;;iBAMA,CAAC;AAE3D,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,6CAA6C,CACrD,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateGs1UniqueProductIdentifierRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const gs1_digital_link_1 = require("./gs1/gs1-digital-link");
6
+ exports.UpdateGs1UniqueProductIdentifierRequestSchema = zod_1.z
7
+ .object({
8
+ gtin: gs1_digital_link_1.GtinInputSchema,
9
+ batch: gs1_digital_link_1.Cset82ComponentInputSchema.optional(),
10
+ serial: gs1_digital_link_1.Cset82ComponentInputSchema.optional(),
11
+ })
12
+ .meta({ id: "UpdateGs1UniqueProductIdentifierRequest" });
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const DisplayLanguage: {
3
+ readonly en: "en";
4
+ readonly de: "de";
5
+ };
6
+ export declare const DisplayLanguageEnum: z.ZodEnum<{
7
+ readonly en: "en";
8
+ readonly de: "de";
9
+ }>;
10
+ export type DisplayLanguageType = z.infer<typeof DisplayLanguageEnum>;
11
+ //# sourceMappingURL=display-language.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-language.dto.d.ts","sourceRoot":"","sources":["../../src/users/display-language.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;EAA0B,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisplayLanguageEnum = exports.DisplayLanguage = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.DisplayLanguage = {
6
+ en: "en",
7
+ de: "de",
8
+ };
9
+ exports.DisplayLanguageEnum = zod_1.z.enum(exports.DisplayLanguage);
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateProfileDtoSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const language_enum_1 = require("../aas/enums/language-enum");
5
+ const display_language_dto_1 = require("./display-language.dto");
6
6
  exports.UpdateProfileDtoSchema = zod_1.z.object({
7
7
  // Empty string is a valid "cleared name" — admin-invited users have firstName: "".
8
8
  // No .min(1): it would lock empty-name users out of saving any profile change.
9
9
  firstName: zod_1.z.string().trim().max(100).optional(),
10
10
  lastName: zod_1.z.string().trim().max(100).optional(),
11
- preferredLanguage: language_enum_1.LanguageEnum.optional(),
11
+ preferredLanguage: display_language_dto_1.DisplayLanguageEnum.optional(),
12
12
  });
@@ -1 +1 @@
1
- {"version":3,"file":"user.dto.d.ts","sourceRoot":"","sources":["../../src/users/user.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;iBAWxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,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"}
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;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;iBAWxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,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"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MemberRoleDtoEnum = exports.MemberRoleDto = exports.UserRoleDtoEnum = exports.UserRoleDto = exports.UserDtoSchema = void 0;
4
- const language_enum_1 = require("../aas/enums/language-enum");
5
4
  const zod_1 = require("zod");
5
+ const display_language_dto_1 = require("./display-language.dto");
6
6
  exports.UserDtoSchema = zod_1.z.object({
7
7
  id: zod_1.z.string(),
8
8
  email: zod_1.z.email(),
@@ -11,7 +11,7 @@ exports.UserDtoSchema = zod_1.z.object({
11
11
  name: zod_1.z.string().nullable(),
12
12
  image: zod_1.z.string().nullable(),
13
13
  emailVerified: zod_1.z.boolean(),
14
- preferredLanguage: language_enum_1.LanguageEnum,
14
+ preferredLanguage: display_language_dto_1.DisplayLanguageEnum,
15
15
  createdAt: zod_1.z.coerce.date(),
16
16
  updatedAt: zod_1.z.coerce.date(),
17
17
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-dpp/dto",
3
- "version": "2.9.0",
3
+ "version": "3.0.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/open-dpp/open-dpp#readme",
@@ -1,8 +1,47 @@
1
1
  import { z } from "zod";
2
2
 
3
3
  export const Language = {
4
- en: "en",
5
- de: "de",
4
+ bg: "bg", // Bulgarian
5
+ cs: "cs", // Czech
6
+ da: "da", // Danish
7
+ de: "de", // German
8
+ el: "el", // Greek
9
+ en: "en", // English
10
+ es: "es", // Spanish
11
+ et: "et", // Estonian
12
+ fi: "fi", // Finnish
13
+ fr: "fr", // French
14
+ hr: "hr", // Croatian
15
+ hu: "hu", // Hungarian
16
+ it: "it", // Italian
17
+ lt: "lt", // Lithuanian
18
+ lv: "lv", // Latvian
19
+ nl: "nl", // Dutch
20
+ no: "no", // Norwegian
21
+ pl: "pl", // Polish
22
+ pt: "pt", // Portuguese
23
+ ro: "ro", // Romanian
24
+ ru: "ru", // Russian
25
+ sk: "sk", // Slovak
26
+ sl: "sl", // Slovenian
27
+ sv: "sv", // Swedish
28
+ tr: "tr", // Turkish
29
+ uk: "uk", // Ukrainian
30
+ bn: "bn", // Bengali
31
+ "zh-Hans": "zh-Hans", // Chinese (Simplified)
32
+ "zh-Hant": "zh-Hant", // Chinese (Traditional)
6
33
  } as const;
7
34
  export const LanguageEnum = z.enum(Language);
8
35
  export type LanguageType = z.infer<typeof LanguageEnum>;
36
+
37
+ export const BcpLanguageTagSchema = z.string().refine(
38
+ (tag) => {
39
+ try {
40
+ return Intl.getCanonicalLocales(tag).length > 0;
41
+ } catch {
42
+ return false;
43
+ }
44
+ },
45
+ { message: "Invalid BCP 47 language tag" },
46
+ );
47
+ export type BcpLanguageTagType = z.infer<typeof BcpLanguageTagSchema>;
package/src/index.ts CHANGED
@@ -84,8 +84,13 @@ export * from "./users/pending-email-change.dto";
84
84
  export * from "./users/request-email-change.dto";
85
85
  export * from "./users/set-user-role.dto";
86
86
  export * from "./users/update-profile.dto";
87
+ export * from "./users/display-language.dto";
87
88
  export * from "./users/user.dto";
88
89
 
89
90
  export * from "./activity-history/activity-history.dto";
90
91
  export * from "./activity-history/change-event-types.dto";
91
92
  export * from "./activity-history/activity-types.dto";
93
+ export * from "./unique-product-identifiers/unique-product-identifier-list-item.dto";
94
+ export * from "./unique-product-identifiers/create-unique-product-identifier.dto";
95
+ export * from "./unique-product-identifiers/create-internal-unique-product-identifier.dto";
96
+ export * from "./unique-product-identifiers/update-unique-product-identifier.dto";