tsv2-library 0.2.46 → 0.2.48

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.
@@ -12,7 +12,7 @@ interface TSFormContext<T> {
12
12
  handleSubmit: FormContext['handleSubmit'];
13
13
  }
14
14
  declare const useForm: <T>() => TSFormContext<T>;
15
- import { handleTokenExpiration, exportToExcel, formatDate, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, getTransactionRole, getSystemRole, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n } from './utils';
15
+ import { handleTokenExpiration, exportToExcel, formatDate, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, getTransactionRole, getSystemRole, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin } from './utils';
16
16
  import { flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys } from './components/v2/Tree/helpers';
17
17
  import useLoadingStore from './components/v2/Loading/store/loading.store';
18
18
  import Tooltip from '../node_modules/primevue/tooltip';
@@ -2849,4 +2849,4 @@ declare const _default: {
2849
2849
  install: (app: App) => void;
2850
2850
  };
2851
2851
  export default _default;
2852
- export { LibConfig, TSToastService, TSi18n, VueHtmlToPaper, Tooltip, Focus, TSAssetInfo, TSApproverInfo, TSBadge, TSBadgeGroup, TSBreadcrumb, TSButton, TSButtonAddByScan, TSButtonBulkAction, TSButtonCopy, TSButtonDownload, TSButtonFilter, TSButtonLogHistory, TSButtonRadio, TSButtonViewLog, TSButtonScan, TSButtonSearch, TSButtonSearchByScan, TSButtonSelectTree, TSButtonSelectUser, TSButtonSync, TSButtonToggle, TSCalendar, TSCard, TSCarousel, TSCheckbox, TSCustomColumn, TSDatePicker, TSDataTable, TSDayPicker, TSDialog, TSDialogApprovalList, TSDialogAssetNameDetail, TSDialogConfirm, TSDialogForm, TSDialogLinkedAsset, TSDialogPrintQR, TSDialogReportDamage, TSDialogReportMissing, TSDialogReportTag, TSDialogSelectTree, TSDialogSelectAsset, TSDialogSelectUser, TSDisposalReport, TSDropdown, TSFilterContainer, TSFileUpload, TSForm, TSIcon, TSImage, TSImageCompressor, TSInlineMessage, TSInputBadge, TSInputCurrency, TSInputEmail, TSInputNumber, TSInputOTP, TSInputPassword, TSInputPhoneNumber, TSInputRangeNumber, TSInputText, TSInputSearch, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, handleTokenExpiration, exportToExcel, formatDate, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, getTransactionRole, getSystemRole, formatCurrency, getHostName, getBaseURL, useI18n, useForm, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, DisposalServices, FilterMatchMode, useLoadingStore, };
2852
+ export { LibConfig, TSToastService, TSi18n, VueHtmlToPaper, Tooltip, Focus, TSAssetInfo, TSApproverInfo, TSBadge, TSBadgeGroup, TSBreadcrumb, TSButton, TSButtonAddByScan, TSButtonBulkAction, TSButtonCopy, TSButtonDownload, TSButtonFilter, TSButtonLogHistory, TSButtonRadio, TSButtonViewLog, TSButtonScan, TSButtonSearch, TSButtonSearchByScan, TSButtonSelectTree, TSButtonSelectUser, TSButtonSync, TSButtonToggle, TSCalendar, TSCard, TSCarousel, TSCheckbox, TSCustomColumn, TSDatePicker, TSDataTable, TSDayPicker, TSDialog, TSDialogApprovalList, TSDialogAssetNameDetail, TSDialogConfirm, TSDialogForm, TSDialogLinkedAsset, TSDialogPrintQR, TSDialogReportDamage, TSDialogReportMissing, TSDialogReportTag, TSDialogSelectTree, TSDialogSelectAsset, TSDialogSelectUser, TSDisposalReport, TSDropdown, TSFilterContainer, TSFileUpload, TSForm, TSIcon, TSImage, TSImageCompressor, TSInlineMessage, TSInputBadge, TSInputCurrency, TSInputEmail, TSInputNumber, TSInputOTP, TSInputPassword, TSInputPhoneNumber, TSInputRangeNumber, TSInputText, TSInputSearch, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, handleTokenExpiration, exportToExcel, formatDate, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, getTransactionRole, getSystemRole, formatCurrency, getHostName, getBaseURL, useI18n, useForm, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, DisposalServices, FilterMatchMode, useLoadingStore, };
@@ -0,0 +1,8 @@
1
+ import { AxiosResponse } from 'axios';
2
+ type ReLogin = {
3
+ jwt: string;
4
+ };
5
+ declare const AuthAPIs: {
6
+ reLogin: (body: ReLogin) => Promise<AxiosResponse>;
7
+ };
8
+ export default AuthAPIs;
@@ -4,3 +4,92 @@ export type User = {
4
4
  fullName?: string;
5
5
  key: number;
6
6
  };
7
+ /**
8
+ * User data in localStorage
9
+ */
10
+ export interface UserLogin {
11
+ _id: string;
12
+ company: string;
13
+ companyName: string;
14
+ companyCode?: string;
15
+ firstName?: string;
16
+ lastName?: string;
17
+ fullName?: string;
18
+ profilePictureMedium?: string;
19
+ profilePictureBig?: string;
20
+ profilePictureSmall?: string;
21
+ email: string;
22
+ phoneNumber?: string;
23
+ employeeId?: string;
24
+ position?: string;
25
+ token: string;
26
+ transactionRoles?: TransactionRoles;
27
+ systemRoles?: SystemRoles;
28
+ generalSetting?: GeneralSetting;
29
+ addOn?: AddOn;
30
+ }
31
+ interface AddOn {
32
+ maintenance?: boolean;
33
+ tracking?: boolean;
34
+ audit?: boolean;
35
+ repairTicketing?: boolean;
36
+ }
37
+ interface GeneralSetting {
38
+ currency?: Currency;
39
+ timezone?: string;
40
+ dateFormat?: DateFormat;
41
+ timeFormat?: boolean;
42
+ }
43
+ interface DateFormat {
44
+ locale: string;
45
+ year: string;
46
+ month: string;
47
+ day: string;
48
+ weekday: string;
49
+ }
50
+ interface Currency {
51
+ currency?: string;
52
+ symbol?: string;
53
+ locale?: string;
54
+ label?: string;
55
+ _id?: string;
56
+ id?: string;
57
+ }
58
+ interface SystemRoles {
59
+ importData?: SystemRoleItem;
60
+ assetAttribute?: SystemRoleItem;
61
+ assetPolicies?: SystemRoleItem;
62
+ depreciationGroup?: SystemRoleItem;
63
+ depreciationMethod?: SystemRoleItem;
64
+ documentDeletion?: SystemRoleItem;
65
+ group?: SystemRoleItem;
66
+ user?: SystemRoleItem;
67
+ iotReader?: SystemRoleItem;
68
+ license?: SystemRoleItem;
69
+ purchaseDocument?: SystemRoleItem;
70
+ purchaseInformation?: SystemRoleItem;
71
+ role?: SystemRoleItem;
72
+ tag?: SystemRoleItem;
73
+ registerAsset?: SystemRoleItem;
74
+ }
75
+ interface SystemRoleItem {
76
+ create?: boolean;
77
+ view?: boolean;
78
+ update?: boolean;
79
+ delete?: boolean;
80
+ }
81
+ interface TransactionRoles {
82
+ trackingRole?: TransactionRoleItem;
83
+ disposalRole?: TransactionRoleItem;
84
+ borrowingRole?: TransactionRoleItem;
85
+ transferRole?: TransactionRoleItem;
86
+ auditRole?: TransactionRoleItem;
87
+ repairRole?: TransactionRoleItem;
88
+ maintenanceRole?: TransactionRoleItem;
89
+ }
90
+ interface TransactionRoleItem {
91
+ manager?: boolean;
92
+ monitoringReport?: boolean;
93
+ staff?: boolean;
94
+ }
95
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const clearStorage: () => void;
2
+ export default clearStorage;
@@ -0,0 +1,2 @@
1
+ declare const forceLogout: () => void;
2
+ export default forceLogout;
@@ -10,6 +10,9 @@ import { unListenSidebarChanges, listenSidebarChanges } from './listenSidebarCha
10
10
  import { getBaseURL, getHostName } from './getBaseURL.util';
11
11
  import useI18n from './tanslation.util';
12
12
  import { getSeverityByAssetStatus } from './getSeverityByAssetStatus.util';
13
+ import clearStorage from './clearStorage.util';
14
+ import forceLogout from './forceLogout.util';
15
+ import reLogin from './reLogin.util';
13
16
  declare const isObjectEmpty: (object: object) => boolean;
14
17
  declare const getNestedProperyValue: (object: object, property: string) => string | boolean | number | object;
15
- export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, formatUserName, formatVowelSoundLabel, exportToExcel, formatDate, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, getTransactionRole, getSystemRole, };
18
+ export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, formatUserName, formatVowelSoundLabel, exportToExcel, formatDate, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, getTransactionRole, getSystemRole, clearStorage, forceLogout, reLogin, };
@@ -0,0 +1,2 @@
1
+ declare const reLogin: () => Promise<unknown>;
2
+ export default reLogin;