@open-dpp/dto 2.5.0 → 2.7.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/dist/api-version.dto.d.ts +14 -0
- package/dist/api-version.dto.d.ts.map +1 -0
- package/dist/api-version.dto.js +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/organizations/member.dto.d.ts +9 -1
- package/dist/organizations/member.dto.d.ts.map +1 -1
- package/dist/organizations/member.dto.js +4 -0
- package/dist/permalinks/permalink.dto.d.ts +2 -2
- package/dist/presentation-configurations/presentation-configuration.dto.d.ts +6 -6
- package/dist/users/set-user-role.dto.d.ts +3 -2
- package/dist/users/set-user-role.dto.d.ts.map +1 -1
- package/dist/users/set-user-role.dto.js +2 -1
- package/package.json +1 -1
- package/src/api-version.dto.ts +13 -0
- package/src/index.ts +1 -0
- package/src/organizations/member.dto.ts +5 -1
- package/src/shared/permalink-base-url.schema.spec.ts +8 -6
- package/src/users/set-user-role.dto.ts +2 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ApiVersionsDto: {
|
|
3
|
+
readonly v1: "1";
|
|
4
|
+
readonly v2: "2";
|
|
5
|
+
};
|
|
6
|
+
export declare const ApiVersionsDtoEnum: z.ZodEnum<{
|
|
7
|
+
readonly v1: "1";
|
|
8
|
+
readonly v2: "2";
|
|
9
|
+
}>;
|
|
10
|
+
export type ApiVersionsDtoType = z.infer<typeof ApiVersionsDtoEnum>;
|
|
11
|
+
export declare const AllApiVersions: ("1" | "2")[];
|
|
12
|
+
export declare const LatestApiVersionDto: "2";
|
|
13
|
+
export declare const LatestApiVersionWithPrefixDto: string;
|
|
14
|
+
//# sourceMappingURL=api-version.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-version.dto.d.ts","sourceRoot":"","sources":["../src/api-version.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AACX,eAAO,MAAM,kBAAkB;;;EAAyB,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,cAAc,eAAgC,CAAC;AAE5D,eAAO,MAAM,mBAAmB,KAAoB,CAAC;AACrD,eAAO,MAAM,6BAA6B,QAA4B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LatestApiVersionWithPrefixDto = exports.LatestApiVersionDto = exports.AllApiVersions = exports.ApiVersionsDtoEnum = exports.ApiVersionsDto = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ApiVersionsDto = {
|
|
6
|
+
v1: "1",
|
|
7
|
+
v2: "2",
|
|
8
|
+
};
|
|
9
|
+
exports.ApiVersionsDtoEnum = zod_1.z.enum(exports.ApiVersionsDto);
|
|
10
|
+
exports.AllApiVersions = Object.values(exports.ApiVersionsDto);
|
|
11
|
+
exports.LatestApiVersionDto = exports.ApiVersionsDto.v2;
|
|
12
|
+
exports.LatestApiVersionWithPrefixDto = `v${exports.LatestApiVersionDto}`;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./aas/common/language-text-json-schema";
|
|
|
8
8
|
export * from "./shared/get-all-params.dto";
|
|
9
9
|
export * from "./shared/filter.dto";
|
|
10
10
|
export * from "./shared/time.dto";
|
|
11
|
+
export * from "./api-version.dto";
|
|
11
12
|
export * from "./organizations/invitation.dto";
|
|
12
13
|
export * from "./instance-settings/instance-settings.dto";
|
|
13
14
|
export * from "./aas/common/qualifier-json-schema";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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AqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AAEjC,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./aas/common/language-text-json-schema"), exports);
|
|
|
24
24
|
__exportStar(require("./shared/get-all-params.dto"), exports);
|
|
25
25
|
__exportStar(require("./shared/filter.dto"), exports);
|
|
26
26
|
__exportStar(require("./shared/time.dto"), exports);
|
|
27
|
+
__exportStar(require("./api-version.dto"), exports);
|
|
27
28
|
__exportStar(require("./organizations/invitation.dto"), exports);
|
|
28
29
|
__exportStar(require("./instance-settings/instance-settings.dto"), exports);
|
|
29
30
|
__exportStar(require("./aas/common/qualifier-json-schema"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type UserDto } from "../users/user.dto";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
export interface MemberDto {
|
|
3
4
|
id: string;
|
|
4
5
|
organizationId: string;
|
|
@@ -8,4 +9,11 @@ export interface MemberDto {
|
|
|
8
9
|
updatedAt: Date;
|
|
9
10
|
user?: UserDto;
|
|
10
11
|
}
|
|
12
|
+
export declare const MemberRoleChangeDtoSchema: z.ZodObject<{
|
|
13
|
+
role: z.ZodEnum<{
|
|
14
|
+
readonly OWNER: "owner";
|
|
15
|
+
readonly MEMBER: "member";
|
|
16
|
+
}>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type MemberRoleChangeDto = z.infer<typeof MemberRoleChangeDtoSchema>;
|
|
11
19
|
//# sourceMappingURL=member.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member.dto.d.ts","sourceRoot":"","sources":["../../src/organizations/member.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"member.dto.d.ts","sourceRoot":"","sources":["../../src/organizations/member.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,yBAAyB;;;;;iBAAwC,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemberRoleChangeDtoSchema = void 0;
|
|
4
|
+
const user_dto_1 = require("../users/user.dto");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.MemberRoleChangeDtoSchema = zod_1.z.object({ role: user_dto_1.MemberRoleDtoEnum });
|
|
@@ -121,10 +121,10 @@ export declare const PassportPermalinkBundleDtoSchema: z.ZodObject<{
|
|
|
121
121
|
readonly Passport: "passport";
|
|
122
122
|
}>;
|
|
123
123
|
label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
124
|
-
elementDesign: z.ZodDefault<z.
|
|
124
|
+
elementDesign: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
125
125
|
readonly BigNumber: "BigNumber";
|
|
126
126
|
}>>>>;
|
|
127
|
-
defaultComponents: z.ZodDefault<z.
|
|
127
|
+
defaultComponents: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
128
128
|
readonly AnnotatedRelationshipElement: "AnnotatedRelationshipElement";
|
|
129
129
|
readonly AssetAdministrationShell: "AssetAdministrationShell";
|
|
130
130
|
readonly BasicEventElement: "BasicEventElement";
|
|
@@ -24,10 +24,10 @@ export declare const PresentationConfigurationDtoSchema: z.ZodObject<{
|
|
|
24
24
|
readonly Passport: "passport";
|
|
25
25
|
}>;
|
|
26
26
|
label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
27
|
-
elementDesign: z.ZodDefault<z.
|
|
27
|
+
elementDesign: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
28
28
|
readonly BigNumber: "BigNumber";
|
|
29
29
|
}>>>>;
|
|
30
|
-
defaultComponents: z.ZodDefault<z.
|
|
30
|
+
defaultComponents: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
31
31
|
readonly AnnotatedRelationshipElement: "AnnotatedRelationshipElement";
|
|
32
32
|
readonly AssetAdministrationShell: "AssetAdministrationShell";
|
|
33
33
|
readonly BasicEventElement: "BasicEventElement";
|
|
@@ -69,10 +69,10 @@ export declare const PresentationConfigurationInvariantsSchema: z.ZodObject<{
|
|
|
69
69
|
label: z.ZodNullable<z.ZodString>;
|
|
70
70
|
}, z.core.$strip>;
|
|
71
71
|
export declare const PresentationConfigurationExportSchema: z.ZodObject<{
|
|
72
|
-
elementDesign: z.ZodDefault<z.
|
|
72
|
+
elementDesign: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
73
73
|
readonly BigNumber: "BigNumber";
|
|
74
74
|
}>>>>;
|
|
75
|
-
defaultComponents: z.ZodDefault<z.
|
|
75
|
+
defaultComponents: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
76
76
|
readonly AnnotatedRelationshipElement: "AnnotatedRelationshipElement";
|
|
77
77
|
readonly AssetAdministrationShell: "AssetAdministrationShell";
|
|
78
78
|
readonly BasicEventElement: "BasicEventElement";
|
|
@@ -115,10 +115,10 @@ export declare const PresentationConfigurationListResponseSchema: z.ZodArray<z.Z
|
|
|
115
115
|
readonly Passport: "passport";
|
|
116
116
|
}>;
|
|
117
117
|
label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
118
|
-
elementDesign: z.ZodDefault<z.
|
|
118
|
+
elementDesign: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
119
119
|
readonly BigNumber: "BigNumber";
|
|
120
120
|
}>>>>;
|
|
121
|
-
defaultComponents: z.ZodDefault<z.
|
|
121
|
+
defaultComponents: z.ZodDefault<z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
122
122
|
readonly AnnotatedRelationshipElement: "AnnotatedRelationshipElement";
|
|
123
123
|
readonly AssetAdministrationShell: "AssetAdministrationShell";
|
|
124
124
|
readonly BasicEventElement: "BasicEventElement";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const SetUserRoleDtoSchema: z.ZodObject<{
|
|
3
3
|
role: z.ZodEnum<{
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
readonly ADMIN: "admin";
|
|
5
|
+
readonly USER: "user";
|
|
6
|
+
readonly ANONYMOUS: "anonymous";
|
|
6
7
|
}>;
|
|
7
8
|
}, z.core.$strip>;
|
|
8
9
|
export type SetUserRoleDto = z.infer<typeof SetUserRoleDtoSchema>;
|
|
@@ -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,CAAC;
|
|
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;AAGxB,eAAO,MAAM,oBAAoB;;;;;;iBAE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetUserRoleDtoSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const user_dto_1 = require("./user.dto");
|
|
5
6
|
exports.SetUserRoleDtoSchema = zod_1.z.object({
|
|
6
|
-
role:
|
|
7
|
+
role: user_dto_1.UserRoleDtoEnum,
|
|
7
8
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const ApiVersionsDto = {
|
|
4
|
+
v1: "1",
|
|
5
|
+
v2: "2",
|
|
6
|
+
} as const;
|
|
7
|
+
export const ApiVersionsDtoEnum = z.enum(ApiVersionsDto);
|
|
8
|
+
export type ApiVersionsDtoType = z.infer<typeof ApiVersionsDtoEnum>;
|
|
9
|
+
|
|
10
|
+
export const AllApiVersions = Object.values(ApiVersionsDto);
|
|
11
|
+
|
|
12
|
+
export const LatestApiVersionDto = ApiVersionsDto.v2;
|
|
13
|
+
export const LatestApiVersionWithPrefixDto = `v${LatestApiVersionDto}`;
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./shared/get-all-params.dto";
|
|
|
10
10
|
export * from "./shared/filter.dto";
|
|
11
11
|
export * from "./shared/time.dto";
|
|
12
12
|
|
|
13
|
+
export * from "./api-version.dto";
|
|
13
14
|
export * from "./organizations/invitation.dto";
|
|
14
15
|
|
|
15
16
|
export * from "./instance-settings/instance-settings.dto";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { MemberRoleDtoEnum, type UserDto } from "../users/user.dto";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
export interface MemberDto {
|
|
4
5
|
id: string;
|
|
@@ -9,3 +10,6 @@ export interface MemberDto {
|
|
|
9
10
|
updatedAt: Date;
|
|
10
11
|
user?: UserDto;
|
|
11
12
|
}
|
|
13
|
+
|
|
14
|
+
export const MemberRoleChangeDtoSchema = z.object({ role: MemberRoleDtoEnum });
|
|
15
|
+
export type MemberRoleChangeDto = z.infer<typeof MemberRoleChangeDtoSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe, expect, it } from "@jest/globals";
|
|
2
1
|
import { PermalinkBaseUrlSchema } from "./permalink-base-url.schema";
|
|
2
|
+
import { LatestApiVersionWithPrefixDto } from "../api-version.dto";
|
|
3
3
|
|
|
4
4
|
describe("PermalinkBaseUrlSchema", () => {
|
|
5
5
|
describe("accepts", () => {
|
|
@@ -9,7 +9,7 @@ describe("PermalinkBaseUrlSchema", () => {
|
|
|
9
9
|
"https://passport.brand.io:8443",
|
|
10
10
|
"https://xn--mller-kva.de",
|
|
11
11
|
"https://example.com/",
|
|
12
|
-
])("'%s'", (input) => {
|
|
12
|
+
])("'%s'", (input: any) => {
|
|
13
13
|
const result = PermalinkBaseUrlSchema.safeParse(input);
|
|
14
14
|
expect(result.success).toBe(true);
|
|
15
15
|
});
|
|
@@ -47,10 +47,12 @@ describe("PermalinkBaseUrlSchema", () => {
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
it("accepts a nested path and preserves it", () => {
|
|
50
|
-
const result = PermalinkBaseUrlSchema.safeParse(
|
|
50
|
+
const result = PermalinkBaseUrlSchema.safeParse(
|
|
51
|
+
`https://example.com/dpp/${LatestApiVersionWithPrefixDto}`,
|
|
52
|
+
);
|
|
51
53
|
expect(result.success).toBe(true);
|
|
52
54
|
if (result.success) {
|
|
53
|
-
expect(result.data).toBe(
|
|
55
|
+
expect(result.data).toBe(`https://example.com/dpp/${LatestApiVersionWithPrefixDto}`);
|
|
54
56
|
}
|
|
55
57
|
});
|
|
56
58
|
|
|
@@ -80,8 +82,8 @@ describe("PermalinkBaseUrlSchema", () => {
|
|
|
80
82
|
["query string", "https://example.com?q=1"],
|
|
81
83
|
["fragment", "https://example.com#h"],
|
|
82
84
|
["double slash in path", "https://example.com//p"],
|
|
83
|
-
["double slash mid-path",
|
|
84
|
-
])("rejects %s ('%s')", (_label, input) => {
|
|
85
|
+
["double slash mid-path", `https://example.com/dpp//${LatestApiVersionWithPrefixDto}`],
|
|
86
|
+
])("rejects %s ('%s')", (_label: any, input: any) => {
|
|
85
87
|
const result = PermalinkBaseUrlSchema.safeParse(input);
|
|
86
88
|
expect(result.success).toBe(false);
|
|
87
89
|
});
|