@retinalabsllc/zairusjs 0.6.7 → 0.6.8
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/index.d.mts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +147 -0
- package/dist/index.mjs +146 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -357,7 +357,7 @@ interface TextInputProps {
|
|
|
357
357
|
maxLength?: number;
|
|
358
358
|
disabled?: boolean;
|
|
359
359
|
readOnly?: boolean;
|
|
360
|
-
type?: 'text' | 'password' | 'email';
|
|
360
|
+
type?: 'text' | 'password' | 'email' | 'url';
|
|
361
361
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
362
362
|
}
|
|
363
363
|
interface NumberInputProps {
|
|
@@ -880,4 +880,26 @@ interface BannerProps {
|
|
|
880
880
|
}
|
|
881
881
|
declare const Banner: React.FC<BannerProps>;
|
|
882
882
|
|
|
883
|
-
|
|
883
|
+
interface UniversalDeveloperSettingsProps {
|
|
884
|
+
initialPublicKey: string;
|
|
885
|
+
initialWebhookUrl: string;
|
|
886
|
+
isReadOnly?: boolean;
|
|
887
|
+
onGenerateKeys: () => Promise<{
|
|
888
|
+
success: boolean;
|
|
889
|
+
data?: {
|
|
890
|
+
publicKey: string;
|
|
891
|
+
secretKey: string;
|
|
892
|
+
};
|
|
893
|
+
error?: string;
|
|
894
|
+
}>;
|
|
895
|
+
onSaveWebhook: (webhookUrl: string) => Promise<{
|
|
896
|
+
success: boolean;
|
|
897
|
+
data?: {
|
|
898
|
+
webhookUrl: string;
|
|
899
|
+
};
|
|
900
|
+
error?: string;
|
|
901
|
+
}>;
|
|
902
|
+
}
|
|
903
|
+
declare const UniversalDeveloperSettings: React.FC<UniversalDeveloperSettingsProps>;
|
|
904
|
+
|
|
905
|
+
export { AITranscriptionFeature, type AITranscriptionFeatureProps, type AgentFilePayload, type AgentStat, AiApproveDecline, type AiApproveDeclineProps, AiStageCheck, type AiStageCheckProps, type AiTask, type AiTaskStatus, AppBento2, type AppBento2Props, Banner, type BannerProps, type BentoFeature, type BoardMember, type CompanyDetails, type CompanyMember, type DashboardList, type DashboardListItem, type DashboardStat, type DocumentSectionData, type EmailContact, Faq, type FaqItem, type FaqProps, FeatureScroll, type FeatureScrollProps, Footer, type FooterColumn, type FooterLink, type FooterProps, GifFeatureCard, type GifFeatureCardProps, Header, type HeaderLink, type HeaderProps, HeroSection, type HeroSectionProps, ManagedBoardBlock, type ManagedBoardBlockProps, ManagedContactBlock, type ManagedContactBlockProps, ManagedDocument, type ManagedDocumentProps, ManagedNewsletterSplitBlock, type ManagedNewsletterSplitBlockProps, ManagedNotFoundBlock, type ManagedNotFoundBlockProps, ManagedPricingBlock, type ManagedPricingBlockProps, ManagedProjectsBlock, type ManagedProjectsBlockProps, ManagedToaster, type NavItem, NumberInput, type NumberInputProps, type OverviewAlert, type OverviewStat, PageSpinner, type PageSpinnerProps, type PlatformFeatureItem, PlatformFeatures, type PlatformFeaturesProps, PortfolioHero, type PortfolioHeroProps, type PricingFeature, type PricingPlan, ProductHero, type ProductHeroProps, type ProjectItem, type ScrollFeature, type SearchTypeOption, type SocialContact, type SocialLink, Stagger, type StaggerProps, TextInput, type TextInputProps, ThreeDActionButton, type ThreeDActionButtonProps, ThreeDButton, type ThreeDButtonProps, UniversalAgentConsole, type UniversalAgentConsoleProps, UniversalBillingPage, type UniversalBillingPageProps, UniversalDashboardPage, type UniversalDashboardPageProps, UniversalDeveloperSettings, type UniversalDeveloperSettingsProps, UniversalDirectoryPage, type UniversalDirectoryPageProps, UniversalErrorView, type UniversalErrorViewProps, UniversalIdentityPage, type UniversalIdentityPageProps, type UniversalInvoice, UniversalLookupPage, type UniversalLookupPageProps, type UniversalMember, UniversalMembersPage, type UniversalMembersPageProps, UniversalOrganizationPage, type UniversalOrganizationPageProps, UniversalOverviewPage, type UniversalOverviewPageProps, UniversalProfileSettings, type UniversalProfileSettingsProps, UniversalRegistrationFlow, type UniversalRegistrationFlowProps, UniversalSidebar, type UniversalSidebarProps, type WorkspaceItem, ZairusAuth, type ZairusAuthProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -357,7 +357,7 @@ interface TextInputProps {
|
|
|
357
357
|
maxLength?: number;
|
|
358
358
|
disabled?: boolean;
|
|
359
359
|
readOnly?: boolean;
|
|
360
|
-
type?: 'text' | 'password' | 'email';
|
|
360
|
+
type?: 'text' | 'password' | 'email' | 'url';
|
|
361
361
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
362
362
|
}
|
|
363
363
|
interface NumberInputProps {
|
|
@@ -880,4 +880,26 @@ interface BannerProps {
|
|
|
880
880
|
}
|
|
881
881
|
declare const Banner: React.FC<BannerProps>;
|
|
882
882
|
|
|
883
|
-
|
|
883
|
+
interface UniversalDeveloperSettingsProps {
|
|
884
|
+
initialPublicKey: string;
|
|
885
|
+
initialWebhookUrl: string;
|
|
886
|
+
isReadOnly?: boolean;
|
|
887
|
+
onGenerateKeys: () => Promise<{
|
|
888
|
+
success: boolean;
|
|
889
|
+
data?: {
|
|
890
|
+
publicKey: string;
|
|
891
|
+
secretKey: string;
|
|
892
|
+
};
|
|
893
|
+
error?: string;
|
|
894
|
+
}>;
|
|
895
|
+
onSaveWebhook: (webhookUrl: string) => Promise<{
|
|
896
|
+
success: boolean;
|
|
897
|
+
data?: {
|
|
898
|
+
webhookUrl: string;
|
|
899
|
+
};
|
|
900
|
+
error?: string;
|
|
901
|
+
}>;
|
|
902
|
+
}
|
|
903
|
+
declare const UniversalDeveloperSettings: React.FC<UniversalDeveloperSettingsProps>;
|
|
904
|
+
|
|
905
|
+
export { AITranscriptionFeature, type AITranscriptionFeatureProps, type AgentFilePayload, type AgentStat, AiApproveDecline, type AiApproveDeclineProps, AiStageCheck, type AiStageCheckProps, type AiTask, type AiTaskStatus, AppBento2, type AppBento2Props, Banner, type BannerProps, type BentoFeature, type BoardMember, type CompanyDetails, type CompanyMember, type DashboardList, type DashboardListItem, type DashboardStat, type DocumentSectionData, type EmailContact, Faq, type FaqItem, type FaqProps, FeatureScroll, type FeatureScrollProps, Footer, type FooterColumn, type FooterLink, type FooterProps, GifFeatureCard, type GifFeatureCardProps, Header, type HeaderLink, type HeaderProps, HeroSection, type HeroSectionProps, ManagedBoardBlock, type ManagedBoardBlockProps, ManagedContactBlock, type ManagedContactBlockProps, ManagedDocument, type ManagedDocumentProps, ManagedNewsletterSplitBlock, type ManagedNewsletterSplitBlockProps, ManagedNotFoundBlock, type ManagedNotFoundBlockProps, ManagedPricingBlock, type ManagedPricingBlockProps, ManagedProjectsBlock, type ManagedProjectsBlockProps, ManagedToaster, type NavItem, NumberInput, type NumberInputProps, type OverviewAlert, type OverviewStat, PageSpinner, type PageSpinnerProps, type PlatformFeatureItem, PlatformFeatures, type PlatformFeaturesProps, PortfolioHero, type PortfolioHeroProps, type PricingFeature, type PricingPlan, ProductHero, type ProductHeroProps, type ProjectItem, type ScrollFeature, type SearchTypeOption, type SocialContact, type SocialLink, Stagger, type StaggerProps, TextInput, type TextInputProps, ThreeDActionButton, type ThreeDActionButtonProps, ThreeDButton, type ThreeDButtonProps, UniversalAgentConsole, type UniversalAgentConsoleProps, UniversalBillingPage, type UniversalBillingPageProps, UniversalDashboardPage, type UniversalDashboardPageProps, UniversalDeveloperSettings, type UniversalDeveloperSettingsProps, UniversalDirectoryPage, type UniversalDirectoryPageProps, UniversalErrorView, type UniversalErrorViewProps, UniversalIdentityPage, type UniversalIdentityPageProps, type UniversalInvoice, UniversalLookupPage, type UniversalLookupPageProps, type UniversalMember, UniversalMembersPage, type UniversalMembersPageProps, UniversalOrganizationPage, type UniversalOrganizationPageProps, UniversalOverviewPage, type UniversalOverviewPageProps, UniversalProfileSettings, type UniversalProfileSettingsProps, UniversalRegistrationFlow, type UniversalRegistrationFlowProps, UniversalSidebar, type UniversalSidebarProps, type WorkspaceItem, ZairusAuth, type ZairusAuthProps };
|
package/dist/index.js
CHANGED
|
@@ -62,6 +62,7 @@ __export(index_exports, {
|
|
|
62
62
|
UniversalAgentConsole: () => UniversalAgentConsole,
|
|
63
63
|
UniversalBillingPage: () => UniversalBillingPage,
|
|
64
64
|
UniversalDashboardPage: () => UniversalDashboardPage,
|
|
65
|
+
UniversalDeveloperSettings: () => UniversalDeveloperSettings,
|
|
65
66
|
UniversalDirectoryPage: () => UniversalDirectoryPage,
|
|
66
67
|
UniversalErrorView: () => UniversalErrorView,
|
|
67
68
|
UniversalIdentityPage: () => UniversalIdentityPage,
|
|
@@ -3642,6 +3643,151 @@ var UniversalRegistrationFlow = ({
|
|
|
3642
3643
|
}, className: `text-left px-4 py-3 rounded-full text-[13px] transition-colors outline-none ${isSelected ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}` }, opt);
|
|
3643
3644
|
})), /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full flex mt-auto shrink-0 " }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setActiveModal({ isOpen: false, type: null, memberIndex: null }), className: "w-full py-4 text-[13px] text-neutral-500 hover:bg-neutral-50 transition-colors outline-none" }, "Close")))));
|
|
3644
3645
|
};
|
|
3646
|
+
|
|
3647
|
+
// src/components/UniversalDeveloperSettings.tsx
|
|
3648
|
+
var import_react67 = __toESM(require("react"));
|
|
3649
|
+
var import_react_hot_toast8 = require("react-hot-toast");
|
|
3650
|
+
var import_react68 = require("@hugeicons/react");
|
|
3651
|
+
var import_core_free_icons22 = require("@hugeicons/core-free-icons");
|
|
3652
|
+
var ButtonSpinner5 = () => /* @__PURE__ */ import_react67.default.createElement(import_react68.HugeiconsIcon, { icon: import_core_free_icons22.Loading03Icon, size: 16, className: "animate-spin text-current" });
|
|
3653
|
+
var UniversalDeveloperSettings = ({
|
|
3654
|
+
initialPublicKey,
|
|
3655
|
+
initialWebhookUrl,
|
|
3656
|
+
isReadOnly = false,
|
|
3657
|
+
onGenerateKeys,
|
|
3658
|
+
onSaveWebhook
|
|
3659
|
+
}) => {
|
|
3660
|
+
const [publicKey, setPublicKey] = (0, import_react67.useState)(initialPublicKey);
|
|
3661
|
+
const [webhookUrl, setWebhookUrl] = (0, import_react67.useState)(initialWebhookUrl);
|
|
3662
|
+
const [isGenerating, setIsGenerating] = (0, import_react67.useState)(false);
|
|
3663
|
+
const [isSavingWebhook, setIsSavingWebhook] = (0, import_react67.useState)(false);
|
|
3664
|
+
const [isRollModalOpen, setIsRollModalOpen] = (0, import_react67.useState)(false);
|
|
3665
|
+
(0, import_react67.useEffect)(() => {
|
|
3666
|
+
setPublicKey(initialPublicKey || "");
|
|
3667
|
+
setWebhookUrl(initialWebhookUrl || "");
|
|
3668
|
+
}, [initialPublicKey, initialWebhookUrl]);
|
|
3669
|
+
const handleWebhookChange = (val) => {
|
|
3670
|
+
setWebhookUrl(val.trim());
|
|
3671
|
+
};
|
|
3672
|
+
const downloadEnvironmentFile = (pubKey, secKey) => {
|
|
3673
|
+
const envContent = `RETINA_PUBLIC_KEY="${pubKey}"
|
|
3674
|
+
RETINA_SECRET_KEY="${secKey}"
|
|
3675
|
+
`;
|
|
3676
|
+
const blob = new Blob([envContent], { type: "text/plain" });
|
|
3677
|
+
const url = URL.createObjectURL(blob);
|
|
3678
|
+
const link = document.createElement("a");
|
|
3679
|
+
link.href = url;
|
|
3680
|
+
link.download = "retina-keys.env";
|
|
3681
|
+
document.body.appendChild(link);
|
|
3682
|
+
link.click();
|
|
3683
|
+
document.body.removeChild(link);
|
|
3684
|
+
URL.revokeObjectURL(url);
|
|
3685
|
+
};
|
|
3686
|
+
const handleGenerateKeys = async () => {
|
|
3687
|
+
if (isGenerating || isReadOnly) return;
|
|
3688
|
+
setIsGenerating(true);
|
|
3689
|
+
try {
|
|
3690
|
+
const res = await onGenerateKeys();
|
|
3691
|
+
if (res.success && res.data) {
|
|
3692
|
+
setPublicKey(res.data.publicKey);
|
|
3693
|
+
downloadEnvironmentFile(res.data.publicKey, res.data.secretKey);
|
|
3694
|
+
import_react_hot_toast8.toast.success("Keys generated. Check your downloads folder.");
|
|
3695
|
+
setIsRollModalOpen(false);
|
|
3696
|
+
} else {
|
|
3697
|
+
import_react_hot_toast8.toast.error(res.error || "Uh oh! Something went wrong.");
|
|
3698
|
+
}
|
|
3699
|
+
} catch (error) {
|
|
3700
|
+
import_react_hot_toast8.toast.error("Uh oh! Something went wrong.");
|
|
3701
|
+
} finally {
|
|
3702
|
+
setIsGenerating(false);
|
|
3703
|
+
}
|
|
3704
|
+
};
|
|
3705
|
+
const handleSaveWebhook = async (e) => {
|
|
3706
|
+
e.preventDefault();
|
|
3707
|
+
if (isSavingWebhook || isReadOnly) return;
|
|
3708
|
+
setIsSavingWebhook(true);
|
|
3709
|
+
try {
|
|
3710
|
+
const res = await onSaveWebhook(webhookUrl);
|
|
3711
|
+
if (res.success && res.data) {
|
|
3712
|
+
setWebhookUrl(res.data.webhookUrl || "");
|
|
3713
|
+
import_react_hot_toast8.toast.success("Webhook URL updated.");
|
|
3714
|
+
} else {
|
|
3715
|
+
import_react_hot_toast8.toast.error(res.error || "Uh oh! Something went wrong.");
|
|
3716
|
+
}
|
|
3717
|
+
} catch (error) {
|
|
3718
|
+
import_react_hot_toast8.toast.error("Uh oh! Something went wrong.");
|
|
3719
|
+
} finally {
|
|
3720
|
+
setIsSavingWebhook(false);
|
|
3721
|
+
}
|
|
3722
|
+
};
|
|
3723
|
+
const hasWebhookChanges = webhookUrl !== initialWebhookUrl;
|
|
3724
|
+
const isWebhookSaveDisabled = isSavingWebhook || isReadOnly || !hasWebhookChanges;
|
|
3725
|
+
return /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex flex-col max-w-3xl rounded-2xl p-6 bg-white gap-8 animate-in fade-in duration-300 min-h-full" }, /* @__PURE__ */ import_react67.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-3 sm:gap-4" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ import_react67.default.createElement("h1", { className: "font-serif text-xl text-black mb-1 truncate tracking-tight" }, "Developer Settings"), /* @__PURE__ */ import_react67.default.createElement("p", { className: "text-xs text-neutral-500 truncate" }, "Manage your API credentials and webhook integrations.")), isReadOnly && /* @__PURE__ */ import_react67.default.createElement("span", { className: "px-3 py-1 bg-neutral-50 text-neutral-500 rounded-full text-[10px] tracking-[0.2em] shrink-0 w-fit" }, "Read Only Access")), /* @__PURE__ */ import_react67.default.createElement("div", { className: "w-full max-w-2xl flex flex-col gap-12" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "space-y-2 min-w-0" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
3726
|
+
TextInput,
|
|
3727
|
+
{
|
|
3728
|
+
label: "Public Key",
|
|
3729
|
+
value: publicKey || "No key generated yet",
|
|
3730
|
+
onChange: () => {
|
|
3731
|
+
},
|
|
3732
|
+
disabled: true
|
|
3733
|
+
}
|
|
3734
|
+
), /* @__PURE__ */ import_react67.default.createElement("p", { className: "text-[10px] text-neutral-400 mt-1 leading-snug" }, "Your public key is used to identify your application. Your secret key will only be shown once upon generation.")), /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
3735
|
+
ThreeDActionButton,
|
|
3736
|
+
{
|
|
3737
|
+
onClick: () => {
|
|
3738
|
+
if (publicKey) setIsRollModalOpen(true);
|
|
3739
|
+
else handleGenerateKeys();
|
|
3740
|
+
},
|
|
3741
|
+
disabled: isGenerating || isReadOnly,
|
|
3742
|
+
isLoading: isGenerating,
|
|
3743
|
+
className: "w-fit"
|
|
3744
|
+
},
|
|
3745
|
+
publicKey ? "Roll API Keys" : "Generate Keys"
|
|
3746
|
+
))), /* @__PURE__ */ import_react67.default.createElement("form", { className: "flex flex-col gap-6 border-t border-neutral-100 pt-8", onSubmit: handleSaveWebhook, autoComplete: "off" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "space-y-2 min-w-0" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
3747
|
+
TextInput,
|
|
3748
|
+
{
|
|
3749
|
+
label: "Webhook URL",
|
|
3750
|
+
value: webhookUrl,
|
|
3751
|
+
onChange: handleWebhookChange,
|
|
3752
|
+
disabled: isReadOnly || isSavingWebhook,
|
|
3753
|
+
placeholder: "https://your-domain.com/webhook",
|
|
3754
|
+
type: "url"
|
|
3755
|
+
}
|
|
3756
|
+
), /* @__PURE__ */ import_react67.default.createElement("p", { className: "text-[10px] text-neutral-400 mt-1 leading-snug" }, "We will send secure POST requests to this endpoint when significant events occur. Must use HTTPS.")), /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between mt-2 gap-6 sm:gap-4" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex items-center gap-6 min-w-0" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ import_react67.default.createElement("span", { className: "text-[10px] text-neutral-400 tracking-[0.2em] block truncate uppercase" }, "Webhook Status"), /* @__PURE__ */ import_react67.default.createElement("span", { className: `text-xs block truncate ${webhookUrl ? "text-emerald-600" : "text-neutral-400"}` }, webhookUrl ? "Active" : "Inactive"))), /* @__PURE__ */ import_react67.default.createElement("div", { className: "flex flex-col-reverse sm:flex-row items-center gap-3 sm:gap-4 w-full sm:w-auto shrink-0" }, hasWebhookChanges && !isSavingWebhook && !isReadOnly && /* @__PURE__ */ import_react67.default.createElement(
|
|
3757
|
+
"button",
|
|
3758
|
+
{
|
|
3759
|
+
type: "button",
|
|
3760
|
+
onClick: () => setWebhookUrl(initialWebhookUrl),
|
|
3761
|
+
className: "text-[11px] tracking-widest text-neutral-500 hover:text-black transition-colors w-full sm:w-auto py-2 sm:py-0 outline-none"
|
|
3762
|
+
},
|
|
3763
|
+
"Cancel"
|
|
3764
|
+
), /* @__PURE__ */ import_react67.default.createElement(
|
|
3765
|
+
ThreeDActionButton,
|
|
3766
|
+
{
|
|
3767
|
+
type: "submit",
|
|
3768
|
+
disabled: isWebhookSaveDisabled,
|
|
3769
|
+
isLoading: isSavingWebhook,
|
|
3770
|
+
className: "min-w-32 w-full sm:w-auto"
|
|
3771
|
+
},
|
|
3772
|
+
"Save Webhook"
|
|
3773
|
+
))))), isRollModalOpen && !isReadOnly && /* @__PURE__ */ import_react67.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => !isGenerating && setIsRollModalOpen(false) }), /* @__PURE__ */ import_react67.default.createElement("div", { className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react67.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react67.default.createElement("h3", { className: "font-serif text-[17px] text-black tracking-tight mb-1" }, "Roll API Keys"), /* @__PURE__ */ import_react67.default.createElement("p", { className: "text-[12px] text-neutral-500 leading-snug mt-2" }, "Are you sure you want to roll your keys? This will permanently invalidate your current secret key and active MCP tokens.")), /* @__PURE__ */ import_react67.default.createElement("div", { className: "w-full flex" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
3774
|
+
"button",
|
|
3775
|
+
{
|
|
3776
|
+
onClick: () => setIsRollModalOpen(false),
|
|
3777
|
+
disabled: isGenerating,
|
|
3778
|
+
className: "flex-1 py-2 text-[13px] text-neutral-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 outline-none"
|
|
3779
|
+
},
|
|
3780
|
+
"Cancel"
|
|
3781
|
+
), /* @__PURE__ */ import_react67.default.createElement(
|
|
3782
|
+
"button",
|
|
3783
|
+
{
|
|
3784
|
+
onClick: handleGenerateKeys,
|
|
3785
|
+
disabled: isGenerating,
|
|
3786
|
+
className: "flex-1 py-2 text-[13px] text-red-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 flex justify-center outline-none"
|
|
3787
|
+
},
|
|
3788
|
+
isGenerating ? /* @__PURE__ */ import_react67.default.createElement(ButtonSpinner5, null) : "Roll Keys"
|
|
3789
|
+
)))));
|
|
3790
|
+
};
|
|
3645
3791
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3646
3792
|
0 && (module.exports = {
|
|
3647
3793
|
AITranscriptionFeature,
|
|
@@ -3675,6 +3821,7 @@ var UniversalRegistrationFlow = ({
|
|
|
3675
3821
|
UniversalAgentConsole,
|
|
3676
3822
|
UniversalBillingPage,
|
|
3677
3823
|
UniversalDashboardPage,
|
|
3824
|
+
UniversalDeveloperSettings,
|
|
3678
3825
|
UniversalDirectoryPage,
|
|
3679
3826
|
UniversalErrorView,
|
|
3680
3827
|
UniversalIdentityPage,
|
package/dist/index.mjs
CHANGED
|
@@ -3601,6 +3601,151 @@ var UniversalRegistrationFlow = ({
|
|
|
3601
3601
|
}, className: `text-left px-4 py-3 rounded-full text-[13px] transition-colors outline-none ${isSelected ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}` }, opt);
|
|
3602
3602
|
})), /* @__PURE__ */ React41.createElement("div", { className: "w-full flex mt-auto shrink-0 " }, /* @__PURE__ */ React41.createElement("button", { onClick: () => setActiveModal({ isOpen: false, type: null, memberIndex: null }), className: "w-full py-4 text-[13px] text-neutral-500 hover:bg-neutral-50 transition-colors outline-none" }, "Close")))));
|
|
3603
3603
|
};
|
|
3604
|
+
|
|
3605
|
+
// src/components/UniversalDeveloperSettings.tsx
|
|
3606
|
+
import React42, { useState as useState21, useEffect as useEffect12 } from "react";
|
|
3607
|
+
import { toast as toast7 } from "react-hot-toast";
|
|
3608
|
+
import { HugeiconsIcon as HugeiconsIcon26 } from "@hugeicons/react";
|
|
3609
|
+
import { Loading03Icon as Loading03Icon13 } from "@hugeicons/core-free-icons";
|
|
3610
|
+
var ButtonSpinner5 = () => /* @__PURE__ */ React42.createElement(HugeiconsIcon26, { icon: Loading03Icon13, size: 16, className: "animate-spin text-current" });
|
|
3611
|
+
var UniversalDeveloperSettings = ({
|
|
3612
|
+
initialPublicKey,
|
|
3613
|
+
initialWebhookUrl,
|
|
3614
|
+
isReadOnly = false,
|
|
3615
|
+
onGenerateKeys,
|
|
3616
|
+
onSaveWebhook
|
|
3617
|
+
}) => {
|
|
3618
|
+
const [publicKey, setPublicKey] = useState21(initialPublicKey);
|
|
3619
|
+
const [webhookUrl, setWebhookUrl] = useState21(initialWebhookUrl);
|
|
3620
|
+
const [isGenerating, setIsGenerating] = useState21(false);
|
|
3621
|
+
const [isSavingWebhook, setIsSavingWebhook] = useState21(false);
|
|
3622
|
+
const [isRollModalOpen, setIsRollModalOpen] = useState21(false);
|
|
3623
|
+
useEffect12(() => {
|
|
3624
|
+
setPublicKey(initialPublicKey || "");
|
|
3625
|
+
setWebhookUrl(initialWebhookUrl || "");
|
|
3626
|
+
}, [initialPublicKey, initialWebhookUrl]);
|
|
3627
|
+
const handleWebhookChange = (val) => {
|
|
3628
|
+
setWebhookUrl(val.trim());
|
|
3629
|
+
};
|
|
3630
|
+
const downloadEnvironmentFile = (pubKey, secKey) => {
|
|
3631
|
+
const envContent = `RETINA_PUBLIC_KEY="${pubKey}"
|
|
3632
|
+
RETINA_SECRET_KEY="${secKey}"
|
|
3633
|
+
`;
|
|
3634
|
+
const blob = new Blob([envContent], { type: "text/plain" });
|
|
3635
|
+
const url = URL.createObjectURL(blob);
|
|
3636
|
+
const link = document.createElement("a");
|
|
3637
|
+
link.href = url;
|
|
3638
|
+
link.download = "retina-keys.env";
|
|
3639
|
+
document.body.appendChild(link);
|
|
3640
|
+
link.click();
|
|
3641
|
+
document.body.removeChild(link);
|
|
3642
|
+
URL.revokeObjectURL(url);
|
|
3643
|
+
};
|
|
3644
|
+
const handleGenerateKeys = async () => {
|
|
3645
|
+
if (isGenerating || isReadOnly) return;
|
|
3646
|
+
setIsGenerating(true);
|
|
3647
|
+
try {
|
|
3648
|
+
const res = await onGenerateKeys();
|
|
3649
|
+
if (res.success && res.data) {
|
|
3650
|
+
setPublicKey(res.data.publicKey);
|
|
3651
|
+
downloadEnvironmentFile(res.data.publicKey, res.data.secretKey);
|
|
3652
|
+
toast7.success("Keys generated. Check your downloads folder.");
|
|
3653
|
+
setIsRollModalOpen(false);
|
|
3654
|
+
} else {
|
|
3655
|
+
toast7.error(res.error || "Uh oh! Something went wrong.");
|
|
3656
|
+
}
|
|
3657
|
+
} catch (error) {
|
|
3658
|
+
toast7.error("Uh oh! Something went wrong.");
|
|
3659
|
+
} finally {
|
|
3660
|
+
setIsGenerating(false);
|
|
3661
|
+
}
|
|
3662
|
+
};
|
|
3663
|
+
const handleSaveWebhook = async (e) => {
|
|
3664
|
+
e.preventDefault();
|
|
3665
|
+
if (isSavingWebhook || isReadOnly) return;
|
|
3666
|
+
setIsSavingWebhook(true);
|
|
3667
|
+
try {
|
|
3668
|
+
const res = await onSaveWebhook(webhookUrl);
|
|
3669
|
+
if (res.success && res.data) {
|
|
3670
|
+
setWebhookUrl(res.data.webhookUrl || "");
|
|
3671
|
+
toast7.success("Webhook URL updated.");
|
|
3672
|
+
} else {
|
|
3673
|
+
toast7.error(res.error || "Uh oh! Something went wrong.");
|
|
3674
|
+
}
|
|
3675
|
+
} catch (error) {
|
|
3676
|
+
toast7.error("Uh oh! Something went wrong.");
|
|
3677
|
+
} finally {
|
|
3678
|
+
setIsSavingWebhook(false);
|
|
3679
|
+
}
|
|
3680
|
+
};
|
|
3681
|
+
const hasWebhookChanges = webhookUrl !== initialWebhookUrl;
|
|
3682
|
+
const isWebhookSaveDisabled = isSavingWebhook || isReadOnly || !hasWebhookChanges;
|
|
3683
|
+
return /* @__PURE__ */ React42.createElement("div", { className: "flex flex-col max-w-3xl rounded-2xl p-6 bg-white gap-8 animate-in fade-in duration-300 min-h-full" }, /* @__PURE__ */ React42.createElement(ManagedToaster, null), /* @__PURE__ */ React42.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-3 sm:gap-4" }, /* @__PURE__ */ React42.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React42.createElement("h1", { className: "font-serif text-xl text-black mb-1 truncate tracking-tight" }, "Developer Settings"), /* @__PURE__ */ React42.createElement("p", { className: "text-xs text-neutral-500 truncate" }, "Manage your API credentials and webhook integrations.")), isReadOnly && /* @__PURE__ */ React42.createElement("span", { className: "px-3 py-1 bg-neutral-50 text-neutral-500 rounded-full text-[10px] tracking-[0.2em] shrink-0 w-fit" }, "Read Only Access")), /* @__PURE__ */ React42.createElement("div", { className: "w-full max-w-2xl flex flex-col gap-12" }, /* @__PURE__ */ React42.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ React42.createElement("div", { className: "space-y-2 min-w-0" }, /* @__PURE__ */ React42.createElement(
|
|
3684
|
+
TextInput,
|
|
3685
|
+
{
|
|
3686
|
+
label: "Public Key",
|
|
3687
|
+
value: publicKey || "No key generated yet",
|
|
3688
|
+
onChange: () => {
|
|
3689
|
+
},
|
|
3690
|
+
disabled: true
|
|
3691
|
+
}
|
|
3692
|
+
), /* @__PURE__ */ React42.createElement("p", { className: "text-[10px] text-neutral-400 mt-1 leading-snug" }, "Your public key is used to identify your application. Your secret key will only be shown once upon generation.")), /* @__PURE__ */ React42.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React42.createElement(
|
|
3693
|
+
ThreeDActionButton,
|
|
3694
|
+
{
|
|
3695
|
+
onClick: () => {
|
|
3696
|
+
if (publicKey) setIsRollModalOpen(true);
|
|
3697
|
+
else handleGenerateKeys();
|
|
3698
|
+
},
|
|
3699
|
+
disabled: isGenerating || isReadOnly,
|
|
3700
|
+
isLoading: isGenerating,
|
|
3701
|
+
className: "w-fit"
|
|
3702
|
+
},
|
|
3703
|
+
publicKey ? "Roll API Keys" : "Generate Keys"
|
|
3704
|
+
))), /* @__PURE__ */ React42.createElement("form", { className: "flex flex-col gap-6 border-t border-neutral-100 pt-8", onSubmit: handleSaveWebhook, autoComplete: "off" }, /* @__PURE__ */ React42.createElement("div", { className: "space-y-2 min-w-0" }, /* @__PURE__ */ React42.createElement(
|
|
3705
|
+
TextInput,
|
|
3706
|
+
{
|
|
3707
|
+
label: "Webhook URL",
|
|
3708
|
+
value: webhookUrl,
|
|
3709
|
+
onChange: handleWebhookChange,
|
|
3710
|
+
disabled: isReadOnly || isSavingWebhook,
|
|
3711
|
+
placeholder: "https://your-domain.com/webhook",
|
|
3712
|
+
type: "url"
|
|
3713
|
+
}
|
|
3714
|
+
), /* @__PURE__ */ React42.createElement("p", { className: "text-[10px] text-neutral-400 mt-1 leading-snug" }, "We will send secure POST requests to this endpoint when significant events occur. Must use HTTPS.")), /* @__PURE__ */ React42.createElement("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between mt-2 gap-6 sm:gap-4" }, /* @__PURE__ */ React42.createElement("div", { className: "flex items-center gap-6 min-w-0" }, /* @__PURE__ */ React42.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React42.createElement("span", { className: "text-[10px] text-neutral-400 tracking-[0.2em] block truncate uppercase" }, "Webhook Status"), /* @__PURE__ */ React42.createElement("span", { className: `text-xs block truncate ${webhookUrl ? "text-emerald-600" : "text-neutral-400"}` }, webhookUrl ? "Active" : "Inactive"))), /* @__PURE__ */ React42.createElement("div", { className: "flex flex-col-reverse sm:flex-row items-center gap-3 sm:gap-4 w-full sm:w-auto shrink-0" }, hasWebhookChanges && !isSavingWebhook && !isReadOnly && /* @__PURE__ */ React42.createElement(
|
|
3715
|
+
"button",
|
|
3716
|
+
{
|
|
3717
|
+
type: "button",
|
|
3718
|
+
onClick: () => setWebhookUrl(initialWebhookUrl),
|
|
3719
|
+
className: "text-[11px] tracking-widest text-neutral-500 hover:text-black transition-colors w-full sm:w-auto py-2 sm:py-0 outline-none"
|
|
3720
|
+
},
|
|
3721
|
+
"Cancel"
|
|
3722
|
+
), /* @__PURE__ */ React42.createElement(
|
|
3723
|
+
ThreeDActionButton,
|
|
3724
|
+
{
|
|
3725
|
+
type: "submit",
|
|
3726
|
+
disabled: isWebhookSaveDisabled,
|
|
3727
|
+
isLoading: isSavingWebhook,
|
|
3728
|
+
className: "min-w-32 w-full sm:w-auto"
|
|
3729
|
+
},
|
|
3730
|
+
"Save Webhook"
|
|
3731
|
+
))))), isRollModalOpen && !isReadOnly && /* @__PURE__ */ React42.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React42.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => !isGenerating && setIsRollModalOpen(false) }), /* @__PURE__ */ React42.createElement("div", { className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React42.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ React42.createElement("h3", { className: "font-serif text-[17px] text-black tracking-tight mb-1" }, "Roll API Keys"), /* @__PURE__ */ React42.createElement("p", { className: "text-[12px] text-neutral-500 leading-snug mt-2" }, "Are you sure you want to roll your keys? This will permanently invalidate your current secret key and active MCP tokens.")), /* @__PURE__ */ React42.createElement("div", { className: "w-full flex" }, /* @__PURE__ */ React42.createElement(
|
|
3732
|
+
"button",
|
|
3733
|
+
{
|
|
3734
|
+
onClick: () => setIsRollModalOpen(false),
|
|
3735
|
+
disabled: isGenerating,
|
|
3736
|
+
className: "flex-1 py-2 text-[13px] text-neutral-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 outline-none"
|
|
3737
|
+
},
|
|
3738
|
+
"Cancel"
|
|
3739
|
+
), /* @__PURE__ */ React42.createElement(
|
|
3740
|
+
"button",
|
|
3741
|
+
{
|
|
3742
|
+
onClick: handleGenerateKeys,
|
|
3743
|
+
disabled: isGenerating,
|
|
3744
|
+
className: "flex-1 py-2 text-[13px] text-red-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 flex justify-center outline-none"
|
|
3745
|
+
},
|
|
3746
|
+
isGenerating ? /* @__PURE__ */ React42.createElement(ButtonSpinner5, null) : "Roll Keys"
|
|
3747
|
+
)))));
|
|
3748
|
+
};
|
|
3604
3749
|
export {
|
|
3605
3750
|
AITranscriptionFeature,
|
|
3606
3751
|
AiApproveDecline,
|
|
@@ -3633,6 +3778,7 @@ export {
|
|
|
3633
3778
|
UniversalAgentConsole,
|
|
3634
3779
|
UniversalBillingPage,
|
|
3635
3780
|
UniversalDashboardPage,
|
|
3781
|
+
UniversalDeveloperSettings,
|
|
3636
3782
|
UniversalDirectoryPage,
|
|
3637
3783
|
UniversalErrorView,
|
|
3638
3784
|
UniversalIdentityPage,
|