@tagsamurai/fats-api-services 2.0.0-alpha.12 → 2.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -243,10 +243,25 @@ const API = createAxiosInstance({
243
243
  });
244
244
  const FileManagerService = {
245
245
  getFileList: (body) => {
246
- return API.post("/list", body);
246
+ return API.post("/file-manager/list", body);
247
247
  },
248
248
  getFileOptions: (body) => {
249
- return API.post("/options", body);
249
+ return API.post("/file-manager/options", body);
250
+ },
251
+ getRecycleBinList: (body) => {
252
+ return API.post("/recycle-bin/list", body);
253
+ },
254
+ getRecycleBinOptions: (body) => {
255
+ return API.post("/recycle-bin/options", body);
256
+ },
257
+ delete: (body) => {
258
+ return API.delete("/file-manager/delete", { params: body });
259
+ },
260
+ deletePermanently: (body) => {
261
+ return API.delete("/recycle-bin/permanently-delete", { params: body });
262
+ },
263
+ recover: (body) => {
264
+ return API.put("/recycle-bin/recover", null, { params: body });
250
265
  }
251
266
  };
252
267
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.14",
4
4
  "type": "module",
5
5
  "author": "Tagsamurai",
6
6
  "description": "Fixed Asset Tagsamurai API Services",
@@ -1,6 +1,6 @@
1
1
  import { TableParams } from './dataTable.dto';
2
2
  export interface GetFileListBody extends TableParams {
3
- createdAt?: string[];
3
+ deletedAt?: string[];
4
4
  fileFormat?: string[];
5
5
  modifiedBy?: string[];
6
6
  }
@@ -8,3 +8,6 @@ export interface GetFileOptionsBody {
8
8
  fileFormatOptions?: boolean;
9
9
  modifiedByOptions?: boolean;
10
10
  }
11
+ export interface DeleteFileBody {
12
+ ids: string[];
13
+ }
@@ -10,6 +10,10 @@ export type CreateUserBody = {
10
10
  access: string;
11
11
  expiryDate?: string;
12
12
  tag?: string;
13
+ customFields?: {
14
+ _id: string;
15
+ value: string | string[];
16
+ }[];
13
17
  };
14
18
  export type EditUserBody = CreateUserBody;
15
19
  export type UserOptionsQueryParams = {
@@ -43,5 +47,5 @@ export type GetUserListQueryParams = TableParams & {
43
47
  position?: string[] | null;
44
48
  division?: string[] | null;
45
49
  modifiedBy?: string[] | null;
46
- updatedAt?: string[] | null;
50
+ updatedAt?: number[] | null;
47
51
  };
@@ -9,5 +9,8 @@ declare const CustomFieldService: {
9
9
  update: (id: string, body: EditCustomFieldBody) => Promise<AxiosResponse<string>>;
10
10
  setActive: (body: SetActiveCustomFieldBody) => Promise<AxiosResponse<string>>;
11
11
  delete: (body: DeleteCustomFieldBody) => Promise<AxiosResponse<string>>;
12
+ checkNameAvailable: (name: string) => Promise<AxiosResponse<{
13
+ message: string;
14
+ }>>;
12
15
  };
13
16
  export default CustomFieldService;
@@ -1,9 +1,14 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
3
- import { GetFileListBody, GetFileOptionsBody } from '../dto/fileManagerService.dto';
4
- import { FileItem, FileOptionsData } from '../types/fileManagerService.type';
3
+ import { DeleteFileBody, GetFileListBody, GetFileOptionsBody } from '../dto/fileManagerService.dto';
4
+ import { FileItem, FileOptionsData, RecycleBinItem } from '../types/fileManagerService.type';
5
5
  declare const FileManagerService: {
6
6
  getFileList: (body: GetFileListBody) => Promise<AxiosResponse<FetchListResponse<FileItem>>>;
7
7
  getFileOptions: (body: GetFileOptionsBody) => Promise<AxiosResponse<FetchDetailResponse<FileOptionsData>>>;
8
+ getRecycleBinList: (body: GetFileListBody) => Promise<AxiosResponse<FetchListResponse<RecycleBinItem>>>;
9
+ getRecycleBinOptions: (body: GetFileOptionsBody) => Promise<AxiosResponse<FetchDetailResponse<FileOptionsData>>>;
10
+ delete: (body: DeleteFileBody) => Promise<AxiosResponse<string>>;
11
+ deletePermanently: (body: DeleteFileBody) => Promise<AxiosResponse<string>>;
12
+ recover: (body: DeleteFileBody) => Promise<AxiosResponse<string>>;
8
13
  };
9
14
  export default FileManagerService;
@@ -11,6 +11,16 @@ export interface FileItem {
11
11
  group: string | null;
12
12
  modifiedBy: string;
13
13
  createdAt: string;
14
+ hasSystemRole: {
15
+ create: boolean;
16
+ view: boolean;
17
+ update: boolean;
18
+ delete: boolean;
19
+ };
20
+ }
21
+ export interface RecycleBinItem extends FileItem {
22
+ countdown: number;
23
+ deletedAt: string;
14
24
  }
15
25
  export interface FileOptionsData {
16
26
  fileFormatOptions: Option[];
@@ -1,29 +0,0 @@
1
- export type LoginBody = {
2
- email: string;
3
- password?: string | null;
4
- overrideSession?: boolean;
5
- isMobile?: boolean;
6
- otp?: string | null;
7
- captcha?: string;
8
- agreePolicy?: boolean;
9
- };
10
- export type RequestOtpBody = {
11
- email: string;
12
- };
13
- export type RequestResetLinkBody = {
14
- email: string;
15
- };
16
- export type SetPasswordBody = {
17
- type: string;
18
- token: string;
19
- password?: string;
20
- };
21
- export type ConfirmEmailChangeBody = {
22
- token: string;
23
- };
24
- export type ModuleLoginBody = {
25
- module: string;
26
- };
27
- export type ModuleLogoutBody = {
28
- module: string;
29
- };
@@ -1,3 +0,0 @@
1
- export type LogoutSessionBody = {
2
- sessionId: string;
3
- };
@@ -1,20 +0,0 @@
1
- import { AxiosResponse } from 'axios';
2
- import { ConfirmEmailChangeBody, LoginBody, ModuleLoginBody, ModuleLogoutBody, RequestOtpBody, RequestResetLinkBody, SetPasswordBody } from '../dto/authService.dto';
3
- import { LoginResponse, ModuleLoginResponse, VerifyTokenResponse } from '../types/authService.type';
4
- declare const AuthService: {
5
- login: (body: LoginBody) => Promise<AxiosResponse<LoginResponse>>;
6
- logout: () => Promise<AxiosResponse<{
7
- message: string;
8
- }>>;
9
- verifyToken: (token: string) => Promise<AxiosResponse<VerifyTokenResponse>>;
10
- requestOtp: (body: RequestOtpBody) => Promise<AxiosResponse<boolean>>;
11
- requestResetLink: (body: RequestResetLinkBody) => Promise<AxiosResponse<boolean>>;
12
- setPassword: (body: SetPasswordBody) => Promise<AxiosResponse<string>>;
13
- confirmEmailChange: (body: ConfirmEmailChangeBody) => Promise<AxiosResponse<string>>;
14
- cancelEmailChange: (id: string) => Promise<AxiosResponse<string>>;
15
- loginModule: (body: ModuleLoginBody) => Promise<AxiosResponse<ModuleLoginResponse>>;
16
- logoutModule: (body: ModuleLogoutBody) => Promise<AxiosResponse<{
17
- message: string;
18
- }>>;
19
- };
20
- export default AuthService;
@@ -1,11 +0,0 @@
1
- import { AxiosResponse } from 'axios';
2
- import { LogoutSessionBody } from '../dto/concurrentUserService.dto';
3
- import { TableParams } from '../dto/dataTable.dto';
4
- import { ConcurrentUserListResponse } from '../types/concurrentUserService.type';
5
- declare const ConcurrentUserService: {
6
- getConcurrentUsers: (moduleHeader: string, params?: TableParams) => Promise<AxiosResponse<ConcurrentUserListResponse>>;
7
- logoutSession: (moduleHeader: string, body: LogoutSessionBody) => Promise<AxiosResponse<{
8
- message: string;
9
- }>>;
10
- };
11
- export default ConcurrentUserService;
@@ -1,62 +0,0 @@
1
- export interface LoginResponse {
2
- _id: string;
3
- companyName: string;
4
- companyCode: string;
5
- fullName: string;
6
- profilePicture: string;
7
- email: string;
8
- isDefault: boolean;
9
- access: string[];
10
- generalSetting: {
11
- dateFormat: string;
12
- timeFormat: string;
13
- timezone: string;
14
- currency: {
15
- currency: string;
16
- symbol: string;
17
- locale: string;
18
- label: string;
19
- };
20
- };
21
- }
22
- export interface VerifyTokenResponse {
23
- token: string;
24
- }
25
- export interface ModuleLoginResponse {
26
- _id: string;
27
- companyName: string;
28
- companyCode: string;
29
- fullName: string;
30
- profilePicture: string;
31
- isDefault: boolean;
32
- generalSetting: {
33
- dateFormat: string;
34
- timeFormat: string;
35
- timezone: string;
36
- currency: {
37
- currency: string;
38
- symbol: string;
39
- locale: string;
40
- label: string;
41
- };
42
- geolocation: boolean;
43
- };
44
- isTotalControl: boolean;
45
- isReadOnly: boolean;
46
- plan: string;
47
- addOn: {
48
- attribute: boolean;
49
- };
50
- systemRoles: Record<string, {
51
- create: boolean;
52
- view: boolean;
53
- update: boolean;
54
- delete: boolean;
55
- }>;
56
- transactionRoles: Record<string, {
57
- manager: boolean;
58
- monitoringReport: boolean;
59
- approver: boolean;
60
- staff: boolean;
61
- }>;
62
- }
@@ -1,15 +0,0 @@
1
- export interface ConcurrentUserItem {
2
- _id: string;
3
- profilePicture: string;
4
- name: string;
5
- email: string;
6
- userType: string;
7
- position: string;
8
- division: string;
9
- lastLogin: string;
10
- }
11
- export interface ConcurrentUserListResponse {
12
- moduleId: string;
13
- activeSessions: ConcurrentUserItem[];
14
- count: number;
15
- }