@tagsamurai/gsts-api-services 1.0.1-alpha.0

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.
Files changed (41) hide show
  1. package/api-services.es.d.ts +2 -0
  2. package/api-services.es.js +178 -0
  3. package/index.html +172 -0
  4. package/main.d.ts +12 -0
  5. package/manifest.json +8 -0
  6. package/microtsm.config.d.ts +2 -0
  7. package/package.json +12 -0
  8. package/src/dto/changelog.dto.d.ts +22 -0
  9. package/src/dto/dataTable.dto.d.ts +42 -0
  10. package/src/dto/hardware.dto.d.ts +99 -0
  11. package/src/dto/logNotification.dto.d.ts +8 -0
  12. package/src/dto/masterData.dto.d.ts +3 -0
  13. package/src/dto/tag.dto.d.ts +52 -0
  14. package/src/dto/tagEventlog.dto.d.ts +22 -0
  15. package/src/dto/user.dto.d.ts +74 -0
  16. package/src/services/auth.service.d.ts +5 -0
  17. package/src/services/changelog.service.d.ts +7 -0
  18. package/src/services/division.service.d.ts +13 -0
  19. package/src/services/globalTag.service.d.ts +26 -0
  20. package/src/services/hardware.service.d.ts +35 -0
  21. package/src/services/logNotification.service.d.ts +7 -0
  22. package/src/services/option.service.d.ts +7 -0
  23. package/src/services/position.service.d.ts +13 -0
  24. package/src/services/tag.service.d.ts +7 -0
  25. package/src/services/tagEventlog.service.d.ts +9 -0
  26. package/src/services/user.service.d.ts +19 -0
  27. package/src/types/changelog.type.d.ts +21 -0
  28. package/src/types/dataTable.type.d.ts +12 -0
  29. package/src/types/fetchResponse.type.d.ts +36 -0
  30. package/src/types/hardware.type.d.ts +88 -0
  31. package/src/types/logNotification.type.d.ts +10 -0
  32. package/src/types/masterData.type.d.ts +7 -0
  33. package/src/types/options.type.d.ts +13 -0
  34. package/src/types/tag.type.d.ts +28 -0
  35. package/src/types/tagEventlog.type.d.ts +19 -0
  36. package/src/types/user.type.d.ts +82 -0
  37. package/src/utils/createInstance.util.d.ts +19 -0
  38. package/src/utils/getBaseURL.util.d.ts +8 -0
  39. package/src/utils/getImageURL.util.d.ts +1 -0
  40. package/src/utils/index.d.ts +4 -0
  41. package/src/utils/queryParamsStringify.util.d.ts +9 -0
@@ -0,0 +1,74 @@
1
+ import { FetchDetailResponse, FetchListResponse, FetchResponse } from '../types/fetchResponse.type';
2
+ import { SessionLog } from '../types/logNotification.type';
3
+ import { MasterDataItem } from '../types/masterData.type';
4
+ import { MultiSelectOption } from '../types/options.type';
5
+ import { UserDetail } from '../types/user.type';
6
+ export type GetMasterDataDetailResponse = FetchDetailResponse<MasterDataItem>;
7
+ export type GetOptionResponse = FetchResponse & {
8
+ data: MultiSelectOption[];
9
+ };
10
+ export type GetUserDetailResponse = FetchDetailResponse<UserDetail>;
11
+ export type GetUserOptionsResponse = FetchResponse & {
12
+ data: {
13
+ positionOptions: MultiSelectOption[];
14
+ divisionOptions: MultiSelectOption[];
15
+ modifiedByOptions: MultiSelectOption[];
16
+ };
17
+ };
18
+ export type GetUserSystemLogOptionsResponse = FetchResponse & {
19
+ data: {
20
+ activityOptions: MultiSelectOption[];
21
+ fieldOptions: MultiSelectOption[];
22
+ objectNameOptions: MultiSelectOption[];
23
+ objectOptions: MultiSelectOption[];
24
+ };
25
+ };
26
+ export type GetChangelogOptionsResponse = FetchResponse & {
27
+ data: {
28
+ actionOptions: MultiSelectOption[];
29
+ fieldOptions: MultiSelectOption[];
30
+ modifiedByOptions: MultiSelectOption[];
31
+ objectNameOptions: MultiSelectOption[];
32
+ };
33
+ };
34
+ export type GetSessionLogListResponse = FetchListResponse<SessionLog>;
35
+ export interface CreateUserBody {
36
+ profilePicture?: File;
37
+ firstName: string;
38
+ lastName: string;
39
+ employeeId?: string;
40
+ position?: string;
41
+ division: string;
42
+ email: string;
43
+ isTemporary?: boolean;
44
+ expiryDate?: number;
45
+ phoneNumber: string;
46
+ access: string;
47
+ userTag?: string;
48
+ }
49
+ export interface EditUserBody extends Partial<CreateUserBody> {
50
+ changeProfilePicture: boolean;
51
+ }
52
+ export interface GetUserOptionsParam {
53
+ divisionOptions?: boolean;
54
+ positionOptions?: boolean;
55
+ modifiedByOptions?: boolean;
56
+ activeStatusOption?: boolean;
57
+ }
58
+ export interface PutToggleStatusUsersBody {
59
+ user: string[];
60
+ isActive: boolean;
61
+ }
62
+ export interface PostResendEmailBody {
63
+ user: string[];
64
+ }
65
+ export interface PutChangePasswordBody {
66
+ oldPassword: string;
67
+ newPassword: string;
68
+ }
69
+ export interface GetUserSystemLogOptionsParam {
70
+ activityOptions?: boolean;
71
+ fieldOptions?: boolean;
72
+ objectNameOptions?: boolean;
73
+ objectOptions?: boolean;
74
+ }
@@ -0,0 +1,5 @@
1
+ import { AxiosResponse } from 'axios';
2
+ declare const _default: {
3
+ logout: () => Promise<AxiosResponse>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { ChangelogFilterQuery, ChangelogOptionQuery, ChangelogOptionResponse, ChangelogResponse } from '../dto/changelog.dto';
3
+ declare const ChangelogServices: {
4
+ getChangelogs: (params?: ChangelogFilterQuery) => Promise<AxiosResponse<ChangelogResponse>>;
5
+ getChangelogOptions: (params?: ChangelogOptionQuery) => Promise<AxiosResponse<ChangelogOptionResponse>>;
6
+ };
7
+ export default ChangelogServices;
@@ -0,0 +1,13 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { CreateEditMasterDataBody } from '../dto/masterData.dto';
3
+ import { GetMasterDataDetailResponse } from '../dto/user.dto';
4
+ import { FetchListResponse, QueryParams } from '../types/fetchResponse.type';
5
+ import { MasterDataItem } from '../types/masterData.type';
6
+ declare const DivisionServices: {
7
+ getDivisions: (params?: QueryParams) => Promise<AxiosResponse<FetchListResponse<MasterDataItem>>>;
8
+ getDivisionDetail: (id: string) => Promise<AxiosResponse<GetMasterDataDetailResponse>>;
9
+ postCreateDivision: (body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
10
+ putEditDivision: (id: string, body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
11
+ deleteDivisions: (ids: string[]) => Promise<AxiosResponse>;
12
+ };
13
+ export default DivisionServices;
@@ -0,0 +1,26 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { BooleanOptions } from '../dto/dataTable.dto';
3
+ import { HardwareFilterQuery } from '../dto/hardware.dto';
4
+ import { PUTAllocateTAGBody, PUTAuditTAGBody, PUTCombineTAGBody, TAGDetailAuditResponse, TAGFetchOptionResponse, TAGFetchResponse } from '../dto/tag.dto';
5
+ import { FetchResponse } from '../types/fetchResponse.type';
6
+ import { TAGType } from '../types/tag.type';
7
+ declare const GlobalTagServices: {
8
+ getTAGAllPaired: (tagType: TAGType, params?: HardwareFilterQuery) => Promise<AxiosResponse<TAGFetchResponse>>;
9
+ getTAGAllPairedOptions: (tagType: TAGType, params?: BooleanOptions) => Promise<AxiosResponse<{
10
+ data: TAGFetchOptionResponse;
11
+ }>>;
12
+ getTAGNotPaired: (tagType: TAGType, params?: HardwareFilterQuery) => Promise<AxiosResponse<TAGFetchResponse>>;
13
+ getTAGNotPairedOptions: (tagType: TAGType, params?: BooleanOptions) => Promise<AxiosResponse<{
14
+ data: TAGFetchOptionResponse;
15
+ }>>;
16
+ getScanTAG: (tagType: TAGType, params?: {
17
+ tag: string;
18
+ }) => Promise<AxiosResponse>;
19
+ putDetailAuditTAG: (tagType: TAGType, body: {
20
+ ids: string[];
21
+ }) => Promise<AxiosResponse<TAGDetailAuditResponse>>;
22
+ putAuditTAG: (tagType: TAGType, body: PUTAuditTAGBody) => Promise<AxiosResponse<FetchResponse>>;
23
+ putAllocateTAG: (tagType: TAGType, body: PUTAllocateTAGBody) => Promise<AxiosResponse<FetchResponse>>;
24
+ putCombineTAG: (body: PUTCombineTAGBody) => Promise<AxiosResponse<FetchResponse>>;
25
+ };
26
+ export default GlobalTagServices;
@@ -0,0 +1,35 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { BooleanOptions } from '../dto/dataTable.dto';
3
+ import { HardwareDetailFilterQuery, HardwareFetchDetailResponse, HardwareFetchOptionResponse, HardwareFetchResponse, HardwareFilterQuery, PutEditAliasName, PutEditAntennaGroup, PutEditAntennaPower, PutEditPortStatus, PutEditReaderGroup, PutHardwareStatusBody, PutPingReadersBody } from '../dto/hardware.dto';
4
+ import { AntennaPortDetail, HardwareDataType, HardwareDetailUserActivity } from '../types/hardware.type';
5
+ declare const HardwareServices: {
6
+ getHandheldReader: (params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse>>;
7
+ getHandheldReaderDetail: (handheldId?: string) => Promise<AxiosResponse<HardwareFetchDetailResponse>>;
8
+ getHandheldReaderOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
9
+ data: HardwareFetchOptionResponse;
10
+ }>>;
11
+ putMarkHandheldStatus: (body: PutHardwareStatusBody) => Promise<AxiosResponse>;
12
+ putPingReaders: (body: PutPingReadersBody) => Promise<AxiosResponse>;
13
+ putMarkIOTStatus: (body: PutHardwareStatusBody, subTab: "iot-reader" | "antenna") => Promise<AxiosResponse>;
14
+ putEditReaderGroup: (moduleTab: "iot" | "handheld", body: PutEditReaderGroup, hardwareId?: string) => Promise<AxiosResponse>;
15
+ putEditAntennaGroup: (body: PutEditAntennaGroup, hardwareId?: string) => Promise<AxiosResponse>;
16
+ putEditPortStatus: (body: PutEditPortStatus, hardwareId?: string) => Promise<AxiosResponse>;
17
+ putEditAliasName: (moduleTab: "iot" | "handheld", body: PutEditAliasName, hardwareId?: string) => Promise<AxiosResponse>;
18
+ putAntennaPower: (body: PutEditAntennaPower, iotId?: string) => Promise<AxiosResponse>;
19
+ getIOTReaderOrAntenna: (subTab: "iot-reader" | "antenna", params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse>>;
20
+ getIOTReaderDetail: (iotId?: string) => Promise<AxiosResponse<HardwareFetchDetailResponse>>;
21
+ getIOTReaderOrAntennaOptions: (subTab: "iot-reader" | "antenna", params?: BooleanOptions) => Promise<AxiosResponse<{
22
+ data: HardwareFetchOptionResponse;
23
+ }>>;
24
+ getActivityLog: (params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse<HardwareDataType>>>;
25
+ getActivityLogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
26
+ data: HardwareFetchOptionResponse;
27
+ }>>;
28
+ getDetailActivityLog: (params?: HardwareDetailFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse<HardwareDetailUserActivity>>>;
29
+ getDetailActivityLogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
30
+ data: HardwareFetchOptionResponse;
31
+ }>>;
32
+ getExistingAliasNames: () => Promise<AxiosResponse>;
33
+ getIotReaderPort: (id: string, params?: HardwareDetailFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse<AntennaPortDetail>>>;
34
+ };
35
+ export default HardwareServices;
@@ -0,0 +1,7 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { SessionLogFetchParams } from '../dto/logNotification.dto';
3
+ import { GetSessionLogListResponse } from '../dto/user.dto';
4
+ declare const LogServices: {
5
+ getSessionLogList: (params: SessionLogFetchParams) => Promise<AxiosResponse<GetSessionLogListResponse>>;
6
+ };
7
+ export default LogServices;
@@ -0,0 +1,7 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { GetOptionResponse } from '../dto/user.dto';
3
+ declare const OptionServices: {
4
+ getPositions: () => Promise<AxiosResponse<GetOptionResponse>>;
5
+ getDivisions: () => Promise<AxiosResponse<GetOptionResponse>>;
6
+ };
7
+ export default OptionServices;
@@ -0,0 +1,13 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { CreateEditMasterDataBody } from '../dto/masterData.dto';
3
+ import { GetMasterDataDetailResponse } from '../dto/user.dto';
4
+ import { FetchListResponse, QueryParams } from '../types/fetchResponse.type';
5
+ import { MasterDataItem } from '../types/masterData.type';
6
+ declare const PositionServices: {
7
+ getPositions: (params?: QueryParams) => Promise<AxiosResponse<FetchListResponse<MasterDataItem>>>;
8
+ getPositionDetail: (id: string) => Promise<AxiosResponse<GetMasterDataDetailResponse>>;
9
+ postCreatePosition: (body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
10
+ putEditPosition: (id: string, body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
11
+ deletePositions: (ids: string[]) => Promise<AxiosResponse>;
12
+ };
13
+ export default PositionServices;
@@ -0,0 +1,7 @@
1
+ import { AxiosResponse } from 'axios';
2
+ declare const TagServices: {
3
+ getTagInfo: (params?: {
4
+ tag?: string;
5
+ }) => Promise<AxiosResponse>;
6
+ };
7
+ export default TagServices;
@@ -0,0 +1,9 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { BooleanOptions } from '../dto/dataTable.dto';
3
+ import { TAGEventlogDetailResponse, TAGEventlogFetchOptionResponse, TAGEventlogFetchResponse, TAGEventlogFilterQuery } from '../dto/tagEventlog.dto';
4
+ declare const TagEventlogServices: {
5
+ getTAGEventlog: (params?: TAGEventlogFilterQuery) => Promise<AxiosResponse<TAGEventlogFetchResponse>>;
6
+ getTAGEventlogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<TAGEventlogFetchOptionResponse>>;
7
+ getDetailTAGEventlog: (eventlogId?: string) => Promise<AxiosResponse<TAGEventlogDetailResponse>>;
8
+ };
9
+ export default TagEventlogServices;
@@ -0,0 +1,19 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { CreateUserBody, EditUserBody, GetUserDetailResponse, GetUserOptionsParam, GetUserOptionsResponse, GetUserSystemLogOptionsParam, GetUserSystemLogOptionsResponse, PostResendEmailBody, PutChangePasswordBody, PutToggleStatusUsersBody } from '../dto/user.dto';
3
+ import { FetchListResponse, QueryParams } from '../types/fetchResponse.type';
4
+ import { SystemLog, UserItem } from '../types/user.type';
5
+ declare const SettingUserGlobalServices: {
6
+ getUsers: (params?: QueryParams) => Promise<AxiosResponse<FetchListResponse<UserItem>>>;
7
+ getUserDetail: (id: string) => Promise<AxiosResponse<GetUserDetailResponse>>;
8
+ getUserSystemLogs: (id: string, params: QueryParams) => Promise<AxiosResponse<FetchListResponse<SystemLog>>>;
9
+ getUserSystemLogOptions: (id: string, optionField: keyof GetUserSystemLogOptionsParam) => Promise<AxiosResponse<GetUserSystemLogOptionsResponse>>;
10
+ postCreateUser: (body: CreateUserBody) => Promise<AxiosResponse>;
11
+ putEditUser: (id: string, body: EditUserBody) => Promise<AxiosResponse>;
12
+ deleteUsers: (ids: string[]) => Promise<AxiosResponse>;
13
+ putToggleStatusUsers: (body: PutToggleStatusUsersBody) => Promise<AxiosResponse>;
14
+ getUserOptions: (optionField: keyof GetUserOptionsParam) => Promise<AxiosResponse<GetUserOptionsResponse>>;
15
+ deleteCancelEmailChange: (id: string) => Promise<AxiosResponse>;
16
+ postResendEmail: (body: PostResendEmailBody) => Promise<AxiosResponse>;
17
+ putChangePassword: (id: string, body: PutChangePasswordBody) => Promise<AxiosResponse>;
18
+ };
19
+ export default SettingUserGlobalServices;
@@ -0,0 +1,21 @@
1
+ import { Option } from '../../node_modules/@fewangsit/wangsvue-gsts/dropdown';
2
+ export type ChangelogType = {
3
+ _id: string;
4
+ action: string;
5
+ field: string;
6
+ oldValue?: string;
7
+ newValue?: string;
8
+ modifiedBy?: string;
9
+ modifiedById?: string;
10
+ object: string;
11
+ objectId: string;
12
+ objectName: string;
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ };
16
+ export type ChangelogOptionFilter = {
17
+ actionOptions?: Option[];
18
+ modifiedByOptions?: Option[];
19
+ fieldOptions?: Option[];
20
+ objectNameOptions?: Option[];
21
+ };
@@ -0,0 +1,12 @@
1
+ export type ChildGroup = {
2
+ groupHeader: string;
3
+ groupItems: Data[];
4
+ };
5
+ export type TableParams = {
6
+ search?: string;
7
+ page?: number;
8
+ limit?: number;
9
+ sortBy?: string;
10
+ sortOrder?: number;
11
+ };
12
+ export type Data = Record<string, unknown>;
@@ -0,0 +1,36 @@
1
+ import { Option } from '../../node_modules/@fewangsit/wangsvue-gsts/dropdown';
2
+ import { Data } from './dataTable.type';
3
+ export type FetchListResponse<T = Data> = {
4
+ status: number;
5
+ message: string;
6
+ data: {
7
+ data: T[];
8
+ totalRecords: number;
9
+ };
10
+ };
11
+ export type ShortFetchListResponse<T = Data> = {
12
+ status: number;
13
+ message: string;
14
+ data: T[];
15
+ };
16
+ export type FetchDetailResponse<T = Data> = {
17
+ status: number;
18
+ message: string;
19
+ data: T;
20
+ };
21
+ export type FetchResponse = {
22
+ status: number;
23
+ message: string;
24
+ };
25
+ export type FilterOptions<Opt = Record<string, boolean>> = Record<keyof Opt, Option[]>;
26
+ export type FetchOptionResponse<Opt = Record<string, boolean>> = {
27
+ message: string;
28
+ data: FilterOptions<Opt>;
29
+ };
30
+ export type StatusMessageResponse = {
31
+ status: number;
32
+ message: string;
33
+ };
34
+ export type QueryParams = {
35
+ [key: string]: string | number | boolean | string[] | number[] | boolean[] | Date | undefined | null;
36
+ };
@@ -0,0 +1,88 @@
1
+ export type HardwareTabType = 'activity-log' | 'handheld-damaged-missing' | 'handheld' | 'iot-reader' | 'iot-antenna' | 'iot-damaged-missing-reader' | 'iot-damaged-missing-antenna';
2
+ export type HardwareDetailTabType = 'All' | 'Tagging' | 'User' | 'Antenna' | 'Changelog';
3
+ export type ModuleGroup = {
4
+ _id: string;
5
+ key: number;
6
+ name: string;
7
+ module: 'fixedAsset' | 'supplyAsset';
8
+ };
9
+ export interface HardwareDataType {
10
+ _id: string;
11
+ imageSmall?: string;
12
+ imageBig?: string;
13
+ name: string;
14
+ sku: string;
15
+ aliasName?: string;
16
+ brand?: string;
17
+ model?: string;
18
+ type: string;
19
+ networkStatus?: 'Online' | 'Offline';
20
+ status: string;
21
+ createdAt?: string;
22
+ updatedAt?: string;
23
+ group?: ModuleGroup[];
24
+ antennaGroup?: {
25
+ port?: number;
26
+ groups?: ModuleGroup[];
27
+ }[];
28
+ activePort?: string;
29
+ reportedBy?: string;
30
+ lastReportDate?: string;
31
+ action?: string;
32
+ userFullName?: string;
33
+ readerName?: string;
34
+ }
35
+ export interface HardwareDetailDataType {
36
+ _id: string;
37
+ imageSmall?: string;
38
+ imageBig?: string;
39
+ readerName?: string;
40
+ serialNumber?: string;
41
+ name: {
42
+ _id: string;
43
+ nameWithSequence: string;
44
+ name: string;
45
+ key: number;
46
+ nameNumber?: number;
47
+ };
48
+ aliasName?: string;
49
+ networkStatus?: 'Online' | 'Offline';
50
+ lastReportDate?: string;
51
+ group?: ModuleGroup[];
52
+ brand?: {
53
+ name?: string;
54
+ key?: number;
55
+ };
56
+ model?: {
57
+ name?: string;
58
+ key?: number;
59
+ };
60
+ manager?: {
61
+ _id: string;
62
+ name?: string;
63
+ key?: number;
64
+ };
65
+ type: string;
66
+ status: string;
67
+ key: number;
68
+ }
69
+ export interface AntennaPortDetail {
70
+ _id: number;
71
+ isActive: boolean;
72
+ port: string;
73
+ group: ModuleGroup[];
74
+ antennaPower: string;
75
+ powerInt: number;
76
+ invalid?: boolean;
77
+ }
78
+ export interface HardwareDetailUserActivity {
79
+ _id: string;
80
+ createdAt: string;
81
+ userFullName?: string;
82
+ action?: string;
83
+ objectName?: string;
84
+ field?: string;
85
+ oldValue?: string;
86
+ newValue?: string;
87
+ modifiedBy?: string;
88
+ }
@@ -0,0 +1,10 @@
1
+ export type SessionLog = {
2
+ activity: string;
3
+ user: string;
4
+ userId: string;
5
+ employeeId: string;
6
+ position: string;
7
+ ipAddress: string;
8
+ createdAt: Date | string;
9
+ updatedAt: Date | string;
10
+ };
@@ -0,0 +1,7 @@
1
+ export interface MasterDataItem {
2
+ _id: string;
3
+ name: string;
4
+ inUse: boolean;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ }
@@ -0,0 +1,13 @@
1
+ export type OptionValue = string | number | boolean | Record<string, unknown>;
2
+ export type DropdownOption = {
3
+ label: string;
4
+ value?: OptionValue;
5
+ visible?: boolean;
6
+ icon?: string;
7
+ };
8
+ export type MultiSelectOption = {
9
+ label: string;
10
+ value?: OptionValue;
11
+ visible?: boolean;
12
+ icon?: string;
13
+ };
@@ -0,0 +1,28 @@
1
+ export type TAGType = 'rfid' | 'nfc' | 'qr';
2
+ export type TAGTabType = 'all' | 'paired' | 'not-paired' | 'combine-tag';
3
+ export type ApplicationModule = 'Settings Portal' | 'Fixed Asset' | 'Supply Asset';
4
+ export interface TAGCountType {
5
+ settingsPortalAvailable?: number;
6
+ settingsPortalDamagedMissing?: number;
7
+ fixedAssetAvailable?: number;
8
+ fixedAssetDamagedMissing?: number;
9
+ supplyAssetAvailable?: number;
10
+ supplyAssetDamagedMissing?: number;
11
+ }
12
+ export interface TAGDataType {
13
+ _id: string;
14
+ rfidCode: string;
15
+ nfcCode: string;
16
+ qrCode: string;
17
+ sku: string;
18
+ type: 'Asset TAG' | 'User TAG';
19
+ status: 'Available' | 'Paired' | 'Damaged/Missing';
20
+ pairedIn: ApplicationModule;
21
+ }
22
+ export interface TAGInfomartion {
23
+ _id: '662f63b17adde9b58b0eb152';
24
+ rfidCode: 'E*40B105';
25
+ nfcCode: 'B*EASD';
26
+ qrCode: 'C*EASDF';
27
+ module: 'Fixed Asset';
28
+ }
@@ -0,0 +1,19 @@
1
+ export interface TAGEventlogData {
2
+ _id: string;
3
+ status?: 'Audit' | 'Allocate';
4
+ activity?: string;
5
+ totalTagScanned: number;
6
+ modifiedBy?: string;
7
+ createdAt: string;
8
+ }
9
+ export interface TAGDetailCount {
10
+ type: 'availableFound' | 'damagedMissingFound' | 'availableMarkDamagedMissing' | 'fixedAssetMoveToPortal' | 'supplyAssetMoveToPortal' | 'allocated';
11
+ isChecked?: boolean;
12
+ groupName?: string;
13
+ rfid?: number;
14
+ nfc?: number;
15
+ rfidQr?: number;
16
+ nfcQr?: number;
17
+ rfidNfc?: number;
18
+ rfidNfcQr?: number;
19
+ }
@@ -0,0 +1,82 @@
1
+ export type UserType = 'Basic' | 'Admin';
2
+ export type User = {
3
+ _id: string;
4
+ key: number;
5
+ isActive: boolean;
6
+ name: string;
7
+ userType: UserType;
8
+ position: string;
9
+ division: string;
10
+ email: string;
11
+ employeeId: string;
12
+ phoneNumber: string;
13
+ modifiedBy: {
14
+ _id: string;
15
+ fullName: string;
16
+ key: number;
17
+ };
18
+ updatedAt: Date | string;
19
+ isDeletable: boolean;
20
+ isConfirmed: boolean;
21
+ isDefault: boolean;
22
+ profilePictureSmall: string;
23
+ profilePictureMedium: string;
24
+ profilePictureBig: string;
25
+ exportSystemRole: string;
26
+ exportTransactionRole: string;
27
+ isSelf: boolean;
28
+ };
29
+ export type UserDetail = {
30
+ _id: string;
31
+ isActive: boolean;
32
+ isDefault: boolean;
33
+ profilePictureBig?: string;
34
+ profilePictureMedium?: string;
35
+ profilePictureSmall?: string;
36
+ firstName: string;
37
+ lastName: string;
38
+ email: string;
39
+ pendingEmailChange: string;
40
+ position?: string;
41
+ division: string;
42
+ employeeId?: string;
43
+ phoneNumber: string;
44
+ isTemporary: boolean;
45
+ expiryDate: string;
46
+ access: string[];
47
+ name: string;
48
+ userTag?: string;
49
+ isSelf?: boolean;
50
+ };
51
+ export type UserItem = {
52
+ _id: string;
53
+ isActive: boolean;
54
+ pendingEmail?: string;
55
+ isDefault: boolean;
56
+ profilePicture: string;
57
+ name: string;
58
+ email: string;
59
+ position: string;
60
+ division: string;
61
+ employeeId: string;
62
+ phoneNumber: string;
63
+ modifiedBy: ModifiedBy;
64
+ lastUpdate: string;
65
+ isSelf?: boolean;
66
+ };
67
+ interface ModifiedBy {
68
+ _id: string;
69
+ fullName: string;
70
+ key: number;
71
+ }
72
+ export type SystemLog = {
73
+ _id: string;
74
+ activity: string;
75
+ date: string;
76
+ field: string;
77
+ newValue: string;
78
+ object: string;
79
+ objectName: string;
80
+ oldValue: string;
81
+ };
82
+ export {};
@@ -0,0 +1,19 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ export interface APIRequestConfig extends Omit<AxiosRequestConfig, 'env'> {
3
+ /**
4
+ * Retrieves the base URL from environment variables.
5
+ *
6
+ * @param env - The environment variable name.
7
+ * @default 'APP_EXAMPLE_API'
8
+ */
9
+ env?: string;
10
+ /**
11
+ * The endpoint prefix that appears on every endpoint.
12
+ * This could include API base paths or versioning groups for endpoints.
13
+ * Prefixes must include leading forward slashes.
14
+ *
15
+ * @example '/api', '/v2'
16
+ */
17
+ prefix?: string;
18
+ }
19
+ export declare const createAxiosInstance: (config?: APIRequestConfig, useDifferentHeaders?: boolean) => AxiosInstance;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Retrieves the base URL from environment variables.
3
+ *
4
+ * @param {string} [env='APP_TAGSAMURAI_API'] - The environment variable name without the platform prefix.
5
+ * @returns The base URL for the specified environment.
6
+ * @example 'APP_EXAMPLE_API'
7
+ */
8
+ export declare const getBaseURL: (env?: string) => string | undefined;
@@ -0,0 +1 @@
1
+ export declare const getImageURL: (name?: string | null, width?: number, height?: number) => string | undefined;
@@ -0,0 +1,4 @@
1
+ export { createAxiosInstance } from './createInstance.util';
2
+ export { getBaseURL } from './getBaseURL.util';
3
+ export { getImageURL } from './getImageURL.util';
4
+ export { queryParamsStringfy } from './queryParamsStringify.util';
@@ -0,0 +1,9 @@
1
+ import { QueryParams } from '../types/fetchResponse.type';
2
+ export interface QueryParamsStringfy {
3
+ [key: string]: string;
4
+ }
5
+ /**
6
+ * This Function will turn all array query params to string
7
+ * using JSON Stringfy
8
+ */
9
+ export declare const queryParamsStringfy: (data: QueryParams | undefined) => QueryParamsStringfy | undefined;