Rename types

This commit is contained in:
adrinr 2023-03-14 12:20:21 +01:00
parent 437672a6a3
commit 9c64f54fa9
2 changed files with 12 additions and 9 deletions

View File

@ -23,15 +23,18 @@ export interface ScimUserResponse {
] ]
} }
export interface ScimListResponse { interface ScimListResponse<T> {
schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"] schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"]
totalResults: number totalResults: number
Resources: ScimUserResponse[] Resources: T[]
startIndex: number startIndex: number
itemsPerPage: number itemsPerPage: number
} }
export interface ScimUserRequest { export interface ScimUserListResponse
extends ScimListResponse<ScimUserResponse> {}
export interface ScimCreateUserRequest {
schemas: [ schemas: [
"urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"

View File

@ -1,7 +1,7 @@
import { import {
AccountMetadata, ScimUserListResponse,
ScimListResponse, ScimCreateUserRequest,
ScimUserRequest, ScimUserResponse,
} from "@budibase/types" } from "@budibase/types"
import TestConfiguration from "../../TestConfiguration" import TestConfiguration from "../../TestConfiguration"
import { TestAPI } from "../base" import { TestAPI } from "../base"
@ -45,14 +45,14 @@ export class ScimUsersAPI extends TestAPI {
"get", "get",
requestSettings requestSettings
) )
return res.body as ScimListResponse return res.body as ScimUserListResponse
} }
post = async ( post = async (
{ {
body, body,
}: { }: {
body: ScimUserRequest body: ScimCreateUserRequest
}, },
requestSettings?: Partial<RequestSettings> requestSettings?: Partial<RequestSettings>
) => { ) => {
@ -63,6 +63,6 @@ export class ScimUsersAPI extends TestAPI {
body body
) )
return res.body as ScimListResponse return res.body as ScimUserResponse
} }
} }