@bizzy-phoenix/utils
Helper collections for Bizzy Phoenix projects
How to install
$ yarn add @bizzy-phoenix/utils
# or
$ npm i @bizzy-phoenix/utils
Sample Usage
import { __apiGet } from '@bizzy-phoenix/utils/dist/api'
Or used untranspiled version:
import { __apiGet } from '@bizzy-phoenix/utils/src/api'
For Test
If you decied using untranspiled version you need to add ignore pattern like this:
transformIgnorePatterns: ['node_modules/(?!(@bizzy-phoenix/utils)/)'],
Available Utils/Helpers
api-util.js
Method | Param |
---|
__apiGet | $store , URL , params |
__apiGetNonAuth | URL , params |
__apiPost | $store , URL , data , onUploadProgress |
__apiPostNonAuth | URL , data , onUploadProgress |
__apiPut | $store , URL , data |
__apiPutNonAuth | URL , data |
__apiDelete | $store , URL , data |
__apiDeleteNonAuth | URL , data |
auth-util.js
Method | Param |
---|
getToken | $store |
getTokenDirectFromStore | $store |
getAddons | $store |
getUsername | $store |
getUserFirstName | $store |
getUserLastName | $store |
getUserFullName | $store |
getUserDefaultGroupId | user |
getCustomerRoles | $store |
getCustomerChannelType | $store |
getCustomerTopDays | $store |
getCustomerOrganizationID | $store |
getCustomerPersonID | $store |
getCustomerName | $store |
getCustomerOrganizationName | $store |
isCustomerSuperAdmin | $store |
isPunchOutUser | $store |
isPunchOut | $store |
isContract | $store |
getActiveGroupId | $store |
getGroups | $store |
getSelectedGroup | $store |
isSalesAdmin | $store |
getCustomerInformation | $store |
getCustomerVendorInformation | $store |
isVendor | $store |
isLoggedIn | $store |
loggedAsSellerOnly | $store |
isCustomerHaveRole | $store |
common-util.js
Method | Notes |
---|
__isNotNull | - |
__isNotEmptyString | - |
__isNotEmptyArray | - |
__isFunction | - |
__slugify | - |
date-util.js
Method | Notes |
---|
__isValidDate | - |
__toDatetime | format: DD-MMM-YYYY, HH:mm:ss |
__toDatetimeToMinutes | format: DD MMM YYYY, HH:mm |
__toDatetimeWithSeparator | format: `DD MMMM YYYY |
__toDateEn | format: YYYY-MM-DD |
__toCompleteDateFormat | format: DD MMMM YYYY |
__checkDiff | - |
notification-util.js
Method | Notes |
---|
__showNotification | - |
__showErrorNotif | - |
__showSuccessNotif | - |
__type | - |
price-util.js
Method | Notes |
---|
__formatPrice | - |
product-util.js
Method | Notes |
---|
__getProductUrl | - |
storage-util.js
Method | Notes |
---|
__getData | - |
__setData | - |
window-util.js
Method | Notes |
---|
__goToPage | - |
__hideModal | - |
__showModal | - |
Script for Development
# run eslint
$ yarn run lint
# run test
$ yarn run test
# run build
$ yarn run build
Copyright © 2018 by Bizzy Engineering Team