@timetac/js-client-library
Advanced tools
Comparing version 0.26.0 to 0.26.1
import BaseApi from '../baseApi'; | ||
import { RequestParams } from '../utils/params/requestParams'; | ||
import { ReadRawResponse } from '../utils/response/readRawResponse'; | ||
import { Department } from './types'; | ||
import { Department, DepartmentCreate } from './types'; | ||
export declare class DepartmentsEndpoint extends BaseApi { | ||
@@ -10,2 +10,3 @@ readonly resourceName = "departments"; | ||
readById(id: number, params?: RequestParams<Department>): Promise<Department>; | ||
create(data: DepartmentCreate): Promise<Department>; | ||
} |
@@ -37,4 +37,8 @@ "use strict"; | ||
} | ||
create(data) { | ||
const response = this._post(`${this.getResourceName()}/create`, data); | ||
return responseHandlers.required(response); | ||
} | ||
} | ||
exports.DepartmentsEndpoint = DepartmentsEndpoint; | ||
//# sourceMappingURL=index.js.map |
@@ -11,1 +11,5 @@ export declare type Department = { | ||
}; | ||
export declare type DepartmentCreate = Omit<Department, 'id'> & { | ||
department_name: string; | ||
mother_id: number; | ||
}; |
@@ -37,3 +37,3 @@ import { AbsenceDaysEndpoint } from './absenceDays'; | ||
export { DeltaSyncResults } from './deltaSync/types'; | ||
export { Department } from './departments/types'; | ||
export { Department, DepartmentCreate } from './departments/types'; | ||
export * from './enums'; | ||
@@ -59,3 +59,3 @@ export { ErrorFormat } from './errors'; | ||
export { UserDefinedFieldDefinitions, UserDefinedFieldDefinitionsIds } from './userDefinedFieldDefinitions/types'; | ||
export { User, UserUpdate } from './users/types'; | ||
export { User, UserUpdate, UserRead, UserCreate, UserReadMe, UserResetPassword, UserUpdatePassword } from './users/types'; | ||
export { UserStatusOverview } from './userStatusOverview/types'; | ||
@@ -62,0 +62,0 @@ export { testAxiosObject } from './utils/axiosSetup'; |
@@ -5,3 +5,3 @@ import BaseApi from '../baseApi'; | ||
import { UpdateRawResponse } from '../utils/response/updateRawResponse'; | ||
import { UserRead, UserCreate, UserResetPassword, UserUpdate, UserUpdatePassword } from './types'; | ||
import { UserRead, UserCreate, UserResetPassword, UserUpdate, UserUpdatePassword, UserReadMe } from './types'; | ||
export declare class UsersEndpoint extends BaseApi { | ||
@@ -12,3 +12,3 @@ readonly resourceName = "users"; | ||
readById(id: number, params?: RequestParams<UserRead>): Promise<UserRead>; | ||
readMe(params?: RequestParams<UserRead>): Promise<UserRead>; | ||
readMe(params?: RequestParams<UserReadMe>): Promise<UserRead>; | ||
create(data: UserCreate): Promise<UserRead>; | ||
@@ -15,0 +15,0 @@ update(data: UserUpdate): Promise<UpdateRawResponse<UserRead>>; |
@@ -95,3 +95,2 @@ export declare type UserRead = { | ||
show_status_overview: boolean; | ||
last_login: string; | ||
}; | ||
@@ -109,2 +108,6 @@ export declare type User = UserRead; | ||
} | ||
export interface UserReadMe extends UserRead { | ||
renew_password: boolean; | ||
last_login: string; | ||
} | ||
export interface UserUpdate extends Partial<UserRead> { | ||
@@ -111,0 +114,0 @@ id: number; |
{ | ||
"name": "@timetac/js-client-library", | ||
"version": "0.26.0", | ||
"version": "0.26.1", | ||
"description": "TimeTac API JS client library", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/TimeTac/js-client-library#readme", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
222978
3269