tsv2-library 0.2.55 → 0.2.57

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, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin } from './utils';
15
+ import { handleTokenExpiration, exportToExcel, formatDate, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, getTransactionRole, getSystemRole, hasSystemRole, checkRouteAccess, hasTransactionRole, hasApprovalRole, 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, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, 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, hasSystemRole, hasTransactionRole, hasApprovalRole, checkRouteAccess, formatCurrency, getHostName, getBaseURL, useI18n, useForm, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, DisposalServices, FilterMatchMode, useLoadingStore, };
@@ -4,7 +4,7 @@ import exportToExcel from './exportToExcel.util';
4
4
  import { formatDate, formatDateReadable } from './date.util';
5
5
  import useToast from './toast.util';
6
6
  import getImageURL from './getImageURL.util';
7
- import { getTransactionRole, getSystemRole } from './role.util';
7
+ import { getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole } from './role.util';
8
8
  import { getCurrency, formatCurrency } from './currency.util';
9
9
  import { unListenSidebarChanges, listenSidebarChanges } from './listenSidebarChanges.util';
10
10
  import { getBaseURL, getHostName } from './getBaseURL.util';
@@ -15,4 +15,4 @@ import forceLogout from './forceLogout.util';
15
15
  import reLogin from './reLogin.util';
16
16
  declare const isObjectEmpty: (object: object) => boolean;
17
17
  declare const getNestedProperyValue: (object: object, property: string) => string | boolean | number | object;
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, };
18
+ export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, formatUserName, formatVowelSoundLabel, exportToExcel, formatDate, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, getTransactionRole, getSystemRole, hasSystemRole, hasApprovalRole, checkRouteAccess, hasTransactionRole, clearStorage, forceLogout, reLogin, };
@@ -1,3 +1,4 @@
1
+ import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
1
2
  export type TransactionRole = {
2
3
  manager: boolean;
3
4
  monitoringReport: boolean;
@@ -10,7 +11,7 @@ export type SystemRole = {
10
11
  update: boolean;
11
12
  delete: boolean;
12
13
  };
13
- export type SystemRoleAttribute = 'importData' | 'assetAttribute' | 'assetPolicies' | 'depreciationGroup' | 'depreciationMethod' | 'documentDeletion' | 'group' | 'user' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'role' | 'tag' | 'registerAsset';
14
+ export type SystemRoleAttribute = 'importData' | 'assetAttribute' | 'assetPolicies' | 'depreciationGroup' | 'depreciationMethod' | 'documentDeletion' | 'group' | 'user' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'role' | 'tag' | 'tagType' | 'registerAsset';
14
15
  export type TransactionAttribute = 'borrowingRole' | 'disposalRole' | 'transferRole' | 'auditRole' | 'maintenanceRole' | 'repairRole' | 'trackingRole' | 'damagedRole' | 'missingRole';
15
16
  export interface UserLogin {
16
17
  transactionRoles: Record<TransactionAttribute, TransactionRole>;
@@ -18,4 +19,8 @@ export interface UserLogin {
18
19
  }
19
20
  declare const getTransactionRole: (name: keyof UserLogin['transactionRoles']) => TransactionRole;
20
21
  declare const getSystemRole: (name: keyof UserLogin['systemRoles']) => SystemRole;
21
- export { getTransactionRole, getSystemRole };
22
+ declare const hasSystemRole: (name: SystemRoleAttribute) => boolean;
23
+ declare const hasTransactionRole: (name: TransactionAttribute) => boolean;
24
+ declare const hasApprovalRole: (name: TransactionAttribute) => boolean;
25
+ declare const checkRouteAccess: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => void;
26
+ export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, };