@executor-js/plugin-openapi 0.1.0 → 1.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddOpenApiSource-FLMNI742.js +19 -0
- package/dist/AddOpenApiSource-FLMNI742.js.map +1 -0
- package/dist/EditOpenApiSource-I4NIGIIJ.js +665 -0
- package/dist/EditOpenApiSource-I4NIGIIJ.js.map +1 -0
- package/dist/OpenApiSourceSummary-CM46DB4L.js +122 -0
- package/dist/OpenApiSourceSummary-CM46DB4L.js.map +1 -0
- package/dist/api/group.d.ts +224 -16
- package/dist/api/index.d.ts +634 -0
- package/dist/chunk-E7PZ2QGD.js +1303 -0
- package/dist/chunk-E7PZ2QGD.js.map +1 -0
- package/dist/chunk-GFQUEZUW.js +216 -0
- package/dist/chunk-GFQUEZUW.js.map +1 -0
- package/dist/chunk-OZ67JNID.js +1447 -0
- package/dist/chunk-OZ67JNID.js.map +1 -0
- package/dist/chunk-TGDT6QCH.js +1120 -0
- package/dist/chunk-TGDT6QCH.js.map +1 -0
- package/dist/client.js +165 -0
- package/dist/client.js.map +1 -0
- package/dist/core.js +8 -10
- package/dist/index.js +2 -1
- package/dist/react/AddOpenApiSource.d.ts +1 -1
- package/dist/react/OpenApiSourceDetailsFields.d.ts +18 -0
- package/dist/react/atoms.d.ts +320 -15
- package/dist/react/client.d.ts +226 -15
- package/dist/sdk/extract.d.ts +54 -3
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/invoke.d.ts +48 -4
- package/dist/sdk/openapi-utils.d.ts +4 -3
- package/dist/sdk/parse.d.ts +1 -1
- package/dist/sdk/parse.test.d.ts +1 -0
- package/dist/sdk/plugin.d.ts +247 -128
- package/dist/sdk/preview.d.ts +201 -49
- package/dist/sdk/store.d.ts +155 -45
- package/dist/sdk/types.d.ts +204 -137
- package/dist/sdk/usage-scope-isolation.test.d.ts +1 -0
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing.js +56 -0
- package/dist/testing.js.map +1 -0
- package/package.json +16 -4
- package/dist/chunk-RBE3CVB4.js +0 -2837
- package/dist/chunk-RBE3CVB4.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/AddOpenApiSource.tsx","../src/react/OpenApiSourceDetailsFields.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useAtomSet } from \"@effect/atom-react\";\nimport * as Exit from \"effect/Exit\";\nimport * as Match from \"effect/Match\";\nimport * as Option from \"effect/Option\";\nimport * as Schema from \"effect/Schema\";\n\nimport { ConnectionId, ScopeId, SecretId } from \"@executor-js/sdk/core\";\nimport { startOAuth } from \"@executor-js/react/api/atoms\";\nimport { useScope, useScopeStack } from \"@executor-js/react/api/scope-context\";\nimport { connectionWriteKeys, sourceWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\n\n// `addSpec` with an oauth2 payload persists a source row AND (for\n// clientCredentials) a freshly-minted Connection + owned secrets,\n// because the inline token exchange happens during `startOAuth`.\n// Invalidate both so the source-detail page opens into its connected\n// state without a refresh.\nconst addSpecWriteKeys = [...sourceWriteKeys, ...connectionWriteKeys] as const;\nconst bindingWriteKeys = [...sourceWriteKeys, ...connectionWriteKeys] as const;\nimport { HeadersList } from \"@executor-js/react/plugins/headers-list\";\nimport {\n HttpCredentialsEditor,\n emptyHttpCredentials,\n serializeHttpCredentials,\n type HttpCredentialsState,\n} from \"@executor-js/react/plugins/http-credentials\";\nimport {\n oauthCallbackUrl,\n useOAuthPopupFlow,\n type OAuthCompletionPayload,\n} from \"@executor-js/react/plugins/oauth-sign-in\";\nimport {\n CreatableSecretPicker,\n matchPresetKey,\n type HeaderState,\n} from \"@executor-js/react/plugins/secret-header-auth\";\nimport { CredentialScopeDropdown } from \"@executor-js/react/plugins/credential-target-scope\";\nimport { slugifyNamespace, useSourceIdentity } from \"@executor-js/react/plugins/source-identity\";\nimport { useSecretPickerSecrets } from \"@executor-js/react/plugins/use-secret-picker-secrets\";\nimport { Button } from \"@executor-js/react/components/button\";\nimport { CopyButton } from \"@executor-js/react/components/copy-button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@executor-js/react/components/collapsible\";\nimport {\n CardStack,\n CardStackContent,\n CardStackEntryField,\n} from \"@executor-js/react/components/card-stack\";\nimport { FieldLabel } from \"@executor-js/react/components/field\";\nimport { FloatActions } from \"@executor-js/react/components/float-actions\";\nimport { HelpTooltip } from \"@executor-js/react/components/help-tooltip\";\nimport { Label } from \"@executor-js/react/components/label\";\nimport { Textarea } from \"@executor-js/react/components/textarea\";\nimport { Checkbox } from \"@executor-js/react/components/checkbox\";\nimport { RadioGroup, RadioGroupItem } from \"@executor-js/react/components/radio-group\";\nimport { IOSSpinner, Spinner } from \"@executor-js/react/components/spinner\";\nimport { addOpenApiSpecOptimistic, previewOpenApiSpec, setOpenApiSourceBinding } from \"./atoms\";\nimport { OpenApiSourceDetailsFields } from \"./OpenApiSourceDetailsFields\";\nimport type { SpecPreview, HeaderPreset, OAuth2Preset } from \"../sdk/preview\";\nimport {\n headerBindingSlot,\n oauth2ClientIdSlot,\n oauth2ClientSecretSlot,\n oauth2ConnectionSlot,\n queryParamBindingSlot,\n} from \"../sdk/store\";\nimport {\n ConfiguredHeaderBinding,\n OAuth2SourceConfig,\n OpenApiSourceBindingInput,\n type ServerInfo,\n} from \"../sdk/types\";\nimport { expandServerUrlOptions } from \"../sdk/openapi-utils\";\n\nexport const OPENAPI_OAUTH_POPUP_NAME = \"openapi-oauth\";\nexport const OPENAPI_OAUTH_CALLBACK_PATH = \"/api/oauth/callback\";\n\nconst ErrorMessage = Schema.Struct({ message: Schema.String });\nconst decodeErrorMessage = Schema.decodeUnknownOption(ErrorMessage);\n\nconst errorMessageFromExit = (exit: Exit.Exit<unknown, unknown>, fallback: string): string =>\n Option.match(Option.flatMap(Exit.findErrorOption(exit), decodeErrorMessage), {\n onNone: () => fallback,\n onSome: ({ message }) => message,\n });\n\nexport const openApiOAuthConnectionId = (\n namespaceSlug: string,\n flow: OAuth2Preset[\"flow\"],\n): string =>\n flow === \"clientCredentials\"\n ? `openapi-oauth2-app-${namespaceSlug || \"default\"}`\n : `openapi-oauth2-user-${namespaceSlug || \"default\"}`;\n\n/**\n * OpenAPI 3.x requires OAuth2 tokenUrl/authorizationUrl to be absolute,\n * but some specs ship relative paths like `/api/rest/v1/oauth/token`.\n * Resolve them against the source's chosen baseUrl so the backend can\n * fetch them directly and the absolute URL is what gets persisted on\n * OAuth2SourceConfig.\n */\nexport function resolveOAuthUrl(url: string, baseUrl: string): string {\n if (!url) return url;\n // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL constructor normalizes provider metadata URLs\n try {\n new URL(url);\n return url;\n } catch {\n if (!baseUrl) return url;\n // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL constructor resolves relative provider metadata URLs\n try {\n return new URL(url, baseUrl).toString();\n } catch {\n return url;\n }\n }\n}\n\nexport function inferOAuthIssuerUrl(authorizationUrl: string): string | null {\n // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL constructor normalizes provider metadata URLs\n try {\n return new URL(authorizationUrl).origin;\n } catch {\n return null;\n }\n}\n\ntype StrategySelection =\n | { readonly kind: \"none\" }\n | { readonly kind: \"custom\" }\n | { readonly kind: \"header\"; readonly presetIndex: number }\n | { readonly kind: \"oauth2\"; readonly presetIndex: number };\n\nconst serializeStrategy = (s: StrategySelection): string =>\n Match.value(s).pipe(\n Match.when({ kind: \"none\" }, () => \"none\"),\n Match.when({ kind: \"custom\" }, () => \"custom\"),\n Match.when({ kind: \"header\" }, (sel) => `header:${sel.presetIndex}`),\n Match.when({ kind: \"oauth2\" }, (sel) => `oauth2:${sel.presetIndex}`),\n Match.exhaustive,\n );\n\nconst parseStrategy = (value: string): StrategySelection => {\n if (value === \"none\") return { kind: \"none\" };\n if (value === \"custom\") return { kind: \"custom\" };\n if (value.startsWith(\"header:\")) {\n return {\n kind: \"header\",\n presetIndex: Number(value.slice(\"header:\".length)),\n };\n }\n if (value.startsWith(\"oauth2:\")) {\n return {\n kind: \"oauth2\",\n presetIndex: Number(value.slice(\"oauth2:\".length)),\n };\n }\n return { kind: \"none\" };\n};\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction prefixForHeader(preset: HeaderPreset, headerName: string): string | undefined {\n const label = preset.label.toLowerCase();\n if (headerName.toLowerCase() === \"authorization\") {\n if (label.includes(\"bearer\")) return \"Bearer \";\n if (label.includes(\"basic\")) return \"Basic \";\n }\n return undefined;\n}\n\nfunction entriesFromSpecPreset(preset: HeaderPreset): HeaderState[] {\n return preset.secretHeaders.map((headerName) => {\n const prefix = prefixForHeader(preset, headerName);\n return {\n name: headerName,\n secretId: null,\n prefix,\n presetKey: matchPresetKey(headerName, prefix),\n fromPreset: true,\n };\n });\n}\n\nconst secretStorageDescription = (label: string): string =>\n label === \"Personal\"\n ? \"Only you can use this secret.\"\n : \"Everyone in the organization can use this secret.\";\n\n// ---------------------------------------------------------------------------\n// Main component — single progressive form\n// ---------------------------------------------------------------------------\n\nexport default function AddOpenApiSource(props: {\n onComplete: () => void;\n onCancel: () => void;\n initialUrl?: string;\n initialNamespace?: string;\n}) {\n // Spec input\n const [specUrl, setSpecUrl] = useState(props.initialUrl ?? \"\");\n const [analyzing, setAnalyzing] = useState(false);\n const [analyzeError, setAnalyzeError] = useState<string | null>(null);\n\n // After analysis\n const [preview, setPreview] = useState<SpecPreview | null>(null);\n const [baseUrl, setBaseUrl] = useState(\"\");\n const identity = useSourceIdentity({\n fallbackName: preview ? Option.getOrElse(preview.title, () => \"\") : \"\",\n fallbackNamespace: props.initialNamespace,\n });\n\n // Auth\n const [strategy, setStrategy] = useState<StrategySelection>({ kind: \"none\" });\n const [customHeaders, setCustomHeaders] = useState<HeaderState[]>([]);\n const [specFetchCredentials, setSpecFetchCredentials] = useState<HttpCredentialsState>(() =>\n emptyHttpCredentials(),\n );\n const [specFetchCredentialsOpen, setSpecFetchCredentialsOpen] = useState(false);\n const [runtimeCredentials, setRuntimeCredentials] = useState<HttpCredentialsState>(() =>\n emptyHttpCredentials(),\n );\n\n // OAuth2 state (only populated while an oauth2 preset is selected)\n const [oauth2ClientIdSecretId, setOauth2ClientIdSecretId] = useState<string | null>(null);\n const [oauth2ClientSecretSecretId, setOauth2ClientSecretSecretId] = useState<string | null>(null);\n const [oauth2ClientIdScope, setOauth2ClientIdScope] = useState<ScopeId | null>(null);\n const [oauth2ClientSecretScope, setOauth2ClientSecretScope] = useState<ScopeId | null>(null);\n const [oauth2SelectedScopes, setOauth2SelectedScopes] = useState<Set<string>>(new Set());\n const [oauth2AuthState, setOauth2AuthState] = useState<{\n readonly fingerprint: string;\n readonly auth: { readonly connectionId: string };\n } | null>(null);\n const [startingOAuth, setStartingOAuth] = useState(false);\n const [oauth2Error, setOauth2Error] = useState<string | null>(null);\n\n // Submit\n const [adding, setAdding] = useState(false);\n const [addError, setAddError] = useState<string | null>(null);\n\n const scopeId = useScope();\n const scopeStack = useScopeStack();\n const credentialScopeOptions = useMemo(\n () =>\n scopeStack.map((entry, index) => ({\n scopeId: entry.id,\n label: index === 0 ? \"Personal\" : entry.name || \"Organization\",\n description: secretStorageDescription(\n index === 0 ? \"Personal\" : entry.name || \"Organization\",\n ),\n })),\n [scopeStack],\n );\n const defaultCredentialTargetScope =\n credentialScopeOptions[credentialScopeOptions.length - 1]?.scopeId ?? scopeId;\n const defaultOAuthTokenTargetScope = credentialScopeOptions[0]?.scopeId ?? scopeId;\n const [credentialTargetScope, setCredentialTargetScope] = useState<ScopeId>(\n defaultCredentialTargetScope,\n );\n const [oauthTokenTargetScope, setOAuthTokenTargetScope] = useState<ScopeId>(\n defaultOAuthTokenTargetScope,\n );\n const bindingScopeOptions = useMemo(\n () => credentialScopeOptions.map((option) => ({ ...option })),\n [credentialScopeOptions],\n );\n useEffect(() => {\n if (!credentialScopeOptions.some((option) => option.scopeId === credentialTargetScope)) {\n setCredentialTargetScope(defaultCredentialTargetScope);\n }\n }, [credentialScopeOptions, credentialTargetScope, defaultCredentialTargetScope]);\n useEffect(() => {\n if (!credentialScopeOptions.some((option) => option.scopeId === oauthTokenTargetScope)) {\n setOAuthTokenTargetScope(defaultOAuthTokenTargetScope);\n }\n }, [credentialScopeOptions, defaultOAuthTokenTargetScope, oauthTokenTargetScope]);\n const initialCredentialScopeOption =\n credentialScopeOptions.find((option) => option.scopeId === credentialTargetScope) ??\n credentialScopeOptions[0];\n const initialCredentialScopeOptions = initialCredentialScopeOption\n ? [initialCredentialScopeOption]\n : [];\n const doPreview = useAtomSet(previewOpenApiSpec, { mode: \"promiseExit\" });\n const doAdd = useAtomSet(addOpenApiSpecOptimistic(scopeId), {\n mode: \"promiseExit\",\n });\n const doStartOAuth = useAtomSet(startOAuth, { mode: \"promiseExit\" });\n const doSetBinding = useAtomSet(setOpenApiSourceBinding, {\n mode: \"promiseExit\",\n });\n const secretList = useSecretPickerSecrets();\n const initialCredentialSecrets = useMemo(\n () => secretList.filter((secret) => secret.scopeId === String(credentialTargetScope)),\n [credentialTargetScope, secretList],\n );\n const oauth = useOAuthPopupFlow<OAuthCompletionPayload>({\n popupName: OPENAPI_OAUTH_POPUP_NAME,\n popupBlockedMessage: \"OAuth popup was blocked by the browser\",\n popupClosedMessage: \"OAuth cancelled - popup was closed before completing the flow.\",\n startErrorMessage: \"Failed to start OAuth\",\n });\n\n // Keep the latest handleAnalyze in a ref so the debounced effect doesn't\n // need it as a dependency (it closes over fresh state).\n const handleAnalyzeRef = useRef<() => void>(() => {});\n\n // Auto-analyze whenever the spec input changes, with a short debounce so\n // typing/pasting doesn't fire a request on every keystroke.\n useEffect(() => {\n const trimmed = specUrl.trim();\n if (!trimmed) return;\n if (preview) return;\n const handle = setTimeout(() => {\n handleAnalyzeRef.current();\n }, 400);\n return () => clearTimeout(handle);\n }, [specUrl, preview]);\n\n // ---- Derived state ----\n\n const expandServerOptions = (server: ServerInfo) => {\n return expandServerUrlOptions(server).map((value) => ({\n value,\n label: value,\n }));\n };\n\n const servers: readonly ServerInfo[] = preview?.servers ?? [];\n const baseUrlOptions = Array.from(\n new Map(servers.flatMap(expandServerOptions).map((option) => [option.value, option])).values(),\n );\n\n const resolvedBaseUrl = baseUrl.trim();\n\n const configuredHeaders: Record<string, ConfiguredHeaderBinding> = {};\n const headerBindings: Array<{\n slot: string;\n secretId: string;\n scope: ScopeId;\n secretScope: ScopeId;\n }> = [];\n const configuredQueryParams: Record<string, string | ConfiguredHeaderBinding> = {};\n const queryParamBindings: Array<{\n slot: string;\n secretId: string;\n scope: ScopeId;\n secretScope: ScopeId;\n }> = [];\n for (const ch of customHeaders) {\n if (!ch.name.trim()) continue;\n const slot = headerBindingSlot(ch.name.trim());\n configuredHeaders[ch.name.trim()] = ConfiguredHeaderBinding.make({\n kind: \"binding\",\n slot,\n prefix: ch.prefix,\n });\n if (ch.secretId) {\n headerBindings.push({\n slot,\n secretId: ch.secretId,\n scope: ch.targetScope ?? credentialTargetScope,\n secretScope: ch.secretScope ?? ch.targetScope ?? credentialTargetScope,\n });\n }\n }\n for (const param of runtimeCredentials.queryParams) {\n const name = param.name.trim();\n if (!name) continue;\n if (param.secretId) {\n const slot = queryParamBindingSlot(name);\n configuredQueryParams[name] = ConfiguredHeaderBinding.make({\n kind: \"binding\",\n slot,\n prefix: param.prefix,\n });\n queryParamBindings.push({\n slot,\n secretId: param.secretId,\n scope: param.targetScope ?? credentialTargetScope,\n secretScope: param.secretScope ?? param.targetScope ?? credentialTargetScope,\n });\n continue;\n }\n if (param.literalValue?.trim()) {\n configuredQueryParams[name] = param.literalValue.trim();\n }\n }\n\n const oauth2Presets: readonly OAuth2Preset[] = preview?.oauth2Presets ?? [];\n const oauth2RedirectUrl = oauthCallbackUrl(OPENAPI_OAUTH_CALLBACK_PATH);\n // Stable source id derivation. Matches the value `handleAdd` sends as\n // `namespace`, and is also the default credential key when the user\n // does not provide a more explicit shared connection id.\n const resolvedSourceId =\n slugifyNamespace(identity.namespace) ||\n (preview ? Option.getOrElse(preview.title, () => \"openapi\") : \"openapi\");\n const selectedOAuth2Preset: OAuth2Preset | null =\n strategy.kind === \"oauth2\" ? (oauth2Presets[strategy.presetIndex] ?? null) : null;\n const selectedOAuth2Fingerprint = selectedOAuth2Preset\n ? [\n resolvedSourceId,\n resolvedBaseUrl,\n selectedOAuth2Preset.securitySchemeName,\n selectedOAuth2Preset.flow,\n selectedOAuth2Preset.tokenUrl,\n Option.getOrElse(selectedOAuth2Preset.authorizationUrl, () => \"\"),\n ].join(\"\\n\")\n : \"\";\n const oauth2Auth =\n oauth2AuthState?.fingerprint === selectedOAuth2Fingerprint ? oauth2AuthState.auth : null;\n\n const configuredOAuth2 =\n strategy.kind === \"oauth2\" && selectedOAuth2Preset\n ? OAuth2SourceConfig.make({\n kind: \"oauth2\",\n securitySchemeName: selectedOAuth2Preset.securitySchemeName,\n flow: selectedOAuth2Preset.flow,\n tokenUrl: resolveOAuthUrl(selectedOAuth2Preset.tokenUrl, resolvedBaseUrl),\n authorizationUrl:\n selectedOAuth2Preset.flow === \"authorizationCode\"\n ? resolveOAuthUrl(\n Option.getOrElse(selectedOAuth2Preset.authorizationUrl, () => \"\"),\n resolvedBaseUrl,\n ) || null\n : null,\n clientIdSlot: oauth2ClientIdSlot(selectedOAuth2Preset.securitySchemeName),\n // Authorization-code specs can still be confidential clients\n // (Spotify is one example). Persist the slot even when the value is\n // deferred so the edit screen can collect the secret later.\n clientSecretSlot: oauth2ClientSecretSlot(selectedOAuth2Preset.securitySchemeName),\n connectionSlot: oauth2ConnectionSlot(selectedOAuth2Preset.securitySchemeName),\n scopes: [...oauth2SelectedScopes],\n })\n : null;\n const hasHeaders = Object.keys(configuredHeaders).length > 0;\n const oauth2Busy = startingOAuth || oauth.busy;\n const canConnectOAuth2 = Boolean(oauth2ClientIdSecretId) && resolvedBaseUrl.length > 0;\n const hasIncompleteHeaderCredentials =\n strategy.kind !== \"none\" &&\n strategy.kind !== \"oauth2\" &&\n customHeaders.some((header) => header.name.trim() && !header.secretId);\n const hasIncompleteQueryCredentials = runtimeCredentials.queryParams.some(\n (param) => param.name.trim() && !param.secretId && !param.literalValue?.trim(),\n );\n const willAddWithoutInitialCredentials =\n Boolean(selectedOAuth2Preset && !oauth2Auth) ||\n hasIncompleteHeaderCredentials ||\n hasIncompleteQueryCredentials;\n\n const canAdd = preview !== null && resolvedBaseUrl.length > 0;\n\n // ---- Handlers ----\n\n const handleAnalyze = async () => {\n setAnalyzing(true);\n setAnalyzeError(null);\n setAddError(null);\n const credentials = serializeHttpCredentials(specFetchCredentials);\n const exit = await doPreview({\n params: { scopeId },\n payload: {\n spec: specUrl,\n specFetchCredentials: credentials,\n },\n });\n if (Exit.isFailure(exit)) {\n setAnalyzeError(errorMessageFromExit(exit, \"Failed to parse spec\"));\n setAnalyzing(false);\n return;\n }\n const result = exit.value;\n setPreview(result);\n\n const firstServer = result.servers[0];\n setBaseUrl(firstServer ? (expandServerOptions(firstServer)[0]?.value ?? \"\") : \"\");\n\n const firstPreset = result.headerPresets[0];\n if (firstPreset) {\n setStrategy({ kind: \"header\", presetIndex: 0 });\n setCustomHeaders(entriesFromSpecPreset(firstPreset));\n } else if (result.oauth2Presets[0]) {\n setStrategy({ kind: \"oauth2\", presetIndex: 0 });\n setCustomHeaders([]);\n setOauth2SelectedScopes(new Set(Object.keys(result.oauth2Presets[0].scopes)));\n } else {\n // No header presets — default to \"custom\" so the headers editor is\n // visible immediately. Specs with no `security` block (e.g. Microsoft\n // Graph) would otherwise leave the user staring at just the\n // Authentication heading with no way to add headers.\n setStrategy({ kind: \"custom\" });\n setCustomHeaders([]);\n }\n setAnalyzing(false);\n };\n\n handleAnalyzeRef.current = handleAnalyze;\n\n const selectStrategy = (next: StrategySelection) => {\n setStrategy(next);\n // Clear any stale OAuth grant whenever the strategy changes away from oauth2.\n if (next.kind !== \"oauth2\") {\n setOauth2AuthState(null);\n setOauth2Error(null);\n }\n Match.value(next).pipe(\n Match.when({ kind: \"none\" }, () => {\n setCustomHeaders([]);\n }),\n Match.when({ kind: \"custom\" }, () => {\n const userHeaders = customHeaders.filter((h) => !h.fromPreset);\n setCustomHeaders(userHeaders.length > 0 ? userHeaders : []);\n }),\n Match.when({ kind: \"header\" }, (n) => {\n const preset = preview?.headerPresets[n.presetIndex];\n if (!preset) return;\n const userHeaders = customHeaders.filter((h) => !h.fromPreset);\n setCustomHeaders([...entriesFromSpecPreset(preset), ...userHeaders]);\n }),\n Match.when({ kind: \"oauth2\" }, (n) => {\n setCustomHeaders([]);\n const preset = preview?.oauth2Presets[n.presetIndex];\n if (preset) {\n setOauth2SelectedScopes(new Set(Object.keys(preset.scopes)));\n }\n }),\n Match.exhaustive,\n );\n };\n\n const handleHeadersChange = (next: HeaderState[]) => {\n setCustomHeaders(next);\n if (strategy.kind === \"header\" && next.every((h) => !h.fromPreset)) {\n setStrategy(next.length === 0 ? { kind: \"none\" } : { kind: \"custom\" });\n }\n };\n\n const setInitialCredentialScope = (targetScope: ScopeId) => {\n setCredentialTargetScope(targetScope);\n setCustomHeaders((headers) =>\n headers.map((header) => ({\n ...header,\n targetScope,\n ...(header.secretScope && header.secretScope !== targetScope\n ? { secretId: null, secretScope: undefined }\n : {}),\n })),\n );\n setOauth2ClientIdSecretId(null);\n setOauth2ClientSecretSecretId(null);\n setOauth2ClientIdScope(null);\n setOauth2ClientSecretScope(null);\n setOauth2AuthState(null);\n };\n\n const toggleOAuth2Scope = (scope: string) => {\n setOauth2SelectedScopes((prev) => {\n const copy = new Set(prev);\n if (copy.has(scope)) copy.delete(scope);\n else copy.add(scope);\n return copy;\n });\n // Changing scopes invalidates any previously-granted token.\n setOauth2AuthState(null);\n };\n\n const handleConnectOAuth2 = useCallback(async () => {\n if (!selectedOAuth2Preset || !oauth2ClientIdSecretId || !preview) return;\n oauth.cancel();\n setOauth2Error(null);\n const displayName = identity.name.trim() || selectedOAuth2Preset.securitySchemeName;\n\n const tokenUrl = resolveOAuthUrl(selectedOAuth2Preset.tokenUrl, resolvedBaseUrl);\n\n if (selectedOAuth2Preset.flow === \"clientCredentials\") {\n // RFC 6749 §4.4: no user-interactive consent step. The client_secret\n // is mandatory; the backend exchanges tokens inline and returns a\n // completed Connection we bind to the source's connection slot.\n if (!oauth2ClientSecretSecretId) {\n setOauth2Error(\"client_credentials requires a client secret\");\n return;\n }\n setStartingOAuth(true);\n const connectionId = openApiOAuthConnectionId(resolvedSourceId, selectedOAuth2Preset.flow);\n const exit = await doStartOAuth({\n params: { scopeId: oauthTokenTargetScope },\n payload: {\n endpoint: tokenUrl,\n redirectUrl: tokenUrl,\n connectionId,\n tokenScope: oauthTokenTargetScope,\n strategy: {\n kind: \"client-credentials\",\n tokenEndpoint: tokenUrl,\n clientIdSecretId: oauth2ClientIdSecretId,\n clientSecretSecretId: oauth2ClientSecretSecretId,\n scopes: [...oauth2SelectedScopes],\n },\n pluginId: \"openapi\",\n identityLabel: `${displayName} OAuth`,\n },\n });\n setStartingOAuth(false);\n if (Exit.isFailure(exit)) {\n setOauth2Error(errorMessageFromExit(exit, \"Failed to start OAuth\"));\n return;\n }\n const response = exit.value;\n if (!response.completedConnection) {\n setOauth2Error(\"client_credentials flow did not mint a connection\");\n return;\n }\n setOauth2AuthState({\n fingerprint: selectedOAuth2Fingerprint,\n auth: { connectionId: response.completedConnection.connectionId },\n });\n setOauth2Error(null);\n return;\n }\n\n const authorizationUrl = resolveOAuthUrl(\n Option.getOrElse(selectedOAuth2Preset.authorizationUrl, () => \"\"),\n resolvedBaseUrl,\n );\n const issuerUrl = inferOAuthIssuerUrl(authorizationUrl);\n\n await oauth.openAuthorization({\n tokenScope: oauthTokenTargetScope,\n run: async () => {\n const exit = await doStartOAuth({\n params: { scopeId: oauthTokenTargetScope },\n payload: {\n endpoint: authorizationUrl,\n connectionId: openApiOAuthConnectionId(resolvedSourceId, selectedOAuth2Preset.flow),\n tokenScope: oauthTokenTargetScope,\n redirectUrl: oauth2RedirectUrl,\n strategy: {\n kind: \"authorization-code\",\n authorizationEndpoint: authorizationUrl,\n tokenEndpoint: tokenUrl,\n issuerUrl,\n clientIdSecretId: oauth2ClientIdSecretId,\n clientSecretSecretId: oauth2ClientSecretSecretId ?? null,\n scopes: [...oauth2SelectedScopes],\n },\n pluginId: \"openapi\",\n identityLabel: `${displayName} OAuth`,\n },\n });\n if (Exit.isFailure(exit)) {\n // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: OAuth popup API represents start failure by rejecting run()\n throw new Error(errorMessageFromExit(exit, \"Failed to start OAuth\"));\n }\n const response = exit.value;\n if (response.authorizationUrl === null) {\n // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: OAuth popup API represents start failure by rejecting run()\n throw new Error(\"Unexpected response flow from server\");\n }\n return {\n sessionId: response.sessionId,\n authorizationUrl: response.authorizationUrl,\n };\n },\n onSuccess: (result) => {\n setOauth2AuthState({\n fingerprint: selectedOAuth2Fingerprint,\n auth: { connectionId: result.connectionId },\n });\n setOauth2Error(null);\n },\n onError: (message) => {\n setStartingOAuth(false);\n setOauth2Error(message);\n },\n });\n }, [\n selectedOAuth2Preset,\n oauth2ClientIdSecretId,\n oauth2ClientSecretSecretId,\n oauth2SelectedScopes,\n oauth2RedirectUrl,\n resolvedBaseUrl,\n preview,\n doStartOAuth,\n identity.name,\n resolvedSourceId,\n selectedOAuth2Fingerprint,\n oauth,\n oauthTokenTargetScope,\n ]);\n\n const handleCancelOAuth2 = useCallback(() => {\n oauth.cancel();\n setStartingOAuth(false);\n setOauth2Error(null);\n }, [oauth]);\n\n const handleAdd = async () => {\n setAdding(true);\n setAddError(null);\n const namespace = resolvedSourceId;\n const displayName =\n identity.name.trim() ||\n (preview ? Option.getOrElse(preview.title, () => namespace) : namespace);\n const exit = await doAdd({\n params: { scopeId },\n payload: {\n targetScope: scopeId,\n credentialTargetScope,\n spec: specUrl,\n specFetchCredentials: serializeHttpCredentials(specFetchCredentials),\n name: displayName,\n namespace,\n baseUrl: resolvedBaseUrl || undefined,\n ...(hasHeaders ? { headers: configuredHeaders } : {}),\n ...(Object.keys(configuredQueryParams).length > 0\n ? { queryParams: configuredQueryParams }\n : {}),\n ...(configuredOAuth2 ? { oauth2: configuredOAuth2 } : {}),\n },\n reactivityKeys: addSpecWriteKeys,\n });\n if (Exit.isFailure(exit)) {\n setAddError(errorMessageFromExit(exit, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n\n const sourceId = exit.value.namespace;\n const sourceScope = ScopeId.make(scopeId);\n const bindingScope = ScopeId.make(credentialTargetScope);\n const oauthTokenBindingScope = ScopeId.make(oauthTokenTargetScope);\n const clientIdSecretScope = oauth2ClientIdScope ?? bindingScope;\n const clientSecretSecretScope = oauth2ClientSecretScope ?? bindingScope;\n\n for (const binding of headerBindings) {\n const bindingExit = await doSetBinding({\n params: { scopeId },\n payload: OpenApiSourceBindingInput.make({\n sourceId,\n sourceScope,\n scope: binding.scope,\n slot: binding.slot,\n value: {\n kind: \"secret\",\n secretId: SecretId.make(binding.secretId),\n secretScopeId: binding.secretScope,\n },\n }),\n reactivityKeys: bindingWriteKeys,\n });\n if (Exit.isFailure(bindingExit)) {\n setAddError(errorMessageFromExit(bindingExit, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n }\n\n for (const binding of queryParamBindings) {\n const bindingExit = await doSetBinding({\n params: { scopeId },\n payload: OpenApiSourceBindingInput.make({\n sourceId,\n sourceScope,\n scope: binding.scope,\n slot: binding.slot,\n value: {\n kind: \"secret\",\n secretId: SecretId.make(binding.secretId),\n secretScopeId: binding.secretScope,\n },\n }),\n reactivityKeys: bindingWriteKeys,\n });\n if (Exit.isFailure(bindingExit)) {\n setAddError(errorMessageFromExit(bindingExit, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n }\n\n if (configuredOAuth2 && oauth2ClientIdSecretId) {\n const bindingExit = await doSetBinding({\n params: { scopeId },\n payload: OpenApiSourceBindingInput.make({\n sourceId,\n sourceScope,\n scope: bindingScope,\n slot: configuredOAuth2.clientIdSlot,\n value: {\n kind: \"secret\",\n secretId: SecretId.make(oauth2ClientIdSecretId),\n secretScopeId: clientIdSecretScope,\n },\n }),\n reactivityKeys: bindingWriteKeys,\n });\n if (Exit.isFailure(bindingExit)) {\n setAddError(errorMessageFromExit(bindingExit, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n }\n\n if (configuredOAuth2?.clientSecretSlot && oauth2ClientSecretSecretId) {\n const bindingExit = await doSetBinding({\n params: { scopeId },\n payload: OpenApiSourceBindingInput.make({\n sourceId,\n sourceScope,\n scope: bindingScope,\n slot: configuredOAuth2.clientSecretSlot,\n value: {\n kind: \"secret\",\n secretId: SecretId.make(oauth2ClientSecretSecretId),\n secretScopeId: clientSecretSecretScope,\n },\n }),\n reactivityKeys: bindingWriteKeys,\n });\n if (Exit.isFailure(bindingExit)) {\n setAddError(errorMessageFromExit(bindingExit, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n }\n\n if (configuredOAuth2 && oauth2Auth) {\n const bindingExit = await doSetBinding({\n params: { scopeId },\n payload: OpenApiSourceBindingInput.make({\n sourceId,\n sourceScope,\n scope: oauthTokenBindingScope,\n slot: configuredOAuth2.connectionSlot,\n value: {\n kind: \"connection\",\n connectionId: ConnectionId.make(oauth2Auth.connectionId),\n },\n }),\n reactivityKeys: bindingWriteKeys,\n });\n if (Exit.isFailure(bindingExit)) {\n setAddError(errorMessageFromExit(bindingExit, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n }\n\n props.onComplete();\n };\n\n // ---- Render ----\n\n return (\n <div className=\"flex flex-1 flex-col gap-6\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">Add OpenAPI Source</h1>\n </div>\n\n {!preview && (\n <>\n {/* ── Spec input ── */}\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntryField\n label=\"OpenAPI Spec\"\n hint=\"Paste a URL or raw JSON/YAML content.\"\n >\n <div className=\"relative\">\n <Textarea\n value={specUrl}\n onChange={(e) => {\n setSpecUrl((e.target as HTMLTextAreaElement).value);\n }}\n placeholder=\"https://api.example.com/openapi.json\"\n rows={3}\n maxRows={10}\n className=\"font-mono text-sm\"\n />\n {analyzing && (\n <div className=\"pointer-events-none absolute right-2 top-2\">\n <IOSSpinner className=\"size-4\" />\n </div>\n )}\n </div>\n </CardStackEntryField>\n </CardStackContent>\n </CardStack>\n\n <Collapsible\n open={specFetchCredentialsOpen}\n onOpenChange={setSpecFetchCredentialsOpen}\n className=\"space-y-3\"\n >\n <CollapsibleTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"self-start\">\n {specFetchCredentialsOpen ? \"Hide spec credentials\" : \"Add spec credentials\"}\n </Button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <HttpCredentialsEditor\n credentials={specFetchCredentials}\n onChange={setSpecFetchCredentials}\n existingSecrets={secretList}\n sourceName={identity.name}\n targetScope={credentialTargetScope}\n labels={{\n headers: \"Spec fetch headers\",\n queryParams: \"Spec fetch query parameters\",\n }}\n />\n </CollapsibleContent>\n </Collapsible>\n </>\n )}\n\n {/* ── Source information card (shown after analysis) ── */}\n {preview ? (\n <OpenApiSourceDetailsFields\n title={Option.getOrElse(preview.title, () => \"API\")}\n description={`${Option.getOrElse(preview.version, () => \"\")}${\n Option.isSome(preview.version) ? \" · \" : \"\"\n }${preview.operationCount} operation${preview.operationCount !== 1 ? \"s\" : \"\"}${\n preview.tags.length > 0\n ? ` · ${preview.tags.length} tag${preview.tags.length !== 1 ? \"s\" : \"\"}`\n : \"\"\n }`}\n identity={identity}\n baseUrl={resolvedBaseUrl}\n onBaseUrlChange={setBaseUrl}\n baseUrlOptions={baseUrlOptions}\n specUrl={specUrl}\n onSpecUrlChange={(value) => {\n setSpecUrl(value);\n setPreview(null);\n setBaseUrl(\"\");\n setCustomHeaders([]);\n setStrategy({ kind: \"none\" });\n setOauth2AuthState(null);\n setOauth2Error(null);\n }}\n faviconUrl={resolvedBaseUrl}\n baseUrlMissingMessage=\"A base URL is required to make requests.\"\n />\n ) : null}\n\n {analyzeError && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-[12px] text-destructive\">{analyzeError}</p>\n </div>\n )}\n\n {/* ── Everything below appears after analysis ── */}\n {preview && (\n <>\n <section className=\"space-y-2.5\">\n <FieldLabel>Authentication method</FieldLabel>\n {/* RadioGroup always renders so the static Custom + None radios\n stay visible for specs with no security schemes (e.g. MS Graph).\n The preset .map() blocks below render nothing when their arrays\n are empty. */}\n <RadioGroup\n value={serializeStrategy(strategy)}\n onValueChange={(value) => selectStrategy(parseStrategy(value))}\n className=\"gap-1.5\"\n >\n {preview.headerPresets.map((preset, i) => {\n const selected = strategy.kind === \"header\" && strategy.presetIndex === i;\n return (\n <Label\n key={`header-${i}`}\n className={`flex items-start gap-2.5 rounded-lg border px-3 py-2 cursor-pointer transition-colors ${\n selected\n ? \"border-primary/50 bg-primary/[0.03]\"\n : \"border-border hover:bg-accent/50\"\n }`}\n >\n <RadioGroupItem value={`header:${i}`} className=\"mt-0.5\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-xs font-medium text-foreground\">{preset.label}</div>\n {preset.secretHeaders.length > 0 && (\n <div className=\"mt-0.5 font-mono text-[10px] text-muted-foreground\">\n {preset.secretHeaders.join(\" · \")}\n </div>\n )}\n </div>\n </Label>\n );\n })}\n {oauth2Presets.map((preset, i) => {\n const selected = strategy.kind === \"oauth2\" && strategy.presetIndex === i;\n const scopeCount = Object.keys(preset.scopes).length;\n return (\n <Label\n key={`oauth2-${i}`}\n className={`flex items-start gap-2.5 rounded-lg border px-3 py-2 cursor-pointer transition-colors ${\n selected\n ? \"border-primary/50 bg-primary/[0.03]\"\n : \"border-border hover:bg-accent/50\"\n }`}\n >\n <RadioGroupItem value={`oauth2:${i}`} className=\"mt-0.5\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-xs font-medium text-foreground\">{preset.label}</div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground\">\n {scopeCount} scope{scopeCount === 1 ? \"\" : \"s\"}\n </div>\n </div>\n </Label>\n );\n })}\n <Label\n className={`flex items-center gap-2.5 rounded-lg border px-3 py-2 cursor-pointer transition-colors ${\n strategy.kind === \"custom\"\n ? \"border-primary/50 bg-primary/[0.03]\"\n : \"border-border hover:bg-accent/50\"\n }`}\n >\n <RadioGroupItem value=\"custom\" />\n <span className=\"text-xs font-medium text-foreground\">Custom</span>\n </Label>\n <Label\n className={`flex items-center gap-2.5 rounded-lg border px-3 py-2 cursor-pointer transition-colors ${\n strategy.kind === \"none\"\n ? \"border-primary/50 bg-primary/[0.03]\"\n : \"border-border hover:bg-accent/50\"\n }`}\n >\n <RadioGroupItem value=\"none\" />\n <span className=\"text-xs font-medium text-foreground\">None</span>\n </Label>\n </RadioGroup>\n\n {/* Header-based auth input */}\n {strategy.kind !== \"none\" && strategy.kind !== \"oauth2\" && (\n <div className=\"space-y-3\">\n <HeadersList\n headers={customHeaders}\n onHeadersChange={handleHeadersChange}\n existingSecrets={secretList}\n sourceName={identity.name}\n targetScope={credentialTargetScope}\n credentialScopeOptions={initialCredentialScopeOptions}\n bindingScopeOptions={bindingScopeOptions}\n restrictSecretsToTargetScope\n emptyLabel=\"No credentials yet. Add the header value this method should use.\"\n />\n </div>\n )}\n\n <HttpCredentialsEditor\n credentials={runtimeCredentials}\n onChange={setRuntimeCredentials}\n existingSecrets={secretList}\n sourceName={identity.name}\n targetScope={credentialTargetScope}\n credentialScopeOptions={initialCredentialScopeOptions}\n bindingScopeOptions={bindingScopeOptions}\n restrictSecretsToTargetScope\n sections={{ headers: false, queryParams: true }}\n labels={{ queryParams: \"Runtime query parameters\" }}\n />\n\n {/* OAuth2 configuration */}\n {selectedOAuth2Preset && (\n <div className=\"space-y-3 rounded-lg border border-border/60 bg-muted/10 p-3\">\n <div className=\"space-y-3\">\n <div className=\"space-y-1.5\">\n <FieldLabel className=\"text-[11px]\">\n Redirect URL{\" \"}\n <span className=\"text-muted-foreground\">\n · add this to your OAuth app's allowed redirects\n </span>\n </FieldLabel>\n <div className=\"flex items-center gap-1 rounded-md border border-border bg-background/50 px-2.5 py-1.5 font-mono text-[11px]\">\n <span className=\"truncate flex-1 text-foreground\">{oauth2RedirectUrl}</span>\n <CopyButton value={oauth2RedirectUrl} />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <FieldLabel className=\"text-[11px]\">Client ID secret</FieldLabel>\n <div className=\"grid gap-2 md:grid-cols-2\">\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-1.5\">\n <FieldLabel className=\"text-[11px]\">Secret</FieldLabel>\n <HelpTooltip label=\"Client ID secret\">\n Select or create the OAuth client ID secret.\n </HelpTooltip>\n </div>\n <CreatableSecretPicker\n value={oauth2ClientIdSecretId}\n onSelect={(id: string, secretScopeId?: ScopeId) => {\n setOauth2ClientIdSecretId(id);\n setOauth2ClientIdScope(secretScopeId ?? credentialTargetScope);\n setOauth2AuthState(null);\n }}\n secrets={initialCredentialSecrets}\n sourceName={identity.name}\n secretLabel=\"Client ID\"\n targetScope={oauth2ClientIdScope ?? credentialTargetScope}\n credentialScopeOptions={initialCredentialScopeOptions}\n onCreatedScope={setOauth2ClientIdScope}\n />\n </div>\n <CredentialScopeDropdown\n value={credentialTargetScope}\n options={bindingScopeOptions}\n onChange={setInitialCredentialScope}\n />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <FieldLabel className=\"text-[11px]\">\n Client secret{\" \"}\n <span className=\"text-muted-foreground\">\n · optional for public clients with PKCE\n </span>\n </FieldLabel>\n <div className=\"grid gap-2 md:grid-cols-2\">\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-1.5\">\n <FieldLabel className=\"text-[11px]\">Secret</FieldLabel>\n <HelpTooltip label=\"Client secret\">\n Select or create the OAuth client secret.\n </HelpTooltip>\n </div>\n <CreatableSecretPicker\n value={oauth2ClientSecretSecretId}\n onSelect={(id: string, secretScopeId?: ScopeId) => {\n setOauth2ClientSecretSecretId(id);\n setOauth2ClientSecretScope(secretScopeId ?? credentialTargetScope);\n setOauth2AuthState(null);\n }}\n secrets={initialCredentialSecrets}\n sourceName={identity.name}\n secretLabel=\"Client Secret\"\n targetScope={oauth2ClientSecretScope ?? credentialTargetScope}\n credentialScopeOptions={initialCredentialScopeOptions}\n onCreatedScope={setOauth2ClientSecretScope}\n />\n </div>\n <CredentialScopeDropdown\n value={credentialTargetScope}\n options={bindingScopeOptions}\n onChange={setInitialCredentialScope}\n />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <FieldLabel className=\"text-[11px]\">Scopes</FieldLabel>\n <div className=\"space-y-1 rounded-md border border-border/50 bg-background/50 p-2\">\n {Object.keys(selectedOAuth2Preset.scopes).length === 0 ? (\n <div className=\"text-[11px] italic text-muted-foreground\">\n No scopes declared by the spec.\n </div>\n ) : (\n Object.entries(selectedOAuth2Preset.scopes).map(([scope, description]) => (\n <Label key={scope} className=\"flex items-start gap-2 cursor-pointer py-1\">\n <Checkbox\n checked={oauth2SelectedScopes.has(scope)}\n onCheckedChange={() => toggleOAuth2Scope(scope)}\n />\n <div className=\"min-w-0 flex-1\">\n <div className=\"font-mono text-[11px] text-foreground\">{scope}</div>\n {description && (\n <div className=\"text-[10px] text-muted-foreground\">\n {description}\n </div>\n )}\n </div>\n </Label>\n ))\n )}\n </div>\n </div>\n\n {oauth2Auth ? (\n <div className=\"flex items-center justify-between rounded-md border border-green-500/30 bg-green-500/5 px-3 py-2\">\n <div className=\"text-[11px] text-green-700 dark:text-green-400\">\n Connected · {oauth2SelectedScopes.size} scope\n {oauth2SelectedScopes.size === 1 ? \"\" : \"s\"} granted\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={() => setOauth2AuthState(null)}>\n Disconnect\n </Button>\n </div>\n ) : oauth2Busy ? (\n <div className=\"flex items-center gap-2\">\n <div className=\"flex flex-1 items-center gap-2 rounded-md border border-border/60 bg-background/50 px-3 py-2 text-[11px] text-muted-foreground\">\n <Spinner className=\"size-3.5\" />\n Waiting for OAuth… complete the flow in the popup, or cancel to retry.\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={handleCancelOAuth2}>\n Cancel\n </Button>\n <Button variant=\"secondary\" size=\"sm\" onClick={handleConnectOAuth2}>\n Retry\n </Button>\n </div>\n ) : (\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"grid gap-2 md:grid-cols-2\">\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-1.5\">\n <FieldLabel className=\"text-[11px]\">OAuth sign-in</FieldLabel>\n <HelpTooltip label=\"OAuth sign-in\">\n Start the provider OAuth flow.\n </HelpTooltip>\n </div>\n <Button\n variant=\"secondary\"\n onClick={handleConnectOAuth2}\n disabled={!canConnectOAuth2}\n className={\n canConnectOAuth2\n ? \"w-full border border-green-500/30 bg-green-600 text-white hover:bg-green-700 focus-visible:ring-green-500/30 dark:bg-green-500 dark:text-white dark:hover:bg-green-600\"\n : \"w-full\"\n }\n >\n Connect via OAuth\n </Button>\n </div>\n <CredentialScopeDropdown\n value={oauthTokenTargetScope}\n options={credentialScopeOptions}\n onChange={(targetScope) => {\n setOAuthTokenTargetScope(targetScope);\n setOauth2AuthState(null);\n }}\n label=\"Token saved to\"\n help=\"Choose who can use the signed-in OAuth token.\"\n />\n </div>\n </div>\n )}\n\n {oauth2Error && (\n <div className=\"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-[11px] text-destructive\">{oauth2Error}</p>\n </div>\n )}\n </div>\n </div>\n )}\n </section>\n\n {/* Add error */}\n {addError && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-[12px] text-destructive\">{addError}</p>\n </div>\n )}\n </>\n )}\n\n <FloatActions>\n <Button variant=\"ghost\" onClick={props.onCancel} disabled={adding}>\n Cancel\n </Button>\n {preview && (\n <Button onClick={handleAdd} disabled={!canAdd || adding}>\n {adding && <Spinner className=\"size-3.5\" />}\n {adding\n ? \"Adding…\"\n : willAddWithoutInitialCredentials\n ? \"Add without credentials\"\n : \"Add source\"}\n </Button>\n )}\n </FloatActions>\n </div>\n );\n}\n","import {\n CardStack,\n CardStackContent,\n CardStackEntry,\n CardStackEntryContent,\n CardStackEntryDescription,\n CardStackEntryField,\n CardStackEntryTitle,\n} from \"@executor-js/react/components/card-stack\";\nimport {\n FreeformCombobox,\n type FreeformComboboxOption,\n} from \"@executor-js/react/components/combobox\";\nimport { Input } from \"@executor-js/react/components/input\";\nimport { SourceFavicon } from \"@executor-js/react/components/source-favicon\";\nimport {\n SourceIdentityFieldRows,\n type SourceIdentity,\n} from \"@executor-js/react/plugins/source-identity\";\n\nexport function OpenApiSourceDetailsFields(props: {\n readonly title: string;\n readonly description?: string;\n readonly identity: SourceIdentity;\n readonly baseUrl: string;\n readonly onBaseUrlChange: (value: string) => void;\n readonly baseUrlOptions?: readonly FreeformComboboxOption[];\n readonly specUrl?: string;\n readonly onSpecUrlChange?: (value: string) => void;\n readonly faviconUrl?: string;\n readonly namespaceReadOnly?: boolean;\n readonly specUrlDisabled?: boolean;\n readonly saveState?: \"idle\" | \"saving\" | \"saved\";\n readonly baseUrlMissingMessage?: string;\n readonly footer?: string;\n}) {\n const baseUrlOptions = props.baseUrlOptions ?? [];\n\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntry>\n {props.faviconUrl && <SourceFavicon url={props.faviconUrl} size={16} />}\n <CardStackEntryContent>\n <CardStackEntryTitle>{props.title}</CardStackEntryTitle>\n {props.description && (\n <CardStackEntryDescription>{props.description}</CardStackEntryDescription>\n )}\n </CardStackEntryContent>\n {props.saveState && props.saveState !== \"idle\" && (\n <span className=\"text-xs text-muted-foreground\">\n {props.saveState === \"saving\" ? \"Saving…\" : \"Saved\"}\n </span>\n )}\n </CardStackEntry>\n <SourceIdentityFieldRows\n identity={props.identity}\n namespaceReadOnly={props.namespaceReadOnly}\n />\n <div className=\"grid grid-cols-1 md:grid-cols-2\">\n <CardStackEntryField label=\"Base URL\">\n {baseUrlOptions.length > 0 ? (\n <FreeformCombobox\n value={props.baseUrl}\n onValueChange={props.onBaseUrlChange}\n options={baseUrlOptions}\n placeholder=\"https://api.example.com\"\n className=\"w-full\"\n inputClassName=\"font-mono text-sm\"\n />\n ) : (\n <Input\n value={props.baseUrl}\n onChange={(e) => props.onBaseUrlChange((e.target as HTMLInputElement).value)}\n placeholder=\"https://api.example.com\"\n className=\"font-mono text-sm\"\n />\n )}\n\n {props.baseUrlMissingMessage && !props.baseUrl && (\n <p className=\"text-[11px] text-amber-600 dark:text-amber-400\">\n {props.baseUrlMissingMessage}\n </p>\n )}\n </CardStackEntryField>\n {props.specUrl !== undefined && props.onSpecUrlChange && (\n <CardStackEntryField label=\"Spec URL\">\n <Input\n value={props.specUrl}\n onChange={(e) => props.onSpecUrlChange?.((e.target as HTMLInputElement).value)}\n placeholder=\"https://api.example.com/openapi.json\"\n className=\"font-mono text-sm\"\n disabled={props.specUrlDisabled}\n />\n </CardStackEntryField>\n )}\n </div>\n {props.footer && (\n <CardStackEntry>\n <CardStackEntryContent>\n <CardStackEntryTitle>{props.footer}</CardStackEntryTitle>\n </CardStackEntryContent>\n </CardStackEntry>\n )}\n </CardStackContent>\n </CardStack>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AAClE,SAAS,kBAAkB;AAC3B,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,YAAY;AACxB,YAAY,YAAY;AAExB,SAAS,cAAc,SAAS,gBAAgB;AAChD,SAAS,kBAAkB;AAC3B,SAAS,UAAU,qBAAqB;AACxC,SAAS,qBAAqB,uBAAuB;AASrD,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,+BAA+B;AACxC,SAAS,kBAAkB,yBAA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AA,OAEJ;AAAA,KACF;AAEJ;","names":["CardStack","CardStackContent","CardStackEntryField","jsx","jsxs","value","CardStack","CardStackContent","CardStackEntryField"]}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// src/react/plugin-client.tsx
|
|
2
|
+
import { defineClientPlugin } from "@executor-js/sdk/client";
|
|
3
|
+
|
|
4
|
+
// src/react/source-plugin.ts
|
|
5
|
+
import { lazy } from "react";
|
|
6
|
+
|
|
7
|
+
// src/sdk/presets.ts
|
|
8
|
+
var openApiPresets = [
|
|
9
|
+
{
|
|
10
|
+
id: "stripe",
|
|
11
|
+
name: "Stripe",
|
|
12
|
+
summary: "Payments, subscriptions, customers, and invoices.",
|
|
13
|
+
url: "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json",
|
|
14
|
+
icon: "https://stripe.com/favicon.ico",
|
|
15
|
+
featured: true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "github-rest",
|
|
19
|
+
name: "GitHub REST",
|
|
20
|
+
summary: "Repos, issues, pull requests, actions, and users.",
|
|
21
|
+
url: "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",
|
|
22
|
+
icon: "https://github.com/favicon.ico",
|
|
23
|
+
featured: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "vercel",
|
|
27
|
+
name: "Vercel",
|
|
28
|
+
summary: "Deployments, domains, projects, and edge config.",
|
|
29
|
+
url: "https://openapi.vercel.sh",
|
|
30
|
+
icon: "https://vercel.com/favicon.ico",
|
|
31
|
+
featured: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "cloudflare",
|
|
35
|
+
name: "Cloudflare",
|
|
36
|
+
summary: "DNS, workers, pages, R2, and security rules.",
|
|
37
|
+
url: "https://raw.githubusercontent.com/cloudflare/api-schemas/main/openapi.json",
|
|
38
|
+
icon: "https://cloudflare.com/favicon.ico",
|
|
39
|
+
featured: true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "neon",
|
|
43
|
+
name: "Neon",
|
|
44
|
+
summary: "Serverless Postgres \u2014 projects, branches, and endpoints.",
|
|
45
|
+
url: "https://neon.tech/api_spec/release/v2.json",
|
|
46
|
+
icon: "https://neon.tech/favicon/favicon.ico",
|
|
47
|
+
featured: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "openai",
|
|
51
|
+
name: "OpenAI",
|
|
52
|
+
summary: "Models, files, responses, and fine-tuning.",
|
|
53
|
+
url: "https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml",
|
|
54
|
+
icon: "https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/openai.svg",
|
|
55
|
+
featured: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "sentry",
|
|
59
|
+
name: "Sentry",
|
|
60
|
+
summary: "Error tracking, performance monitoring, and releases.",
|
|
61
|
+
url: "https://raw.githubusercontent.com/getsentry/sentry-api-schema/main/openapi-derefed.json",
|
|
62
|
+
icon: "https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png",
|
|
63
|
+
featured: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "exa",
|
|
67
|
+
name: "Exa",
|
|
68
|
+
summary: "Web search, similar links, content retrieval, and answers.",
|
|
69
|
+
url: "https://raw.githubusercontent.com/exa-labs/openapi-spec/refs/heads/master/exa-openapi-spec.yaml",
|
|
70
|
+
icon: "https://exa.ai/images/favicon-32x32.png",
|
|
71
|
+
featured: true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "exa-websets",
|
|
75
|
+
name: "Exa Websets",
|
|
76
|
+
summary: "Websets, enrichments, webhooks, and monitors.",
|
|
77
|
+
url: "https://raw.githubusercontent.com/exa-labs/openapi-spec/refs/heads/master/exa-websets-spec.yaml",
|
|
78
|
+
icon: "https://exa.ai/images/favicon-32x32.png",
|
|
79
|
+
featured: true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "axiom",
|
|
83
|
+
name: "Axiom",
|
|
84
|
+
summary: "Log ingestion, querying, datasets, and monitors.",
|
|
85
|
+
url: "https://axiom.co/docs/restapi/versions/v2.json",
|
|
86
|
+
icon: "https://axiom.co/favicon.ico"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "asana",
|
|
90
|
+
name: "Asana",
|
|
91
|
+
summary: "Tasks, projects, teams, and workspace management.",
|
|
92
|
+
url: "https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/asana.com/1.0/openapi.yaml",
|
|
93
|
+
icon: "https://asana.com/favicon.ico"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "twilio",
|
|
97
|
+
name: "Twilio",
|
|
98
|
+
summary: "SMS, voice, video, and messaging APIs.",
|
|
99
|
+
url: "https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json",
|
|
100
|
+
icon: "https://twilio.com/favicon.ico"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "digitalocean",
|
|
104
|
+
name: "DigitalOcean",
|
|
105
|
+
summary: "Droplets, Kubernetes, databases, and networking.",
|
|
106
|
+
url: "https://raw.githubusercontent.com/digitalocean/openapi/main/specification/DigitalOcean-public.v2.yaml",
|
|
107
|
+
icon: "https://assets.digitalocean.com/favicon.ico"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "petstore",
|
|
111
|
+
name: "Petstore",
|
|
112
|
+
summary: "Classic OpenAPI demo \u2014 no auth required.",
|
|
113
|
+
url: "https://petstore3.swagger.io/api/v3/openapi.json",
|
|
114
|
+
icon: "https://petstore3.swagger.io/favicon-32x32.png"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "val-town",
|
|
118
|
+
name: "Val Town",
|
|
119
|
+
summary: "Vals, runs, blobs, and email/web endpoints.",
|
|
120
|
+
url: "https://api.val.town/openapi.json",
|
|
121
|
+
icon: "https://www.val.town/favicon.svg"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "resend",
|
|
125
|
+
name: "Resend",
|
|
126
|
+
summary: "Transactional email sending and domain management.",
|
|
127
|
+
url: "https://raw.githubusercontent.com/resend/resend-openapi/main/resend.yaml",
|
|
128
|
+
icon: "https://resend.com/static/favicons/favicon.ico"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "spotify",
|
|
132
|
+
name: "Spotify",
|
|
133
|
+
summary: "Tracks, albums, playlists, library, and playback.",
|
|
134
|
+
url: "https://raw.githubusercontent.com/sonallux/spotify-web-api/refs/heads/main/official-spotify-open-api.yml",
|
|
135
|
+
icon: "https://spotify.com/favicon.ico"
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
// src/react/source-plugin.ts
|
|
140
|
+
var importAdd = () => import("./AddOpenApiSource-FLMNI742.js");
|
|
141
|
+
var importEdit = () => import("./EditOpenApiSource-I4NIGIIJ.js");
|
|
142
|
+
var importSummary = () => import("./OpenApiSourceSummary-CM46DB4L.js");
|
|
143
|
+
var openApiSourcePlugin = {
|
|
144
|
+
key: "openapi",
|
|
145
|
+
label: "OpenAPI",
|
|
146
|
+
add: lazy(importAdd),
|
|
147
|
+
edit: lazy(importEdit),
|
|
148
|
+
summary: lazy(importSummary),
|
|
149
|
+
presets: openApiPresets,
|
|
150
|
+
preload: () => {
|
|
151
|
+
void importAdd();
|
|
152
|
+
void importEdit();
|
|
153
|
+
void importSummary();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/react/plugin-client.tsx
|
|
158
|
+
var plugin_client_default = defineClientPlugin({
|
|
159
|
+
id: "openapi",
|
|
160
|
+
sourcePlugin: openApiSourcePlugin
|
|
161
|
+
});
|
|
162
|
+
export {
|
|
163
|
+
plugin_client_default as default
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/plugin-client.tsx","../src/react/source-plugin.ts","../src/sdk/presets.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @executor-js/plugin-openapi/client — `defineClientPlugin` entry.\n//\n// Aggregates the openapi plugin's frontend contributions into a single\n// declarative spec. The host's Vite plugin reads this via\n// `virtual:executor/plugins-client`, so the host's sources page derives\n// the openapi entry from here without a direct `*/react` import.\n//\n// The richer add/edit/summary components still live in `./react`; this\n// module just imports them and bundles them into the spec.\n// ---------------------------------------------------------------------------\n\nimport { defineClientPlugin } from \"@executor-js/sdk/client\";\n\nimport { openApiSourcePlugin } from \"./source-plugin\";\n\nexport default defineClientPlugin({\n id: \"openapi\" as const,\n sourcePlugin: openApiSourcePlugin,\n});\n","import { lazy } from \"react\";\nimport type { SourcePlugin } from \"@executor-js/sdk/client\";\nimport { openApiPresets } from \"../sdk/presets\";\n\nconst importAdd = () => import(\"./AddOpenApiSource\");\nconst importEdit = () => import(\"./EditOpenApiSource\");\nconst importSummary = () => import(\"./OpenApiSourceSummary\");\n\nexport const openApiSourcePlugin: SourcePlugin = {\n key: \"openapi\",\n label: \"OpenAPI\",\n add: lazy(importAdd),\n edit: lazy(importEdit),\n summary: lazy(importSummary),\n presets: openApiPresets,\n preload: () => {\n void importAdd();\n void importEdit();\n void importSummary();\n },\n};\n","export interface OpenApiPreset {\n readonly id: string;\n readonly name: string;\n readonly summary: string;\n readonly url: string;\n readonly icon?: string;\n readonly featured?: boolean;\n}\n\nexport const openApiPresets: readonly OpenApiPreset[] = [\n {\n id: \"stripe\",\n name: \"Stripe\",\n summary: \"Payments, subscriptions, customers, and invoices.\",\n url: \"https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json\",\n icon: \"https://stripe.com/favicon.ico\",\n featured: true,\n },\n {\n id: \"github-rest\",\n name: \"GitHub REST\",\n summary: \"Repos, issues, pull requests, actions, and users.\",\n url: \"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json\",\n icon: \"https://github.com/favicon.ico\",\n featured: true,\n },\n {\n id: \"vercel\",\n name: \"Vercel\",\n summary: \"Deployments, domains, projects, and edge config.\",\n url: \"https://openapi.vercel.sh\",\n icon: \"https://vercel.com/favicon.ico\",\n featured: true,\n },\n {\n id: \"cloudflare\",\n name: \"Cloudflare\",\n summary: \"DNS, workers, pages, R2, and security rules.\",\n url: \"https://raw.githubusercontent.com/cloudflare/api-schemas/main/openapi.json\",\n icon: \"https://cloudflare.com/favicon.ico\",\n featured: true,\n },\n {\n id: \"neon\",\n name: \"Neon\",\n summary: \"Serverless Postgres — projects, branches, and endpoints.\",\n url: \"https://neon.tech/api_spec/release/v2.json\",\n icon: \"https://neon.tech/favicon/favicon.ico\",\n featured: true,\n },\n {\n id: \"openai\",\n name: \"OpenAI\",\n summary: \"Models, files, responses, and fine-tuning.\",\n url: \"https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml\",\n icon: \"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/openai.svg\",\n featured: true,\n },\n {\n id: \"sentry\",\n name: \"Sentry\",\n summary: \"Error tracking, performance monitoring, and releases.\",\n url: \"https://raw.githubusercontent.com/getsentry/sentry-api-schema/main/openapi-derefed.json\",\n icon: \"https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png\",\n featured: true,\n },\n {\n id: \"exa\",\n name: \"Exa\",\n summary: \"Web search, similar links, content retrieval, and answers.\",\n url: \"https://raw.githubusercontent.com/exa-labs/openapi-spec/refs/heads/master/exa-openapi-spec.yaml\",\n icon: \"https://exa.ai/images/favicon-32x32.png\",\n featured: true,\n },\n {\n id: \"exa-websets\",\n name: \"Exa Websets\",\n summary: \"Websets, enrichments, webhooks, and monitors.\",\n url: \"https://raw.githubusercontent.com/exa-labs/openapi-spec/refs/heads/master/exa-websets-spec.yaml\",\n icon: \"https://exa.ai/images/favicon-32x32.png\",\n featured: true,\n },\n {\n id: \"axiom\",\n name: \"Axiom\",\n summary: \"Log ingestion, querying, datasets, and monitors.\",\n url: \"https://axiom.co/docs/restapi/versions/v2.json\",\n icon: \"https://axiom.co/favicon.ico\",\n },\n {\n id: \"asana\",\n name: \"Asana\",\n summary: \"Tasks, projects, teams, and workspace management.\",\n url: \"https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/asana.com/1.0/openapi.yaml\",\n icon: \"https://asana.com/favicon.ico\",\n },\n {\n id: \"twilio\",\n name: \"Twilio\",\n summary: \"SMS, voice, video, and messaging APIs.\",\n url: \"https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json\",\n icon: \"https://twilio.com/favicon.ico\",\n },\n {\n id: \"digitalocean\",\n name: \"DigitalOcean\",\n summary: \"Droplets, Kubernetes, databases, and networking.\",\n url: \"https://raw.githubusercontent.com/digitalocean/openapi/main/specification/DigitalOcean-public.v2.yaml\",\n icon: \"https://assets.digitalocean.com/favicon.ico\",\n },\n {\n id: \"petstore\",\n name: \"Petstore\",\n summary: \"Classic OpenAPI demo — no auth required.\",\n url: \"https://petstore3.swagger.io/api/v3/openapi.json\",\n icon: \"https://petstore3.swagger.io/favicon-32x32.png\",\n },\n {\n id: \"val-town\",\n name: \"Val Town\",\n summary: \"Vals, runs, blobs, and email/web endpoints.\",\n url: \"https://api.val.town/openapi.json\",\n icon: \"https://www.val.town/favicon.svg\",\n },\n {\n id: \"resend\",\n name: \"Resend\",\n summary: \"Transactional email sending and domain management.\",\n url: \"https://raw.githubusercontent.com/resend/resend-openapi/main/resend.yaml\",\n icon: \"https://resend.com/static/favicons/favicon.ico\",\n },\n {\n id: \"spotify\",\n name: \"Spotify\",\n summary: \"Tracks, albums, playlists, library, and playback.\",\n url: \"https://raw.githubusercontent.com/sonallux/spotify-web-api/refs/heads/main/official-spotify-open-api.yml\",\n icon: \"https://spotify.com/favicon.ico\",\n },\n];\n"],"mappings":";AAYA,SAAS,0BAA0B;;;ACZnC,SAAS,YAAY;;;ACSd,IAAM,iBAA2C;AAAA,EACtD;AAAA,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-1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
annotationsForOperation,
|
|
3
|
+
invoke,
|
|
4
|
+
invokeWithLayer,
|
|
5
|
+
openApiPlugin,
|
|
6
|
+
resolveHeaders
|
|
7
|
+
} from "./chunk-OZ67JNID.js";
|
|
1
8
|
import {
|
|
2
9
|
AuthStrategy,
|
|
3
10
|
DocResolver,
|
|
@@ -6,10 +13,8 @@ import {
|
|
|
6
13
|
ExtractionResult,
|
|
7
14
|
HeaderPreset,
|
|
8
15
|
HttpMethod,
|
|
9
|
-
InvocationConfig,
|
|
10
16
|
InvocationResult,
|
|
11
17
|
MediaBinding,
|
|
12
|
-
OAuth2Auth,
|
|
13
18
|
OAuth2AuthorizationCodeFlow,
|
|
14
19
|
OAuth2ClientCredentialsFlow,
|
|
15
20
|
OAuth2Flows,
|
|
@@ -32,22 +37,17 @@ import {
|
|
|
32
37
|
ServerInfo,
|
|
33
38
|
ServerVariable,
|
|
34
39
|
SpecPreview,
|
|
35
|
-
annotationsForOperation,
|
|
36
40
|
extract,
|
|
37
41
|
fetchSpecText,
|
|
38
|
-
invoke,
|
|
39
|
-
invokeWithLayer,
|
|
40
42
|
makeDefaultOpenapiStore,
|
|
41
|
-
openApiPlugin,
|
|
42
43
|
openapiSchema,
|
|
43
44
|
parse,
|
|
44
45
|
preferredContent,
|
|
45
46
|
previewSpec,
|
|
46
47
|
resolveBaseUrl,
|
|
47
|
-
resolveHeaders,
|
|
48
48
|
resolveSpecText,
|
|
49
49
|
substituteUrlVariables
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-E7PZ2QGD.js";
|
|
51
51
|
export {
|
|
52
52
|
AuthStrategy,
|
|
53
53
|
DocResolver,
|
|
@@ -56,10 +56,8 @@ export {
|
|
|
56
56
|
ExtractionResult,
|
|
57
57
|
HeaderPreset,
|
|
58
58
|
HttpMethod,
|
|
59
|
-
InvocationConfig,
|
|
60
59
|
InvocationResult,
|
|
61
60
|
MediaBinding,
|
|
62
|
-
OAuth2Auth,
|
|
63
61
|
OAuth2AuthorizationCodeFlow,
|
|
64
62
|
OAuth2ClientCredentialsFlow,
|
|
65
63
|
OAuth2Flows,
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export declare const openApiOAuthConnectionId: (namespaceSlug: string, flow: OAu
|
|
|
7
7
|
* but some specs ship relative paths like `/api/rest/v1/oauth/token`.
|
|
8
8
|
* Resolve them against the source's chosen baseUrl so the backend can
|
|
9
9
|
* fetch them directly and the absolute URL is what gets persisted on
|
|
10
|
-
*
|
|
10
|
+
* OAuth2SourceConfig.
|
|
11
11
|
*/
|
|
12
12
|
export declare function resolveOAuthUrl(url: string, baseUrl: string): string;
|
|
13
13
|
export declare function inferOAuthIssuerUrl(authorizationUrl: string): string | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type FreeformComboboxOption } from "@executor-js/react/components/combobox";
|
|
2
|
+
import { type SourceIdentity } from "@executor-js/react/plugins/source-identity";
|
|
3
|
+
export declare function OpenApiSourceDetailsFields(props: {
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly identity: SourceIdentity;
|
|
7
|
+
readonly baseUrl: string;
|
|
8
|
+
readonly onBaseUrlChange: (value: string) => void;
|
|
9
|
+
readonly baseUrlOptions?: readonly FreeformComboboxOption[];
|
|
10
|
+
readonly specUrl?: string;
|
|
11
|
+
readonly onSpecUrlChange?: (value: string) => void;
|
|
12
|
+
readonly faviconUrl?: string;
|
|
13
|
+
readonly namespaceReadOnly?: boolean;
|
|
14
|
+
readonly specUrlDisabled?: boolean;
|
|
15
|
+
readonly saveState?: "idle" | "saving" | "saved";
|
|
16
|
+
readonly baseUrlMissingMessage?: string;
|
|
17
|
+
readonly footer?: string;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|