@bizzy-phoenix/utils
v1.0.14
Published
Helper collections for Bizzy Phoenix projects - Part of Bizzy Common Web
Downloads
18
Readme
@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.js
| Method | Param |
|--------------------------|-------------------------------------|
| __apiGet
| $store
, URL
, params
|
| __apiGetNonAuth
| URL
, params
|
| __apiGetCustomHeader
| headers
, URL
, params
|
| __apiPost
| $store
, URL
, data
, onUploadProgress
|
| __apiPostNonAuth
| URL
, data
, onUploadProgress
|
| __apiPostCustomHeader
| headers
, URL
, data
, onUploadProgress
|
| __apiPut
| $store
, URL
, data
|
| __apiPutNonAuth
| URL
, data
|
| __apiDelete
| $store
, URL
, data
|
| __apiDeleteNonAuth
| URL
, data
|
auth.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
|
| getCustomerUsername
| $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
|
| isAccountCompanySwitched
| $store
|
common.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __isNotNull
| - |
| __isNotEmptyString
| - |
| __isNotEmptyArray
| - |
| __isFunction
| - |
| __slugify
| - |
date.js
| Method | Notes |
|------------------------------|-------------------------------------|
| __isValidDate
| - |
| __toDatetime
| format: DD-MMM-YYYY, HH:mm:ss
|
| __toDatetimeToMinutes
| format: DD MMM YYYY, HH:mm
|
| __toDatetimeWithSeparator
| format: DD MMMM YYYY | HH:mm:ss
|
| __toDateEn
| format: YYYY-MM-DD
|
| __toCompleteDateFormat
| format: DD MMMM YYYY
|
| __checkDiff
| - |
notification.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __showNotification
| - |
| __showErrorNotif
| - |
| __showSuccessNotif
| - |
| __type
| - |
price.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __formatPrice
| - |
product.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __getProductUrl
| - |
storage.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __getData
| - |
| __setData
| - |
window.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