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/Recon/ReconScreens/ReconReports/ShowAllReports.res | .res | module ShowOrderDetails = {
@react.component
let make = (
~data,
~getHeading,
~getCell,
~detailsFields,
~justifyClassName="justify-start",
~widthClass="w-full",
~bgColor="bg-white dark:bg-jp-gray-lightgray_background",
~isButtonEnabled=false,
~border="border border-jp-gray-940 bo... | 1,283 | 9,421 |
hyperswitch-control-center | src/Recon/ReconScreens/ReconReports/ReconReportUtils.res | .res | open ReportsTypes
open LogicUtils
let getArrayDictFromRes = res => {
res->getDictFromJsonObject->getArrayFromDict("data", [])
}
let getSizeofRes = res => {
res->getDictFromJsonObject->getInt("size", 0)
}
let getTabFromUrl = search => {
switch search {
| "tab=exceptions" => Exceptions
| _ => All
}
}
let ... | 481 | 9,422 |
hyperswitch-control-center | src/Recon/ReconScreens/ReconReports/ReportsTableEntity.res | .res | open ReportsTypes
open ReconReportUtils
let defaultColumns: array<allColtype> = [
OrderId,
TransactionId,
PaymentGateway,
PaymentMethod,
TxnAmount,
SettlementAmount,
ReconStatus,
TransactionDate,
]
let allColumns: array<allColtype> = [
TransactionId,
OrderId,
PaymentGateway,
PaymentMethod,
Tx... | 646 | 9,423 |
hyperswitch-control-center | src/Recon/ReconScreens/ReconReports/ReconExceptionsUtils.res | .res | open ReportsTypes
open LogicUtils
let getExceptionMatrixPayloadType = dict => {
{
source: dict->getString("source", ""),
order_id: dict->getString("order_id", ""),
payment_gateway: dict->getString("payment_gateway", ""),
settlement_date: dict->getString("settlement_date", ""),
txn_amount: dict->g... | 632 | 9,424 |
hyperswitch-control-center | src/Recon/ReconScreens/ReconReports/ReconReportsList.res | .res | @react.component
let make = () => {
open LogicUtils
let (offset, setOffset) = React.useState(_ => 0)
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let (selectedId, setSelectedId) = React.useState(_ =>
Dict.make()->ReconReportUtils.getAllReportPayloadType
)
let (showModal, setShowModal) = Rea... | 1,152 | 9,425 |
hyperswitch-control-center | src/Recon/ReconScreens/ReconReports/ReconReportsHelper.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,
~overiddingHeadingStyles="",
... | 951 | 9,426 |
hyperswitch-control-center | src/Recon/ReconContainer/ReconOverviewContainer.res | .res | @react.component
let make = (~showOnBoarding) => {
open ReconOnboardingHelper
{
switch showOnBoarding {
| false => <ReconOverviewContent />
| true => <ReconOnboardingLanding />
}
}
}
| 58 | 9,427 |
hyperswitch-control-center | src/Recon/ReconContainer/ReconConfigurationContainer.res | .res | @react.component
let make = (~setShowOnBoarding, ~currentStep, ~setCurrentStep) => {
<ReconConfiguration setShowOnBoarding currentStep setCurrentStep />
}
| 39 | 9,428 |
hyperswitch-control-center | src/Recon/ReconContainer/ReconReportsContainer.res | .res | @react.component
let make = (~showOnBoarding) => {
let url = RescriptReactRouter.useUrl()
switch url.path->HSwitchUtils.urlPath {
| list{"v2", "recon", "reports", ...remainingPath} =>
<EntityScaffold
entityName="Payments"
remainingPath
access=Access
renderList={() => <ReconReports sho... | 123 | 9,429 |
hyperswitch-control-center | src/Recon/ReconApp/ReconApp.res | .res | @react.component
let make = () => {
open APIUtils
open LogicUtils
open ReconConfigurationUtils
open VerticalStepIndicatorTypes
open ReconConfigurationTypes
open ReconOnboardingHelper
let url = RescriptReactRouter.useUrl()
let (showOnBoarding, setShowOnBoarding) = React.useState(_ => true)
let (curren... | 587 | 9,430 |
hyperswitch-control-center | src/Recon/ReconApp/ReconSidebarValues.res | .res | open SidebarTypes
let reconOnBoarding = {
Link({
name: "Overview",
link: `/v2/recon/overview`,
access: Access,
icon: "nd-overview",
selectedIcon: "nd-overview-fill",
})
}
let reconReports = {
Link({
name: "Reconciliation Report",
link: `/v2/recon/reports`,
access: Access,
ico... | 134 | 9,431 |
hyperswitch-control-center | src/libraries/XMLHttpRequest.res | .res | module XHR = {
type t
@send external addEventListener: (t, string, unit => unit) => unit = "addEventListener"
@send external setRequestHeader: (t, string, string) => unit = "setRequestHeader"
@send external open_: (t, string, string) => unit = "open"
@send external send: (t, string) => unit = "send"
@get ... | 163 | 9,432 |
hyperswitch-control-center | src/libraries/SankeyHighcharts.res | .res | type title = {"text": string}
type node = {
id: string,
color: string,
name: string,
dataLabels: {"x": int},
}
type nodeColor = {color: string}
type tooltiplink = {
from: string,
to: string,
weight: float,
total: float,
fromColorIndex: string,
toColorIndex: string,
name: string,
fromNode: nodeCo... | 567 | 9,433 |
hyperswitch-control-center | src/libraries/MixPanel.res | .res | type people = {set: JSON.t => unit}
type mixpanel = {people: people}
@module("mixpanel-browser")
external mixpanel: mixpanel = "default"
@send external distinctIdWrapper: (mixpanel, unit) => string = "get_distinct_id"
let getDistinctId = distinctIdWrapper(mixpanel, _)
@send external identifyWrapper: (mixpanel, stri... | 227 | 9,434 |
hyperswitch-control-center | src/libraries/ApexCharts.res | .res | type zoom = {enabled: bool}
type display = {show: bool}
type padding = {
left?: int,
right?: int,
top?: int,
bottom?: int,
}
type chart = {
height?: int,
zoom?: zoom,
toolbar?: display,
padding?: padding,
}
type dataLabels = {enabled?: bool}
type stroke = {curve: string}
type title = {
text?: str... | 341 | 9,435 |
hyperswitch-control-center | src/libraries/Highcharts.res | .res | type title = {"text": string, "style": JSON.t}
type subtitle = {"text": string}
type data_obj = {"name": string, "value": int, "color": string, "id": string}
type new_series = {"type": string, "layoutAlgorithm": string, "data": array<data_obj>}
type series = {"type": string, "name": string, "data": array<(float, float)... | 2,618 | 9,436 |
hyperswitch-control-center | src/libraries/HeadlessUI.res | .res | module Transition = {
@module("@headlessui/react") @react.component
external make: (
~\"as": string,
~show: bool=?,
~appear: bool=?,
~unmount: bool=?,
~enter: string=?,
~enterFrom: string=?,
~enterTo: string=?,
~leave: string=?,
~leaveFrom: string=?,
~leaveTo: string=?,
~... | 4,005 | 9,437 |
hyperswitch-control-center | src/libraries/SessionStorage.res | .res | type sessionStorage = {
getItem: string => Nullable.t<string>,
setItem: (string, string) => unit,
removeItem: string => unit,
}
@val external sessionStorage: sessionStorage = "sessionStorage"
| 45 | 9,438 |
hyperswitch-control-center | src/libraries/MonacoEditor.res | .res | open LazyUtils
type miniTypes = {enabled: bool}
type setOptions = {
readOnly: bool,
fontSize?: option<int>,
fontFamily?: option<string>,
fontWeight?: option<string>,
minimap?: miniTypes,
}
type props = {
defaultLanguage: string,
defaultValue?: string,
value?: string,
height?: string,
theme?: stri... | 150 | 9,439 |
hyperswitch-control-center | src/libraries/ReactFinalForm.res | .res | type fieldRenderPropsInput = {
name: string,
onBlur: ReactEvent.Focus.t => unit,
onChange: ReactEvent.Form.t => unit,
onFocus: ReactEvent.Focus.t => unit,
value: JSON.t,
checked: bool,
}
type fieldRenderPropsCustomInput<'t> = {
name: string,
onBlur: ReactEvent.Focus.t => unit,
onChange: 't => unit,
... | 1,683 | 9,440 |
hyperswitch-control-center | src/libraries/CookieStorage.res | .res | @set external setCookie: (DOMUtils.document, string) => unit = "cookie"
@get external getCookie: DOMUtils.document => Js.Nullable.t<string> = "cookie"
let getCookieDict = () => {
getCookie(DOMUtils.document)
->Nullable.toOption
->Option.getOr("")
->String.split(";")
->Array.map(value => {
let arr = value... | 322 | 9,441 |
hyperswitch-control-center | src/libraries/ReactBeautifulDND.res | .res | type droppableFunctionReturn
type droppableMode = Standard | Virtual
module DragDropContext = {
@module("react-beautiful-dnd") @react.component
external make: (~children: React.element=?, ~onDragEnd: 'a => unit) => React.element =
"DragDropContext"
}
module Droppable = {
@module("react-beautiful-dnd") @reac... | 205 | 9,442 |
hyperswitch-control-center | src/libraries/HighchartsGanttChart.res | .res | type highcharts
type highchartsGantt
@module("highcharts/modules/gantt")
external highchartsGantt: highcharts => unit = "default"
@module("highcharts") external highchartsModule: highcharts = "default"
| 50 | 9,443 |
hyperswitch-control-center | src/libraries/recoil.js | .js | import {
RecoilRoot,
atom as recoilAtom,
selector,
useRecoilState,
useRecoilValue,
} from "recoil";
export function atom(key, defaultVal) {
return recoilAtom({ key, default: defaultVal });
}
| 56 | 9,444 |
hyperswitch-control-center | src/libraries/ReactHyperJs.res | .res | type hyperloader
type hyperPromise = promise<hyperloader>
type sdkType = ELEMENT | WIDGET
type paymentStatus =
SUCCESS | INCOMPLETE | FAILED(string) | LOADING | PROCESSING | CHECKCONFIGURATION | CUSTOMSTATE
type confirmParamType = {return_url: string}
type confirmPaymentObj = {confirmParams: confirmParamType}
type op... | 695 | 9,445 |
hyperswitch-control-center | src/libraries/HighchartsHorizontalBarChart.res | .res | type title = {text: string, align?: string, useHTML?: bool}
type tooltipRecord = {category: string, y: int}
external asTooltipPointFormatter: Js_OO.Callback.arity1<'a> => tooltipRecord => string = "%identity"
type tooltip = {
pointFormatter: tooltipRecord => string,
useHTML: bool,
backgroundColor: string,
borde... | 584 | 9,446 |
hyperswitch-control-center | src/libraries/Document.res | .res | type domElement
type document = {querySelectorAll: string => array<domElement>}
@val external document: document = "document"
@val @scope("document")
external querySelector: string => Nullable.t<domElement> = "querySelector"
@val @scope("document")
external activeElement: Dom.element = "activeElement"
@send external... | 101 | 9,447 |
hyperswitch-control-center | src/libraries/HighchartsLine.res | .res | type title = {"text": string}
type subtitle = {"text": string}
type series = {"type": string, "name": string, "data": array<(float, float)>}
type chart = {
"type": string,
"zoomType": string,
"margin": option<array<int>>,
"backgroundColor": Nullable.t<string>,
"height": option<int>,
}
type linearGradient = {"... | 501 | 9,448 |
hyperswitch-control-center | src/libraries/Recoil.res | .res | module RecoilRoot = {
@module("recoil") @react.component
external make: (~children: React.element) => React.element = "RecoilRoot"
}
type recoilAtom<'v> = RecoilAtom('v)
type recoilSelector<'v> = RecoilSelector('v)
@module("./recoil")
external atom: (string, 'v) => recoilAtom<'v> = "atom"
@module("recoil")
exter... | 358 | 9,449 |
hyperswitch-control-center | src/libraries/FramerMotion.res | .res | type transition = {
duration?: float,
repeat?: int,
repeatType?: string,
staggerChildren?: float,
ease?: string,
stiffness?: int,
restDelta?: int,
@as("type")
_type?: string,
delayChildren?: float,
delay?: float,
}
type animate = {
scale?: float,
rotate?: array<int>,
borderRadius?: array<str... | 482 | 9,450 |
hyperswitch-control-center | src/libraries/RRule.res | .res | type recurrenceFrequency =
| Daily
| Weekly
| Monthly
| Yearly
type recurrenceRule = {
frequency: recurrenceFrequency,
interval: int,
byDay: option<array<int>>,
byDate: option<array<int>>,
byWeek: option<array<int>>,
byMonth: option<array<int>>,
byYear: option<array<int>>,
}
type durationUnit =
... | 1,290 | 9,451 |
hyperswitch-control-center | src/libraries/LocalStorage.res | .res | @val @scope("localStorage")
external getItem: string => Nullable.t<string> = "getItem"
@val @scope("localStorage")
external setItemOrig: (string, string) => unit = "setItem"
@val @scope("localStorage")
external removeItem: string => unit = "removeItem"
@val @scope("localStorage")
external clear: unit => unit = "clea... | 387 | 9,452 |
hyperswitch-control-center | src/libraries/ReactSyntaxHighlighter.res | .res | type editorStyle
@module("react-syntax-highlighter/dist/esm/styles/hljs")
external lightfair: editorStyle = "googlecode"
type style = {
backgroundColor?: string,
lineHeight?: string,
fontSize?: string,
paddingLeft?: string,
padding?: string,
}
type props = {
language?: string,
style?: editorStyle,
cu... | 210 | 9,453 |
hyperswitch-control-center | src/libraries/FileReader.res | .res | type arg = ReactEvent.Form.t
type file
type read = {
mutable onload: arg => unit,
readAsText: string => unit,
readAsBinaryString: string => unit,
readAsDataURL: file => unit,
result: string,
onerror: string => unit,
}
@new external reader: read = "FileReader"
| 76 | 9,454 |
hyperswitch-control-center | src/libraries/GoogleAnalytics.res | .res | type eventType = {
category: string,
action: string,
label: string,
}
type pageViewType = {hitType: string, page: string}
type analyticsType = {
initialize: string => unit,
event: eventType => unit,
send: pageViewType => unit,
}
@module("react-ga4")
external analytics: analyticsType = "default"
let send... | 93 | 9,455 |
hyperswitch-control-center | src/libraries/Window.res | .res | type t
type listener<'ev> = 'ev => unit
type event = {data: string}
@val @scope("window")
external parent: 't = "parent"
@val @scope("window")
external addEventListener: (string, listener<'ev>) => unit = "addEventListener"
@val @scope("window")
external close: unit => unit = "close"
@val @scope("window")
external... | 1,842 | 9,456 |
hyperswitch-control-center | src/libraries/Lottie.res | .res | open LazyUtils
type props = {
animationData: JSON.t,
autoplay: bool,
loop: bool,
lottieRef?: React.ref<Nullable.t<Dom.element>>,
initialSegment?: array<int>,
}
let make: props => React.element = reactLazy(() => import_("lottie-react"))
| 65 | 9,457 |
hyperswitch-control-center | src/libraries/ReactWindow.res | .res | module ListComponent = {
type t
@send
external resetAfterIndex: (t, int, bool) => unit = "resetAfterIndex"
@send
external scrollToItem: (t, int, string) => unit = "scrollToItem"
}
module VariableSizeList = {
@module("react-window") @react.component
external make: (
~ref: ListComponent.t => unit=?,
... | 163 | 9,458 |
hyperswitch-control-center | src/libraries/HighchartsPieChart.res | .res | type title = {text: string, align: string, useHTML: bool}
type point = {name: string, percentage: float}
type yAxisRecord = {point: point}
type tooltipRecord = {name: string, y: int}
type style = {color: string, opacity: string}
external asTooltipPointFormatter: Js_OO.Callback.arity1<'a> => tooltipRecord => string = "%... | 462 | 9,459 |
hyperswitch-control-center | src/libraries/Monaco.res | .res | module Language = {
type completionItemEnum
type completionItemKind
type model
type languages
type position = {
lineNumber: int,
column: int,
}
type word = {
startColumn: int,
endColumn: int,
}
type range = {
startLineNumber: int,
endLineNumber: int,
startColumn: int,
... | 639 | 9,460 |
hyperswitch-control-center | src/libraries/DayJs.res | .res | type relativeTime
@module("dayjs/plugin/relativeTime")
external relativeTime: relativeTime = "default"
@module("dayjs/plugin/isToday")
external isToday: relativeTime = "default"
@module("dayjs/plugin/customParseFormat")
external customParseFormat: relativeTime = "default"
type rec dayJs = {
isValid: unit => bool,... | 316 | 9,461 |
hyperswitch-control-center | src/libraries/ReactQRCode.res | .res | @module("react-qr-code") @react.component
external make: (
~value: string=?,
~style: string=?,
~size: int=?,
~viewBox: string=?,
) => React.element = "default"
| 53 | 9,462 |
hyperswitch-control-center | src/libraries/Shimmer.res | .res | type shimmerType = Small | Big
@module("react-shimmer-effect") @react.component
let make = (~styleClass="w-96 h-96", ~shimmerType: shimmerType=Small) => {
let theme = ThemeProvider.useTheme()
let shimmerClass = switch shimmerType {
| Small => "animate-shimmer"
| Big => "animate-shimmer-fast"
}
let backgroun... | 307 | 9,463 |
hyperswitch-control-center | src/libraries/JsDatePicker.res | .res | type input = {mutable value: string}
type date = {toLocaleDateString: unit => string}
type instance
type options = {
formatter?: (input, date, instance) => unit,
position?: [#tr | #tl | #br | #bl | #c],
}
@module("js-datepicker")
external datepicker: (string, options) => unit = "default"
| 80 | 9,464 |
hyperswitch-control-center | src/libraries/HighchartsGanttChartLazy.res | .res | open LazyUtils
open HighchartsGanttChart
type props = {
highcharts: highcharts,
options?: JSON.t,
constructorType: string,
}
let make: props => React.element = reactLazy(() => import_("highcharts-react-official"))
| 55 | 9,465 |
hyperswitch-control-center | src/libraries/Clipboard.res | .res | type styleObj
@get external style: Dom.element => styleObj = "style"
@val @scope(("navigator", "clipboard"))
external writeTextDoc: string => unit = "writeText"
@val external document: 'a = "document"
@set external setPosition: (styleObj, string) => unit = "position"
@set external setLeft: (styleObj, string) => unit ... | 621 | 9,466 |
hyperswitch-control-center | src/libraries/PDFViewer/PDFViewerTypes.res | .res | type pdfInfoNumPages = {numPages: int}
type pdfInfoType = {_pdfInfo: pdfInfoNumPages}
module Page = {
@module("react-pdf") @react.component
external make: (
~pageNumber: int,
~renderAnnotationLayer: bool,
~renderTextLayer: bool,
~className: string=?,
~height: int=?,
~width: int=?,
~sca... | 210 | 9,467 |
hyperswitch-control-center | src/libraries/PDFViewer/ReactPDFViewerSinglePageLazy.res | .res | open LazyUtils
type props = {
url: string,
width?: int,
height?: int,
className?: string,
loading?: React.element,
error?: React.element,
}
let make: props => React.element = reactLazy(() => import_("./ReactPDFViewerSinglePage.res.js"))
| 64 | 9,468 |
hyperswitch-control-center | src/libraries/PDFViewer/ReactPDFViewerSinglePage.res | .res | /*
* Reference - https://github.com/wojtekmaj/react-pdf
* If url is not provided the path of the pdf should be in public folder
*/
@module("react-pdf") external pdfjs: {..} = "pdfjs"
pdfjs["GlobalWorkerOptions"]["workerSrc"] = `//unpkg.com/pdfjs-dist@${pdfjs["version"]}/build/pdf.worker.min.js`
open PDFViewerTyp... | 337 | 9,469 |
hyperswitch-control-center | src/libraries/bsfetch/Fetch__Iterator.ml | .ml | module Next = struct
type 'a t
external done_ : _ t -> bool option = "done" [@@bs.get]
external value : 'a t -> 'a option = "value" [@@bs.get] [@@bs.return nullable]
end
type 'a t
external next : 'a t -> 'a Next.t = "next" [@@bs.send]
let rec forEach ~f t =
let item = next t in
match Next.(done_ item, val... | 170 | 9,470 |
hyperswitch-control-center | src/libraries/bsfetch/Fetch__Iterator.mli | .mli | (** We need to bind to JavaScript Iterators for FormData functionality.
But ideally this binding should be moved into BuckleScript itself.
@see {{: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols}} *)
module Next : sig
type 'a t
external done_ : _ t -> bool option = ... | 190 | 9,471 |
hyperswitch-control-center | src/libraries/bsfetch/Fetch.res | .res | type body
type bodyInit
type headers
type headersInit
type response
type request
type requestInit
type abortController
type signal
/* external */
type arrayBuffer /* TypedArray */
type bufferSource /* Web IDL, either an arrayBuffer or arrayBufferView */
type formData /* XMLHttpRequest */
type readableStream /* Streams... | 3,627 | 9,472 |
hyperswitch-control-center | src/fragments/FragmentUtils.res | .res | 1 | 9,473 | |
hyperswitch-control-center | src/fragments/VerticalStepIndicator/VerticalStepIndicatorUtils.res | .res | open VerticalStepIndicatorTypes
let default: section = {
id: "",
name: "",
icon: "",
subSections: None,
}
let getSectionById = (sections: array<section>, sectionId) =>
sections->Array.find(section => section.id === sectionId)->Option.getOr(default)
let getSubSectionById = (subSections, subSectionId) =>
s... | 1,176 | 9,474 |
hyperswitch-control-center | src/fragments/VerticalStepIndicator/VerticalStepIndicator.res | .res | open VerticalStepIndicatorTypes
@react.component
let make = (
~titleElement: React.element,
~sections: array<section>,
~currentStep: step,
~backClick,
) => {
open VerticalStepIndicatorUtils
let rows = sections->Array.length->Int.toString
let currIndex = sections->findSectionIndex(currentStep.sectionId)
... | 1,097 | 9,475 |
hyperswitch-control-center | src/fragments/VerticalStepIndicator/VerticalStepIndicatorTypes.res | .res | type identifier = {id: string, name: string}
type rec section = {
...identifier,
icon: string,
subSections: option<array<subSection>>,
}
and subSection = {
...identifier,
}
type step = {
sectionId: string,
subSectionId: option<string>,
}
| 67 | 9,476 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorFragmentUtils.res | .res | let connectorLabelDetailField = Dict.fromArray([
("connector_label", "Connector label"->JSON.Encode.string),
])
| 25 | 9,477 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorHelperV2.res | .res | let textInput = (~field: CommonConnectorTypes.inputField, ~formName, ~customStyle=?) => {
let {placeholder, label, required} = field
let customStyle = {
switch customStyle {
| Some(val) => val
| None => ""
}
}
FormRenderer.makeFieldInfo(
~label,
~name={formName},
~placeholder,
~c... | 1,942 | 9,478 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/PMTSelection.res | .res | module PMT = {
@react.component
let make = (
~pmtData: ConnectorTypes.paymentMethodConfigTypeV2,
~pm,
~fieldsArray: array<ReactFinalForm.fieldRenderProps>,
~connector,
~formValues: ConnectorTypes.connectorPayloadV2,
) => {
open ConnectorPaymentMethodV2Utils
let pmInp = (fieldsArray[0]-... | 948 | 9,479 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/ConnectorPaymentMethodV2.res | .res | /*
PM - PaymentMethod
PMT - PaymentMethodType
PME - PaymentMethodExperience
PMIndex - PaymentMethod Index
PMTIndex - PaymentMethodType Index
*/
@react.component
let make = (~initialValues, ~isInEditState, ~ignoreKeys=[]) => {
open LogicUtils
open ConnectorPaymentMethodV2Utils
let connector = UrlUtils.useGetFilte... | 1,146 | 9,480 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/ConnectorPaymentMethodV2Utils.res | .res | open ConnectorTypes
open LogicUtils
let getPMFromString = paymentMethod => {
switch paymentMethod->String.toLowerCase {
| "card" => Card
| "debit" | "credit" => Card
| "pay_later" => PayLater
| "wallet" => Wallet
| "bank_redirect" => BankRedirect
| "bank_transfer" => BankTransfer
| "crypto" => Crypto
... | 1,279 | 9,481 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/PMSelectAll.res | .res | module PMSelectAll = {
@react.component
let make = (
~availablePM: array<ConnectorTypes.paymentMethodConfigTypeV2>,
~fieldsArray: array<ReactFinalForm.fieldRenderProps>,
~pm,
~pmt,
) => {
open LogicUtils
open ConnectorPaymentMethodV2Utils
let pmEnabledInp = (fieldsArray[0]->Option.getO... | 1,416 | 9,482 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/Sections/Card.res | .res | module SelectedCardValues = {
@react.component
let make = (~initialValues, ~index) => {
open LogicUtils
open SectionHelper
open ConnectorPaymentMethodV2Utils
let data1 = initialValues->getDictFromJsonObject
let data = ConnectorInterface.mapDictToConnectorPayload(
ConnectorInterface.connect... | 1,066 | 9,483 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/Sections/OtherPaymentMethod.res | .res | module SelectedCardValues = {
@react.component
let make = (~initialValues, ~index, ~pm) => {
open LogicUtils
open SectionHelper
let data1 = initialValues->getDictFromJsonObject
let data = ConnectorInterface.mapDictToConnectorPayload(
ConnectorInterface.connectorInterfaceV2,
data1,
)
... | 1,851 | 9,484 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorPaymentMethodv2/Sections/SectionHelper.res | .res | module Heading = {
@react.component
let make = (~heading) => {
open ConnectorPaymentMethodV2Utils
<div className="flex gap-2.5 items-center">
<div className="p-2 bg-white border rounded-md">
<Icon name={heading->pmIcon} />
</div>
<p className="font-semibold"> {heading->LogicUtils.s... | 898 | 9,485 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorAuthKeys/ConnectorAuthKeysHelper.res | .res | let connectorsWithIntegrationSteps: array<ConnectorTypes.connectorTypes> = [
Processors(ADYEN),
Processors(CHECKOUT),
Processors(STRIPE),
Processors(PAYPAL),
]
module MultiConfigInp = {
@react.component
let make = (~label, ~fieldsArray: array<ReactFinalForm.fieldRenderProps>) => {
let enabledList = (fi... | 2,344 | 9,486 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorAuthKeys/ConnectorAuthKeys.res | .res | @react.component
let make = (
~initialValues,
~showVertically=true,
~processorType=ConnectorTypes.Processor,
~updateAccountDetails=true,
) => {
open LogicUtils
open ConnectorAuthKeysHelper
let connector = UrlUtils.useGetFilterDictFromUrl("")->LogicUtils.getString("name", "")
let form = ReactFinalForm.us... | 518 | 9,487 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorAuthKeys/ConnectorAuthKeyUtils.res | .res | let validateRequiredFiled = (valuesFlattenJson, dict, fieldName, errors) => {
open LogicUtils
let newDict = getDictFromJsonObject(errors)
dict
->Dict.keysToArray
->Array.forEach(_value => {
let lastItem = fieldName->String.split(".")->Array.pop->Option.getOr("")
let errorKey = dict->getString(lastItem... | 534 | 9,488 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorLabel/ConnectorLabelV2.res | .res | @react.component
let make = (
~labelTextStyleClass="",
~labelClass="font-semibold",
~isInEditState,
~connectorInfo: ConnectorTypes.connectorPayloadV2,
) => {
open LogicUtils
open ConnectorHelperV2
let labelFieldDict = ConnectorFragmentUtils.connectorLabelDetailField
let label = labelFieldDict->getStrin... | 181 | 9,489 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorWebhookDetails/ConnectorWebhookPreview.res | .res | @react.component
let make = (
~merchantId,
~connectorName,
~textCss="",
~showFullText=false,
~showFullCopy=false,
~containerClass="flex",
~hideLabel=false,
~displayTextLength=?,
~truncateDisplayValue=false,
) => {
let showToast = ToastState.useShowToast()
let copyValueOfWebhookEndpoint = `${Window... | 566 | 9,490 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorWebhookDetails/ConnectorWebhookDetails.res | .res | @react.component
let make = (
~showVertically=true,
~labelTextStyleClass="",
~labelClass="font-semibold ",
~isInEditState,
~connectorInfo: ConnectorTypes.connectorPayloadV2,
~processorType=ConnectorTypes.Processor,
) => {
open LogicUtils
open ConnectorHelperV2
let connector = UrlUtils.useGetFilterDict... | 714 | 9,491 |
hyperswitch-control-center | src/fragments/ConnectorFragments/ConnectorMetadataV2/ConnectorMetadataV2.res | .res | @react.component
let make = (
~labelTextStyleClass="",
~labelClass="font-semibold !text-hyperswitch_black",
~isInEditState,
~connectorInfo: ConnectorTypes.connectorPayloadV2,
~processorType=ConnectorTypes.Processor,
) => {
open LogicUtils
open ConnectorMetaDataUtils
open ConnectorHelperV2
let connect... | 596 | 9,492 |
hyperswitch-control-center | src/screens/HSwitchRemoteFilter.res | .res | type filterBody = {
start_time: string,
end_time: string,
}
let formateDateString = date => {
date->Date.toISOString->TimeZoneHook.formattedISOString("YYYY-MM-DDTHH:mm:ss[Z]")
}
let getDateFilteredObject = (~range=7) => {
let currentDate = Date.make()
let end_time = currentDate->formateDateString
let st... | 2,158 | 9,493 |
hyperswitch-control-center | src/screens/HSwitchUtilsTypes.res | .res | type browserDetailsObject = {
userAgent: string,
browserVersion: string,
platform: string,
browserName: string,
browserLanguage: string,
screenHeight: string,
screenWidth: string,
timeZoneOffset: string,
clientCountry: Country.timezoneType,
}
type pageLevelVariant =
| HOME
| PAYMENTS
| REFUNDS
... | 188 | 9,494 |
hyperswitch-control-center | src/screens/HSLocalStorage.res | .res | let getInfoFromLocalStorage = (~lStorageKey) => {
let stringifiedJson = LocalStorage.getItem(lStorageKey)->LogicUtils.getValFromNullableValue("")
stringifiedJson->LogicUtils.safeParse->LogicUtils.getDictFromJsonObject
}
let getBooleanFromLocalStorage = (~key) => {
let stringifiedJson = LocalStorage.getItem(key)... | 204 | 9,495 |
hyperswitch-control-center | src/screens/MixpanelHook.res | .res | type functionType = (~eventName: string=?, ~email: string=?, ~description: option<string>=?) => unit
let useSendEvent = () => {
open GlobalVars
open Window
let fetchApi = AuthHooks.useApiFetcher()
let {userInfo: {email: authInfoEmail, merchantId, name}} = React.useContext(
UserInfoProvider.defaultContext,
... | 1,415 | 9,496 |
hyperswitch-control-center | src/screens/PendingInvitationsHome.res | .res | module InviteForMultipleInvitation = {
@react.component
let make = (
~pendingInvites: array<PreLoginTypes.invitationResponseType>,
~acceptInvite,
~showModal,
~setShowModal,
) => {
open LogicUtils
let (acceptedInvites, setAcceptedInvites) = React.useState(_ =>
JSON.Encode.null->getArr... | 1,634 | 9,497 |
hyperswitch-control-center | src/screens/HSwitchUtils.res | .res | open LogicUtils
open HSLocalStorage
open HyperswitchAtom
module TextFieldRow = {
@react.component
let make = (~label, ~children, ~isRequired=true, ~labelWidth="w-72") => {
<div className="flex mt-5">
<div
className={`mt-2 ${labelWidth} text-gray-900/50 dark:text-jp-gray-text_darktheme dark:text-o... | 2,116 | 9,498 |
hyperswitch-control-center | src/screens/Sidebar/SidebarSwitch.res | .res | module OrgMerchantSwitchCollapsed = {
@react.component
let make = () => {
let {userInfo: {orgId, merchantId}} = React.useContext(UserInfoProvider.defaultContext)
let style = "p-2 mx-auto my-0.5 text-white font-semibold fs-20 ring-1 ring-blue-800 ring-opacity-15 rounded uppercase "
<div className="flex... | 332 | 9,499 |
hyperswitch-control-center | src/screens/Sidebar/SidebarProvider.res | .res | open ProviderTypes
let defaultValue = {
isSidebarExpanded: false,
setIsSidebarExpanded: _ => (),
}
let defaultContext = React.createContext(defaultValue)
module Provider = {
let make = React.Context.provider(defaultContext)
}
@react.component
let make = (~children) => {
let (isSidebarExpanded, setIsSidebarE... | 106 | 9,500 |
hyperswitch-control-center | src/screens/Sidebar/SidebarTypes.res | .res | type optionType = {
name: string,
icon: string,
link: string,
access: CommonAuthTypes.authorization,
searchOptions?: array<(string, string)>,
remoteIcon?: bool,
selectedIcon?: string,
}
type optionTypeWithTag = {
name: string,
icon: string,
iconTag: string,
iconStyles?: string,
iconSize?: int,
... | 331 | 9,501 |
hyperswitch-control-center | src/screens/Sidebar/OrgSidebar.res | .res | module OrgTile = {
@react.component
let make = (
~orgID: string,
~isActive,
~orgSwitch,
~orgName: string,
~index: int,
~currentlyEditingId: option<int>,
~handleIdUnderEdit,
) => {
open LogicUtils
open APIUtils
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
le... | 3,565 | 9,502 |
hyperswitch-control-center | src/screens/Sidebar/Sidebar.res | .res | open HeadlessUI
open SidebarTypes
let defaultLinkSelectionCheck = (firstPart, tabLink) => {
firstPart->LogicUtils.removeTrailingSlash === tabLink->LogicUtils.removeTrailingSlash
}
let getIconSize = buttonType => {
switch buttonType {
| "large" => 42
| "larger" => 65
| _ => 20
}
}
module MenuOption = {
... | 6,246 | 9,503 |
hyperswitch-control-center | src/screens/PayoutRouting/PayoutRoutingConfigure.res | .res | @react.component
let make = (~routingType) => {
open LogicUtils
open RoutingTypes
open RoutingUtils
let url = RescriptReactRouter.useUrl()
let (currentRouting, setCurrentRouting) = React.useState(() => NO_ROUTING)
let (id, setId) = React.useState(() => None)
let (isActive, setIsActive) = React.useState(_... | 505 | 9,504 |
hyperswitch-control-center | src/screens/PayoutRouting/PayoutHistoryTable.res | .res | open PayoutHistoryTableEntity
@react.component
let make = (~records, ~activeRoutingIds: array<string>) => {
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let (offset, setOffset) = React.useState(_ => 0)
<LoadedTable
title="History"
hideTitle=true
actualData=records
entity={payoutHist... | 153 | 9,505 |
hyperswitch-control-center | src/screens/PayoutRouting/PayoutCurrentActiveRouting.res | .res | @react.component
let make = (~routingType: array<JSON.t>) => {
open LogicUtils
<div className="mt-4 flex flex-col gap-6">
{routingType
->Array.mapWithIndex((ele, i) => {
let id = ele->getDictFromJsonObject->getString("id", "")
<ActiveRouting.ActiveSection
key={i->Int.toString}
ac... | 124 | 9,506 |
hyperswitch-control-center | src/screens/PayoutRouting/PayoutRoutingStack.res | .res | @react.component
let make = (~remainingPath, ~previewOnly=false) => {
open APIUtils
let getURL = useGetURL()
let fetchDetails = useGetMethod()
let url = RescriptReactRouter.useUrl()
let pathVar = url.path->List.toArray->Array.joinWith("/")
let (records, setRecords) = React.useState(_ => [])
let (activeRo... | 1,284 | 9,507 |
hyperswitch-control-center | src/screens/PayoutRouting/PayoutHistoryTableEntity.res | .res | open LogicUtils
open RoutingUtils
open RoutingTypes
let allColumns: array<historyColType> = [Name, Type, Description, Created, LastUpdated, Status]
let itemToObjMapper = dict => {
{
id: getString(dict, "id", ""),
name: getString(dict, "name", ""),
profile_id: getString(dict, "profile_id", ""),
kind:... | 657 | 9,508 |
hyperswitch-control-center | src/screens/Helpers/DefaultLandingPage.res | .res | @react.component
let make = (
~width="98%",
~height="100%",
~title="",
~subtitle="",
~customStyle="",
~isButton=false,
~buttonText="Home",
~onClickHandler=_ => (),
~overriddingStylesTitle="",
~overriddingStylesSubtitle="",
~showLogoutButton=false,
) => {
let handleLogout = APIUtils.useHandleLogo... | 447 | 9,509 |
hyperswitch-control-center | src/screens/Helpers/HelperComponents.res | .res | module CopyTextCustomComp = {
@react.component
let make = (
~displayValue=None,
~copyValue=None,
~customTextCss="",
~customParentClass="flex items-center gap-2",
~customOnCopyClick=() => (),
~customIconCss="h-7 opacity-70",
) => {
let showToast = ToastState.useShowToast()
let copy... | 1,889 | 9,510 |
hyperswitch-control-center | src/screens/Helpers/PageLoaderWrapper.res | .res | @unboxed
type viewType = Loading | Error(string) | Success | Custom
module ScreenLoader = {
@react.component
let make = (~sectionHeight="h-80-vh") => {
let loaderLottieFile = LottieFiles.useLottieJson("hyperswitch_loader.json")
let loader = LottieFiles.useLottieJson("loader-circle.json")
let {devThemeF... | 604 | 9,511 |
hyperswitch-control-center | src/screens/Helpers/TableSearchFilter.res | .res | @react.component
let make = (
~data,
~filterLogic=_ => {()},
~placeholder,
~searchVal,
~setSearchVal,
~customSearchBarWrapperWidth="w-1/4",
~customInputBoxWidth="w-72",
) => {
let filterData = React.useCallback(filterLogic, [])
React.useEffect(() => {
filterData((searchVal, data))
None
}, [... | 323 | 9,512 |
hyperswitch-control-center | src/screens/Helpers/PageUtils.res | .res | module PageHeading = {
@react.component
let make = (
~title,
~subTitle=?,
~customTitleStyle="",
~customSubTitleStyle="text-lg font-medium",
~customHeadingStyle="py-2",
~isTag=false,
~tagText="",
~customTagStyle="bg-extra-light-grey border-light-grey",
~leftIcon=None,
) => {
... | 318 | 9,513 |
hyperswitch-control-center | src/screens/Helpers/CardUtils.res | .res | module CardHeader = {
@react.component
let make = (
~heading,
~subHeading,
~leftIcon=None,
~customSubHeadingStyle="",
~customHeadingStyle="",
) => {
<div className="md:flex gap-3">
{switch leftIcon {
| Some(icon) =>
<img alt="image" className="h-6 inline-block align-top... | 316 | 9,514 |
hyperswitch-control-center | src/screens/Helpers/HSSelfServeSidebar.res | .res | type status = COMPLETED | ONGOING | PENDING
type subOption = {
title: string,
status: status,
}
type sidebarOption = {
title: string,
status: status,
link: string,
subOptions?: array<subOption>,
}
@react.component
let make = (~heading, ~sidebarOptions: array<sidebarOption>=[]) => {
let {setDashboardPag... | 1,072 | 9,515 |
hyperswitch-control-center | src/screens/UserManagement/UserRevamp/UserManagementUtils.res | .res | let errorClass = "text-sm leading-4 font-medium text-start ml-1 mt-2"
let createCustomRole = FormRenderer.makeFieldInfo(
~label="Enter custom role name",
~name="role_name",
~customInput=InputFields.textInput(~autoComplete="off", ~autoFocus=false),
~isRequired=true,
)
let roleScope = userRole => {
let roleSc... | 932 | 9,516 |
hyperswitch-control-center | src/screens/UserManagement/UserRevamp/ListUserTableEntity.res | .res | open LogicUtils
type role = Admin | ViewOnly | Operator | Developer | OrgAdmin | CustomerSupport | IAM | None
type userStatus = Active | InviteSent | None
type rolesType = {
role_id: string,
role_name: string,
}
type userTableTypes = {
email: string,
roles: array<rolesType>,
}
type userColTypes =
| Email... | 600 | 9,517 |
hyperswitch-control-center | src/screens/UserManagement/UserRevamp/NewUserInvitationForm.res | .res | let p1MediumTextClass = HSwitchUtils.getTextClass((P1, Medium))
let p2MediumTextClass = HSwitchUtils.getTextClass((P2, Medium))
let p3MediumTextClass = HSwitchUtils.getTextClass((P3, Medium))
let p3RegularTextClass = HSwitchUtils.getTextClass((P3, Regular))
module ModuleAccessRenderer = {
@react.component
let make... | 1,991 | 9,518 |
hyperswitch-control-center | src/screens/UserManagement/UserRevamp/UserInfo.res | .res | let h2OptionalStyle = HSwitchUtils.getTextClass((H2, Optional))
module UserAction = {
@react.component
let make = (~value: UserManagementTypes.userDetailstype) => {
open UserManagementTypes
let url = RescriptReactRouter.useUrl()
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let userEma... | 1,899 | 9,519 |
hyperswitch-control-center | src/screens/UserManagement/UserRevamp/ManageUserModal.res | .res | let h2OptionalStyle = HSwitchUtils.getTextClass((H2, Optional))
let p1MediumStyle = HSwitchUtils.getTextClass((P1, Medium))
let p2RegularStyle = HSwitchUtils.getTextClass((P1, Regular))
let itemParentContainerCss = "flex flex-wrap gap-4 md:justify-between items-center"
let itemsContainerCss = "flex flex-col items-start... | 2,106 | 9,520 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.