{"version":3,"file":"properties.mjs","sources":["../../src/sso/properties.ts"],"sourcesContent":["import { WebViewErrorEvent } from \"react-native-webview/lib/WebViewTypes\"\nimport {\n  Type,\n  InternalWidgetConfigurationProps,\n  WidgetConfigurationProps,\n} from \"./widget_configuration\"\n\nexport type Props<CustomWidgetConfigurationProps> = WebViewProps &\n  SsoUrlProps &\n  InternalWidgetConfigurationProps &\n  CustomWidgetConfigurationProps\n\nexport type ApiRequestOptions = {\n  url: RequestInfo\n  options: RequestInit\n}\n\nexport type ApiResponseBody = {\n  widget_url: {\n    type: Type\n    url: string\n  }\n}\n\nexport type WebViewProps = {\n  onWebViewError?: (event: WebViewErrorEvent) => void\n}\n\nexport type SsoUrlProps = SsoUrlMethodProps & SsoUrlRequestProps\n\nexport type SsoUrlMethodProps =\n  | SsoUrlMethodUrlProps\n  | SsoUrlMethodPlatformApiProps\n  | SsoUrlMethodProxyServerProps\n\nexport type SsoUrlMethodUrlProps = {\n  url: string\n}\n\nexport type SsoUrlMethodPlatformApiProps = {\n  apiKey: string\n  clientId: string\n  environment: string\n  userGuid: string\n}\n\nexport type SsoUrlMethodProxyServerProps = {\n  proxy: string\n}\n\nexport type SsoUrlRequestProps = {\n  onSsoUrlLoadError?: (error: Error) => void\n  ssoRequestBuilder?: (\n    props: WidgetConfigurationProps & InternalWidgetConfigurationProps,\n  ) => ApiRequestOptions\n  ssoRequestPreprocess?: (opts: ApiRequestOptions) => ApiRequestOptions\n  ssoRequestPostprocess?: (res: ApiResponseBody) => string\n}\n\nexport function isSsoUrlMethodUrl(props: SsoUrlProps): props is SsoUrlMethodUrlProps {\n  return \"url\" in props && typeof props.url === \"string\"\n}\n\nexport function isSsoUrlMethodProxyServer(\n  props: SsoUrlProps,\n): props is SsoUrlMethodProxyServerProps {\n  return \"proxy\" in props && typeof props.proxy === \"string\"\n}\n\nexport function isSsoUrlMethodPlatformApi(\n  props: SsoUrlProps,\n): props is SsoUrlMethodPlatformApiProps {\n  return (\n    \"clientId\" in props &&\n    typeof props.clientId === \"string\" &&\n    \"apiKey\" in props &&\n    typeof props.apiKey === \"string\" &&\n    \"userGuid\" in props &&\n    typeof props.userGuid === \"string\" &&\n    \"environment\" in props &&\n    typeof props.environment === \"string\"\n  )\n}\n"],"names":["isSsoUrlMethodUrl","props","isSsoUrlMethodProxyServer","isSsoUrlMethodPlatformApi"],"mappings":"AA2DO,SAASA,EAAkBC,GAAmD;AACnF,SAAO,SAASA,KAAS,OAAOA,EAAM,OAAQ;AAChD;AAEO,SAASC,EACdD,GACuC;AACvC,SAAO,WAAWA,KAAS,OAAOA,EAAM,SAAU;AACpD;AAEO,SAASE,EACdF,GACuC;AACvC,SACE,cAAcA,KACd,OAAOA,EAAM,YAAa,YAC1B,YAAYA,KACZ,OAAOA,EAAM,UAAW,YACxB,cAAcA,KACd,OAAOA,EAAM,YAAa,YAC1B,iBAAiBA,KACjB,OAAOA,EAAM,eAAgB;AAEjC;"}