Skip to content

Commit 888f2a1

Browse files
committed
Refactor AuthInfo
1 parent ce0580d commit 888f2a1

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

typespec/einnsyn.web.operations.tsp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,21 @@ namespace Statistics {
250250
}
251251

252252
namespace AuthInfo {
253+
model AuthInfo {
254+
@visibility(Lifecycle.Read) entity: "AuthInfo";
255+
256+
@visibility(Lifecycle.Read)
257+
authType: "Ansattporten" | "ApiKey" | "Bruker";
258+
259+
@visibility(Lifecycle.Read) type: "Bruker" | "Enhet";
260+
@visibility(Lifecycle.Read) id: eInnsynId<Bruker | Enhet>;
261+
@visibility(Lifecycle.Read) orgnummer?: string;
262+
@visibility(Lifecycle.Read) email?: string;
263+
}
264+
253265
model AuthInfoResponse {
254266
@statusCode _: 200;
255-
@body body: {
256-
@visibility(Lifecycle.Read) entity: "AuthInfo";
257-
@visibility(Lifecycle.Read)
258-
authType: "Ansattporten" | "ApiKey" | "Bruker";
259-
@visibility(Lifecycle.Read) type: "Bruker" | "Enhet";
260-
@visibility(Lifecycle.Read) id: eInnsynId<Bruker | Enhet>;
261-
@visibility(Lifecycle.Read) orgnummer?: string;
262-
@visibility(Lifecycle.Read) email?: string;
263-
};
267+
@body body: AuthInfo;
264268
}
265269

266270
@route("/me")

0 commit comments

Comments
 (0)