From ad4f70b82600590c2844c167fac99c75bb6ead18 Mon Sep 17 00:00:00 2001 From: adrinr Date: Mon, 3 Apr 2023 16:45:55 +0100 Subject: [PATCH] Type emails --- .../types/src/api/web/global/scim/users.ts | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/types/src/api/web/global/scim/users.ts b/packages/types/src/api/web/global/scim/users.ts index 1b3b05d2ee..1e6aa58d0f 100644 --- a/packages/types/src/api/web/global/scim/users.ts +++ b/packages/types/src/api/web/global/scim/users.ts @@ -1,8 +1,16 @@ -import { ScimResource, ScimMeta, ScimPatchOperation } from "scim-patch" +import { ScimResource, ScimMeta } from "scim-patch" import { ScimListResponse } from "./shared" type BooleanString = boolean | "True" | "true" | "False" | "false" +type Emails = + | { + value: string + type: "work" + primary: boolean + }[] + | undefined + export interface ScimUserResponse extends ScimResource { schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"] id: string @@ -18,13 +26,7 @@ export interface ScimUserResponse extends ScimResource { givenName: string } active: BooleanString - emails: [ - { - value: string - type: "work" - primary: true - } - ] + emails: Emails } export interface ScimCreateUserRequest { @@ -35,13 +37,7 @@ export interface ScimCreateUserRequest { externalId: string userName: string active: BooleanString - emails: [ - { - primary: true - type: "work" - value: string - } - ] + emails: Emails meta: { resourceType: "User" }