repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 30
values | content stringlengths 0 5.21M | token_count int64 0 3.8M |
|---|---|---|---|---|
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodsTypes.res | .res | type psp_tokens = {
mca_id: string,
connector: string,
status: string,
tokentype: string,
token: string,
}
type psp_tokensization = {psp_token: array<psp_tokens>}
type paymentMethodCardType = {
issuer_country: string,
last4_digits: string,
expiry_month: string,
expiry_year: string,
card_holder_nam... | 349 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomerSummary.res | .res | module DisplayKeyValueParams = {
@react.component
let make = (
~showTitle: bool=true,
~heading: Table.header,
~value: Table.cell,
~isInHeader=false,
~isHorizontal=false,
~customMoneyStyle="",
~labelMargin="",
~customDateStyle="",
~wordBreak=true,
~textColor="",
~overiddin... | 2,318 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodUtils.res | .res | type status = Enabled | Disabled
type connectorTokenStatus = Active | Inactive
let statusToVariantMapper = (status: string) => {
switch status {
| "ENABLED" => Enabled
| "DISABLED" => Disabled
| _ => Disabled
}
}
let connectrTokensStatusToVariantMapper = (connectorTokenStatus: string) => {
switch connect... | 115 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomersType.res | .res | type customers = {
id: string,
name: string,
email: string,
phone: string,
phone_country_code: string,
description: string,
address: string,
created_at: string,
metadata: JSON.t,
}
type customersColsType =
| CustomerId
| Name
| Email
| Phone
| PhoneCountryCode
| Address
| CreatedAt
typ... | 111 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultNetworkTokensEntity.res | .res | open VaultPaymentMethodDetailsTypes
open LogicUtils
type networkTokenColsTypes =
| Token
| CardNetwork
let defaultColumns = [Token, CardNetwork]
let getHeading = colType => {
switch colType {
| Token => Table.makeHeaderInfo(~key="token", ~title="Token")
| CardNetwork => Table.makeHeaderInfo(~key="card_netw... | 181 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConnectorUtils.res | .res | let connectorListForVault: array<ConnectorTypes.connectorTypes> = [Processors(STRIPE)]
| 21 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultNetworkTokenisation.res | .res | @react.component
let make = () => {
let (toggleState, setToggleState) = React.useState(_ => false)
<div className="mt-10 flex flex-col gap-2">
<div className="flex flex-row justify-between items-center">
<p className="font-semibold text-lg text-nd_gray-600">
{"Network Tokenization"->React.string... | 319 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultProceesorReview.res | .res | @react.component
let make = (~connectorInfo) => {
open CommonAuthHooks
open LogicUtils
let {setShowSideBar} = React.useContext(GlobalProvider.defaultContext)
let connectorInfodict = ConnectorInterface.mapDictToConnectorPayload(
ConnectorInterface.connectorInterfaceV2,
connectorInfo->LogicUtils.getDictF... | 774 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultProcessorList.res | .res | @react.component
let make = () => {
let (configuredConnectors, setConfiguredConnectors) = React.useState(_ => [])
let (filteredConnectorData, setFilteredConnectorData) = React.useState(_ => [])
let connectorListFromRecoil = ConnectorInterface.useConnectorArrayMapper(
~interface=ConnectorInterface.connectorInt... | 602 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConfiguration.res | .res | @react.component
let make = () => {
let (tabIndex, setTabIndex) = React.useState(_ => 0)
let setCurrentTabName = Recoil.useSetRecoilState(HyperswitchAtom.currentTabNameRecoilAtom)
let {setShowSideBar} = React.useContext(GlobalProvider.defaultContext)
let vaultPspTokenizationTabElement = {
<div className="f... | 788 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConnectorHelper.res | .res | module VaultRequestProcessorCard = {
@react.component
let make = () => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let handleClick = () => {
mixpanelEvent(~eventName="vault_request_processor")
"https://hyperswitch-io.slack.com/?redir=%2Fssb%2Fredirect"->Window._open
}
<div
cl... | 226 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConnectorEntity.res | .res | open ConnectorTypes
let getPreviouslyConnectedList: JSON.t => array<connectorPayloadV2> = json => {
let data = ConnectorInterface.mapJsonArrayToConnectorPayloads(
ConnectorInterface.connectorInterfaceV2,
json,
PaymentProcessor,
)
data
}
type colType =
| Name
| Status
| Disabled
| Actions
| P... | 881 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultProcessorCards.res | .res | let p1MediumTextStyle = HSwitchUtils.getTextClass((P1, Medium))
module RequestConnector = {
@react.component
let make = (~connectorList, ~setShowModal) => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let handleClick = () => {
mixpanelEvent(~eventName="vault_request_processor")
setShowModa... | 1,462 |
hyperswitch-control-center | src/Vault/VaultApp/VaultApp.res | .res | @react.component
let make = () => {
let url = RescriptReactRouter.useUrl()
{
switch url.path->HSwitchUtils.urlPath {
| list{"v2", "vault"} => <VaultHome />
| list{"v2", "vault", "home"} => <VaultDefaultHome />
| list{"v2", "vault", "onboarding", ..._} | list{"v2", "vault", "customers-tokens", ..._}... | 120 |
hyperswitch-control-center | src/Vault/VaultApp/VaultSidebarValues.res | .res | open SidebarTypes
let vaultConfiguration = {
Link({
name: "Configuration",
link: `/v2/vault/onboarding`,
icon: "nd-overview",
access: Access,
searchOptions: [("Vault configuration", "")],
selectedIcon: "nd-overview-fill",
})
}
let vaultCustomersAndTokens = {
Link({
name: "Customers &... | 216 |
hyperswitch-control-center | src/UIConifg/UIConfig.res | .res | module ButtonConfig = {
type borderRadius = {
default: string,
defaultPagination: string,
}
type textColor = {
primaryOutline: string,
primaryNormal: string,
primaryDisabled: string,
secondaryNormal: string,
secondaryLoading: string,
secondaryDisabled: string,
secondaryNoBorder... | 1,717 |
hyperswitch-control-center | src/server/config.mjs | .mjs | import * as Fs from "fs";
import toml from "@iarna/toml";
// Helper function for error handling
const errorHandler = (res, errorMessage = "something went wrong") => {
res.writeHead(500, { "Content-Type": "text/plain" });
console.error(errorMessage);
res.end("Internal Server Error");
};
// Update config with env... | 1,292 |
hyperswitch-control-center | src/server/NodeJs.res | .res | type promisifyable
type execResponse
type promiseableExecFile = (string, array<string>) => Promise.t<execResponse>
module Util = {
@module("util")
external promisify: promisifyable => promiseableExecFile = "promisify"
}
module ChildProcess = {
@module("child_process")
external execFile: promisifyable = "execF... | 365 |
hyperswitch-control-center | src/server/Server.res | .res | @val @scope("process")
external env: Dict.t<string> = "env"
let appName = Some("hyperswitch")
let serverPath = "dist/hyperswitch"
let port = 9000
open NodeJs
@module("./config.mjs")
external configHandler: (Http.request, Http.response, bool, string, string) => unit =
"configHandler"
@module("./config.mjs")
exter... | 1,261 |
hyperswitch-control-center | src/server/health.mjs | .mjs | import * as Fs from "fs";
const errorHandler = (res, result) => {
res.writeHead(500, { "Content-Type": "application/json" });
res.write(JSON.stringify(result));
res.end();
};
let checkHealth = async (res) => {
let output = {
env_config: false,
app_file: false,
wasm_file: false,
};
try {
let... | 362 |
hyperswitch-control-center | src/entities/EntityType.res | .res | type initialFilters<'t> = {
field: FormRenderer.fieldInfoType,
localFilter: option<(array<Nullable.t<'t>>, JSON.t) => array<Nullable.t<'t>>>,
}
type optionType<'t> = {
urlKey: string,
field: FormRenderer.fieldInfoType,
parser: JSON.t => JSON.t,
localFilter: option<(array<Nullable.t<'t>>, JSON.t) => array<Nu... | 1,002 |
hyperswitch-control-center | src/utils/GlobalVars.res | .res | @val external appVersion: string = "appVersion"
type appName = [
| #hyperswitch
]
type appEnv = [#production | #sandbox | #integration | #development]
let isLocalhost =
Window.Location.hostname === "localhost" || Window.Location.hostname === "127.0.0.1"
let dashboardPrefix = "dashboard"
let dashboardBasePath = ... | 463 |
hyperswitch-control-center | src/utils/AccessControl.res | .res | open CommonAuthTypes
@react.component
let make = (~isEnabled=true, ~authorization, ~children) => {
let isAccessAllowed = authorization === Access
isEnabled && isAccessAllowed ? children : <UnauthorizedPage />
}
| 48 |
hyperswitch-control-center | src/utils/MapTypes.res | .res | type rec map = {entries: unit => map}
@new external create: 't => map = "Map"
type object = {fromEntries: map => JSON.t}
external object: object = "Object"
| 44 |
hyperswitch-control-center | src/utils/DateTimeUtils.res | .res | type days = Sunday | Monday | Tuesday | Wednesday | Thrusday | Friday | Saturday
let daysArr = [Sunday, Monday, Tuesday, Wednesday, Thrusday, Friday, Saturday]
let dayMapper = (days: days) => {
switch days {
| Sunday => "Sunday"
| Monday => "Monday"
| Tuesday => "Tuesda"
| Wednesday => "Wednesday"
| Thrus... | 1,863 |
hyperswitch-control-center | src/utils/ModalCloseIcon.res | .res | @react.component
let make = (~fill="#7c7d82", ~onClick) => {
<AddDataAttributes attributes=[("data-component", `modalCloseIcon`)]>
<div className="" onClick>
<Icon name="close" className="border-2 p-2 rounded-2xl bg-gray-100 cursor-pointer" size=30 />
</div>
</AddDataAttributes>
}
| 91 |
hyperswitch-control-center | src/utils/Identity.res | .res | external formReactEventToString: ReactEvent.Form.t => string = "%identity"
external stringToFormReactEvent: string => ReactEvent.Form.t = "%identity"
external anyTypeToReactEvent: 'a => ReactEvent.Form.t = "%identity"
external arrofStringToReactEvent: array<string> => ReactEvent.Form.t = "%identity"
external jsonToNull... | 350 |
hyperswitch-control-center | src/utils/ModalUtils.res | .res | let getHeaderTextClass = _ => "text-lg font-semibold leading-6"
let getAnimationClass = showModal =>
switch showModal {
| true => "animate-slideUp animate-fadeIn"
| _ => ""
}
let getCloseIcon = onClick => {
<Icon name="modal-close-icon" className="cursor-pointer" size=30 onClick />
}
| 76 |
hyperswitch-control-center | src/utils/CurrencyUtils.res | .res | type currencyCode =
| AED
| ALL
| AMD
| ANG
| ARS
| AUD
| AWG
| AZN
| BBD
| BDT
| BHD
| BMD
| BND
| BOB
| BRL
| BSD
| BWP
| BZD
| CAD
| CHF
| COP
| CRC
| CUP
| CZK
| DKK
| DOP
| DZD
| EGP
| ETB
| EUR
| FJD
| GBP
| GHS
| GIP
| GMD
| GTQ
| GYD
| ... | 4,929 |
hyperswitch-control-center | src/utils/AnalyticsNewUtils.res | .res | open DateTimeUtils
open LogicUtils
type timeZone = UTC | IST
let calculateHistoricTime = (
~startTime: string,
~endTime: string,
~format: string="YYYY-MM-DDTHH:mm:ss[Z]",
~timeZone: timeZone=UTC,
) => {
let toUtc = switch timeZone {
| UTC => toUtc
| IST => val => val
}
if startTime->LogicUtils.isNonEm... | 3,767 |
hyperswitch-control-center | src/utils/Modal.resi | .resi | type modalData = {heading: string, content: React.element}
module ModalHeading: {
@react.component
let make: (
~headingClass: string,
~headerTextClass: string,
~headerAlignmentClass: string,
~modalHeading: string,
~showCloseIcon: bool,
~showCloseOnLeft: bool,
~showBackIcon: bool,
~le... | 791 |
hyperswitch-control-center | src/utils/CurrencyFormatUtils.res | .res | type currencyFormat =
| IND
| USD
| DefaultConvert
| 17 |
hyperswitch-control-center | src/utils/UrlFetchUtils.res | .res | let getFilterValue = value => {
if String.includes(value, "[") {
let str = String.slice(~start=1, ~end=value->String.length - 1, value)
let splitArray = String.split(str, ",")
let jsonarr = splitArray->Array.map(val => JSON.Encode.string(val))
JSON.Encode.array(jsonarr)
} else {
JSON.Encode.stri... | 88 |
hyperswitch-control-center | src/utils/ArrayUtils.res | .res | let getUniqueStrArray = (arr: array<string>) => {
arr
->Array.map(item => {
(item, 0)
})
->Dict.fromArray
->Dict.keysToArray
}
| 46 |
hyperswitch-control-center | src/utils/DownloadUtils.res | .res | type blobInstanceType
@new
external blob: (array<'a>, {"type": string}) => blobInstanceType = "Blob"
@val @scope(("window", "URL"))
external createObjectURL: blobInstanceType => string = "createObjectURL"
@send
external clickElement: Dom.element => unit = "click"
let download = (~fileName, ~content, ~fileType) => {
... | 203 |
hyperswitch-control-center | src/utils/BreadCrumbNavigation.res | .res | type breadcrumb = {
title: string,
link: string,
onClick?: ReactEvent.Mouse.t => unit,
warning?: string,
mixPanelCustomString?: string,
}
let arrowDivider =
<span className="ml-2 mr-2">
<Icon className="align-middle text-jp-gray-930" size=8 name="chevron-right" />
</span>
type dividerVal =
| Slash
... | 900 |
hyperswitch-control-center | src/utils/UserTimeZoneTypes.res | .res | type timezoneData = {
offset: string,
region: string,
title: string,
}
type timeZoneType =
| GMT
| EAT
| CET
| WAT
| CAT
| EET
| CEST
| SAST
| HDT
| AKDT
| AST
| EST
| CDT
| CST
| MDT
| MST
| EDT
| ADT
| PDT
| NDT
| AEST
| NZST
| EEST
| HKT
| WIB
| WIT
| IDT
... | 258 |
hyperswitch-control-center | src/utils/DateRangeUtils.res | .res | type customDateRange =
| Today
| Tomorrow
| Yesterday
| ThisMonth
| LastMonth
| LastSixMonths
| NextMonth
| Hour(float)
| Day(float)
type compareOption =
| No_Comparison
| Previous_Period
| Custom
@unboxed
type comparison =
| EnableComparison
| DisableComparison
let comparisonMapprer = val ... | 3,280 |
hyperswitch-control-center | src/utils/UseEvent.res | .res | let useEvent0 = callback => {
let callbackRef = React.useRef(callback)
React.useEffect(() => {
callbackRef.current = callback
None
}, [callback])
React.useCallback(() => {
callbackRef.current()
}, [])
}
| 56 |
hyperswitch-control-center | src/utils/LazyUtils.res | .res | type lazyScreen
type lazyScreenLoader = unit => promise<lazyScreen>
@val
external import_: string => promise<lazyScreen> = "import"
type reactLazy<'component> = lazyScreenLoader => 'component
@module("react") @val
external reactLazy: reactLazy<'a> = "lazy"
| 68 |
hyperswitch-control-center | src/utils/DOMUtils.res | .res | type document = {mutable title: string}
type window = {mutable _env_: HyperSwitchConfigTypes.urlConfig}
@val external document: document = "document"
@send external getElementById: (document, string) => Dom.element = "getElementById"
@send external createElement: (document, string) => Dom.element = "createElement"
@val... | 299 |
hyperswitch-control-center | src/utils/NumericUtils.res | .res | // Copied from https://gist.github.com/Frencil/aab561687cdd2b0de04a
let pretty = (range: array<float>, n: int) => {
if range->Array.length === 2 {
let range = if range[0] === range[1] {
[0., range[1]->Option.getOr(0.)]
} else {
range
}
let min_n = Int.toFloat(n) /. 3.
let shrink_sml ... | 639 |
hyperswitch-control-center | src/utils/FormDataUtils.res | .res | type formData
@new external formData: unit => Fetch.formData = "FormData"
@send external append: (Fetch.formData, string, 'a) => unit = "append"
| 36 |
hyperswitch-control-center | src/utils/UrlUtils.res | .res | let useGetFilterDictFromUrl = prefix => {
let url = RescriptReactRouter.useUrl()
let (searchParamsDict, setSearchParamDict) = React.useState(_ => Dict.make())
React.useEffect(() => {
if url.search->LogicUtils.isNonEmptyString {
let searcParamsToDict =
url.search
->decodeURI
->St... | 278 |
hyperswitch-control-center | src/utils/JsonFlattenUtils.res | .res | let rec flattenObject = (obj, addIndicatorForObject) => {
let newDict = Dict.make()
switch obj->JSON.Decode.object {
| Some(obj) =>
obj
->Dict.toArray
->Array.forEach(entry => {
let (key, value) = entry
if value->Identity.jsonToNullableJson->Js.Nullable.isNullable {
Dict.set(newDi... | 484 |
hyperswitch-control-center | src/utils/Modal.res | .res | open ModalUtils
type modalData = {
heading: string,
content: React.element,
}
module Back = {
@react.component
let make = (~onClick) => {
<Icon
size=18 name="chevron-left" className="cursor-pointer opacity-50 dark:opacity-100 " onClick
/>
}
}
module ModalHeading = {
@react.component
let m... | 2,467 |
hyperswitch-control-center | src/utils/Country.res | .res | type timezoneType = {
isoAlpha3: string,
timeZones: array<string>,
countryName: CountryUtils.countries,
isoAlpha2: CountryUtils.countiesCode,
}
let defaultTimeZone = {
isoAlpha3: "",
timeZones: [],
countryName: UnitedStatesOfAmerica,
isoAlpha2: US,
}
let country = [
{
isoAlpha3: "AFG",
timeZ... | 6,598 |
hyperswitch-control-center | src/utils/ResizeObserver.res | .res | type observer
type dimensions
@new external newResizerObserver: (array<dimensions> => unit) => observer = "ResizeObserver"
| 29 |
hyperswitch-control-center | src/utils/DictionaryUtils.res | .res | let deleteKey = (dictionary: Dict.t<'a>, key: string) => {
dictionary
->Dict.toArray
->Belt.Array.keepMap(entry => {
let (filterKey, _) = entry
key !== filterKey ? Some(entry) : None
})
->Dict.fromArray
}
let deleteKeys = (dictionary: Dict.t<'a>, keys: array<string>) => {
let updatedDict =
dict... | 751 |
hyperswitch-control-center | src/utils/LogicUtilsTypes.res | .res | type valueType =
| Amount
| Rate
| Volume
| Latency
| LatencyMs
| FormattedAmount
| AmountWithSuffix
| Default
| 42 |
hyperswitch-control-center | src/utils/Reveal.res | .res | type postion = Top | Right
| 8 |
hyperswitch-control-center | src/utils/LoaderModal.res | .res | @react.component
let make = (~showModal, ~setShowModal, ~text) => {
<RenderIf condition={showModal}>
<Modal
showModal
setShowModal
modalClass="w-80 !h-56 flex items-center justify-center m-auto"
paddingClass=""
childClass="flex items-center justify-center h-full w-full">
<div c... | 134 |
hyperswitch-control-center | src/utils/CountryUtils.res | .res | type countries =
| AlandIslands
| Albania
| Afghanistan
| Algeria
| AmericanSamoa
| Andorra
| Angola
| Anguilla
| Antarctica
| AntiguaAndBarbuda
| Argentina
| Armenia
| Aruba
| Australia
| Austria
| Azerbaijan
| Bahamas
| Bahrain
| Bangladesh
| Barbados
| Belarus
| Belgium
... | 16,889 |
hyperswitch-control-center | src/utils/IframeUtils.res | .res | @val external document: 'a = "document"
type window
type parent
@val external window: window = "window"
@val @scope("window") external iframeParent: parent = "parent"
type event = {data: string}
@get
external contentWindow: Dom.element => Dom.element = "contentWindow"
@send external postMessageToParent: (parent, JSON.... | 223 |
hyperswitch-control-center | src/utils/TimeZoneUtils.res | .res | let getUserTimeZoneString = () => {
Date.make()->Js.Date.toTimeString->String.split(" ")->Array.get(1)->Option.getOr("")
}
let getUserTimeZone = () => {
open UserTimeZoneTypes
let userTimeZone = getUserTimeZoneString()
switch userTimeZone {
| "GMT+0000" => GMT
| "GMT+0300" => EAT
| "GMT+0100" => CET
... | 367 |
hyperswitch-control-center | src/utils/PromiseUtils.res | .res | // Pollyfill for Promise.allSettled()
// Promise.allSettled() takes an iterable of promises and returns a single promise that is fulfilled with an array of promise settlement result
let allSettledPolyfill = (arr: array<promise<JSON.t>>) => {
arr
->Array.map(promise =>
promise
->Promise.then(val => {
... | 152 |
hyperswitch-control-center | src/utils/TimeZoneConversion.res | .res | type timeZoneObject = {timeZone: string}
@send external toLocaleString: (Date.t, string, timeZoneObject) => string = "toLocaleString"
type dateTime = {
year: float,
month: float,
date: float,
hour: float,
minute: float,
second: float,
}
let timezoneOffset = Dict.fromArray([("IST", "+05:30"), ("GMT", "+00:... | 400 |
hyperswitch-control-center | src/utils/AnalyticsTypesUtils.res | .res | type dataState<'a> = Loaded('a) | Loading | LoadedError
type metricsType =
| Latency
| Volume
| Rate
| Amount
| NegativeRate
type timeObj = {
apiStartTime: float,
apiEndTime: float,
}
| 61 |
hyperswitch-control-center | src/utils/UserPrefUtils.res | .res | open LogicUtils
type moduleVisePref = {
searchParams?: string,
moduleConfig?: Dict.t<JSON.t>, // we store array of string here
}
type userPref = {
lastVisitedTab?: string,
moduleVisePref?: Dict.t<moduleVisePref>,
}
external userPrefToJson: userPref => JSON.t = "%identity"
// DO NOT CHANGE THE KEYS
let userPre... | 629 |
hyperswitch-control-center | src/utils/RenderIf.res | .res | @react.component
let make = (~condition, ~children) => {
if condition {
children
} else {
React.null
}
}
| 33 |
hyperswitch-control-center | src/utils/LogicUtils.res | .res | let isEmptyString = str => str->String.length === 0
let isNonEmptyString = str => str->String.length > 0
let methodStr = (method: Fetch.requestMethod) => {
switch method {
| Get => "GET"
| Head => "HEAD"
| Post => "POST"
| Put => "PUT"
| Delete => "DELETE"
| Connect => "CONNECT"
| Options => "OPTIONS"... | 5,784 |
hyperswitch-control-center | src/utils/HyperSwitchUtils.res | .res | let getMixpanelRouteName = (pageTitle, url: RescriptReactRouter.url) => {
switch (url.path, url.search) {
| (list{"payments", ""}, _)
| (list{"refunds", ""}, _)
| (list{"disputes", ""}, _)
| (list{"connectors", ""}, _)
| (list{"routing", ""}, _)
| (list{"settings"}, "") =>
`/${pageTitle}`
| (list{"o... | 474 |
hyperswitch-control-center | src/utils/Form.res | .res | let defaultSubmit = (_, _) => {
Nullable.null->Promise.resolve
}
module FormBody = {
@react.component
let make = (~children, ~formClass, ~handleSubmit, ~submitOnEnter) => {
let form = ReactFinalForm.useForm()
let formRef = React.useRef(Nullable.null)
React.useEffect(() => {
let onKeyDown = (ev: ... | 377 |
hyperswitch-control-center | src/utils/Mappers/MerchantAccountDetailsMapper.res | .res | open HSwitchSettingTypes
let getMerchantDetails = (values: JSON.t) => {
open LogicUtils
let valuesDict = values->getDictFromJsonObject
let merchantDetails = valuesDict->getObj("merchant_details", Dict.make())
let address = merchantDetails->getObj("address", Dict.make())
let primary_business_details =
val... | 663 |
hyperswitch-control-center | src/utils/Mappers/GroupACLMapper.res | .res | open CommonAuthTypes
open UserManagementTypes
let mapGroupAccessTypeToString = groupAccessType =>
switch groupAccessType {
| OperationsView => "operations_view"
| OperationsManage => "operations_manage"
| ConnectorsView => "connectors_view"
| ConnectorsManage => "connectors_manage"
| WorkflowsView => "work... | 1,153 |
hyperswitch-control-center | src/utils/Mappers/BusinessProfileMapper.res | .res | open HSwitchSettingTypes
let constructWebhookDetailsObject = webhookDetailsDict => {
open LogicUtils
let webhookDetails = {
webhook_version: webhookDetailsDict->getOptionString("webhook_version"),
webhook_username: webhookDetailsDict->getOptionString("webhook_username"),
webhook_password: webhookDetail... | 799 |
hyperswitch-control-center | src/components/TimeInput.res | .res | let padNum = num => {
let str = num->Int.toString
if str->String.length === 1 {
`0${str}`
} else {
str
}
}
module OptionVals = {
@react.component
let make = (~upto=60, ~value, ~onChange, ~isDisabled) => {
let cursorClass = isDisabled ? "cursor-not-allowed" : ""
<select
value={value->In... | 727 |
hyperswitch-control-center | src/components/DynamicSingleStat.res | .res | type chartType = Default | Table
type singleStatData = {
title: string,
tooltipText: string,
deltaTooltipComponent: string => React.element,
value: float,
delta: float,
data: array<(float, float)>,
statType: string,
showDelta: bool,
label?: string,
}
type columnsType<'colType> = {
colType: 'colTyp... | 4,947 |
hyperswitch-control-center | src/components/CustomExpandableTable.res | .res | open Table
@react.component
let make = (
~title,
~heading=[],
~rows,
~offset=0,
~fullWidth=true,
~showScrollBar=false,
~setFilterObj=?,
~filterObj=?,
~onExpandIconClick,
~expandedRowIndexArray,
~getRowDetails,
~showSerial=false,
) => {
if showSerial {
heading->Array.unshift(makeHeaderInfo... | 1,330 |
hyperswitch-control-center | src/components/DesktopView.res | .res | @react.component
let make = (~children) => {
let isMobileView = MatchMedia.useMobileChecker()
<RenderIf condition={!isMobileView}> children </RenderIf>
}
| 40 |
hyperswitch-control-center | src/components/InfraCalendar.res | .res | type month = Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec
type highlighter = {
highlightSelf: bool,
highlightLeft: bool,
highlightRight: bool,
}
module TableRow = {
let defaultCellHighlighter = _ => {
highlightSelf: false,
highlightLeft: false,
highlightRight: false,
}
... | 2,470 |
hyperswitch-control-center | src/components/ACLDiv.res | .res | @react.component
let make = (
~authorization,
~onClick,
~children,
~className="",
~noAccessDescription=?,
~description=?,
~tooltipWidthClass=?,
~isRelative=?,
~showTooltip=true,
~contentAlign=?,
~justifyClass=?,
~tooltipForWidthClass=?,
~dataAttrStr=?,
~height=?,
) => {
switch showTooltip ... | 231 |
hyperswitch-control-center | src/components/DateRangeCompareFields.res | .res | let defaultCellHighlighter = (_): Calendar.highlighter => {
{
highlightSelf: false,
highlightLeft: false,
highlightRight: false,
}
}
let useErrorValueResetter = (value: string, setValue: (string => string) => unit) => {
React.useEffect(() => {
let isErroryTimeValue = _ => {
try {
fa... | 5,891 |
hyperswitch-control-center | src/components/DynamicFilter.res | .res | module CustomFilters = {
@react.component
let make = (
~setShowModal,
~tabNames,
~moduleName as _,
~setCustomFilter,
~currentFilterValue,
) => {
open LogicUtils
let (errMessage, setErrMessage) = React.useState(_ => "")
let (completionDisposable, setCompletionDisposable) = Recoil.u... | 1,820 |
hyperswitch-control-center | src/components/DatePicker.res | .res | @react.component
let make = (
~input: ReactFinalForm.fieldRenderPropsInput,
~isDisabled=false,
~disablePastDates=true,
~disableFutureDates=false,
~format="YYYY-MM-DDTHH:mm:ss",
~customButtonStyle="",
~newThemeCustomButtonStyle="",
~leftIcon=?,
~rightIcon=?,
~buttonType=?,
~buttonSize=?,
~customD... | 1,970 |
hyperswitch-control-center | src/components/Button.res | .res | type buttonState = Normal | Loading | Disabled | NoHover | Focused
type buttonVariant = Fit | Long | Full | Rounded
type buttonType =
| Primary
| Secondary
| PrimaryOutline
| SecondaryFilled
| NonFilled
| Pagination
| Pill
| FilterAdd
| Delete
| Transparent
| SelectTransparent
| DarkPurple
| ... | 6,444 |
hyperswitch-control-center | src/components/Table.res | .res | include TableUtils
module TableFilterRow = {
@react.component
let make = (
~item: array<filterRow>,
~removeVerticalLines,
~removeHorizontalLines,
~evenVertivalLines,
~tableDataBorderClass,
~customFilterRowStyle,
~showCheckbox,
) => {
let colsLen = item->Array.length
let borderC... | 7,352 |
hyperswitch-control-center | src/components/NoDataFound.res | .res | type renderType = InfoBox | Painting | NotFound | Locked | LoadError | ExtendDateUI
@react.component
let make = (
~title=?,
~message,
~renderType: renderType=InfoBox,
~children=?,
~customCssClass="my-6",
~customBorderClass="",
~customMessageCss="",
~handleClick=?,
) => {
let prefix = LogicUtils.useUr... | 1,173 |
hyperswitch-control-center | src/components/ACLButton.resi | .resi | @react.component
let make: (
~text: string=?,
~buttonState: Button.buttonState=?,
~buttonType: Button.buttonType=?,
~buttonVariant: Button.buttonVariant=?,
~buttonSize: Button.buttonSize=?,
~leftIcon: Button.iconType=?,
~rightIcon: Button.iconType=?,
~showBorder: bool=?,
~type_: string=?,
~onClick: ... | 283 |
hyperswitch-control-center | src/components/DateRangeField.res | .res | let defaultCellHighlighter = (_): Calendar.highlighter => {
{
highlightSelf: false,
highlightLeft: false,
highlightRight: false,
}
}
let useErroryValueResetter = (value: string, setValue: (string => string) => unit) => {
React.useEffect(() => {
let isErroryTimeValue = _ => {
try {
f... | 7,267 |
hyperswitch-control-center | src/components/DynamicTabs.res | .res | type tab = {
title: string,
value: string,
isRemovable: bool,
description?: string,
}
let getValueFromArrayTab = (tabsVal: array<tab>, index: int) => {
switch tabsVal->Array.get(index) {
| Some(val) => val.value
| None => ""
}
}
type boundingClient = {x: int, right: int}
type scrollIntoViewParams = {be... | 4,911 |
hyperswitch-control-center | src/components/InputFields.resi | .resi | type customInputFn = (
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder: string,
) => React.element
type comboCustomInputFn = array<ReactFinalForm.fieldRenderProps> => React.element
type comboCustomInputRecord = {fn: comboCustomInputFn, names: array<string>}
let selectInput: (
~options: array<SelectBox.... | 3,076 |
hyperswitch-control-center | src/components/CalendarList.res | .res | external ffInputToSelectInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalForm.fieldRenderPropsCustomInput<
array<string>,
> = "%identity"
open Calendar
@react.component
let make = (
~changeHighlightCellStyle="",
~calendarContaierStyle="",
~month: option<month>=?,
~year: option<int>=?,
~onDateClick=... | 1,301 |
hyperswitch-control-center | src/components/HSwitchFeedBackModal.res | .res | @react.component
let make = (
~modalHeading,
~setShowModal,
~showModal,
~feedbackVia="user",
~modalType: HSwitchFeedBackModalUtils.modalType=FeedBackModal,
) => {
open HSwitchFeedBackModalUtils
open APIUtils
let {email} = CommonAuthHooks.useCommonAuthInfo()->Option.getOr(CommonAuthHooks.defaultAuthInfo)... | 792 |
hyperswitch-control-center | src/components/MonacoEditorLazy.res | .res | @react.component
let make = (
~defaultLanguage: string,
~defaultValue=?,
~value=?,
~height=?,
~theme=?,
~readOnly=false,
~width=?,
~onChange=?,
~onValidate=?,
~showCopy=true,
~fontSize=?,
~fontFamily=?,
~fontWeight=?,
~minimap=true,
~outerWidth="w-full",
~onMount: option<Monaco.Editor.IS... | 283 |
hyperswitch-control-center | src/components/DateRangePicker.res | .res | let defaultCellHighlighter = (_): Calendar.highlighter => {
{
highlightSelf: false,
highlightLeft: false,
highlightRight: false,
}
}
let useErroryValueResetter = (value: string, setValue: (string => string) => unit) => {
React.useEffect(() => {
let isErroryTimeValue = _ => {
try {
f... | 7,099 |
hyperswitch-control-center | src/components/MakeRuleFieldComponent.res | .res | let validateConditionJson = json => {
open LogicUtils
let checkValue = dict => {
dict
->getArrayFromDict("value", [])
->Array.filter(ele => {
ele != ""->JSON.Encode.string
})
->Array.length > 0 ||
dict->getString("value", "")->LogicUtils.isNonEmptyString ||
dict->getFloat("value", ... | 781 |
hyperswitch-control-center | src/components/TableUtils.resi | .resi | let regex: string => RescriptCore.RegExp.t
let highlightedText: (Js.String.t, string) => React.element
type labelColor =
| LabelGreen
| LabelRed
| LabelBlue
| LabelGray
| LabelOrange
| LabelYellow
| LabelLightGray
type filterDataType = Float(float, float) | String | DateTime
type disableField = {key: stri... | 1,745 |
hyperswitch-control-center | src/components/InfraCalendarList.res | .res | external ffInputToSelectInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalForm.fieldRenderPropsCustomInput<
array<string>,
> = "%identity"
let startYear = ref(2016)
let years = []
while Date.make()->Js.Date.getFullYear->Float.toInt >= startYear.contents {
years->Array.push(startYear.contents)->ignore
star... | 1,405 |
hyperswitch-control-center | src/components/DateRangeHelper.res | .res | open DateRangeUtils
module CompareOption = {
@react.component
let make = (~value: compareOption, ~comparison, ~startDateVal, ~endDateVal, ~onClick) => {
let isoStringToCustomTimeZone = TimeZoneHook.useIsoStringToCustomTimeZone()
let previousPeriod = React.useMemo(() => {
let startDateStr = formatDat... | 1,402 |
hyperswitch-control-center | src/components/ReactWindowTable.res | .res | open TableUtils
type checkBoxProps = {
showCheckBox: bool,
selectedData: array<JSON.t>,
setSelectedData: (array<JSON.t> => array<JSON.t>) => unit,
}
let checkBoxPropDefaultVal: checkBoxProps = {
showCheckBox: false,
selectedData: [],
setSelectedData: _ => (),
}
module FilterRow = {
@react.component
let... | 8,342 |
hyperswitch-control-center | src/components/NotFoundPage.res | .res | @react.component
let make = (~message="Error 404!") => {
let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext)
<NoDataFound message renderType={NotFound}>
<Button
text={"Go to Home"}
buttonType=Primary
buttonSize=Small
onClick={_ => {
setDashboardPageState... | 121 |
hyperswitch-control-center | src/components/Button.resi | .resi | type buttonState = Normal | Loading | Disabled | NoHover | Focused
type buttonVariant = Fit | Long | Full | Rounded
type buttonType =
| Primary
| Secondary
| PrimaryOutline
| SecondaryFilled
| NonFilled
| Pagination
| Pill
| FilterAdd
| Delete
| Transparent
| SelectTransparent
| DarkPurple
| ... | 706 |
hyperswitch-control-center | src/components/BottomModal.res | .res | @react.component
let make = (~onCloseClick, ~children, ~headerText) => {
let onClick = e => {
e->ReactEvent.Mouse.stopPropagation
}
<div
onClick
className={`flex flex-col border border-jp-gray-500 dark:border-jp-gray-960 bg-jp-gray-950 dark:bg-white-600 dark:bg-opacity-80 fixed bg-opacity-70 h-scree... | 339 |
hyperswitch-control-center | src/components/HSwitchSingleStatTableWidget.res | .res | type statChartColor = [#blue | #grey]
type tableRowType = {
rowLabel: string,
rowValue: float,
}
type cols =
| Label
| Value
let visibleColumns = [Label, Value]
let colMapper = (col: cols) => {
switch col {
| Label => "rowLabel"
| Value => "rowValue"
}
}
let tableItemToObjMapper: 'a => tableRowType... | 1,815 |
hyperswitch-control-center | src/components/AdvancedSearchComponent.res | .res | let getSummary: JSON.t => EntityType.summary = json => {
switch json->JSON.Decode.object {
| Some(dict) => {
let rowsCount = LogicUtils.getArrayFromDict(dict, "rows", [])->Array.length
let totalCount = LogicUtils.getInt(dict, "entries", 0)
{totalCount, count: rowsCount}
}
| None => {totalCo... | 797 |
hyperswitch-control-center | src/components/SearchInput.res | .res | open LottieFiles
@react.component
let make = (
~onChange,
~inputText,
~autoFocus=true,
~placeholder="",
~searchIconCss="ml-2",
~roundedBorder=true,
~widthClass="w-full",
~heightClass="h-8",
~searchRef=?,
~shouldSubmitForm=true,
~placeholderCss="bg-transparent text-fs-14",
~bgColor="border-jp-gra... | 758 |
hyperswitch-control-center | src/components/FilterUtils.res | .res | let parseFilterString = queryString => {
queryString
->decodeURI
->String.split("&")
->Belt.Array.keepMap(str => {
let arr = str->String.split("=")
let key = arr->Array.get(0)->Option.getOr("-")
let val = arr->Array.sliceToEnd(~start=1)->Array.joinWith("=")
key->LogicUtils.isEmptyString || val->... | 159 |
hyperswitch-control-center | src/components/DynamicTableUtils.res | .res | let tableHeadingClass = "font-bold text-xl text-black text-opacity-75 dark:text-white dark:text-opacity-75"
type view = Table | Card
let visibilityColFunc = (
~dateFormatConvertor: string => option<JSON.t>,
~jsonVal: option<JSON.t>,
~tableCell: Table.cell,
) => {
switch tableCell {
| Label(x) | ColoredText(x... | 2,543 |
hyperswitch-control-center | src/components/Icon.resi | .resi | @react.component
let make: (
~name: string,
~size: int=?,
~className: string=?,
~themeBased: bool=?,
~onClick: ReactEvent.Mouse.t => unit=?,
~parentClass: string=?,
~customIconColor: string=?,
~customWidth: string=?,
~customHeight: string=?,
) => React.element
| 86 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.