repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 23
values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
hyperswitch-control-center | src/components/Graphs/BarGraph/BarGraphUtils.res | .res | // constants
let fontFamily = "Arial, sans-serif"
let darkGray = "#666666"
let gridLineColor = "#e6e6e6"
open BarGraphTypes
let getBarGraphOptions = (barGraphOptions: barGraphPayload) => {
let {categories, data, title, tooltipFormatter} = barGraphOptions
let style = {
fontFamily,
fontSize: "12px",
colo... | 444 | 10,121 |
hyperswitch-control-center | src/components/Graphs/PieGraph/PieGraphUtils.res | .res | open PieGraphTypes
let getPieChartOptions = (pieGraphOptions: pieGraphPayload<'t>) => {
let {
data,
title,
legendFormatter,
tooltipFormatter,
chartSize,
startAngle,
endAngle,
legend,
} = pieGraphOptions
let pieGraphTitle = {
...title,
align: "center",
verticalAlign: "b... | 1,542 | 10,122 |
hyperswitch-control-center | src/components/Graphs/PieGraph/PieGraphTypes.res | .res | type info = {index: int}
type toolTipSeris = {name: string}
type point = {name: string}
type pointFormatter = {
color: string,
x: string,
y: float,
series: toolTipSeris,
point: point,
}
type legendLabelFormatter = {name: string, y: int}
external asTooltipPointFormatter: Js_OO.Callback.arity1<'a> => pointForma... | 845 | 10,123 |
hyperswitch-control-center | src/components/Graphs/PieGraph/PieGraph.res | .res | external pieGraphOptionsToJson: PieGraphTypes.pieGraphOptions<'t> => JSON.t = "%identity"
@react.component
let make = (~options: PieGraphTypes.pieGraphOptions<'t>, ~className="") => {
<div className>
<Highcharts.DonutChart
options={options->pieGraphOptionsToJson} highcharts={Highcharts.highcharts}
/>
... | 88 | 10,124 |
hyperswitch-control-center | src/components/Graphs/StackedBarGraph/StackedBarGraphUtils.res | .res | let fontFamily = "InterDisplay, sans-serif"
let darkGray = "#525866"
open StackedBarGraphTypes
let getStackedBarGraphOptions = (
stackedBarGraphOptions: stackedBarGraphPayload,
~yMax,
~labelItemDistance,
) => {
let {categories, data, labelFormatter} = stackedBarGraphOptions
let style = {
fontFamily,
... | 531 | 10,125 |
hyperswitch-control-center | src/components/Graphs/StackedBarGraph/StackedBarGraph.res | .res | external stackedBarGraphOptionsToJson: StackedBarGraphTypes.stackedBarGraphOptions => JSON.t =
"%identity"
@react.component
let make = (~options: StackedBarGraphTypes.stackedBarGraphOptions, ~className="") => {
<div className>
<Highcharts.Chart
options={options->stackedBarGraphOptionsToJson} highcharts={... | 90 | 10,126 |
hyperswitch-control-center | src/components/Graphs/StackedBarGraph/StackedBarGraphTypes.res | .res | type \"type" = string
type spacingLeft = int
type spacingRight = int
type categories = array<string>
type align = string
type color = string
type gridLineWidth = int
type gridLineColor = string
type gridLineDashStyle = string
type tickmarkPlacement = string
type endOnTick = bool
type startOnTick = bool
type tickInterv... | 614 | 10,127 |
hyperswitch-control-center | src/components/tooltip/ToolTip.resi | .resi | type toolTipPosition = Top | Bottom | Left | Right | TopRight | TopLeft | BottomLeft | BottomRight
type contentPosition = Left | Right | Middle | Default
type toolTipSize = Large | Medium | Small | XSmall
type tooltipPositioning = [#absolute | #fixed | #static]
@react.component
let make: (
~description: string=?,
... | 296 | 10,128 |
hyperswitch-control-center | src/components/tooltip/ACLToolTip.res | .res | open ToolTip
@react.component
let make = (
~authorization,
~noAccessDescription=HSwitchUtils.noAccessControlText,
~description="",
~descriptionComponent=React.null,
~tooltipPositioning: tooltipPositioning=#fixed,
~toolTipFor=?,
~tooltipWidthClass="w-fit",
~tooltipForWidthClass="",
~toolTipPosition: o... | 343 | 10,129 |
hyperswitch-control-center | src/components/tooltip/ACLToolTip.resi | .resi | @react.component
let make: (
~authorization: CommonAuthTypes.authorization,
~noAccessDescription: string=?,
~description: string=?,
~descriptionComponent: React.element=?,
~tooltipPositioning: ToolTip.tooltipPositioning=?,
~toolTipFor: React.element=?,
~tooltipWidthClass: string=?,
~tooltipForWidthClass... | 238 | 10,130 |
hyperswitch-control-center | src/components/tooltip/ToolTip.res | .res | type toolTipPosition = Top | Bottom | Left | Right | TopRight | TopLeft | BottomLeft | BottomRight
type contentPosition = Left | Right | Middle | Default
type toolTipSize = Large | Medium | Small | XSmall
@send external getBoundingClientRect: Dom.element => Window.boundingClient = "getBoundingClientRect"
type tooltip... | 5,612 | 10,131 |
hyperswitch-control-center | src/components/priority-logics/AddPLGateway.res | .res | type gateway = RoutingTypes.volumeSplitConnectorSelectionData
module GatewayView = {
@react.component
let make = (~gateways: array<gateway>) => {
let url = RescriptReactRouter.useUrl()
let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
let connectorType: Connector... | 1,911 | 10,132 |
hyperswitch-control-center | src/components/SingleStats/SingleStatEntity.res | .res | open AnalyticsTypesUtils
type filterConfig = {
source: string, // source can be BATCH, KVLOGS basically which DB to fetch
modeValue: string, // modeValue can be ORDERS, TXN so here is the mode is orders we see data aggregated by the order_id and if mode is txn the data is aggregated by txn id simmilarly more mode ... | 720 | 10,133 |
hyperswitch-control-center | src/components/modal/ModalContainer.res | .res | module ModalHeading = {
@react.component
let make = (~title, ~hideModal) => {
let handleClick = React.useCallback(_ => {
hideModal()
}, [hideModal])
<div className="bg-purple-300 p-4 text-lg flex flex-row justify-between">
<div> {title->React.string} </div>
<button className="text-purp... | 552 | 10,134 |
hyperswitch-control-center | src/Hypersense/HypersenseContainer/HypersenseHomeContainer.res | .res | @react.component
let make = () => {
<HypersenseHome />
}
| 19 | 10,135 |
hyperswitch-control-center | src/Hypersense/HypersenseContainer/HypersenseConfigurationContainer.res | .res | @react.component
let make = () => {
<HypersenseConfiguration />
}
| 19 | 10,136 |
hyperswitch-control-center | src/Hypersense/HypersenseScreens/HypersenseHome.res | .res | @react.component
let make = () => {
open APIUtils
open LogicUtils
open PageUtils
let getURL = useGetURL()
let fetchDetails = useGetMethod()
let mixpanelEvent = MixpanelHook.useSendEvent()
let onExploreClick = async () => {
let hypersenseTokenUrl = getURL(
~entityName=V1(HYPERSENSE),
~met... | 501 | 10,137 |
hyperswitch-control-center | src/Hypersense/HypersenseScreens/HypersenseConfiguration.res | .res | @react.component
let make = () => {
open PageUtils
let mixpanelEvent = MixpanelHook.useSendEvent()
let {setCreateNewMerchant} = React.useContext(ProductSelectionProvider.defaultContext)
let userHasCreateMerchantAccess = OMPCreateAccessHook.useOMPCreateAccessHook([
#tenant_admin,
#org_admin,
])
<div... | 415 | 10,138 |
hyperswitch-control-center | src/Hypersense/HypersenseApp/HypersenseApp.res | .res | @react.component
let make = () => {
let url = RescriptReactRouter.useUrl()
{
switch url.path->HSwitchUtils.urlPath {
| list{"v2", "cost-observability"} => <HypersenseConfigurationContainer />
| list{"v2", "cost-observability", "home"} => <HypersenseHomeContainer />
| _ => React.null
}
}
}
| 93 | 10,139 |
hyperswitch-control-center | src/Hypersense/HypersenseApp/HypersenseSidebarValues.res | .res | open SidebarTypes
let hypersenseConfiguration = {
Link({
name: "Home",
link: `/v2/cost-observability/home`,
icon: "home",
access: Access,
selectedIcon: "home",
})
}
let hypersenseSidebars = {
[hypersenseConfiguration]
}
| 68 | 10,140 |
hyperswitch-control-center | src/container/TransactionContainer.res | .res | @react.component
let make = () => {
open HSwitchUtils
open HyperswitchAtom
let url = RescriptReactRouter.useUrl()
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let {userInfo: {transactionEntity}} = React.useContext(UserInfoProvider.defaultContext)
let {payOut} = featureFlagAtom->Recoil.useRecoi... | 612 | 10,141 |
hyperswitch-control-center | src/container/BusinessProfileContainer.res | .res | /*
Modules that depend on Business Profiles data are located within this container.
*/
@react.component
let make = () => {
open HSwitchUtils
open HyperswitchAtom
let url = RescriptReactRouter.useUrl()
let featureFlagDetails = featureFlagAtom->Recoil.useRecoilValueFromAtom
let fetchBusinessProfiles = Business... | 318 | 10,142 |
hyperswitch-control-center | src/container/ConnectorContainer.res | .res | /*
Modules that depend on Connector and Business Profiles data are located within this container.
*/
@react.component
let make = () => {
open HSwitchUtils
open HyperswitchAtom
let url = RescriptReactRouter.useUrl()
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let featureFlagDetails = featureFlag... | 1,406 | 10,143 |
hyperswitch-control-center | src/container/MerchantAccountContainer.res | .res | /*
Modules that depend on Merchant data are located within this container.
*/
@react.component
let make = (~setAppScreenState) => {
open HSwitchUtils
open HyperswitchAtom
let url = RescriptReactRouter.useUrl()
let (surveyModal, setSurveyModal) = React.useState(_ => false)
let {
userHasAccess,
hasAnyG... | 868 | 10,144 |
hyperswitch-control-center | src/container/APMContainer.res | .res | @react.component
let make = () => {
let url = RescriptReactRouter.useUrl()
{
switch url.path->HSwitchUtils.urlPath {
| list{"apm"} => <AltPaymentMethods />
| _ => React.null
}
}
}
| 59 | 10,145 |
hyperswitch-control-center | src/container/NewAnalyticsContainer.res | .res | @react.component
let make = () => {
open NewAnalyticsContainerUtils
open LogicUtils
open APIUtils
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let url = RescriptReactRouter.useUrl()
let {newAnalyticsSmartRetries, newAnalyticsRefunds} =
HyperswitchAtom.featureFlagAtom->Recoil.useRecoi... | 1,249 | 10,146 |
hyperswitch-control-center | src/container/AnalyticsContainer.res | .res | @react.component
let make = () => {
open HSwitchUtils
open HyperswitchAtom
let url = RescriptReactRouter.useUrl()
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let {userInfo: {analyticsEntity}, checkUserEntity} = React.useContext(
UserInfoProvider.defaultContext,
)
let {performanceMonitor,... | 468 | 10,147 |
hyperswitch-control-center | src/container/UserManagementContainer.res | .res | /*
This container holds the APIs needed for all user management-related modules.
It ensures that the necessary data is available before any user management component loads.
Pre-requisite APIs :
- ROLE_INFO : To get the list available authorizations for modules
*/
@react.component
let make = () => {
open HSwitchU... | 560 | 10,148 |
hyperswitch-control-center | src/APIUtils/APIUtilsTypes.res | .res | type entityName =
| CONNECTOR
| ROUTING
| MERCHANT_ACCOUNT
| UPDATE_ORGANIZATION
| REFUNDS
| REFUND_FILTERS
| DISPUTES
| DISPUTE_FILTERS
| PAYOUTS
| PAYOUTS_FILTERS
| ANALYTICS_FILTERS
| ANALYTICS_PAYMENTS
| ANALYTICS_DISPUTES
| ANALYTICS_REFUNDS
| ANALYTICS_AUTHENTICATION
| ANALYTICS_AU... | 1,114 | 10,149 |
hyperswitch-control-center | src/APIUtils/APIUtils.res | .res | open LogicUtils
open APIUtilsTypes
exception JsonException(JSON.t)
let getV2Url = (
~entityName: v2entityNameType,
~userType: userType=#NONE,
~methodType: Fetch.requestMethod,
~id=None,
~profileId,
~merchantId,
~queryParamerters: option<string>=None,
) => {
let connectorBaseURL = "v2/connector-accounts... | 8,405 | 10,150 |
hyperswitch-control-center | src/context/FilterContext.res | .res | type filterUpdater = {
query: string,
filterValue: Dict.t<string>,
updateExistingKeys: Dict.t<string> => unit,
removeKeys: array<string> => unit,
filterKeys: array<string>,
setfilterKeys: (array<string> => array<string>) => unit,
filterValueJson: Dict.t<JSON.t>,
reset: unit => unit,
}
let filterUpdater... | 1,043 | 10,151 |
hyperswitch-control-center | src/context/UserPrefContext.res | .res | // will be used in future
// docfor the user preference https://docs.google.com/document/d/1BM_UgHLuN0U-cXfRYqN6wWSq-5KUiqojinCfBrUEiVo/edit
open UserPrefUtils
external userPrefToJson: userPref => JSON.t = "%identity"
external dictUserPrefToStr: Dict.t<userPref> => string = "%identity"
let userPrefSetter: (Dict.t<userP... | 1,660 | 10,152 |
hyperswitch-control-center | src/context/ButtonGroupContext.res | .res | type buttonInfo = {
isFirst: bool,
isLast: bool,
}
let defaultButtonInfo = {
isFirst: true,
isLast: true,
}
let buttonGroupContext = React.createContext(defaultButtonInfo)
module Parent = {
let make = React.Context.provider(buttonGroupContext)
}
| 63 | 10,153 |
hyperswitch-control-center | src/context/TableFilterSectionContext.res | .res | let filterSectionContext = React.createContext(false)
module Provider = {
let make = React.Context.provider(filterSectionContext)
}
@react.component
let make = (~children, ~isFilterSection) => {
<Provider value=isFilterSection> children </Provider>
}
| 56 | 10,154 |
hyperswitch-control-center | src/context/RefreshStateContext.res | .res | let defaultSetter = (_: int => int) => ()
let refreshStateContext = React.createContext((0, defaultSetter))
let make = React.Context.provider(refreshStateContext)
| 37 | 10,155 |
hyperswitch-control-center | src/context/DropdownTextWeighContextWrapper.res | .res | let selectedTextWeightContext = React.createContext(false)
module Provider = {
let make = React.Context.provider(selectedTextWeightContext)
}
@react.component
let make = (~children, ~isDropdownSelectedTextDark) => {
<Provider value=isDropdownSelectedTextDark>
<div> children </div>
</Provider>
}
| 70 | 10,156 |
hyperswitch-control-center | src/context/ThemeUtils.res | .res | let useThemeFromEvent = () => {
let (eventTheme, setEventTheme) = React.useState(_ => None)
React.useEffect(() => {
let setEventThemeVal = (eventName, dict) => {
if eventName === "AuthenticationDetails" {
let payloadDict = dict->Dict.get("payload")->Option.flatMap(obj => obj->JSON.Decode.object)
... | 308 | 10,157 |
hyperswitch-control-center | src/context/ThemeProvider.res | .res | type theme = Light | Dark
let defaultSetter = _ => ()
type themeType = LightTheme
type x = {theme: string}
type customUIConfig = {
globalUIConfig: UIConfig.t,
theme: theme,
themeSetter: theme => unit,
configCustomDomainTheme: JSON.t => unit,
getThemesJson: (string, JSON.t, bool) => promise<JSON.t>,
}
let... | 2,558 | 10,158 |
hyperswitch-control-center | src/context/DataTableFilterOpenContext.res | .res | let defaultValue: Dict.t<bool> = Dict.make()
let setDefaultValue: (string, bool) => unit = (_key, _b) => ()
let filterOpenContext = React.createContext((defaultValue, setDefaultValue))
let make = React.Context.provider(filterOpenContext)
| 55 | 10,159 |
hyperswitch-control-center | src/context/ReactSuspenseWrapper.res | .res | @react.component
let make = (~children, ~loadingText="Loading...") => {
<React.Suspense fallback={<Loader loadingText />}>
<ErrorBoundary> children </ErrorBoundary>
</React.Suspense>
}
| 50 | 10,160 |
hyperswitch-control-center | src/context/AuthInfoProvider.res | .res | open AuthProviderTypes
type defaultProviderTypes = {
authStatus: authStatus,
setAuthStatus: authStatus => unit,
setAuthStateToLogout: unit => unit,
setAuthMethods: (
array<SSOTypes.authMethodResponseType> => array<SSOTypes.authMethodResponseType>
) => unit,
authMethods: array<SSOTypes.authMethodRespons... | 484 | 10,161 |
hyperswitch-control-center | src/context/FormAuthContext.res | .res | let formAuthContext = React.createContext(CommonAuthTypes.Access)
let make = React.Context.provider(formAuthContext)
| 23 | 10,162 |
hyperswitch-control-center | src/context/BetaEndPointConfigProvider.res | .res | let defaultSetter = _ => ()
let defaultValue: option<AuthHooks.betaEndpoint> = None
let betaEndPointConfig = React.createContext(defaultValue)
let make = React.Context.provider(betaEndPointConfig)
| 41 | 10,163 |
hyperswitch-control-center | src/context/AddAttributesContext.res | .res | let ignoreAttributesContext = React.createContext(false)
module Provider = {
let make = React.Context.provider(ignoreAttributesContext)
}
@react.component
let make = (~children, ~ignoreAttributes) => {
<Provider value=ignoreAttributes>
<div> children </div>
</Provider>
}
| 63 | 10,164 |
hyperswitch-control-center | src/context/SingleStatContext.res | .res | open AnalyticsTypesUtils
open SingleStatEntity
open DictionaryUtils
open Promise
open LogicUtils
open AnalyticsNewUtils
type singleStatComponent = {
singleStatData: option<Dict.t<dataState<JSON.t>>>,
singleStatTimeSeries: option<Dict.t<dataState<JSON.t>>>,
singleStatDelta: option<Dict.t<dataState<JSON.t>>>,
si... | 3,461 | 10,165 |
hyperswitch-control-center | src/context/UserTimeZoneProvider.res | .res | open UserTimeZoneTypes
let defaultSetter = _ => ()
let userTimeContext = React.createContext((IST, defaultSetter))
module TimeZone = {
let make = React.Context.provider(userTimeContext)
}
@react.component
let make = (~children) => {
let (zone, setZoneBase) = React.useState(_ => UserTimeZoneTypes.IST)
let setZo... | 115 | 10,166 |
hyperswitch-control-center | src/context/TokenContextProvider.res | .res | let defaultTokenSetter = _ => ()
let defaultDictSetter = _ => ()
type tokenContextObjectType = {
token: option<string>,
setToken: (option<string> => option<string>) => unit,
tokenDetailsDict: Dict.t<JSON.t>,
setTokenDetailsDict: (Dict.t<JSON.t> => Dict.t<JSON.t>) => unit,
parentAuthInfo: option<AuthProviderT... | 336 | 10,167 |
hyperswitch-control-center | src/context/DateFormatProvider.res | .res | let defaultValue = "MMM DD, YYYY hh:mm A"
let dateFormatContext = React.createContext(defaultValue)
@live
let make = React.Context.provider(dateFormatContext)
| 35 | 10,168 |
hyperswitch-control-center | src/context/DatatableContext.res | .res | let defaultValue: Dict.t<array<JSON.t>> = Dict.make()
let setDefaultValue: (string, array<JSON.t>) => unit = (_string, _arr) => ()
let datatableContext = React.createContext((defaultValue, setDefaultValue))
let make = React.Context.provider(datatableContext)
| 61 | 10,169 |
hyperswitch-control-center | src/context/ChartContext.res | .res | open AnalyticsTypesUtils
open Promise
open LogicUtils
type chartComponent = {
topChartData: option<dataState<JSON.t>>,
bottomChartData: option<dataState<JSON.t>>,
topChartLegendData: option<dataState<JSON.t>>,
bottomChartLegendData: option<dataState<JSON.t>>,
setTopChartVisible: (bool => bool) => unit,
set... | 8,362 | 10,170 |
hyperswitch-control-center | src/context/LoadedTableContext.res | .res | type infoData
external toInfoData: 'a => array<Nullable.t<infoData>> = "%identity"
let arr: array<Nullable.t<infoData>> = []
let loadedTableContext = React.createContext(arr)
let make = React.Context.provider(loadedTableContext)
| 58 | 10,171 |
hyperswitch-control-center | src/context/MatchMedia.res | .res | let useMatchMedia = mediaQuery => {
let mediaQueryList = React.useMemo(() => {
Window.matchMedia(mediaQuery)
}, [mediaQuery])
let (isMatched, setIsMatched) = React.useState(_ => {
mediaQueryList.matches
})
React.useEffect(() => {
let screenTest = (ev: Window.MatchMedia.matchEvent) => {
let... | 183 | 10,172 |
hyperswitch-control-center | src/Interface/ConnectorInterface/ConnectorInterfaceUtils.res | .res | open ConnectorTypes
open LogicUtils
let connectorAuthTypeMapper = (str): connectorAuthType => {
switch str->String.toLowerCase {
| "headerkey" => HeaderKey
| "bodykey" => BodyKey
| "signaturekey" => SignatureKey
| "multiauthkey" => MultiAuthKey
| "currencyauthkey" => CurrencyAuthKey
| "certificateauth" =>... | 2,489 | 10,173 |
hyperswitch-control-center | src/Interface/ConnectorInterface/ConnectorInterface.res | .res | open ConnectorTypes
open ConnectorInterfaceUtils
// Interface
module type ConnectorInterface = {
type mapperInput
type mapperOutput
type filterCriteria
type input
type output
let mapDictToConnectorPayload: mapperInput => mapperOutput
let mapJsonArrayToConnectorPayloads: (JSON.t, filterCriteria) => array<... | 1,220 | 10,174 |
hyperswitch-control-center | src/hooks/DateRefreshHooks.res | .res | open DayJs
open DateRangeUtils
let useConstructQueryOnBasisOfOpt = () => {
let customTimezoneToISOString = TimeZoneHook.useCustomTimeZoneToIsoString()
let isoStringToCustomTimeZone = TimeZoneHook.useIsoStringToCustomTimeZone()
let isoStringToCustomTimezoneInFloat = TimeZoneHook.useIsoStringToCustomTimeZoneInFloat... | 707 | 10,175 |
hyperswitch-control-center | src/hooks/OutsideClick.res | .res | external ffToDomType: Dom.eventTarget => Dom.node_like<'a> = "%identity"
external ffToWebDom: Nullable.t<Dom.element> => Nullable.t<Webapi.Dom.Element.t> = "%identity"
type ref =
| ArrayOfRef(array<React.ref<Nullable.t<Dom.element>>>)
| RefArray(React.ref<array<Nullable.t<Dom.element>>>)
let useOutsideClick = (
... | 566 | 10,176 |
hyperswitch-control-center | src/hooks/PopUpState.res | .res | type popUpType = Success | Primary | Secondary | Danger | Warning | Denied
type iconType = WithIcon | WithoutIcon
type popUpSize = Small | Large
type popupAction = {
text: string,
icon?: Button.iconType,
onClick?: ReactEvent.Mouse.t => unit,
}
type popUpProps = {
heading: string,
description: React.element,... | 224 | 10,177 |
hyperswitch-control-center | src/hooks/SnackBarState.res | .res | type snackbarType =
| General
| Success
| Error
| Warning
| Information
type snackbarProps = {
snackbarKey: string,
heading: string,
body: string,
snackbarType: snackbarType,
actionElement: React.element,
onClose?: unit => unit,
}
let defaultOpenSnackbar: array<snackbarProps> = []
let openSnack... | 154 | 10,178 |
hyperswitch-control-center | src/hooks/ApiProgressHooks.res | .res | let pendingRequestCount = Recoil.atom("pendingRequestCount", 0)
| 16 | 10,179 |
hyperswitch-control-center | src/hooks/ToastState.res | .res | type toastType =
| ToastError
| ToastWarning
| ToastInfo
| ToastSuccess
type toastProps = {
toastKey: string,
message: string,
toastType: toastType,
autoClose: bool,
toastDuration: int,
buttonText?: string,
helpLink?: string,
toastElement: React.element,
}
let randomString = (length, chars) =>... | 514 | 10,180 |
hyperswitch-control-center | src/hooks/AuthHooks.res | .res | type contentType = Headers(string) | Unknown
let headersForXFeature = (~uri, ~headers) => {
if (
uri->String.includes("lottie-files") ||
uri->String.includes("config/merchant") ||
uri->String.includes("config/feature")
) {
headers->Dict.set("Content-Type", `application/json`)
} else {
headers... | 983 | 10,181 |
hyperswitch-control-center | src/hooks/ModalsState.res | .res | type hideModalFn = unit => unit
type modalProps = {
title: string,
getContent: hideModalFn => React.element,
closeOnClickOutside: bool,
}
let defaultOpenModals: array<modalProps> = []
let openModals = Recoil.atom("openModals", defaultOpenModals)
| 68 | 10,182 |
hyperswitch-control-center | src/hooks/TimeZoneHook.res | .res | type dateTimeString = {
year: string,
month: string,
date: string,
hour: string,
minute: string,
second: string,
}
type dateTimeFloat = {
year: float,
month: float,
date: float,
hour: float,
minute: float,
second: float,
}
let formatter = str => {
let strLen = str->String.length
strLen == 0... | 1,567 | 10,183 |
hyperswitch-control-center | src/Recoils/TableAtoms.res | .res | let historyDefaultCols = Recoil.atom("hyperSwitchHistoryDefaultCols", HistoryEntity.defaultColumns)
let refundsMapDefaultCols = Recoil.atom("refundsMapDefaultCols", RefundEntity.defaultColumns)
let payoutsMapDefaultCols = Recoil.atom("payoutsMapDefaultCols", PayoutsEntity.defaultColumns)
let ordersMapDefaultCols = R... | 236 | 10,184 |
hyperswitch-control-center | src/Recoils/HyperswitchAtom.res | .res | type accessMapping = {
groups: Map.t<UserManagementTypes.groupAccessType, CommonAuthTypes.authorization>,
resources: Map.t<UserManagementTypes.resourceAccessType, CommonAuthTypes.authorization>,
}
let ompDefaultValue: OMPSwitchTypes.ompListTypes = {id: "", name: ""}
let merchantDetailsValueAtom: Recoil.recoilAtom<H... | 651 | 10,185 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingApp/IntelligentRoutingSidebarValues.res | .res | open SidebarTypes
let intelligentRoutingHome = {
Link({
name: "Configuration",
link: `/v2/dynamic-routing`,
icon: "nd-overview",
access: Access,
searchOptions: [("Intelligent Routing home", ""), ("Intelligent Routing configuration", "")],
selectedIcon: "nd-overview-fill",
})
}
let intellig... | 89 | 10,186 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingApp/IntelligentRoutingApp.res | .res | @react.component
let make = () => {
let url = RescriptReactRouter.useUrl()
{
switch url.path->HSwitchUtils.urlPath {
| list{"v2", "dynamic-routing"} => <IntelligentRoutingHome />
| list{"v2", "dynamic-routing", "home"} => <IntelligentRoutingConfiguration />
| list{"v2", "dynamic-routing", "dashboar... | 106 | 10,187 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingHelper.res | .res | open IntelligentRoutingTypes
let defaultTimeRange = {minDate: "", maxDate: ""}
let simulatorBanner =
<div
className="absolute z-10 top-76-px left-0 w-full py-4 px-10 bg-orange-50 flex justify-between items-center">
<div className="flex gap-4 items-center">
<Icon name="nd-information-triangle" size=24 /... | 4,137 | 10,188 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingReviewFieldsEntity.res | .res | open IntelligentRoutingTypes
open LogicUtils
let defaultColumns = [FileName, TotalAmount, NumberOfTransaction, Processors, PaymentMethodTypes]
let allColumns = [FileName, TotalAmount, NumberOfTransaction, Processors, PaymentMethodTypes]
let getHeading = colType => {
switch colType {
| NumberOfTransaction => Tabl... | 404 | 10,189 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingTransactionsEntity.res | .res | open LogicUtils
open IntelligentRoutingTypes
type cols =
| PaymentID
| PaymentMethodType
| TxnAmount
| Status
| CardNetwork
| ActualGateway
| SuggestedGateway
| SuccessRateUplift
| CreatedAt
let defaultColumns = [
PaymentID,
PaymentMethodType,
CardNetwork,
TxnAmount,
Status,
ActualGatewa... | 1,069 | 10,190 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingStatsResponse.res | .res | let response = {
"overall_success_rate": {
"baseline": 90.32,
"model": 99.96,
},
"total_failed_payments": {
"baseline": 2904,
"model": 12,
},
"total_revenue": {
"baseline": 8359285.0,
"model": 9621580.0,
},
"faar": {
"baseline": 94.31,
"model": 99.94,
},
"time_series_da... | 3,741 | 10,191 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingAnalytics.res | .res | module GetProductionAccess = {
@react.component
let make = () => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let {isProdIntentCompleted, setShowProdIntentForm} = React.useContext(
GlobalProvider.defaultContext,
)
let isProdIntent = isProdIntentCompleted->Option.getOr(false)
let produ... | 3,791 | 10,192 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingUtils.res | .res | open VerticalStepIndicatorTypes
open IntelligentRoutingTypes
let dataSource = [Historical, Realtime]
let fileTypes = [Sample, Upload]
let realtime = [StreamLive]
let dataTypeVariantToString = dataType =>
switch dataType {
| Historical => "Historical Data"
| Realtime => "Realtime Data"
}
let sections = [
{... | 1,176 | 10,193 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingConfiguration.res | .res | module Review = {
@react.component
let make = (~reviewFields, ~isUpload=false) => {
open IntelligentRoutingReviewFieldsEntity
open APIUtils
open LogicUtils
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let showToast = ToastState.useShowToast()
let mixpanelEvent = Mixpane... | 2,252 | 10,194 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingTypes.res | .res | type timeRange = {
minDate: string,
maxDate: string,
}
type dataType = Historical | Realtime
type file = Sample | Upload
type realtime = StreamLive
type reviewFieldsColsType =
| NumberOfTransaction
| TotalAmount
| FileName
| Processors
| PaymentMethodTypes
type reviewFields = {
total: int,
total_am... | 340 | 10,195 |
hyperswitch-control-center | src/IntelligentRouting/IntelligentRoutingScreens/IntelligentRoutingHome.res | .res | @react.component
let make = () => {
let {setCreateNewMerchant, activeProduct} = React.useContext(
ProductSelectionProvider.defaultContext,
)
let userHasCreateMerchantAccess = OMPCreateAccessHook.useOMPCreateAccessHook([
#tenant_admin,
#org_admin,
])
let mixpanelEvent = MixpanelHook.useSendEvent()
... | 455 | 10,196 |
hyperswitch-control-center | src/mockData/TimeZoneData.res | .res | open UserTimeZoneTypes
let getTimeZoneData = timeZoneType => {
switch timeZoneType {
| GMT => {
offset: "+00:00",
region: "Africa/Abidjan",
title: "GMT",
}
| EAT => {
offset: "+03:00",
region: "Africa/Addis_Ababa",
title: "EAT",
}
| CET => {
offset: "+01:00",
... | 1,446 | 10,197 |
hyperswitch-control-center | cypress/start_hyperswitch.sh | .sh | #!/bin/bash
git clone --depth 1 https://github.com/juspay/hyperswitch
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# Navigate to the cloned directory
cd hyperswitch
sed 's|juspaydotin/hyperswitch-router:standalone|juspayd... | 308 | 10,198 |
hyperswitch-control-center | cypress/e2e/start.cy.js | .js | describe("template spec", () => {
it("passes", () => {
cy.visit("/");
cy.contains("Hey there,").should("be.visible");
});
});
| 36 | 10,199 |
hyperswitch-control-center | cypress/e2e/9-profile/profile.cy.js | .js | 0 | 10,200 | |
hyperswitch-control-center | cypress/e2e/1-auth/auth.cy.js | .js | import * as helper from "../../support/helper";
import SignInPage from "../../support/pages/auth/SignInPage";
import SignUpPage from "../../support/pages/auth/SignUpPage";
import ResetPasswordPage from "../../support/pages/auth/ResetPasswordPage";
import { reset } from "mixpanel-browser";
const signinPage = new SignIn... | 3,326 | 10,201 |
hyperswitch-control-center | cypress/e2e/5-analytics/PerformanceMonitor.cy.js | .js | 0 | 10,202 | |
hyperswitch-control-center | cypress/e2e/8-settings/users.cy.js | .js | import * as helper from "../../support/helper";
import HomePage from "../../support/pages/homepage/HomePage";
const homePage = new HomePage();
beforeEach(function () {
const email = helper.generateUniqueEmail();
cy.visit_signupPage();
cy.sign_up_with_email(email, Cypress.env("CYPRESS_PASSWORD"));
cy.url().sho... | 373 | 10,203 |
hyperswitch-control-center | cypress/e2e/4-connectors/connector.cy.js | .js | describe("connector", () => {
const password = Cypress.env("CYPRESS_PASSWORD");
const username = `cypress${Math.round(+new Date() / 1000)}@gmail.com`;
const getIframeBody = () => {
return cy
.get("iframe")
.its("0.contentDocument.body")
.should("not.be.empty")
.then(cy.wrap);
};
... | 2,565 | 10,204 |
hyperswitch-control-center | cypress/e2e/2-homepage/homepage.cy.js | .js | import * as helper from "../../support/helper";
import SignInPage from "../../support/pages/auth/SignInPage";
import SignUpPage from "../../support/pages/auth/SignUpPage";
const signinPage = new SignInPage();
const signupPage = new SignUpPage();
describe("Sign up", () => {
let email = "";
// check if the permiss... | 526 | 10,205 |
hyperswitch-control-center | cypress/e2e/7-developers/PaymentSettings.cy.js | .js | 0 | 10,206 | |
hyperswitch-control-center | cypress/e2e/6-workflow/PaymentRouting.cy.js | .js | import * as helper from "../../support/helper";
import SignInPage from "../../support/pages/auth/SignInPage";
import HomePage from "../../support/pages/homepage/HomePage";
import PaymentRouting from "../../support/pages/workflow/paymentRouting/PaymentRouting";
import DefaultFallback from "../../support/pages/workflow/p... | 1,710 | 10,207 |
hyperswitch-control-center | cypress/e2e/3-operations/paymentOperations.cy.js | .js | import * as helper from "../../support/helper";
import HomePage from "../../support/pages/homepage/HomePage";
import PaymentOperations from "../../support/pages/operations/PaymentOperations";
const homePage = new HomePage();
const paymentOperations = new PaymentOperations();
beforeEach(function () {
const email = h... | 2,469 | 10,208 |
hyperswitch-control-center | cypress/support/e2e.js | .js | // ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// auto... | 131 | 10,209 |
hyperswitch-control-center | cypress/support/permissions.js | .js | // Define roles and permissions for each section
export const rolePermissions = {
admin: {
operations: "write",
connectors: "write",
analytics: "read",
workflows: "write",
reconOps: "write",
reconReports: "write",
users: "write",
account: "write",
},
customer_support: {
operati... | 952 | 10,210 |
hyperswitch-control-center | cypress/support/helper.js | .js | module.exports = { generateUniqueEmail, generateDateTimeString };
function generateUniqueEmail() {
const email = `cypress+org_admin_${Math.floor(new Date().getTime() / 1000)}@test.com`;
return email;
}
function generateDateTimeString() {
const now = new Date();
return now
.toISOString()
.replace(/[-:.... | 95 | 10,211 |
hyperswitch-control-center | cypress/support/commands.js | .js | // ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***************************... | 4,247 | 10,212 |
hyperswitch-control-center | cypress/support/pages/homepage/HomePage.js | .js | class HomePage {
// Onboarding
get enterMerchantName() {
return cy.get('[name="merchant_name"]');
}
get onboardingSubmitButton() {
return cy.get('[data-button-for="startExploring"]');
}
get orgDropdown() {
return cy.get();
}
get merchantDropdown() {
return cy.get();
}
get profile... | 290 | 10,213 |
hyperswitch-control-center | cypress/support/pages/workflow/paymentRouting/VolumeBasedConfiguration.js | .js | class VolumeBasedConfiguration {
get connectorDropdown() {
return cy.get(`[data-value="addProcessors"]`);
}
}
export default VolumeBasedConfiguration;
| 34 | 10,214 |
hyperswitch-control-center | cypress/support/pages/workflow/paymentRouting/DefaultFallback.js | .js | class DefaultFallback {
get defaultFallbackList() {
return cy.get('[class="flex flex-col w-full"]');
}
get saveChangesButton() {
return cy.get('data-button-for="saveChanges"');
}
}
export default DefaultFallback;
| 55 | 10,215 |
hyperswitch-control-center | cypress/support/pages/workflow/paymentRouting/PaymentRouting.js | .js | class PaymentRouting {
//
get volumeBasedRoutingSetupButton() {
return cy.get('[data-button-for="setup"]').eq(0);
}
get volumeBasedRoutingHeader() {
return cy.get('[class="flex items-center gap-4"]');
}
get ruleBasedRoutingSetupButton() {
return cy.get('[data-button-for="setup"]').eq(1);
}
... | 109 | 10,216 |
hyperswitch-control-center | cypress/support/pages/operations/PaymentOperations.js | .js | class PaymentOperations {
get searchBox() {
return cy.get(`[name="name"]`);
}
get dateSelector() {
return cy.get(`[data-testid="date-range-selector"]`);
}
get viewDropdown() {
return cy.get(`[class="flex h-fit rounded-lg hover:bg-opacity-80"]`);
}
get addFilters() {
return cy.get(`[data... | 144 | 10,217 |
hyperswitch-control-center | cypress/support/pages/auth/ResetPasswordPage.js | .js | class ResetPasswordPage {
get createPassword() {
return cy.get('[name="create_password"]');
}
get confirmPassword() {
return cy.get('[data-testid="comfirm_password"]').children().eq(1);
}
get eyeIcon() {
return cy.get('[data-icon="eye-slash"]');
}
get confirmButton() {
return cy.get('[d... | 137 | 10,218 |
hyperswitch-control-center | cypress/support/pages/auth/SignUpPage.js | .js | class SignUpPage {
get headerText() {
return cy.get('[data-testid="card-header"]');
}
get signInLink() {
return cy.get('[data-testid="card-subtitle"]');
}
get emailInput() {
return cy.get('[data-testid="email"]').children().first();
}
get passwordInput() {
return cy.get('[data-testid="p... | 195 | 10,219 |
hyperswitch-control-center | cypress/support/pages/auth/SignInPage.js | .js | class SignInPage {
get emailInput() {
return cy.get('[data-testid="email"]');
}
get passwordInput() {
return cy.get('[data-testid="password"]');
}
get signinButton() {
return cy.get('[data-button-for="continue"]');
}
get signUpLink() {
return cy.get("#card-subtitle");
}
get headerT... | 432 | 10,220 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.