@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 0.5.1-develop.2954.610bab2d08
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/helpers/integration/salesUi.js +25 -23
- package/dist/helpers/integration/salesUi.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/fields/attachment.js +4 -6
- package/dist/modules/attachments/fields/attachment.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +26 -26
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/business_rules/components/ActionRow.js +36 -25
- package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
- package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionRow.js +19 -10
- package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
- package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
- package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/components/AddressEditor.js +24 -7
- package/dist/modules/customers/components/AddressEditor.js.map +2 -2
- package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
- package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
- package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +19 -14
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +16 -12
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
- package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
- package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +18 -13
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +23 -19
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/feature_toggles/components/formConfig.js +17 -9
- package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
- package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
- package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
- package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
- package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
- package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
- package/dist/modules/staff/components/TeamMemberForm.js +14 -9
- package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
- package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
- package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js +14 -6
- package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
- package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
- package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/package.json +3 -3
- package/src/helpers/integration/salesUi.ts +40 -30
- package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
- package/src/modules/attachments/fields/attachment.tsx +4 -6
- package/src/modules/auth/backend/users/create/page.tsx +16 -20
- package/src/modules/business_rules/components/ActionRow.tsx +51 -32
- package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
- package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
- package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
- package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
- package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
- package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
- package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
- package/src/modules/customers/components/AddressEditor.tsx +30 -16
- package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
- package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
- package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
- package/src/modules/customers/components/detail/DealForm.tsx +33 -20
- package/src/modules/customers/components/formConfig.tsx +25 -17
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
- package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
- package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
- package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
- package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
- package/src/modules/entities/components/EncryptionManager.tsx +49 -33
- package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
- package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
- package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
- package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
- package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
- package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
- package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
- package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
- package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
- package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
- package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
- package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
- package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
- package/src/modules/workflows/components/StepsEditor.tsx +20 -10
- package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
- package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
- package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
|
@@ -3,6 +3,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useEffect, useMemo, useState } from "react";
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import Link from "next/link";
|
|
6
|
+
import { Input } from "@open-mercato/ui/primitives/input";
|
|
7
|
+
import {
|
|
8
|
+
Select,
|
|
9
|
+
SelectContent,
|
|
10
|
+
SelectItem,
|
|
11
|
+
SelectTrigger,
|
|
12
|
+
SelectValue
|
|
13
|
+
} from "@open-mercato/ui/primitives/select";
|
|
6
14
|
const METHOD_STYLES = {
|
|
7
15
|
GET: "bg-emerald-100 text-emerald-800 border border-emerald-200",
|
|
8
16
|
POST: "bg-blue-100 text-blue-800 border border-blue-200",
|
|
@@ -399,13 +407,13 @@ function ApiDocsExplorer(props) {
|
|
|
399
407
|
] }),
|
|
400
408
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between", children: [
|
|
401
409
|
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-3", children: /* @__PURE__ */ jsx(
|
|
402
|
-
|
|
410
|
+
Input,
|
|
403
411
|
{
|
|
404
412
|
type: "search",
|
|
405
413
|
value: searchTerm,
|
|
406
414
|
onChange: (event) => setSearchTerm(event.target.value),
|
|
407
415
|
placeholder: "Search endpoints by path or summary",
|
|
408
|
-
className: "flex-1
|
|
416
|
+
className: "flex-1"
|
|
409
417
|
}
|
|
410
418
|
) }),
|
|
411
419
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 text-xs", children: methodOptions.map((method) => {
|
|
@@ -1028,19 +1036,14 @@ ${headerEntries}
|
|
|
1028
1036
|
] }),
|
|
1029
1037
|
/* @__PURE__ */ jsxs("label", { className: "space-y-2 text-sm", children: [
|
|
1030
1038
|
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "Base URL" }),
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
|
|
1033
|
-
{
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
" ",
|
|
1040
|
-
server.description ? `\u2014 ${server.description}` : ""
|
|
1041
|
-
] }, server.url))
|
|
1042
|
-
}
|
|
1043
|
-
),
|
|
1039
|
+
/* @__PURE__ */ jsxs(Select, { value: baseUrl, onValueChange: (value) => setBaseUrl(value), children: [
|
|
1040
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1041
|
+
/* @__PURE__ */ jsx(SelectContent, { children: mergedBaseUrls.map((server) => /* @__PURE__ */ jsxs(SelectItem, { value: server.url, children: [
|
|
1042
|
+
server.url,
|
|
1043
|
+
" ",
|
|
1044
|
+
server.description ? `\u2014 ${server.description}` : ""
|
|
1045
|
+
] }, server.url)) })
|
|
1046
|
+
] }),
|
|
1044
1047
|
!baseUrl.trim() && requestPreview?.usesPlaceholderBase ? /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
1045
1048
|
"Examples default to ",
|
|
1046
1049
|
PLACEHOLDER_BASE_URL,
|
|
@@ -1051,13 +1054,12 @@ ${headerEntries}
|
|
|
1051
1054
|
/* @__PURE__ */ jsxs("label", { className: "space-y-2 text-sm", children: [
|
|
1052
1055
|
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "API key" }),
|
|
1053
1056
|
/* @__PURE__ */ jsx(
|
|
1054
|
-
|
|
1057
|
+
Input,
|
|
1055
1058
|
{
|
|
1056
1059
|
type: "text",
|
|
1057
1060
|
value: apiKey,
|
|
1058
1061
|
onChange: (event) => setApiKey(event.target.value),
|
|
1059
|
-
placeholder: "Paste your API key secret (omk_\u2026)"
|
|
1060
|
-
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20"
|
|
1062
|
+
placeholder: "Paste your API key secret (omk_\u2026)"
|
|
1061
1063
|
}
|
|
1062
1064
|
)
|
|
1063
1065
|
] }),
|
|
@@ -1069,7 +1071,7 @@ ${headerEntries}
|
|
|
1069
1071
|
parameter.required ? /* @__PURE__ */ jsx("span", { className: "text-amber-600", children: "required" }) : null
|
|
1070
1072
|
] }),
|
|
1071
1073
|
/* @__PURE__ */ jsx(
|
|
1072
|
-
|
|
1074
|
+
Input,
|
|
1073
1075
|
{
|
|
1074
1076
|
type: "text",
|
|
1075
1077
|
value: pathValues[parameter.name] ?? "",
|
|
@@ -1077,8 +1079,7 @@ ${headerEntries}
|
|
|
1077
1079
|
...prev,
|
|
1078
1080
|
[parameter.name]: event.target.value
|
|
1079
1081
|
})),
|
|
1080
|
-
placeholder: parameter.description ?? ""
|
|
1081
|
-
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20"
|
|
1082
|
+
placeholder: parameter.description ?? ""
|
|
1082
1083
|
}
|
|
1083
1084
|
)
|
|
1084
1085
|
] }, parameter.name)) })
|
|
@@ -1091,7 +1092,7 @@ ${headerEntries}
|
|
|
1091
1092
|
parameter.required ? /* @__PURE__ */ jsx("span", { className: "text-amber-600", children: "required" }) : null
|
|
1092
1093
|
] }),
|
|
1093
1094
|
/* @__PURE__ */ jsx(
|
|
1094
|
-
|
|
1095
|
+
Input,
|
|
1095
1096
|
{
|
|
1096
1097
|
type: "text",
|
|
1097
1098
|
value: queryValues[parameter.name] ?? "",
|
|
@@ -1099,8 +1100,7 @@ ${headerEntries}
|
|
|
1099
1100
|
...prev,
|
|
1100
1101
|
[parameter.name]: event.target.value
|
|
1101
1102
|
})),
|
|
1102
|
-
placeholder: parameter.description ?? ""
|
|
1103
|
-
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20"
|
|
1103
|
+
placeholder: parameter.description ?? ""
|
|
1104
1104
|
}
|
|
1105
1105
|
)
|
|
1106
1106
|
] }, parameter.name)) })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/api_docs/frontend/docs/api/Explorer.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport { useEffect, useMemo, useState, type ReactNode } from 'react'\nimport Image from 'next/image'\nimport Link from 'next/link'\n\nconst METHOD_STYLES: Record<string, string> = {\n GET: 'bg-emerald-100 text-emerald-800 border border-emerald-200',\n POST: 'bg-blue-100 text-blue-800 border border-blue-200',\n PUT: 'bg-amber-100 text-amber-800 border border-amber-200',\n PATCH: 'bg-purple-100 text-purple-800 border border-purple-200',\n DELETE: 'bg-rose-100 text-rose-800 border border-rose-200',\n}\n\nconst PREFERRED_MEDIA_TYPES = [\n 'application/json',\n 'application/x-www-form-urlencoded',\n 'multipart/form-data',\n 'text/plain',\n]\n\ntype ExplorerOperation = {\n id: string\n path: string\n method: string\n tag: string\n summary?: string\n description?: string\n operation: any\n}\n\ntype ServerOption = { url: string; description?: string }\n\ntype ApiDocsExplorerProps = {\n title: string\n version: string\n description?: string\n operations: ExplorerOperation[]\n tagOrder: string[]\n servers: ServerOption[]\n docsUrl: string\n jsonSpecUrl: string\n markdownSpecUrl: string\n}\n\ntype ContentVariant = {\n mediaType: string\n entry: any\n}\n\ntype TestResponse = {\n status: number\n durationMs: number\n ok: boolean\n body: string\n parsed?: unknown\n}\n\nfunction pickContentVariant(content?: Record<string, any>): ContentVariant | null {\n if (!content) return null\n const entries = Object.entries(content)\n if (!entries.length) return null\n for (const mediaType of PREFERRED_MEDIA_TYPES) {\n const match = entries.find(([candidate]) => candidate === mediaType)\n if (match) {\n return { mediaType: match[0], entry: match[1] }\n }\n }\n const [mediaType, entry] = entries[0]\n return { mediaType, entry }\n}\n\nfunction buildExampleFromSchema(schema: any): unknown {\n if (!schema || typeof schema !== 'object') return undefined\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length) return schema.enum[0]\n\n if (Array.isArray(schema.oneOf) && schema.oneOf.length) return buildExampleFromSchema(schema.oneOf[0])\n if (Array.isArray(schema.anyOf) && schema.anyOf.length) return buildExampleFromSchema(schema.anyOf[0])\n if (Array.isArray(schema.allOf) && schema.allOf.length) {\n return Object.assign({}, ...schema.allOf.map((part: any) => buildExampleFromSchema(part) ?? {}))\n }\n\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type\n\n if (schema.properties || type === 'object' || (!type && schema.required)) {\n const properties = schema.properties ?? {}\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(properties)) {\n const value = buildExampleFromSchema(properties[key])\n if (value !== undefined) {\n result[key] = value\n }\n }\n if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {\n const value = buildExampleFromSchema(schema.additionalProperties)\n if (value !== undefined) {\n result['additionalProperty'] = value\n }\n }\n return Object.keys(result).length ? result : {}\n }\n\n if (type === 'array') {\n const itemSchema = schema.items ?? (Array.isArray(schema.prefixItems) ? schema.prefixItems[0] : undefined)\n const value = buildExampleFromSchema(itemSchema)\n return value === undefined ? [] : [value]\n }\n\n if (type === 'number' || type === 'integer') return 1\n if (type === 'boolean') return true\n if (schema.format === 'date-time') return new Date('2025-01-01T00:00:00.000Z').toISOString()\n if (schema.format === 'uuid') return '00000000-0000-4000-8000-000000000000'\n if (schema.format === 'email') return 'user@example.com'\n if (schema.format === 'uri' || schema.format === 'url') return 'https://example.com/resource'\n\n return 'string'\n}\n\nfunction stringifyExample(mediaType: string, example: unknown): string {\n if (example === undefined || example === null) return ''\n if (mediaType === 'application/json') {\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n }\n if (mediaType === 'application/x-www-form-urlencoded') {\n if (typeof example !== 'object') return ''\n const params = new URLSearchParams()\n for (const [key, value] of Object.entries(example as Record<string, unknown>)) {\n if (value === undefined) continue\n params.append(key, value === null ? '' : String(value))\n }\n return params.toString()\n }\n if (mediaType === 'multipart/form-data') {\n if (typeof example === 'object') {\n return Object.entries(example as Record<string, unknown>)\n .map(([key, value]) => `${key}=${value ?? ''}`)\n .join('\\n')\n }\n return typeof example === 'string' ? example : ''\n }\n if (typeof example === 'string') return example\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction formatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction applyPathParams(path: string, params: Record<string, string>): string {\n return path.replace(/\\{([^}]+)\\}/g, (_, key: string) => {\n const value = params[key] ?? ''\n return value ? encodeURIComponent(value) : `{${key}}`\n })\n}\n\ntype Category = {\n tag: string\n operations: ExplorerOperation[]\n}\n\nconst PLACEHOLDER_BASE_URL = 'https://api.your-service.com'\nconst CATEGORY_PAGE_SIZE = 20\n\ntype RequestPreview = {\n method: string\n url: string\n headers: Array<[string, string]>\n body?: string\n jsonBody?: unknown\n mediaType?: string\n usesPlaceholderBase: boolean\n missingPathParam?: string\n bodyParseError?: string\n baseError?: string\n}\n\ntype CodeSnippet = {\n id: string\n label: string\n language: string\n code: string\n}\n\nfunction escapeSingleQuotes(value: string): string {\n return value.replace(/'/g, `'\\\\''`)\n}\n\nfunction escapeSingleQuotesForJs(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n}\n\nfunction escapeBackticks(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/`/g, '\\\\`')\n}\n\nfunction toPythonLiteral(value: unknown, indent = 0): string {\n const padding = ' '.repeat(indent)\n if (value === null || value === undefined) return 'None'\n if (typeof value === 'boolean') return value ? 'True' : 'False'\n if (typeof value === 'number' && Number.isFinite(value)) return String(value)\n if (typeof value === 'string') {\n return `'${value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`\n }\n if (Array.isArray(value)) {\n if (!value.length) return '[]'\n const entries = value\n .map((item) => `${' '.repeat(indent + 1)}${toPythonLiteral(item, indent + 1)}`)\n .join(',\\n')\n return `[\\n${entries},\\n${padding}]`\n }\n if (typeof value === 'object') {\n const entries = Object.entries(value as Record<string, unknown>)\n if (!entries.length) return '{}'\n const lines = entries.map(\n ([key, entry]) =>\n `${' '.repeat(indent + 1)}'${key.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}': ${toPythonLiteral(entry, indent + 1)}`\n )\n return `{\\n${lines.join(',\\n')},\\n${padding}}`\n }\n return 'None'\n}\n\nexport default function ApiDocsExplorer(props: ApiDocsExplorerProps) {\n const { title, version, description, operations, tagOrder, servers, docsUrl, jsonSpecUrl, markdownSpecUrl } = props\n\n const methodOptions = useMemo(\n () => Array.from(new Set(operations.map((operation) => operation.method))).sort((a, b) => a.localeCompare(b)),\n [operations]\n )\n\n const operationsById = useMemo(() => {\n const map = new Map<string, ExplorerOperation>()\n for (const operation of operations) {\n map.set(operation.id, operation)\n }\n return map\n }, [operations])\n\n const [searchTerm, setSearchTerm] = useState('')\n const [methodFilter, setMethodFilter] = useState<string[]>(methodOptions)\n const [selectedId, setSelectedId] = useState<string>(operations[0]?.id ?? '')\n const [isNavOpen, setIsNavOpen] = useState(false)\n const [isTesterOpen, setIsTesterOpen] = useState(false)\n const [expanded, setExpanded] = useState<Record<string, boolean>>({})\n const [visibleCounts, setVisibleCounts] = useState<Record<string, number>>({})\n const [baseUrl, setBaseUrl] = useState<string>(servers[0]?.url ?? '')\n const [apiKey, setApiKey] = useState<string>('')\n\n useEffect(() => {\n setMethodFilter(methodOptions)\n }, [methodOptions])\n\n useEffect(() => {\n if (servers.length === 0) return\n setBaseUrl((prev) => {\n if (!prev) return servers[0].url\n return prev\n })\n }, [servers])\n\n const filteredOperations = useMemo(() => {\n const lowered = searchTerm.trim().toLowerCase()\n return operations.filter((operation) => {\n if (!methodFilter.includes(operation.method)) return false\n if (!lowered) return true\n return (\n operation.path.toLowerCase().includes(lowered) ||\n (operation.summary && operation.summary.toLowerCase().includes(lowered)) ||\n (operation.description && operation.description.toLowerCase().includes(lowered))\n )\n })\n }, [operations, methodFilter, searchTerm])\n\n const categories = useMemo(() => {\n const grouped = new Map<string, ExplorerOperation[]>()\n for (const operation of filteredOperations) {\n const list = grouped.get(operation.tag) ?? []\n list.push(operation)\n grouped.set(operation.tag, list)\n }\n const ordered: Category[] = []\n for (const tag of tagOrder) {\n const list = grouped.get(tag)\n if (list && list.length) {\n ordered.push({ tag, operations: list })\n grouped.delete(tag)\n }\n }\n const remaining = Array.from(grouped.entries()).sort(([a], [b]) => a.localeCompare(b))\n for (const [tag, ops] of remaining) {\n ordered.push({ tag, operations: ops })\n }\n return ordered\n }, [filteredOperations, tagOrder])\n\n useEffect(() => {\n setExpanded((prev) => {\n const next: Record<string, boolean> = {}\n for (const category of categories) {\n next[category.tag] = prev[category.tag] ?? true\n }\n return next\n })\n setVisibleCounts((prev) => {\n const next: Record<string, number> = {}\n for (const category of categories) {\n const total = category.operations.length\n const previous = prev[category.tag] ?? CATEGORY_PAGE_SIZE\n next[category.tag] = Math.min(total, previous)\n }\n return next\n })\n }, [categories])\n\n useEffect(() => {\n if (!selectedId && filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n return\n }\n if (selectedId && filteredOperations.some((operation) => operation.id === selectedId)) return\n if (filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n }\n }, [filteredOperations, selectedId])\n\n const selectedOperation =\n (selectedId ? operationsById.get(selectedId) : undefined) ?? filteredOperations[0] ?? operations[0] ?? null\n\n const shouldOpenTesterOverlay = () => {\n if (typeof window === 'undefined') return false\n return window.innerWidth < 1280\n }\n\n const handleSelectOperation = (operationId: string) => {\n setSelectedId(operationId)\n const targetCategory = categories.find((category) =>\n category.operations.some((operation) => operation.id === operationId)\n )\n if (targetCategory) {\n const index = targetCategory.operations.findIndex((operation) => operation.id === operationId)\n if (index >= 0) {\n setVisibleCounts((prev) => {\n const currentVisible = prev[targetCategory.tag] ?? CATEGORY_PAGE_SIZE\n if (index < currentVisible) return prev\n return { ...prev, [targetCategory.tag]: index + 1 }\n })\n }\n }\n requestAnimationFrame(() => {\n const element = document.getElementById(`operation-${operationId}`)\n if (element) element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })\n })\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n setIsNavOpen(false)\n }\n\n return (\n <div className=\"min-h-screen bg-background text-foreground\">\n <header className=\"border-b bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n className=\"inline-flex h-10 w-10 items-center justify-center rounded-md border border-border text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground lg:hidden\"\n onClick={() => setIsNavOpen(true)}\n >\n <span className=\"sr-only\">Open navigation</span>\n \u2630\n </button>\n <Link href=\"/\" className=\"flex items-center gap-3\">\n <Image src=\"/open-mercato.svg\" alt=\"Open Mercato\" width={36} height={36} />\n <div>\n <div className=\"text-base font-semibold leading-tight\">{title}</div>\n <div className=\"text-xs text-muted-foreground\">Version {version}</div>\n </div>\n </Link>\n </div>\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n <nav className=\"hidden items-center gap-2 text-xs text-muted-foreground sm:flex\">\n <Link href=\"/\" className=\"hover:text-foreground hover:underline\">\n Home\n </Link>\n <span>/</span>\n <span>Docs</span>\n <span>/</span>\n <span className=\"font-medium text-foreground\">API Explorer</span>\n </nav>\n <button\n type=\"button\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground xl:hidden\"\n onClick={() => setIsTesterOpen(true)}\n >\n Try Endpoint\n </button>\n <Link\n href={jsonSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n OpenAPI JSON\n </Link>\n <Link\n href={markdownSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n Markdown Docs\n </Link>\n <Link\n href={docsUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hidden rounded-md border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 sm:inline-flex\"\n >\n View full docs\n </Link>\n </div>\n </div>\n </header>\n\n <main className=\"mx-auto flex w-full max-w-screen-2xl flex-1 flex-col px-6 py-8 lg:flex-row lg:gap-6\">\n <aside className=\"hidden w-64 shrink-0 lg:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto rounded-lg border bg-card p-4\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <nav className=\"mt-4 space-y-4 text-sm\">\n {categories.map((category) => {\n const isExpanded = expanded[category.tag] ?? true\n return (\n <div key={category.tag} className=\"space-y-2\">\n <button\n type=\"button\"\n className=\"flex w-full items-center justify-between rounded-md bg-muted px-3 py-2 text-left font-medium text-foreground hover:bg-muted/50\"\n onClick={() =>\n setExpanded((prev) => ({\n ...prev,\n [category.tag]: !isExpanded,\n }))\n }\n >\n <span>{category.tag}</span>\n <span className=\"text-xs text-muted-foreground\">{isExpanded ? '\u2212' : '+'}</span>\n </button>\n {isExpanded ? (\n <ul className=\"space-y-1 pl-2\">\n {category.operations.map((operation) => (\n <li key={operation.id}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md px-3 py-2 text-left transition ${\n selectedOperation?.id === operation.id\n ? 'bg-primary/10 text-primary'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate text-xs\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n )\n })}\n </nav>\n </div>\n </aside>\n\n <section className=\"flex-1 space-y-6\">\n <div className=\"rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">OpenAPI Explorer</h1>\n {description ? <p className=\"text-sm text-muted-foreground\">{description}</p> : null}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {servers[0]?.url ? <span>Default server: {servers[0].url}</span> : <span>Server URL not configured.</span>}\n </div>\n </div>\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex flex-1 items-center gap-3\">\n <input\n type=\"search\"\n value={searchTerm}\n onChange={(event) => setSearchTerm(event.target.value)}\n placeholder=\"Search endpoints by path or summary\"\n className=\"flex-1 rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </div>\n <div className=\"flex flex-wrap gap-2 text-xs\">\n {methodOptions.map((method) => {\n const isActive = methodFilter.includes(method)\n return (\n <button\n key={method}\n type=\"button\"\n className={`rounded-md border px-3 py-1 font-semibold uppercase transition ${\n isActive\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => {\n setMethodFilter((prev) => {\n if (prev.includes(method)) {\n const next = prev.filter((entry) => entry !== method)\n return next.length ? next : prev\n }\n return [...prev, method]\n })\n }}\n >\n {method}\n </button>\n )\n })}\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"space-y-8\">\n {categories.map((category) => {\n const totalCount = category.operations.length\n const visibleCount = Math.min(\n totalCount,\n visibleCounts[category.tag] ?? CATEGORY_PAGE_SIZE\n )\n const visibleOperations = category.operations.slice(0, visibleCount)\n const hiddenCount = totalCount - visibleCount\n return (\n <div key={category.tag} className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold\">{category.tag}</h2>\n <div className=\"text-xs text-muted-foreground\">\n Showing {visibleCount} of {totalCount} endpoints\n </div>\n </div>\n <div className=\"space-y-6\">\n {visibleOperations.map((operation) => {\n const methodClass = METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n const operationId = `operation-${operation.id}`\n const contentVariant = pickContentVariant(operation.operation?.requestBody?.content)\n const contentExample =\n contentVariant?.entry?.example ??\n contentVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(contentVariant?.entry?.schema)\n const requestSnippet =\n contentVariant && contentExample\n ? stringifyExample(contentVariant.mediaType, contentExample)\n : undefined\n\n return (\n <article\n key={operation.id}\n id={operationId}\n className={`rounded-lg border bg-card shadow-sm transition ${\n selectedOperation?.id === operation.id ? 'ring-2 ring-primary/40' : ''\n }`}\n >\n <div className=\"flex flex-col gap-4 border-b bg-muted/50 px-5 py-4 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-3\">\n <span className={`rounded px-3 py-1 text-xs font-semibold uppercase ${methodClass}`}>\n {operation.method}\n </span>\n <code className=\"text-sm text-foreground\">{operation.path}</code>\n </div>\n <div className=\"flex items-center gap-2 text-overline text-muted-foreground\">\n {operation.operation?.['x-require-auth'] ? (\n <span className=\"rounded bg-amber-100 px-2 py-0.5 text-amber-900\">Auth required</span>\n ) : null}\n {Array.isArray(operation.operation?.['x-require-features'])\n ? operation.operation['x-require-features'].map((feature: string) => (\n <span key={feature} className=\"rounded bg-blue-100 px-2 py-0.5 text-blue-900\">\n {feature}\n </span>\n ))\n : null}\n </div>\n </div>\n <div className=\"space-y-5 p-5\">\n <div className=\"space-y-2\">\n {operation.summary ? <h3 className=\"text-lg font-semibold\">{operation.summary}</h3> : null}\n {operation.description ? (\n <p className=\"text-sm text-muted-foreground whitespace-pre-line\">\n {operation.description}\n </p>\n ) : null}\n </div>\n\n {Array.isArray(operation.operation?.parameters) &&\n operation.operation.parameters.length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Parameters\n </h4>\n <div className=\"overflow-hidden rounded-lg border\">\n <table className=\"min-w-full divide-y divide-border text-left text-xs\">\n <thead className=\"bg-muted/50 text-overline uppercase tracking-wide text-muted-foreground\">\n <tr>\n <th className=\"px-3 py-2 font-medium\">Name</th>\n <th className=\"px-3 py-2 font-medium\">In</th>\n <th className=\"px-3 py-2 font-medium\">Required</th>\n <th className=\"px-3 py-2 font-medium\">Schema</th>\n <th className=\"px-3 py-2 font-medium\">Description</th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border text-xs\">\n {operation.operation.parameters.map((parameter: any) => (\n <tr key={`${parameter.in}-${parameter.name}`}>\n <td className=\"px-3 py-2 font-medium text-foreground\">{parameter.name}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">{parameter.in}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.required ? 'Yes' : 'No'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.schema?.type ?? 'any'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.description ?? '\u2014'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n ) : null}\n\n {contentVariant ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Request body ({contentVariant.mediaType})\n </h4>\n {requestSnippet ? (\n <pre className=\"max-h-80 overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {requestSnippet}\n </pre>\n ) : (\n <p className=\"text-xs text-muted-foreground\">\n No example available for this content type.\n </p>\n )}\n </section>\n ) : null}\n\n {operation.operation?.responses ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Responses\n </h4>\n <div className=\"space-y-3\">\n {Object.entries(operation.operation.responses).map(([status, response]: [string, any]) => {\n if (response?.['x-autoGenerated']) return null\n const responseVariant = pickContentVariant(response?.content)\n const responseExample =\n responseVariant?.entry?.example ??\n responseVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(responseVariant?.entry?.schema)\n const responseSnippet =\n responseVariant && responseExample\n ? stringifyExample(responseVariant.mediaType, responseExample)\n : undefined\n\n return (\n <div key={status} className=\"rounded-lg border\">\n <div className=\"flex items-center justify-between border-b bg-muted/50 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <span>{status}</span>\n <span className=\"text-muted-foreground\">\n {response?.description ?? 'Response'}\n </span>\n </div>\n {responseVariant ? (\n <div className=\"border-b bg-muted/50 px-4 py-2 text-overline text-muted-foreground\">\n Content-Type: {responseVariant.mediaType}\n </div>\n ) : null}\n {responseSnippet ? (\n <pre className=\"max-h-80 overflow-auto bg-muted px-4 py-3 text-xs leading-relaxed\">\n {responseSnippet}\n </pre>\n ) : (\n <p className=\"px-4 py-3 text-xs text-muted-foreground\">\n {responseVariant ? 'No example available for this content type.' : 'No response body.'}\n </p>\n )}\n </div>\n )\n })}\n </div>\n </section>\n ) : null}\n\n {Array.isArray(operation.operation?.['x-codeSamples']) &&\n operation.operation['x-codeSamples'].length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Example\n </h4>\n <pre className=\"overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {operation.operation['x-codeSamples'][0].source}\n </pre>\n </section>\n ) : null}\n\n <div className=\"flex flex-wrap gap-3\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-primary px-4 py-2 text-sm font-semibold text-primary hover:bg-primary/10\"\n onClick={() => {\n setSelectedId(operation.id)\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n }}\n >\n Test this endpoint\n </button>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() => handleSelectOperation(operation.id)}\n >\n Jump to tester\n </button>\n </div>\n </div>\n </article>\n )\n })}\n </div>\n {hiddenCount > 0 ? (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() =>\n setVisibleCounts((prev) => ({\n ...prev,\n [category.tag]: Math.min(\n totalCount,\n (prev[category.tag] ?? CATEGORY_PAGE_SIZE) + CATEGORY_PAGE_SIZE\n ),\n }))\n }\n >\n Show {Math.min(CATEGORY_PAGE_SIZE, hiddenCount)} more endpoints\n </button>\n </div>\n ) : null}\n </div>\n )\n })}\n {!categories.length ? (\n <div className=\"rounded-lg border border-dashed bg-muted/50 p-6 text-center text-sm text-muted-foreground\">\n No endpoints match your filters. Try adjusting the method filters or clearing the search query.\n </div>\n ) : null}\n </div>\n </section>\n\n <aside className=\"hidden w-96 shrink-0 xl:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto\">\n <TesterPanel\n key={selectedOperation?.id ?? 'tester'}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </div>\n </aside>\n </main>\n\n <footer className=\"border-t bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 md:flex-row md:items-center md:justify-between\">\n <div className=\"text-sm text-muted-foreground\">\u00A9 {new Date().getFullYear()} Open Mercato. All rights reserved.</div>\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground\">\n <Link href={docsUrl} target=\"_blank\" rel=\"noreferrer\" className=\"hover:text-foreground hover:underline\">\n Documentation\n </Link>\n <Link\n href=\"https://openmercato.com/privacy\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Privacy\n </Link>\n <Link\n href=\"https://openmercato.com/terms\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Terms\n </Link>\n </div>\n </div>\n </footer>\n\n {isNavOpen ? (\n <MobileOverlay title=\"API categories\" onClose={() => setIsNavOpen(false)}>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <button\n type=\"button\"\n className=\"text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => setIsNavOpen(false)}\n >\n Close\n </button>\n </div>\n <div className=\"max-h-[70vh] space-y-4 overflow-y-auto\">\n {categories.map((category) => (\n <div key={`mobile-${category.tag}`} className=\"space-y-2\">\n <div className=\"font-semibold text-foreground\">{category.tag}</div>\n <ul className=\"space-y-2\">\n {category.operations.map((operation) => (\n <li key={`mobile-${operation.id}`}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-sm ${\n selectedOperation?.id === operation.id\n ? 'border-primary text-primary'\n : 'border-border text-muted-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </MobileOverlay>\n ) : null}\n\n {isTesterOpen ? (\n <MobileOverlay title=\"API tester\" onClose={() => setIsTesterOpen(false)}>\n <TesterPanel\n key={`mobile-${selectedOperation?.id ?? 'tester'}`}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </MobileOverlay>\n ) : null}\n </div>\n )\n}\n\nfunction CodeSnippetTabs(props: { snippets: CodeSnippet[] }) {\n const { snippets } = props\n const [activeId, setActiveId] = useState(snippets[0]?.id ?? '')\n const [copied, setCopied] = useState(false)\n\n useEffect(() => {\n const first = snippets[0]?.id ?? ''\n setActiveId((current) => (snippets.some((snippet) => snippet.id === current) ? current : first))\n }, [snippets])\n\n useEffect(() => {\n setCopied(false)\n }, [activeId])\n\n useEffect(() => {\n if (!copied) return\n const timeout = window.setTimeout(() => setCopied(false), 2000)\n return () => window.clearTimeout(timeout)\n }, [copied])\n\n if (!snippets.length) {\n return null\n }\n\n const activeSnippet = snippets.find((snippet) => snippet.id === activeId) ?? snippets[0]\n\n const handleCopy = async () => {\n if (!activeSnippet) return\n if (typeof navigator === 'undefined' || !navigator.clipboard) return\n try {\n await navigator.clipboard.writeText(activeSnippet.code)\n setCopied(true)\n } catch {\n setCopied(false)\n }\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-wrap gap-2\">\n {snippets.map((snippet) => (\n <button\n type=\"button\"\n key={snippet.id}\n className={`rounded-md border px-3 py-1 text-xs font-semibold ${\n snippet.id === activeSnippet.id\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => setActiveId(snippet.id)}\n >\n {snippet.label}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-3 py-1 text-xs font-semibold text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={handleCopy}\n >\n {copied ? 'Copied' : 'Copy'}\n </button>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {activeSnippet.code}\n </pre>\n </div>\n )\n}\n\nfunction MobileOverlay(props: { title: string; children: ReactNode; onClose: () => void }) {\n const { title, children, onClose } = props\n return (\n <div className=\"fixed inset-0 z-modal flex flex-col bg-background/95 backdrop-blur\">\n <div className=\"border-b bg-card px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\n <button\n type=\"button\"\n className=\"rounded-md border border-border px-3 py-1 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={onClose}\n >\n Close\n </button>\n </div>\n </div>\n <div className=\"flex-1 overflow-y-auto px-6 py-4\">{children}</div>\n </div>\n )\n}\n\ntype TesterPanelProps = {\n operation: ExplorerOperation | null\n baseUrl: string\n setBaseUrl: (value: string) => void\n baseUrlOptions: ServerOption[]\n apiKey: string\n setApiKey: (value: string) => void\n}\n\nfunction TesterPanel(props: TesterPanelProps) {\n const { operation, baseUrl, setBaseUrl, baseUrlOptions, apiKey, setApiKey } = props\n const [pathValues, setPathValues] = useState<Record<string, string>>({})\n const [queryValues, setQueryValues] = useState<Record<string, string>>({})\n const [bodyContent, setBodyContent] = useState<string>('')\n const [response, setResponse] = useState<TestResponse | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [isLoading, setIsLoading] = useState(false)\n\n const parameters = useMemo(\n () => (operation && Array.isArray(operation.operation?.parameters) ? operation.operation.parameters : []),\n [operation]\n )\n const pathParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'path'),\n [parameters]\n )\n const queryParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'query'),\n [parameters]\n )\n const requestVariant = useMemo(\n () => (operation ? pickContentVariant(operation.operation?.requestBody?.content) : null),\n [operation]\n )\n const mergedBaseUrls = useMemo(() => {\n if (!baseUrl) return baseUrlOptions\n if (baseUrlOptions.some((server) => server.url === baseUrl)) return baseUrlOptions\n return [...baseUrlOptions, { url: baseUrl }]\n }, [baseUrlOptions, baseUrl])\n\n const requestPreview = useMemo<RequestPreview | null>(() => {\n if (!operation) return null\n const method = operation.method.toUpperCase()\n const rawBase = baseUrl.trim()\n const normalizedBase = rawBase || PLACEHOLDER_BASE_URL\n const usesPlaceholderBase = !rawBase\n const baseWithSlash = normalizedBase.endsWith('/') ? normalizedBase : `${normalizedBase}/`\n const resolvedPath = applyPathParams(operation.path, pathValues)\n const relativePath = resolvedPath.replace(/^\\//, '')\n\n let url: URL\n try {\n url = new URL(relativePath, baseWithSlash)\n } catch {\n return {\n method,\n url: '',\n headers: [],\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n baseError: 'Base URL must be absolute (include protocol, e.g. https://api.example.com).',\n }\n }\n\n for (const [key, value] of Object.entries(queryValues)) {\n if (!value) continue\n url.searchParams.append(key, value)\n }\n\n const headers: Array<[string, string]> = [['Accept', 'application/json']]\n const trimmedKey = apiKey.trim()\n if (trimmedKey) {\n headers.push(['Authorization', `ApiKey ${trimmedKey}`])\n headers.push(['X-Api-Key', trimmedKey])\n }\n\n let body: string | undefined\n let jsonBody: unknown\n let bodyParseError: string | undefined\n\n if (requestVariant && method !== 'GET' && method !== 'HEAD') {\n headers.push(['Content-Type', requestVariant.mediaType])\n if (requestVariant.mediaType === 'application/json') {\n if (bodyContent.trim()) {\n try {\n jsonBody = JSON.parse(bodyContent)\n body = JSON.stringify(jsonBody)\n } catch {\n bodyParseError = 'Request body must be valid JSON.'\n }\n }\n } else {\n if (bodyContent) {\n body = bodyContent\n }\n }\n }\n\n const missingPathParam = pathParams.find((parameter: any) => parameter.required && !pathValues[parameter.name])\n\n return {\n method,\n url: url.toString(),\n headers,\n body,\n jsonBody,\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n missingPathParam: missingPathParam?.name,\n bodyParseError,\n }\n }, [operation, baseUrl, pathValues, queryValues, apiKey, requestVariant, bodyContent, pathParams])\n\n const codeSnippets = useMemo<CodeSnippet[]>(() => {\n if (!requestPreview || requestPreview.baseError) return []\n\n const snippets: CodeSnippet[] = []\n const { method, url, headers, body, jsonBody, mediaType } = requestPreview\n\n if (url) {\n const curlParts = [`curl -X ${method} '${escapeSingleQuotes(url)}'`]\n for (const [key, value] of headers) {\n curlParts.push(` -H '${escapeSingleQuotes(`${key}: ${value}`)}'`)\n }\n if (body) {\n curlParts.push(` --data '${escapeSingleQuotes(body)}'`)\n }\n snippets.push({\n id: 'curl',\n label: 'cURL',\n language: 'bash',\n code: curlParts.join(' \\\\\\n'),\n })\n\n const headerEntries =\n headers.length === 0\n ? ''\n : headers.map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`).join('\\n')\n const tsLines: string[] = [\n `const url = '${escapeSingleQuotesForJs(url)}';`,\n headerEntries ? `const headers = {\\n${headerEntries}\\n};` : 'const headers = {};',\n ]\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const payloadLiteral = JSON.stringify(jsonBody, null, 2)\n tsLines.push('', `const payload = ${payloadLiteral};`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body: JSON.stringify(payload),',\n '});'\n )\n } else if (body) {\n tsLines.push('', `const body = \\`${escapeBackticks(body)}\\`;`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body,',\n '});'\n )\n } else {\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n '});'\n )\n }\n tsLines.push('const data = await response.json();', 'console.log(data);')\n\n snippets.push({\n id: 'typescript',\n label: 'TypeScript',\n language: 'ts',\n code: tsLines.join('\\n'),\n })\n\n const pythonLines: string[] = [\"import requests\", \"\", `url = '${escapeSingleQuotesForJs(url)}'`]\n if (headers.length) {\n const pythonHeaders = headers\n .map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`)\n .join('\\n')\n pythonLines.push('headers = {', pythonHeaders, '}')\n } else {\n pythonLines.push('headers = {}')\n }\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const pythonPayload = toPythonLiteral(jsonBody)\n pythonLines.push('', `payload = ${pythonPayload}`)\n pythonLines.push(\n `response = requests.request('${method}', url, headers=headers, json=payload)`\n )\n } else if (body) {\n pythonLines.push('', `data = ${toPythonLiteral(body)}`)\n pythonLines.push(`response = requests.request('${method}', url, headers=headers, data=data)`)\n } else {\n pythonLines.push('', `response = requests.request('${method}', url, headers=headers)`)\n }\n pythonLines.push('print(response.status_code)', 'print(response.text)')\n\n snippets.push({\n id: 'python',\n label: 'Python',\n language: 'python',\n code: pythonLines.join('\\n'),\n })\n }\n\n return snippets\n }, [requestPreview])\n\n useEffect(() => {\n const nextPath: Record<string, string> = {}\n for (const parameter of pathParams) {\n nextPath[parameter.name] = ''\n }\n const nextQuery: Record<string, string> = {}\n for (const parameter of queryParams) {\n nextQuery[parameter.name] = ''\n }\n setPathValues(nextPath)\n setQueryValues(nextQuery)\n\n if (requestVariant) {\n const example =\n requestVariant.entry?.example ??\n requestVariant.entry?.examples?.default?.value ??\n buildExampleFromSchema(requestVariant.entry?.schema)\n setBodyContent(example ? stringifyExample(requestVariant.mediaType, example) : '')\n } else {\n setBodyContent('')\n }\n setResponse(null)\n setError(null)\n }, [operation?.id, pathParams, queryParams, requestVariant])\n\n if (!operation) {\n return (\n <div className=\"rounded-lg border bg-card p-5 text-sm text-muted-foreground\">\n Select an endpoint to start testing requests.\n </div>\n )\n }\n\n const handleSubmit = async () => {\n if (!operation) return\n if (!baseUrl.trim()) {\n setError('Please provide a base URL for the request.')\n return\n }\n if (requestPreview?.baseError) {\n setError(requestPreview.baseError)\n return\n }\n if (requestPreview?.missingPathParam) {\n setError(`Path parameter \"${requestPreview.missingPathParam}\" is required.`)\n return\n }\n if (requestPreview?.bodyParseError) {\n setError(requestPreview.bodyParseError)\n return\n }\n if (!requestPreview) {\n setError('Unable to prepare the request. Check your input and try again.')\n return\n }\n\n setIsLoading(true)\n setError(null)\n setResponse(null)\n\n try {\n const started = performance.now()\n const res = await fetch(requestPreview.url, {\n method: requestPreview.method,\n headers: Object.fromEntries(requestPreview.headers),\n body: requestPreview.body,\n })\n const duration = performance.now() - started\n const text = await res.text()\n let parsed: unknown | undefined\n try {\n parsed = JSON.parse(text)\n } catch {\n parsed = undefined\n }\n setResponse({\n status: res.status,\n ok: res.ok,\n durationMs: Math.round(duration),\n body: text,\n parsed,\n })\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : 'Request failed. Check your network connection.')\n } finally {\n setIsLoading(false)\n }\n }\n\n return (\n <div className=\"flex flex-col gap-4 rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">Interactive tester</h2>\n <p className=\"text-xs text-muted-foreground\">\n Provide the endpoint parameters and your API key to execute a live request.\n </p>\n </div>\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n </div>\n\n <div className=\"space-y-2 text-xs\">\n <div className=\"font-semibold text-foreground\">Endpoint</div>\n <code className=\"rounded-md bg-muted px-3 py-2 text-xs text-primary\">{operation.path}</code>\n </div>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">Base URL</span>\n <select\n value={baseUrl}\n onChange={(event) => setBaseUrl(event.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n >\n {mergedBaseUrls.map((server) => (\n <option key={server.url} value={server.url}>\n {server.url} {server.description ? `\u2014 ${server.description}` : ''}\n </option>\n ))}\n </select>\n {!baseUrl.trim() && requestPreview?.usesPlaceholderBase ? (\n <p className=\"text-xs text-muted-foreground\">\n Examples default to {PLACEHOLDER_BASE_URL}. Update the base URL to match your environment.\n </p>\n ) : null}\n {requestPreview?.baseError ? (\n <p className=\"text-xs text-rose-600\">{requestPreview.baseError}</p>\n ) : null}\n </label>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">API key</span>\n <input\n type=\"text\"\n value={apiKey}\n onChange={(event) => setApiKey(event.target.value)}\n placeholder=\"Paste your API key secret (omk_\u2026)\"\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </label>\n\n {pathParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Path parameters</div>\n <div className=\"space-y-3\">\n {pathParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <input\n type=\"text\"\n value={pathValues[parameter.name] ?? ''}\n onChange={(event) =>\n setPathValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {queryParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Query parameters</div>\n <div className=\"space-y-3\">\n {queryParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <input\n type=\"text\"\n value={queryValues[parameter.name] ?? ''}\n onChange={(event) =>\n setQueryValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {requestVariant ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"font-medium text-foreground\">Request body</span>\n <span className=\"text-xs text-muted-foreground\">{requestVariant.mediaType}</span>\n </div>\n <textarea\n value={bodyContent}\n onChange={(event) => setBodyContent(event.target.value)}\n rows={8}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-xs font-mono leading-relaxed focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n placeholder=\"Provide request payload\"\n />\n </section>\n ) : null}\n\n {requestPreview?.bodyParseError ? (\n <div className=\"rounded border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-700\">\n {requestPreview.bodyParseError}\n </div>\n ) : null}\n\n {codeSnippets.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Request examples</div>\n <CodeSnippetTabs snippets={codeSnippets} />\n </section>\n ) : null}\n\n <button\n type=\"button\"\n onClick={handleSubmit}\n disabled={isLoading}\n className=\"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:bg-primary/10\"\n >\n {isLoading ? 'Sending\u2026' : 'Send request'}\n </button>\n\n {error ? <div className=\"rounded border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-700\">{error}</div> : null}\n\n {response ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <div className=\"font-medium text-foreground\">\n Response \u00B7 <span className={response.ok ? 'text-emerald-600' : 'text-rose-600'}>{response.status}</span>\n </div>\n <div className=\"text-xs text-muted-foreground\">{response.durationMs} ms</div>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {response.parsed ? formatJson(response.parsed) : response.body || '(empty response)'}\n </pre>\n </section>\n ) : null}\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": ";AAuXY,SAKE,KALF;AArXZ,SAAS,WAAW,SAAS,gBAAgC;AAC7D,OAAO,WAAW;AAClB,OAAO,UAAU;AAEjB,MAAM,gBAAwC;AAAA,EAC5C,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA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AQ,oBAAC,SAAI,WAAU,6EAA6E,iBAAM,IAAS;AAAA,IAEnH,WACC,qBAAC,aAAQ,WAAU,qBACjB;AAAA,2BAAC,SAAI,WAAU,qCACb;AAAA,6BAAC,SAAI,WAAU,+BAA8B;AAAA;AAAA,UAChC,oBAAC,UAAK,WAAW,SAAS,KAAK,qBAAqB,iBAAkB,mBAAS,QAAO;AAAA,WACnG;AAAA,QACA,qBAAC,SAAI,WAAU,iCAAiC;AAAA,mBAAS;AAAA,UAAW;AAAA,WAAG;AAAA,SACzE;AAAA,MACA,oBAAC,SAAI,WAAU,gFACZ,mBAAS,SAAS,WAAW,SAAS,MAAM,IAAI,SAAS,QAAQ,oBACpE;AAAA,OACF,IACE;AAAA,KACN;AAEJ;",
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport { useEffect, useMemo, useState, type ReactNode } from 'react'\nimport Image from 'next/image'\nimport Link from 'next/link'\nimport { Input } from '@open-mercato/ui/primitives/input'\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@open-mercato/ui/primitives/select'\n\nconst METHOD_STYLES: Record<string, string> = {\n GET: 'bg-emerald-100 text-emerald-800 border border-emerald-200',\n POST: 'bg-blue-100 text-blue-800 border border-blue-200',\n PUT: 'bg-amber-100 text-amber-800 border border-amber-200',\n PATCH: 'bg-purple-100 text-purple-800 border border-purple-200',\n DELETE: 'bg-rose-100 text-rose-800 border border-rose-200',\n}\n\nconst PREFERRED_MEDIA_TYPES = [\n 'application/json',\n 'application/x-www-form-urlencoded',\n 'multipart/form-data',\n 'text/plain',\n]\n\ntype ExplorerOperation = {\n id: string\n path: string\n method: string\n tag: string\n summary?: string\n description?: string\n operation: any\n}\n\ntype ServerOption = { url: string; description?: string }\n\ntype ApiDocsExplorerProps = {\n title: string\n version: string\n description?: string\n operations: ExplorerOperation[]\n tagOrder: string[]\n servers: ServerOption[]\n docsUrl: string\n jsonSpecUrl: string\n markdownSpecUrl: string\n}\n\ntype ContentVariant = {\n mediaType: string\n entry: any\n}\n\ntype TestResponse = {\n status: number\n durationMs: number\n ok: boolean\n body: string\n parsed?: unknown\n}\n\nfunction pickContentVariant(content?: Record<string, any>): ContentVariant | null {\n if (!content) return null\n const entries = Object.entries(content)\n if (!entries.length) return null\n for (const mediaType of PREFERRED_MEDIA_TYPES) {\n const match = entries.find(([candidate]) => candidate === mediaType)\n if (match) {\n return { mediaType: match[0], entry: match[1] }\n }\n }\n const [mediaType, entry] = entries[0]\n return { mediaType, entry }\n}\n\nfunction buildExampleFromSchema(schema: any): unknown {\n if (!schema || typeof schema !== 'object') return undefined\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length) return schema.enum[0]\n\n if (Array.isArray(schema.oneOf) && schema.oneOf.length) return buildExampleFromSchema(schema.oneOf[0])\n if (Array.isArray(schema.anyOf) && schema.anyOf.length) return buildExampleFromSchema(schema.anyOf[0])\n if (Array.isArray(schema.allOf) && schema.allOf.length) {\n return Object.assign({}, ...schema.allOf.map((part: any) => buildExampleFromSchema(part) ?? {}))\n }\n\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type\n\n if (schema.properties || type === 'object' || (!type && schema.required)) {\n const properties = schema.properties ?? {}\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(properties)) {\n const value = buildExampleFromSchema(properties[key])\n if (value !== undefined) {\n result[key] = value\n }\n }\n if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {\n const value = buildExampleFromSchema(schema.additionalProperties)\n if (value !== undefined) {\n result['additionalProperty'] = value\n }\n }\n return Object.keys(result).length ? result : {}\n }\n\n if (type === 'array') {\n const itemSchema = schema.items ?? (Array.isArray(schema.prefixItems) ? schema.prefixItems[0] : undefined)\n const value = buildExampleFromSchema(itemSchema)\n return value === undefined ? [] : [value]\n }\n\n if (type === 'number' || type === 'integer') return 1\n if (type === 'boolean') return true\n if (schema.format === 'date-time') return new Date('2025-01-01T00:00:00.000Z').toISOString()\n if (schema.format === 'uuid') return '00000000-0000-4000-8000-000000000000'\n if (schema.format === 'email') return 'user@example.com'\n if (schema.format === 'uri' || schema.format === 'url') return 'https://example.com/resource'\n\n return 'string'\n}\n\nfunction stringifyExample(mediaType: string, example: unknown): string {\n if (example === undefined || example === null) return ''\n if (mediaType === 'application/json') {\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n }\n if (mediaType === 'application/x-www-form-urlencoded') {\n if (typeof example !== 'object') return ''\n const params = new URLSearchParams()\n for (const [key, value] of Object.entries(example as Record<string, unknown>)) {\n if (value === undefined) continue\n params.append(key, value === null ? '' : String(value))\n }\n return params.toString()\n }\n if (mediaType === 'multipart/form-data') {\n if (typeof example === 'object') {\n return Object.entries(example as Record<string, unknown>)\n .map(([key, value]) => `${key}=${value ?? ''}`)\n .join('\\n')\n }\n return typeof example === 'string' ? example : ''\n }\n if (typeof example === 'string') return example\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction formatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction applyPathParams(path: string, params: Record<string, string>): string {\n return path.replace(/\\{([^}]+)\\}/g, (_, key: string) => {\n const value = params[key] ?? ''\n return value ? encodeURIComponent(value) : `{${key}}`\n })\n}\n\ntype Category = {\n tag: string\n operations: ExplorerOperation[]\n}\n\nconst PLACEHOLDER_BASE_URL = 'https://api.your-service.com'\nconst CATEGORY_PAGE_SIZE = 20\n\ntype RequestPreview = {\n method: string\n url: string\n headers: Array<[string, string]>\n body?: string\n jsonBody?: unknown\n mediaType?: string\n usesPlaceholderBase: boolean\n missingPathParam?: string\n bodyParseError?: string\n baseError?: string\n}\n\ntype CodeSnippet = {\n id: string\n label: string\n language: string\n code: string\n}\n\nfunction escapeSingleQuotes(value: string): string {\n return value.replace(/'/g, `'\\\\''`)\n}\n\nfunction escapeSingleQuotesForJs(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n}\n\nfunction escapeBackticks(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/`/g, '\\\\`')\n}\n\nfunction toPythonLiteral(value: unknown, indent = 0): string {\n const padding = ' '.repeat(indent)\n if (value === null || value === undefined) return 'None'\n if (typeof value === 'boolean') return value ? 'True' : 'False'\n if (typeof value === 'number' && Number.isFinite(value)) return String(value)\n if (typeof value === 'string') {\n return `'${value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`\n }\n if (Array.isArray(value)) {\n if (!value.length) return '[]'\n const entries = value\n .map((item) => `${' '.repeat(indent + 1)}${toPythonLiteral(item, indent + 1)}`)\n .join(',\\n')\n return `[\\n${entries},\\n${padding}]`\n }\n if (typeof value === 'object') {\n const entries = Object.entries(value as Record<string, unknown>)\n if (!entries.length) return '{}'\n const lines = entries.map(\n ([key, entry]) =>\n `${' '.repeat(indent + 1)}'${key.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}': ${toPythonLiteral(entry, indent + 1)}`\n )\n return `{\\n${lines.join(',\\n')},\\n${padding}}`\n }\n return 'None'\n}\n\nexport default function ApiDocsExplorer(props: ApiDocsExplorerProps) {\n const { title, version, description, operations, tagOrder, servers, docsUrl, jsonSpecUrl, markdownSpecUrl } = props\n\n const methodOptions = useMemo(\n () => Array.from(new Set(operations.map((operation) => operation.method))).sort((a, b) => a.localeCompare(b)),\n [operations]\n )\n\n const operationsById = useMemo(() => {\n const map = new Map<string, ExplorerOperation>()\n for (const operation of operations) {\n map.set(operation.id, operation)\n }\n return map\n }, [operations])\n\n const [searchTerm, setSearchTerm] = useState('')\n const [methodFilter, setMethodFilter] = useState<string[]>(methodOptions)\n const [selectedId, setSelectedId] = useState<string>(operations[0]?.id ?? '')\n const [isNavOpen, setIsNavOpen] = useState(false)\n const [isTesterOpen, setIsTesterOpen] = useState(false)\n const [expanded, setExpanded] = useState<Record<string, boolean>>({})\n const [visibleCounts, setVisibleCounts] = useState<Record<string, number>>({})\n const [baseUrl, setBaseUrl] = useState<string>(servers[0]?.url ?? '')\n const [apiKey, setApiKey] = useState<string>('')\n\n useEffect(() => {\n setMethodFilter(methodOptions)\n }, [methodOptions])\n\n useEffect(() => {\n if (servers.length === 0) return\n setBaseUrl((prev) => {\n if (!prev) return servers[0].url\n return prev\n })\n }, [servers])\n\n const filteredOperations = useMemo(() => {\n const lowered = searchTerm.trim().toLowerCase()\n return operations.filter((operation) => {\n if (!methodFilter.includes(operation.method)) return false\n if (!lowered) return true\n return (\n operation.path.toLowerCase().includes(lowered) ||\n (operation.summary && operation.summary.toLowerCase().includes(lowered)) ||\n (operation.description && operation.description.toLowerCase().includes(lowered))\n )\n })\n }, [operations, methodFilter, searchTerm])\n\n const categories = useMemo(() => {\n const grouped = new Map<string, ExplorerOperation[]>()\n for (const operation of filteredOperations) {\n const list = grouped.get(operation.tag) ?? []\n list.push(operation)\n grouped.set(operation.tag, list)\n }\n const ordered: Category[] = []\n for (const tag of tagOrder) {\n const list = grouped.get(tag)\n if (list && list.length) {\n ordered.push({ tag, operations: list })\n grouped.delete(tag)\n }\n }\n const remaining = Array.from(grouped.entries()).sort(([a], [b]) => a.localeCompare(b))\n for (const [tag, ops] of remaining) {\n ordered.push({ tag, operations: ops })\n }\n return ordered\n }, [filteredOperations, tagOrder])\n\n useEffect(() => {\n setExpanded((prev) => {\n const next: Record<string, boolean> = {}\n for (const category of categories) {\n next[category.tag] = prev[category.tag] ?? true\n }\n return next\n })\n setVisibleCounts((prev) => {\n const next: Record<string, number> = {}\n for (const category of categories) {\n const total = category.operations.length\n const previous = prev[category.tag] ?? CATEGORY_PAGE_SIZE\n next[category.tag] = Math.min(total, previous)\n }\n return next\n })\n }, [categories])\n\n useEffect(() => {\n if (!selectedId && filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n return\n }\n if (selectedId && filteredOperations.some((operation) => operation.id === selectedId)) return\n if (filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n }\n }, [filteredOperations, selectedId])\n\n const selectedOperation =\n (selectedId ? operationsById.get(selectedId) : undefined) ?? filteredOperations[0] ?? operations[0] ?? null\n\n const shouldOpenTesterOverlay = () => {\n if (typeof window === 'undefined') return false\n return window.innerWidth < 1280\n }\n\n const handleSelectOperation = (operationId: string) => {\n setSelectedId(operationId)\n const targetCategory = categories.find((category) =>\n category.operations.some((operation) => operation.id === operationId)\n )\n if (targetCategory) {\n const index = targetCategory.operations.findIndex((operation) => operation.id === operationId)\n if (index >= 0) {\n setVisibleCounts((prev) => {\n const currentVisible = prev[targetCategory.tag] ?? CATEGORY_PAGE_SIZE\n if (index < currentVisible) return prev\n return { ...prev, [targetCategory.tag]: index + 1 }\n })\n }\n }\n requestAnimationFrame(() => {\n const element = document.getElementById(`operation-${operationId}`)\n if (element) element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })\n })\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n setIsNavOpen(false)\n }\n\n return (\n <div className=\"min-h-screen bg-background text-foreground\">\n <header className=\"border-b bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n className=\"inline-flex h-10 w-10 items-center justify-center rounded-md border border-border text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground lg:hidden\"\n onClick={() => setIsNavOpen(true)}\n >\n <span className=\"sr-only\">Open navigation</span>\n \u2630\n </button>\n <Link href=\"/\" className=\"flex items-center gap-3\">\n <Image src=\"/open-mercato.svg\" alt=\"Open Mercato\" width={36} height={36} />\n <div>\n <div className=\"text-base font-semibold leading-tight\">{title}</div>\n <div className=\"text-xs text-muted-foreground\">Version {version}</div>\n </div>\n </Link>\n </div>\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n <nav className=\"hidden items-center gap-2 text-xs text-muted-foreground sm:flex\">\n <Link href=\"/\" className=\"hover:text-foreground hover:underline\">\n Home\n </Link>\n <span>/</span>\n <span>Docs</span>\n <span>/</span>\n <span className=\"font-medium text-foreground\">API Explorer</span>\n </nav>\n <button\n type=\"button\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground xl:hidden\"\n onClick={() => setIsTesterOpen(true)}\n >\n Try Endpoint\n </button>\n <Link\n href={jsonSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n OpenAPI JSON\n </Link>\n <Link\n href={markdownSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n Markdown Docs\n </Link>\n <Link\n href={docsUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hidden rounded-md border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 sm:inline-flex\"\n >\n View full docs\n </Link>\n </div>\n </div>\n </header>\n\n <main className=\"mx-auto flex w-full max-w-screen-2xl flex-1 flex-col px-6 py-8 lg:flex-row lg:gap-6\">\n <aside className=\"hidden w-64 shrink-0 lg:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto rounded-lg border bg-card p-4\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <nav className=\"mt-4 space-y-4 text-sm\">\n {categories.map((category) => {\n const isExpanded = expanded[category.tag] ?? true\n return (\n <div key={category.tag} className=\"space-y-2\">\n <button\n type=\"button\"\n className=\"flex w-full items-center justify-between rounded-md bg-muted px-3 py-2 text-left font-medium text-foreground hover:bg-muted/50\"\n onClick={() =>\n setExpanded((prev) => ({\n ...prev,\n [category.tag]: !isExpanded,\n }))\n }\n >\n <span>{category.tag}</span>\n <span className=\"text-xs text-muted-foreground\">{isExpanded ? '\u2212' : '+'}</span>\n </button>\n {isExpanded ? (\n <ul className=\"space-y-1 pl-2\">\n {category.operations.map((operation) => (\n <li key={operation.id}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md px-3 py-2 text-left transition ${\n selectedOperation?.id === operation.id\n ? 'bg-primary/10 text-primary'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate text-xs\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n )\n })}\n </nav>\n </div>\n </aside>\n\n <section className=\"flex-1 space-y-6\">\n <div className=\"rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">OpenAPI Explorer</h1>\n {description ? <p className=\"text-sm text-muted-foreground\">{description}</p> : null}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {servers[0]?.url ? <span>Default server: {servers[0].url}</span> : <span>Server URL not configured.</span>}\n </div>\n </div>\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex flex-1 items-center gap-3\">\n <Input\n type=\"search\"\n value={searchTerm}\n onChange={(event) => setSearchTerm(event.target.value)}\n placeholder=\"Search endpoints by path or summary\"\n className=\"flex-1\"\n />\n </div>\n <div className=\"flex flex-wrap gap-2 text-xs\">\n {methodOptions.map((method) => {\n const isActive = methodFilter.includes(method)\n return (\n <button\n key={method}\n type=\"button\"\n className={`rounded-md border px-3 py-1 font-semibold uppercase transition ${\n isActive\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => {\n setMethodFilter((prev) => {\n if (prev.includes(method)) {\n const next = prev.filter((entry) => entry !== method)\n return next.length ? next : prev\n }\n return [...prev, method]\n })\n }}\n >\n {method}\n </button>\n )\n })}\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"space-y-8\">\n {categories.map((category) => {\n const totalCount = category.operations.length\n const visibleCount = Math.min(\n totalCount,\n visibleCounts[category.tag] ?? CATEGORY_PAGE_SIZE\n )\n const visibleOperations = category.operations.slice(0, visibleCount)\n const hiddenCount = totalCount - visibleCount\n return (\n <div key={category.tag} className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold\">{category.tag}</h2>\n <div className=\"text-xs text-muted-foreground\">\n Showing {visibleCount} of {totalCount} endpoints\n </div>\n </div>\n <div className=\"space-y-6\">\n {visibleOperations.map((operation) => {\n const methodClass = METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n const operationId = `operation-${operation.id}`\n const contentVariant = pickContentVariant(operation.operation?.requestBody?.content)\n const contentExample =\n contentVariant?.entry?.example ??\n contentVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(contentVariant?.entry?.schema)\n const requestSnippet =\n contentVariant && contentExample\n ? stringifyExample(contentVariant.mediaType, contentExample)\n : undefined\n\n return (\n <article\n key={operation.id}\n id={operationId}\n className={`rounded-lg border bg-card shadow-sm transition ${\n selectedOperation?.id === operation.id ? 'ring-2 ring-primary/40' : ''\n }`}\n >\n <div className=\"flex flex-col gap-4 border-b bg-muted/50 px-5 py-4 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-3\">\n <span className={`rounded px-3 py-1 text-xs font-semibold uppercase ${methodClass}`}>\n {operation.method}\n </span>\n <code className=\"text-sm text-foreground\">{operation.path}</code>\n </div>\n <div className=\"flex items-center gap-2 text-overline text-muted-foreground\">\n {operation.operation?.['x-require-auth'] ? (\n <span className=\"rounded bg-amber-100 px-2 py-0.5 text-amber-900\">Auth required</span>\n ) : null}\n {Array.isArray(operation.operation?.['x-require-features'])\n ? operation.operation['x-require-features'].map((feature: string) => (\n <span key={feature} className=\"rounded bg-blue-100 px-2 py-0.5 text-blue-900\">\n {feature}\n </span>\n ))\n : null}\n </div>\n </div>\n <div className=\"space-y-5 p-5\">\n <div className=\"space-y-2\">\n {operation.summary ? <h3 className=\"text-lg font-semibold\">{operation.summary}</h3> : null}\n {operation.description ? (\n <p className=\"text-sm text-muted-foreground whitespace-pre-line\">\n {operation.description}\n </p>\n ) : null}\n </div>\n\n {Array.isArray(operation.operation?.parameters) &&\n operation.operation.parameters.length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Parameters\n </h4>\n <div className=\"overflow-hidden rounded-lg border\">\n <table className=\"min-w-full divide-y divide-border text-left text-xs\">\n <thead className=\"bg-muted/50 text-overline uppercase tracking-wide text-muted-foreground\">\n <tr>\n <th className=\"px-3 py-2 font-medium\">Name</th>\n <th className=\"px-3 py-2 font-medium\">In</th>\n <th className=\"px-3 py-2 font-medium\">Required</th>\n <th className=\"px-3 py-2 font-medium\">Schema</th>\n <th className=\"px-3 py-2 font-medium\">Description</th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border text-xs\">\n {operation.operation.parameters.map((parameter: any) => (\n <tr key={`${parameter.in}-${parameter.name}`}>\n <td className=\"px-3 py-2 font-medium text-foreground\">{parameter.name}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">{parameter.in}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.required ? 'Yes' : 'No'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.schema?.type ?? 'any'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.description ?? '\u2014'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n ) : null}\n\n {contentVariant ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Request body ({contentVariant.mediaType})\n </h4>\n {requestSnippet ? (\n <pre className=\"max-h-80 overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {requestSnippet}\n </pre>\n ) : (\n <p className=\"text-xs text-muted-foreground\">\n No example available for this content type.\n </p>\n )}\n </section>\n ) : null}\n\n {operation.operation?.responses ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Responses\n </h4>\n <div className=\"space-y-3\">\n {Object.entries(operation.operation.responses).map(([status, response]: [string, any]) => {\n if (response?.['x-autoGenerated']) return null\n const responseVariant = pickContentVariant(response?.content)\n const responseExample =\n responseVariant?.entry?.example ??\n responseVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(responseVariant?.entry?.schema)\n const responseSnippet =\n responseVariant && responseExample\n ? stringifyExample(responseVariant.mediaType, responseExample)\n : undefined\n\n return (\n <div key={status} className=\"rounded-lg border\">\n <div className=\"flex items-center justify-between border-b bg-muted/50 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <span>{status}</span>\n <span className=\"text-muted-foreground\">\n {response?.description ?? 'Response'}\n </span>\n </div>\n {responseVariant ? (\n <div className=\"border-b bg-muted/50 px-4 py-2 text-overline text-muted-foreground\">\n Content-Type: {responseVariant.mediaType}\n </div>\n ) : null}\n {responseSnippet ? (\n <pre className=\"max-h-80 overflow-auto bg-muted px-4 py-3 text-xs leading-relaxed\">\n {responseSnippet}\n </pre>\n ) : (\n <p className=\"px-4 py-3 text-xs text-muted-foreground\">\n {responseVariant ? 'No example available for this content type.' : 'No response body.'}\n </p>\n )}\n </div>\n )\n })}\n </div>\n </section>\n ) : null}\n\n {Array.isArray(operation.operation?.['x-codeSamples']) &&\n operation.operation['x-codeSamples'].length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Example\n </h4>\n <pre className=\"overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {operation.operation['x-codeSamples'][0].source}\n </pre>\n </section>\n ) : null}\n\n <div className=\"flex flex-wrap gap-3\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-primary px-4 py-2 text-sm font-semibold text-primary hover:bg-primary/10\"\n onClick={() => {\n setSelectedId(operation.id)\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n }}\n >\n Test this endpoint\n </button>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() => handleSelectOperation(operation.id)}\n >\n Jump to tester\n </button>\n </div>\n </div>\n </article>\n )\n })}\n </div>\n {hiddenCount > 0 ? (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() =>\n setVisibleCounts((prev) => ({\n ...prev,\n [category.tag]: Math.min(\n totalCount,\n (prev[category.tag] ?? CATEGORY_PAGE_SIZE) + CATEGORY_PAGE_SIZE\n ),\n }))\n }\n >\n Show {Math.min(CATEGORY_PAGE_SIZE, hiddenCount)} more endpoints\n </button>\n </div>\n ) : null}\n </div>\n )\n })}\n {!categories.length ? (\n <div className=\"rounded-lg border border-dashed bg-muted/50 p-6 text-center text-sm text-muted-foreground\">\n No endpoints match your filters. Try adjusting the method filters or clearing the search query.\n </div>\n ) : null}\n </div>\n </section>\n\n <aside className=\"hidden w-96 shrink-0 xl:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto\">\n <TesterPanel\n key={selectedOperation?.id ?? 'tester'}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </div>\n </aside>\n </main>\n\n <footer className=\"border-t bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 md:flex-row md:items-center md:justify-between\">\n <div className=\"text-sm text-muted-foreground\">\u00A9 {new Date().getFullYear()} Open Mercato. All rights reserved.</div>\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground\">\n <Link href={docsUrl} target=\"_blank\" rel=\"noreferrer\" className=\"hover:text-foreground hover:underline\">\n Documentation\n </Link>\n <Link\n href=\"https://openmercato.com/privacy\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Privacy\n </Link>\n <Link\n href=\"https://openmercato.com/terms\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Terms\n </Link>\n </div>\n </div>\n </footer>\n\n {isNavOpen ? (\n <MobileOverlay title=\"API categories\" onClose={() => setIsNavOpen(false)}>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <button\n type=\"button\"\n className=\"text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => setIsNavOpen(false)}\n >\n Close\n </button>\n </div>\n <div className=\"max-h-[70vh] space-y-4 overflow-y-auto\">\n {categories.map((category) => (\n <div key={`mobile-${category.tag}`} className=\"space-y-2\">\n <div className=\"font-semibold text-foreground\">{category.tag}</div>\n <ul className=\"space-y-2\">\n {category.operations.map((operation) => (\n <li key={`mobile-${operation.id}`}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-sm ${\n selectedOperation?.id === operation.id\n ? 'border-primary text-primary'\n : 'border-border text-muted-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </MobileOverlay>\n ) : null}\n\n {isTesterOpen ? (\n <MobileOverlay title=\"API tester\" onClose={() => setIsTesterOpen(false)}>\n <TesterPanel\n key={`mobile-${selectedOperation?.id ?? 'tester'}`}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </MobileOverlay>\n ) : null}\n </div>\n )\n}\n\nfunction CodeSnippetTabs(props: { snippets: CodeSnippet[] }) {\n const { snippets } = props\n const [activeId, setActiveId] = useState(snippets[0]?.id ?? '')\n const [copied, setCopied] = useState(false)\n\n useEffect(() => {\n const first = snippets[0]?.id ?? ''\n setActiveId((current) => (snippets.some((snippet) => snippet.id === current) ? current : first))\n }, [snippets])\n\n useEffect(() => {\n setCopied(false)\n }, [activeId])\n\n useEffect(() => {\n if (!copied) return\n const timeout = window.setTimeout(() => setCopied(false), 2000)\n return () => window.clearTimeout(timeout)\n }, [copied])\n\n if (!snippets.length) {\n return null\n }\n\n const activeSnippet = snippets.find((snippet) => snippet.id === activeId) ?? snippets[0]\n\n const handleCopy = async () => {\n if (!activeSnippet) return\n if (typeof navigator === 'undefined' || !navigator.clipboard) return\n try {\n await navigator.clipboard.writeText(activeSnippet.code)\n setCopied(true)\n } catch {\n setCopied(false)\n }\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-wrap gap-2\">\n {snippets.map((snippet) => (\n <button\n type=\"button\"\n key={snippet.id}\n className={`rounded-md border px-3 py-1 text-xs font-semibold ${\n snippet.id === activeSnippet.id\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => setActiveId(snippet.id)}\n >\n {snippet.label}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-3 py-1 text-xs font-semibold text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={handleCopy}\n >\n {copied ? 'Copied' : 'Copy'}\n </button>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {activeSnippet.code}\n </pre>\n </div>\n )\n}\n\nfunction MobileOverlay(props: { title: string; children: ReactNode; onClose: () => void }) {\n const { title, children, onClose } = props\n return (\n <div className=\"fixed inset-0 z-modal flex flex-col bg-background/95 backdrop-blur\">\n <div className=\"border-b bg-card px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\n <button\n type=\"button\"\n className=\"rounded-md border border-border px-3 py-1 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={onClose}\n >\n Close\n </button>\n </div>\n </div>\n <div className=\"flex-1 overflow-y-auto px-6 py-4\">{children}</div>\n </div>\n )\n}\n\ntype TesterPanelProps = {\n operation: ExplorerOperation | null\n baseUrl: string\n setBaseUrl: (value: string) => void\n baseUrlOptions: ServerOption[]\n apiKey: string\n setApiKey: (value: string) => void\n}\n\nfunction TesterPanel(props: TesterPanelProps) {\n const { operation, baseUrl, setBaseUrl, baseUrlOptions, apiKey, setApiKey } = props\n const [pathValues, setPathValues] = useState<Record<string, string>>({})\n const [queryValues, setQueryValues] = useState<Record<string, string>>({})\n const [bodyContent, setBodyContent] = useState<string>('')\n const [response, setResponse] = useState<TestResponse | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [isLoading, setIsLoading] = useState(false)\n\n const parameters = useMemo(\n () => (operation && Array.isArray(operation.operation?.parameters) ? operation.operation.parameters : []),\n [operation]\n )\n const pathParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'path'),\n [parameters]\n )\n const queryParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'query'),\n [parameters]\n )\n const requestVariant = useMemo(\n () => (operation ? pickContentVariant(operation.operation?.requestBody?.content) : null),\n [operation]\n )\n const mergedBaseUrls = useMemo(() => {\n if (!baseUrl) return baseUrlOptions\n if (baseUrlOptions.some((server) => server.url === baseUrl)) return baseUrlOptions\n return [...baseUrlOptions, { url: baseUrl }]\n }, [baseUrlOptions, baseUrl])\n\n const requestPreview = useMemo<RequestPreview | null>(() => {\n if (!operation) return null\n const method = operation.method.toUpperCase()\n const rawBase = baseUrl.trim()\n const normalizedBase = rawBase || PLACEHOLDER_BASE_URL\n const usesPlaceholderBase = !rawBase\n const baseWithSlash = normalizedBase.endsWith('/') ? normalizedBase : `${normalizedBase}/`\n const resolvedPath = applyPathParams(operation.path, pathValues)\n const relativePath = resolvedPath.replace(/^\\//, '')\n\n let url: URL\n try {\n url = new URL(relativePath, baseWithSlash)\n } catch {\n return {\n method,\n url: '',\n headers: [],\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n baseError: 'Base URL must be absolute (include protocol, e.g. https://api.example.com).',\n }\n }\n\n for (const [key, value] of Object.entries(queryValues)) {\n if (!value) continue\n url.searchParams.append(key, value)\n }\n\n const headers: Array<[string, string]> = [['Accept', 'application/json']]\n const trimmedKey = apiKey.trim()\n if (trimmedKey) {\n headers.push(['Authorization', `ApiKey ${trimmedKey}`])\n headers.push(['X-Api-Key', trimmedKey])\n }\n\n let body: string | undefined\n let jsonBody: unknown\n let bodyParseError: string | undefined\n\n if (requestVariant && method !== 'GET' && method !== 'HEAD') {\n headers.push(['Content-Type', requestVariant.mediaType])\n if (requestVariant.mediaType === 'application/json') {\n if (bodyContent.trim()) {\n try {\n jsonBody = JSON.parse(bodyContent)\n body = JSON.stringify(jsonBody)\n } catch {\n bodyParseError = 'Request body must be valid JSON.'\n }\n }\n } else {\n if (bodyContent) {\n body = bodyContent\n }\n }\n }\n\n const missingPathParam = pathParams.find((parameter: any) => parameter.required && !pathValues[parameter.name])\n\n return {\n method,\n url: url.toString(),\n headers,\n body,\n jsonBody,\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n missingPathParam: missingPathParam?.name,\n bodyParseError,\n }\n }, [operation, baseUrl, pathValues, queryValues, apiKey, requestVariant, bodyContent, pathParams])\n\n const codeSnippets = useMemo<CodeSnippet[]>(() => {\n if (!requestPreview || requestPreview.baseError) return []\n\n const snippets: CodeSnippet[] = []\n const { method, url, headers, body, jsonBody, mediaType } = requestPreview\n\n if (url) {\n const curlParts = [`curl -X ${method} '${escapeSingleQuotes(url)}'`]\n for (const [key, value] of headers) {\n curlParts.push(` -H '${escapeSingleQuotes(`${key}: ${value}`)}'`)\n }\n if (body) {\n curlParts.push(` --data '${escapeSingleQuotes(body)}'`)\n }\n snippets.push({\n id: 'curl',\n label: 'cURL',\n language: 'bash',\n code: curlParts.join(' \\\\\\n'),\n })\n\n const headerEntries =\n headers.length === 0\n ? ''\n : headers.map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`).join('\\n')\n const tsLines: string[] = [\n `const url = '${escapeSingleQuotesForJs(url)}';`,\n headerEntries ? `const headers = {\\n${headerEntries}\\n};` : 'const headers = {};',\n ]\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const payloadLiteral = JSON.stringify(jsonBody, null, 2)\n tsLines.push('', `const payload = ${payloadLiteral};`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body: JSON.stringify(payload),',\n '});'\n )\n } else if (body) {\n tsLines.push('', `const body = \\`${escapeBackticks(body)}\\`;`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body,',\n '});'\n )\n } else {\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n '});'\n )\n }\n tsLines.push('const data = await response.json();', 'console.log(data);')\n\n snippets.push({\n id: 'typescript',\n label: 'TypeScript',\n language: 'ts',\n code: tsLines.join('\\n'),\n })\n\n const pythonLines: string[] = [\"import requests\", \"\", `url = '${escapeSingleQuotesForJs(url)}'`]\n if (headers.length) {\n const pythonHeaders = headers\n .map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`)\n .join('\\n')\n pythonLines.push('headers = {', pythonHeaders, '}')\n } else {\n pythonLines.push('headers = {}')\n }\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const pythonPayload = toPythonLiteral(jsonBody)\n pythonLines.push('', `payload = ${pythonPayload}`)\n pythonLines.push(\n `response = requests.request('${method}', url, headers=headers, json=payload)`\n )\n } else if (body) {\n pythonLines.push('', `data = ${toPythonLiteral(body)}`)\n pythonLines.push(`response = requests.request('${method}', url, headers=headers, data=data)`)\n } else {\n pythonLines.push('', `response = requests.request('${method}', url, headers=headers)`)\n }\n pythonLines.push('print(response.status_code)', 'print(response.text)')\n\n snippets.push({\n id: 'python',\n label: 'Python',\n language: 'python',\n code: pythonLines.join('\\n'),\n })\n }\n\n return snippets\n }, [requestPreview])\n\n useEffect(() => {\n const nextPath: Record<string, string> = {}\n for (const parameter of pathParams) {\n nextPath[parameter.name] = ''\n }\n const nextQuery: Record<string, string> = {}\n for (const parameter of queryParams) {\n nextQuery[parameter.name] = ''\n }\n setPathValues(nextPath)\n setQueryValues(nextQuery)\n\n if (requestVariant) {\n const example =\n requestVariant.entry?.example ??\n requestVariant.entry?.examples?.default?.value ??\n buildExampleFromSchema(requestVariant.entry?.schema)\n setBodyContent(example ? stringifyExample(requestVariant.mediaType, example) : '')\n } else {\n setBodyContent('')\n }\n setResponse(null)\n setError(null)\n }, [operation?.id, pathParams, queryParams, requestVariant])\n\n if (!operation) {\n return (\n <div className=\"rounded-lg border bg-card p-5 text-sm text-muted-foreground\">\n Select an endpoint to start testing requests.\n </div>\n )\n }\n\n const handleSubmit = async () => {\n if (!operation) return\n if (!baseUrl.trim()) {\n setError('Please provide a base URL for the request.')\n return\n }\n if (requestPreview?.baseError) {\n setError(requestPreview.baseError)\n return\n }\n if (requestPreview?.missingPathParam) {\n setError(`Path parameter \"${requestPreview.missingPathParam}\" is required.`)\n return\n }\n if (requestPreview?.bodyParseError) {\n setError(requestPreview.bodyParseError)\n return\n }\n if (!requestPreview) {\n setError('Unable to prepare the request. Check your input and try again.')\n return\n }\n\n setIsLoading(true)\n setError(null)\n setResponse(null)\n\n try {\n const started = performance.now()\n const res = await fetch(requestPreview.url, {\n method: requestPreview.method,\n headers: Object.fromEntries(requestPreview.headers),\n body: requestPreview.body,\n })\n const duration = performance.now() - started\n const text = await res.text()\n let parsed: unknown | undefined\n try {\n parsed = JSON.parse(text)\n } catch {\n parsed = undefined\n }\n setResponse({\n status: res.status,\n ok: res.ok,\n durationMs: Math.round(duration),\n body: text,\n parsed,\n })\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : 'Request failed. Check your network connection.')\n } finally {\n setIsLoading(false)\n }\n }\n\n return (\n <div className=\"flex flex-col gap-4 rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">Interactive tester</h2>\n <p className=\"text-xs text-muted-foreground\">\n Provide the endpoint parameters and your API key to execute a live request.\n </p>\n </div>\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n </div>\n\n <div className=\"space-y-2 text-xs\">\n <div className=\"font-semibold text-foreground\">Endpoint</div>\n <code className=\"rounded-md bg-muted px-3 py-2 text-xs text-primary\">{operation.path}</code>\n </div>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">Base URL</span>\n <Select value={baseUrl} onValueChange={(value) => setBaseUrl(value)}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {mergedBaseUrls.map((server) => (\n <SelectItem key={server.url} value={server.url}>\n {server.url} {server.description ? `\u2014 ${server.description}` : ''}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {!baseUrl.trim() && requestPreview?.usesPlaceholderBase ? (\n <p className=\"text-xs text-muted-foreground\">\n Examples default to {PLACEHOLDER_BASE_URL}. Update the base URL to match your environment.\n </p>\n ) : null}\n {requestPreview?.baseError ? (\n <p className=\"text-xs text-rose-600\">{requestPreview.baseError}</p>\n ) : null}\n </label>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">API key</span>\n <Input\n type=\"text\"\n value={apiKey}\n onChange={(event) => setApiKey(event.target.value)}\n placeholder=\"Paste your API key secret (omk_\u2026)\"\n />\n </label>\n\n {pathParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Path parameters</div>\n <div className=\"space-y-3\">\n {pathParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <Input\n type=\"text\"\n value={pathValues[parameter.name] ?? ''}\n onChange={(event) =>\n setPathValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {queryParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Query parameters</div>\n <div className=\"space-y-3\">\n {queryParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <Input\n type=\"text\"\n value={queryValues[parameter.name] ?? ''}\n onChange={(event) =>\n setQueryValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {requestVariant ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"font-medium text-foreground\">Request body</span>\n <span className=\"text-xs text-muted-foreground\">{requestVariant.mediaType}</span>\n </div>\n <textarea\n value={bodyContent}\n onChange={(event) => setBodyContent(event.target.value)}\n rows={8}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-xs font-mono leading-relaxed focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n placeholder=\"Provide request payload\"\n />\n </section>\n ) : null}\n\n {requestPreview?.bodyParseError ? (\n <div className=\"rounded border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-700\">\n {requestPreview.bodyParseError}\n </div>\n ) : null}\n\n {codeSnippets.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Request examples</div>\n <CodeSnippetTabs snippets={codeSnippets} />\n </section>\n ) : null}\n\n <button\n type=\"button\"\n onClick={handleSubmit}\n disabled={isLoading}\n className=\"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:bg-primary/10\"\n >\n {isLoading ? 'Sending\u2026' : 'Send request'}\n </button>\n\n {error ? <div className=\"rounded border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-700\">{error}</div> : null}\n\n {response ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <div className=\"font-medium text-foreground\">\n Response \u00B7 <span className={response.ok ? 'text-emerald-600' : 'text-rose-600'}>{response.status}</span>\n </div>\n <div className=\"text-xs text-muted-foreground\">{response.durationMs} ms</div>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {response.parsed ? formatJson(response.parsed) : response.body || '(empty response)'}\n </pre>\n </section>\n ) : null}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA+XY,SAKE,KALF;AA7XZ,SAAS,WAAW,SAAS,gBAAgC;AAC7D,O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I,WAAU,+BAA8B,8BAAgB;AAAA,MAC7D,oBAAC,mBAAgB,UAAU,cAAc;AAAA,OAC3C,IACE;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAU;AAAA,QAET,sBAAY,kBAAa;AAAA;AAAA,IAC5B;AAAA,IAEC,QAAQ,oBAAC,SAAI,WAAU,6EAA6E,iBAAM,IAAS;AAAA,IAEnH,WACC,qBAAC,aAAQ,WAAU,qBACjB;AAAA,2BAAC,SAAI,WAAU,qCACb;AAAA,6BAAC,SAAI,WAAU,+BAA8B;AAAA;AAAA,UAChC,oBAAC,UAAK,WAAW,SAAS,KAAK,qBAAqB,iBAAkB,mBAAS,QAAO;AAAA,WACnG;AAAA,QACA,qBAAC,SAAI,WAAU,iCAAiC;AAAA,mBAAS;AAAA,UAAW;AAAA,WAAG;AAAA,SACzE;AAAA,MACA,oBAAC,SAAI,WAAU,gFACZ,mBAAS,SAAS,WAAW,SAAS,MAAM,IAAI,SAAS,QAAQ,oBACpE;AAAA,OACF,IACE;AAAA,KACN;AAEJ;",
|
|
6
6
|
"names": ["mediaType"]
|
|
7
7
|
}
|
|
@@ -6,6 +6,13 @@ import { RowActions } from "@open-mercato/ui/backend/RowActions";
|
|
|
6
6
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
7
7
|
import { Input } from "@open-mercato/ui/primitives/input";
|
|
8
8
|
import { Label } from "@open-mercato/ui/primitives/label";
|
|
9
|
+
import {
|
|
10
|
+
Select,
|
|
11
|
+
SelectContent,
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectTrigger,
|
|
14
|
+
SelectValue
|
|
15
|
+
} from "@open-mercato/ui/primitives/select";
|
|
9
16
|
import {
|
|
10
17
|
Dialog,
|
|
11
18
|
DialogContent,
|
|
@@ -352,14 +359,15 @@ function AttachmentPartitionSettings() {
|
|
|
352
359
|
] }),
|
|
353
360
|
form.requiresOcr && /* @__PURE__ */ jsxs("div", { className: "space-y-2 pl-6", children: [
|
|
354
361
|
/* @__PURE__ */ jsx(Label, { htmlFor: "partition-ocr-model", children: t("attachments.partitions.form.ocrModelLabel", "OCR Model") }),
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
|
|
362
|
+
/* @__PURE__ */ jsxs(
|
|
363
|
+
Select,
|
|
357
364
|
{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
365
|
+
value: form.ocrModel || void 0,
|
|
366
|
+
onValueChange: (value) => setForm((prev) => ({ ...prev, ocrModel: value ?? "" })),
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id: "partition-ocr-model", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
369
|
+
/* @__PURE__ */ jsx(SelectContent, { children: OCR_MODEL_OPTIONS.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: t(`attachments.partitions.form.ocrModelOptions.${option.value || "default"}`, option.label) }, option.value)) })
|
|
370
|
+
]
|
|
363
371
|
}
|
|
364
372
|
),
|
|
365
373
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|