Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I noticed that there is an array called product inside the products o… #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
getUsers function added
IlirEdis committed Jun 7, 2024
commit 5f185c58565ea45bb4390b350ee7c751fff74dc8
14 changes: 14 additions & 0 deletions src/interface/users/get-users.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface GetUsersRequest {
limitstart?: number;
limitnum?: number;
sorting?: string;
search?: string;
}

export interface GetUsersResponse {
result: string;
totalresults: number;
startnumber: number;
numreturned: number;
users: [];
}
105 changes: 73 additions & 32 deletions src/module/users.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,86 @@
import { AddUserRequest, AddUserResponse } from "../interface/users/add-user";
import { CreateClientInviteRequest, CreateClientInviteResponse } from "../interface/users/create-client-invite";
import { DeleteUserClientRequest, DeleteUserClientResponse } from "../interface/users/delete-user-client";
import { GetPermissionsListRequest, GetPermissionsListResponse } from "../interface/users/get-permissions-list";
import { GetUserPermissionsRequest, GetUserPermissionsResponse } from "../interface/users/get-user-permissions";
import { ResetPasswordRequest, ResetPasswordResponse } from "../interface/users/reset-password";
import { UpdateUserRequest, UpdateUserResponse } from "../interface/users/update-user";
import { UpdateUserPermissionsRequest, UpdateUserPermissionsResponse } from "../interface/users/update-user-permissions";
import {
CreateClientInviteRequest,
CreateClientInviteResponse,
} from "../interface/users/create-client-invite";
import {
DeleteUserClientRequest,
DeleteUserClientResponse,
} from "../interface/users/delete-user-client";
import {
GetPermissionsListRequest,
GetPermissionsListResponse,
} from "../interface/users/get-permissions-list";
import {
GetUserPermissionsRequest,
GetUserPermissionsResponse,
} from "../interface/users/get-user-permissions";
import {
GetUsersRequest,
GetUsersResponse,
} from "../interface/users/get-users";
import {
ResetPasswordRequest,
ResetPasswordResponse,
} from "../interface/users/reset-password";
import {
UpdateUserRequest,
UpdateUserResponse,
} from "../interface/users/update-user";
import {
UpdateUserPermissionsRequest,
UpdateUserPermissionsResponse,
} from "../interface/users/update-user-permissions";
import { BaseModule } from "./base";

export class WhmcsUsersService extends BaseModule {

public async addUser(options: AddUserRequest): Promise<AddUserResponse> {
return this.request('AddUser', options);
return this.request("AddUser", options);
}

public async createClientInvite(options: CreateClientInviteRequest): Promise<CreateClientInviteResponse> {
return this.request('CreateClientInvite', options);

public async createClientInvite(
options: CreateClientInviteRequest
): Promise<CreateClientInviteResponse> {
return this.request("CreateClientInvite", options);
}

public async deleteUserClient(options: DeleteUserClientRequest): Promise<DeleteUserClientResponse> {
return this.request('DeleteUserClient', options);

public async deleteUserClient(
options: DeleteUserClientRequest
): Promise<DeleteUserClientResponse> {
return this.request("DeleteUserClient", options);
}

public async getPermissionsList(options: GetPermissionsListRequest): Promise<GetPermissionsListResponse> {
return this.request('GetPermissionsList', options);

public async getPermissionsList(
options: GetPermissionsListRequest
): Promise<GetPermissionsListResponse> {
return this.request("GetPermissionsList", options);
}

public async getUserPermissions(options: GetUserPermissionsRequest): Promise<GetUserPermissionsResponse> {
return this.request('GetUserPermissions', options);

public async getUserPermissions(
options: GetUserPermissionsRequest
): Promise<GetUserPermissionsResponse> {
return this.request("GetUserPermissions", options);
}
public async resetPassword(options: ResetPasswordRequest): Promise<ResetPasswordResponse> {
return this.request('ResetPassword', options);

public async getUsers(options: GetUsersRequest): Promise<GetUsersResponse> {
return this.request("GetUsers", options);
}

public async updateUser(options: UpdateUserRequest): Promise<UpdateUserResponse> {
return this.request('UpdateUser', options);

public async resetPassword(
options: ResetPasswordRequest
): Promise<ResetPasswordResponse> {
return this.request("ResetPassword", options);
}

public async updateUser(
options: UpdateUserRequest
): Promise<UpdateUserResponse> {
return this.request("UpdateUser", options);
}

public async updateUserPermissions(options: UpdateUserPermissionsRequest): Promise<UpdateUserPermissionsResponse> {
return this.request('UpdateUserPermissions', options);

public async updateUserPermissions(
options: UpdateUserPermissionsRequest
): Promise<UpdateUserPermissionsResponse> {
return this.request("UpdateUserPermissions", options);
}

}
}