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"]
totalResults: number
Resources: ScimUserResponse[]
Resources: T[]
startIndex: number
itemsPerPage: number
}
export interface ScimUserRequest {
export interface ScimUserListResponse
extends ScimListResponse<ScimUserResponse> {}
export interface ScimCreateUserRequest {
schemas: [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"

View File

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