@stigmer/react 0.0.71 → 0.0.73
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/agent/AgentEnvForm.d.ts +2 -0
- package/agent/AgentEnvForm.d.ts.map +1 -1
- package/agent/AgentEnvForm.js.map +1 -1
- package/agent/AgentPicker.d.ts +2 -0
- package/agent/AgentPicker.d.ts.map +1 -1
- package/agent/AgentPicker.js.map +1 -1
- package/agent/agentSetupReducer.d.ts +69 -7
- package/agent/agentSetupReducer.d.ts.map +1 -1
- package/agent/agentSetupReducer.js.map +1 -1
- package/agent/useAgentCount.d.ts +2 -0
- package/agent/useAgentCount.d.ts.map +1 -1
- package/agent/useAgentCount.js.map +1 -1
- package/attachment/AttachmentChipList.d.ts +15 -0
- package/attachment/AttachmentChipList.d.ts.map +1 -1
- package/attachment/AttachmentChipList.js +15 -0
- package/attachment/AttachmentChipList.js.map +1 -1
- package/attachment/useAttachments.d.ts +14 -0
- package/attachment/useAttachments.d.ts.map +1 -1
- package/attachment/useAttachments.js.map +1 -1
- package/composer/useComposer.d.ts +5 -0
- package/composer/useComposer.d.ts.map +1 -1
- package/composer/useComposer.js.map +1 -1
- package/execution/ExecutionPhaseBadge.d.ts +1 -1
- package/execution/ExecutionPhaseBadge.js +1 -1
- package/execution/McpToolDetail.d.ts +16 -8
- package/execution/McpToolDetail.d.ts.map +1 -1
- package/execution/McpToolDetail.js +0 -6
- package/execution/McpToolDetail.js.map +1 -1
- package/execution/TodoList.d.ts +8 -0
- package/execution/TodoList.d.ts.map +1 -1
- package/execution/TodoList.js +8 -0
- package/execution/TodoList.js.map +1 -1
- package/execution/ToolArgsView.d.ts +1 -0
- package/execution/ToolArgsView.d.ts.map +1 -1
- package/execution/ToolArgsView.js.map +1 -1
- package/execution/UsageWidget.d.ts +1 -1
- package/execution/UsageWidget.js +1 -1
- package/execution/file-path-resolver.d.ts +10 -0
- package/execution/file-path-resolver.d.ts.map +1 -1
- package/execution/file-path-resolver.js.map +1 -1
- package/execution/index.d.ts +1 -1
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js.map +1 -1
- package/execution/useArtifactContent.d.ts +33 -0
- package/execution/useArtifactContent.d.ts.map +1 -1
- package/execution/useArtifactContent.js +33 -0
- package/execution/useArtifactContent.js.map +1 -1
- package/execution/useSubmitApproval.d.ts +2 -0
- package/execution/useSubmitApproval.d.ts.map +1 -1
- package/execution/useSubmitApproval.js.map +1 -1
- package/github/GitHubRepoPicker.d.ts +13 -0
- package/github/GitHubRepoPicker.d.ts.map +1 -1
- package/github/GitHubRepoPicker.js +13 -0
- package/github/GitHubRepoPicker.js.map +1 -1
- package/github/useGitHubConnection.d.ts +29 -1
- package/github/useGitHubConnection.d.ts.map +1 -1
- package/github/useGitHubConnection.js +29 -1
- package/github/useGitHubConnection.js.map +1 -1
- package/github/useGitHubRepos.d.ts +31 -0
- package/github/useGitHubRepos.d.ts.map +1 -1
- package/github/useGitHubRepos.js +31 -0
- package/github/useGitHubRepos.js.map +1 -1
- package/github/useGitHubSearch.d.ts +25 -0
- package/github/useGitHubSearch.d.ts.map +1 -1
- package/github/useGitHubSearch.js +25 -0
- package/github/useGitHubSearch.js.map +1 -1
- package/iam-policy/GrantAccessForm.d.ts +39 -0
- package/iam-policy/GrantAccessForm.d.ts.map +1 -0
- package/iam-policy/GrantAccessForm.js +75 -0
- package/iam-policy/GrantAccessForm.js.map +1 -0
- package/iam-policy/OrgMembersPanel.d.ts +28 -0
- package/iam-policy/OrgMembersPanel.d.ts.map +1 -0
- package/iam-policy/OrgMembersPanel.js +192 -0
- package/iam-policy/OrgMembersPanel.js.map +1 -0
- package/iam-policy/RoleSelector.d.ts +37 -0
- package/iam-policy/RoleSelector.d.ts.map +1 -0
- package/iam-policy/RoleSelector.js +42 -0
- package/iam-policy/RoleSelector.js.map +1 -0
- package/iam-policy/index.d.ts +12 -0
- package/iam-policy/index.d.ts.map +1 -0
- package/iam-policy/index.js +12 -0
- package/iam-policy/index.js.map +1 -0
- package/iam-policy/useCreateIamPolicy.d.ts +35 -0
- package/iam-policy/useCreateIamPolicy.d.ts.map +1 -0
- package/iam-policy/useCreateIamPolicy.js +46 -0
- package/iam-policy/useCreateIamPolicy.js.map +1 -0
- package/iam-policy/useDeleteIamPolicy.d.ts +34 -0
- package/iam-policy/useDeleteIamPolicy.d.ts.map +1 -0
- package/iam-policy/useDeleteIamPolicy.js +45 -0
- package/iam-policy/useDeleteIamPolicy.js.map +1 -0
- package/iam-policy/useGrantableRoles.d.ts +28 -0
- package/iam-policy/useGrantableRoles.d.ts.map +1 -0
- package/iam-policy/useGrantableRoles.js +32 -0
- package/iam-policy/useGrantableRoles.js.map +1 -0
- package/iam-policy/usePrincipalsCount.d.ts +31 -0
- package/iam-policy/usePrincipalsCount.d.ts.map +1 -0
- package/iam-policy/usePrincipalsCount.js +72 -0
- package/iam-policy/usePrincipalsCount.js.map +1 -0
- package/iam-policy/useResourceAccess.d.ts +51 -0
- package/iam-policy/useResourceAccess.d.ts.map +1 -0
- package/iam-policy/useResourceAccess.js +85 -0
- package/iam-policy/useResourceAccess.js.map +1 -0
- package/iam-policy/useRevokeOrgAccess.d.ts +36 -0
- package/iam-policy/useRevokeOrgAccess.d.ts.map +1 -0
- package/iam-policy/useRevokeOrgAccess.js +48 -0
- package/iam-policy/useRevokeOrgAccess.js.map +1 -0
- package/iam-policy/useRoleSelector.d.ts +52 -0
- package/iam-policy/useRoleSelector.d.ts.map +1 -0
- package/iam-policy/useRoleSelector.js +50 -0
- package/iam-policy/useRoleSelector.js.map +1 -0
- package/iam-policy/useWhoAmI.d.ts +30 -0
- package/iam-policy/useWhoAmI.d.ts.map +1 -0
- package/iam-policy/useWhoAmI.js +56 -0
- package/iam-policy/useWhoAmI.js.map +1 -0
- package/identity-provider/CreateIdentityProviderForm.d.ts +39 -0
- package/identity-provider/CreateIdentityProviderForm.d.ts.map +1 -0
- package/identity-provider/CreateIdentityProviderForm.js +102 -0
- package/identity-provider/CreateIdentityProviderForm.js.map +1 -0
- package/identity-provider/IdentityProviderDetailPanel.d.ts +42 -0
- package/identity-provider/IdentityProviderDetailPanel.d.ts.map +1 -0
- package/identity-provider/IdentityProviderDetailPanel.js +156 -0
- package/identity-provider/IdentityProviderDetailPanel.js.map +1 -0
- package/identity-provider/IdentityProviderListPanel.d.ts +41 -0
- package/identity-provider/IdentityProviderListPanel.d.ts.map +1 -0
- package/identity-provider/IdentityProviderListPanel.js +110 -0
- package/identity-provider/IdentityProviderListPanel.js.map +1 -0
- package/identity-provider/IdentityProviderWizard.d.ts +40 -0
- package/identity-provider/IdentityProviderWizard.d.ts.map +1 -0
- package/identity-provider/IdentityProviderWizard.js +180 -0
- package/identity-provider/IdentityProviderWizard.js.map +1 -0
- package/identity-provider/ProviderPicker.d.ts +28 -0
- package/identity-provider/ProviderPicker.d.ts.map +1 -0
- package/identity-provider/ProviderPicker.js +64 -0
- package/identity-provider/ProviderPicker.js.map +1 -0
- package/identity-provider/SsoLoginPrompt.d.ts +51 -0
- package/identity-provider/SsoLoginPrompt.d.ts.map +1 -0
- package/identity-provider/SsoLoginPrompt.js +119 -0
- package/identity-provider/SsoLoginPrompt.js.map +1 -0
- package/identity-provider/index.d.ts +14 -0
- package/identity-provider/index.d.ts.map +1 -0
- package/identity-provider/index.js +14 -0
- package/identity-provider/index.js.map +1 -0
- package/identity-provider/presets.d.ts +65 -0
- package/identity-provider/presets.d.ts.map +1 -0
- package/identity-provider/presets.js +200 -0
- package/identity-provider/presets.js.map +1 -0
- package/identity-provider/useCreateIdentityProvider.d.ts +37 -0
- package/identity-provider/useCreateIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useCreateIdentityProvider.js +48 -0
- package/identity-provider/useCreateIdentityProvider.js.map +1 -0
- package/identity-provider/useDeleteIdentityProvider.d.ts +34 -0
- package/identity-provider/useDeleteIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useDeleteIdentityProvider.js +45 -0
- package/identity-provider/useDeleteIdentityProvider.js.map +1 -0
- package/identity-provider/useIdentityProvider.d.ts +37 -0
- package/identity-provider/useIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useIdentityProvider.js +62 -0
- package/identity-provider/useIdentityProvider.js.map +1 -0
- package/identity-provider/useIdentityProviderList.d.ts +48 -0
- package/identity-provider/useIdentityProviderList.d.ts.map +1 -0
- package/identity-provider/useIdentityProviderList.js +75 -0
- package/identity-provider/useIdentityProviderList.js.map +1 -0
- package/identity-provider/useOidcDiscovery.d.ts +39 -0
- package/identity-provider/useOidcDiscovery.d.ts.map +1 -0
- package/identity-provider/useOidcDiscovery.js +76 -0
- package/identity-provider/useOidcDiscovery.js.map +1 -0
- package/identity-provider/useSsoProvider.d.ts +50 -0
- package/identity-provider/useSsoProvider.d.ts.map +1 -0
- package/identity-provider/useSsoProvider.js +83 -0
- package/identity-provider/useSsoProvider.js.map +1 -0
- package/identity-provider/useUpdateIdentityProvider.d.ts +38 -0
- package/identity-provider/useUpdateIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useUpdateIdentityProvider.js +49 -0
- package/identity-provider/useUpdateIdentityProvider.js.map +1 -0
- package/index.d.ts +14 -5
- package/index.d.ts.map +1 -1
- package/index.js +10 -2
- package/index.js.map +1 -1
- package/internal/CloudFeatureNotice.d.ts +12 -0
- package/internal/CloudFeatureNotice.d.ts.map +1 -1
- package/internal/CloudFeatureNotice.js +12 -0
- package/internal/CloudFeatureNotice.js.map +1 -1
- package/invitation/InvitationCreatedAlert.d.ts +35 -0
- package/invitation/InvitationCreatedAlert.d.ts.map +1 -0
- package/invitation/InvitationCreatedAlert.js +60 -0
- package/invitation/InvitationCreatedAlert.js.map +1 -0
- package/invitation/InvitationManager.d.ts +44 -0
- package/invitation/InvitationManager.d.ts.map +1 -0
- package/invitation/InvitationManager.js +248 -0
- package/invitation/InvitationManager.js.map +1 -0
- package/invitation/InvitationRedemption.d.ts +69 -0
- package/invitation/InvitationRedemption.d.ts.map +1 -0
- package/invitation/InvitationRedemption.js +140 -0
- package/invitation/InvitationRedemption.js.map +1 -0
- package/invitation/index.d.ts +17 -0
- package/invitation/index.d.ts.map +1 -0
- package/invitation/index.js +9 -0
- package/invitation/index.js.map +1 -0
- package/invitation/useCreateInvitation.d.ts +52 -0
- package/invitation/useCreateInvitation.d.ts.map +1 -0
- package/invitation/useCreateInvitation.js +55 -0
- package/invitation/useCreateInvitation.js.map +1 -0
- package/invitation/useInvitationPreview.d.ts +51 -0
- package/invitation/useInvitationPreview.d.ts.map +1 -0
- package/invitation/useInvitationPreview.js +80 -0
- package/invitation/useInvitationPreview.js.map +1 -0
- package/invitation/useOrgInvitations.d.ts +36 -0
- package/invitation/useOrgInvitations.d.ts.map +1 -0
- package/invitation/useOrgInvitations.js +65 -0
- package/invitation/useOrgInvitations.js.map +1 -0
- package/invitation/useRedeemInvitation.d.ts +47 -0
- package/invitation/useRedeemInvitation.d.ts.map +1 -0
- package/invitation/useRedeemInvitation.js +53 -0
- package/invitation/useRedeemInvitation.js.map +1 -0
- package/invitation/useRevokeInvitation.d.ts +35 -0
- package/invitation/useRevokeInvitation.d.ts.map +1 -0
- package/invitation/useRevokeInvitation.js +47 -0
- package/invitation/useRevokeInvitation.js.map +1 -0
- package/library/detect-skill-package.d.ts +1 -0
- package/library/detect-skill-package.d.ts.map +1 -1
- package/library/detect-skill-package.js.map +1 -1
- package/library/detect-stigmer-resource.d.ts +1 -0
- package/library/detect-stigmer-resource.d.ts.map +1 -1
- package/library/detect-stigmer-resource.js.map +1 -1
- package/library/parse-resource-yaml.d.ts +4 -0
- package/library/parse-resource-yaml.d.ts.map +1 -1
- package/library/parse-resource-yaml.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts +2 -2
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +1 -1
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/mcpServerSetupReducer.d.ts +54 -0
- package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -1
- package/mcp-server/mcpServerSetupReducer.js.map +1 -1
- package/models/ModelSelector.d.ts +9 -0
- package/models/ModelSelector.d.ts.map +1 -1
- package/models/ModelSelector.js +9 -0
- package/models/ModelSelector.js.map +1 -1
- package/models/registry.d.ts +11 -1
- package/models/registry.d.ts.map +1 -1
- package/models/registry.js.map +1 -1
- package/models/useModelRegistry.d.ts +20 -0
- package/models/useModelRegistry.d.ts.map +1 -1
- package/models/useModelRegistry.js +20 -0
- package/models/useModelRegistry.js.map +1 -1
- package/organization/OrgProfilePanel.d.ts +31 -0
- package/organization/OrgProfilePanel.d.ts.map +1 -0
- package/organization/OrgProfilePanel.js +147 -0
- package/organization/OrgProfilePanel.js.map +1 -0
- package/organization/index.d.ts +6 -0
- package/organization/index.d.ts.map +1 -1
- package/organization/index.js +3 -0
- package/organization/index.js.map +1 -1
- package/organization/useOrganization.d.ts +31 -0
- package/organization/useOrganization.d.ts.map +1 -0
- package/organization/useOrganization.js +56 -0
- package/organization/useOrganization.js.map +1 -0
- package/organization/useUpdateOrganization.d.ts +40 -0
- package/organization/useUpdateOrganization.d.ts.map +1 -0
- package/organization/useUpdateOrganization.js +51 -0
- package/organization/useUpdateOrganization.js.map +1 -0
- package/package.json +4 -4
- package/provider.d.ts +1 -0
- package/provider.d.ts.map +1 -1
- package/provider.js.map +1 -1
- package/search/useResourceList.d.ts +4 -2
- package/search/useResourceList.d.ts.map +1 -1
- package/search/useResourceList.js +2 -1
- package/search/useResourceList.js.map +1 -1
- package/search/useResourceSearch.d.ts +10 -2
- package/search/useResourceSearch.d.ts.map +1 -1
- package/search/useResourceSearch.js +2 -1
- package/search/useResourceSearch.js.map +1 -1
- package/session/group-sessions.d.ts +23 -0
- package/session/group-sessions.d.ts.map +1 -1
- package/session/group-sessions.js +23 -0
- package/session/group-sessions.js.map +1 -1
- package/session/index.d.ts +1 -1
- package/session/index.d.ts.map +1 -1
- package/session/index.js.map +1 -1
- package/session/useCreateSession.d.ts +11 -2
- package/session/useCreateSession.d.ts.map +1 -1
- package/session/useCreateSession.js.map +1 -1
- package/session/useSession.d.ts +24 -0
- package/session/useSession.d.ts.map +1 -1
- package/session/useSession.js +24 -0
- package/session/useSession.js.map +1 -1
- package/session/useSessionArtifacts.d.ts +1 -0
- package/session/useSessionArtifacts.d.ts.map +1 -1
- package/session/useSessionArtifacts.js.map +1 -1
- package/session/useSessionConversation.d.ts +7 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionExecutions.d.ts +23 -0
- package/session/useSessionExecutions.d.ts.map +1 -1
- package/session/useSessionExecutions.js +23 -0
- package/session/useSessionExecutions.js.map +1 -1
- package/session/useSessionList.d.ts +19 -0
- package/session/useSessionList.d.ts.map +1 -1
- package/session/useSessionList.js +19 -0
- package/session/useSessionList.js.map +1 -1
- package/session/useSessionWriteBacks.d.ts +1 -0
- package/session/useSessionWriteBacks.d.ts.map +1 -1
- package/session/useSessionWriteBacks.js.map +1 -1
- package/session/useUpdateSession.d.ts +22 -0
- package/session/useUpdateSession.d.ts.map +1 -1
- package/session/useUpdateSession.js +22 -0
- package/session/useUpdateSession.js.map +1 -1
- package/skill/SkillPicker.d.ts +15 -0
- package/skill/SkillPicker.d.ts.map +1 -1
- package/skill/SkillPicker.js +15 -0
- package/skill/SkillPicker.js.map +1 -1
- package/src/agent/AgentEnvForm.tsx +2 -0
- package/src/agent/AgentPicker.tsx +2 -0
- package/src/agent/agentSetupReducer.ts +109 -20
- package/src/agent/useAgentCount.ts +2 -0
- package/src/attachment/AttachmentChipList.tsx +15 -0
- package/src/attachment/useAttachments.ts +14 -0
- package/src/composer/useComposer.ts +5 -0
- package/src/execution/ExecutionPhaseBadge.tsx +1 -1
- package/src/execution/McpToolDetail.tsx +18 -6
- package/src/execution/TodoList.tsx +8 -0
- package/src/execution/ToolArgsView.tsx +1 -0
- package/src/execution/UsageWidget.tsx +1 -1
- package/src/execution/file-path-resolver.ts +28 -4
- package/src/execution/index.ts +5 -1
- package/src/execution/useArtifactContent.ts +33 -0
- package/src/execution/useSubmitApproval.ts +2 -0
- package/src/github/GitHubRepoPicker.tsx +13 -0
- package/src/github/useGitHubConnection.ts +29 -1
- package/src/github/useGitHubRepos.ts +31 -0
- package/src/github/useGitHubSearch.ts +25 -0
- package/src/iam-policy/GrantAccessForm.tsx +198 -0
- package/src/iam-policy/OrgMembersPanel.tsx +572 -0
- package/src/iam-policy/RoleSelector.tsx +105 -0
- package/src/iam-policy/index.ts +51 -0
- package/src/iam-policy/useCreateIamPolicy.ts +66 -0
- package/src/iam-policy/useDeleteIamPolicy.ts +65 -0
- package/src/iam-policy/useGrantableRoles.ts +45 -0
- package/src/iam-policy/usePrincipalsCount.ts +96 -0
- package/src/iam-policy/useResourceAccess.ts +128 -0
- package/src/iam-policy/useRevokeOrgAccess.ts +74 -0
- package/src/iam-policy/useRoleSelector.ts +97 -0
- package/src/iam-policy/useWhoAmI.ts +78 -0
- package/src/identity-provider/CreateIdentityProviderForm.tsx +308 -0
- package/src/identity-provider/IdentityProviderDetailPanel.tsx +583 -0
- package/src/identity-provider/IdentityProviderListPanel.tsx +370 -0
- package/src/identity-provider/IdentityProviderWizard.tsx +684 -0
- package/src/identity-provider/ProviderPicker.tsx +152 -0
- package/src/identity-provider/SsoLoginPrompt.tsx +404 -0
- package/src/identity-provider/index.ts +67 -0
- package/src/identity-provider/presets.ts +262 -0
- package/src/identity-provider/useCreateIdentityProvider.ts +68 -0
- package/src/identity-provider/useDeleteIdentityProvider.ts +65 -0
- package/src/identity-provider/useIdentityProvider.ts +86 -0
- package/src/identity-provider/useIdentityProviderList.ts +100 -0
- package/src/identity-provider/useOidcDiscovery.ts +124 -0
- package/src/identity-provider/useSsoProvider.ts +99 -0
- package/src/identity-provider/useUpdateIdentityProvider.ts +69 -0
- package/src/index.ts +121 -1
- package/src/internal/CloudFeatureNotice.tsx +12 -0
- package/src/invitation/InvitationCreatedAlert.tsx +185 -0
- package/src/invitation/InvitationManager.tsx +842 -0
- package/src/invitation/InvitationRedemption.tsx +434 -0
- package/src/invitation/index.ts +16 -0
- package/src/invitation/useCreateInvitation.ts +83 -0
- package/src/invitation/useInvitationPreview.ts +103 -0
- package/src/invitation/useOrgInvitations.ts +88 -0
- package/src/invitation/useRedeemInvitation.ts +82 -0
- package/src/invitation/useRevokeInvitation.ts +66 -0
- package/src/library/detect-skill-package.ts +4 -1
- package/src/library/detect-stigmer-resource.ts +4 -1
- package/src/library/parse-resource-yaml.ts +12 -2
- package/src/mcp-server/McpServerDetailView.tsx +2 -1
- package/src/mcp-server/index.ts +4 -1
- package/src/mcp-server/mcpServerSetupReducer.ts +86 -8
- package/src/models/ModelSelector.tsx +9 -0
- package/src/models/registry.ts +11 -1
- package/src/models/useModelRegistry.ts +20 -0
- package/src/organization/OrgProfilePanel.tsx +451 -0
- package/src/organization/index.ts +6 -0
- package/src/organization/useOrganization.ts +79 -0
- package/src/organization/useUpdateOrganization.ts +71 -0
- package/src/provider.tsx +1 -0
- package/src/search/useResourceList.ts +6 -3
- package/src/search/useResourceSearch.ts +12 -3
- package/src/session/group-sessions.ts +23 -0
- package/src/session/index.ts +1 -0
- package/src/session/useCreateSession.ts +19 -3
- package/src/session/useSession.ts +24 -0
- package/src/session/useSessionArtifacts.ts +1 -0
- package/src/session/useSessionConversation.ts +7 -0
- package/src/session/useSessionExecutions.ts +23 -0
- package/src/session/useSessionList.ts +19 -0
- package/src/session/useSessionWriteBacks.ts +1 -0
- package/src/session/useUpdateSession.ts +22 -0
- package/src/skill/SkillPicker.tsx +15 -0
- package/src/usage/OrgUsagePanel.tsx +465 -0
- package/src/usage/date-range.ts +86 -0
- package/src/usage/index.ts +13 -0
- package/src/usage/useOrgUsageReport.ts +110 -0
- package/src/workspace/FolderBrowser.tsx +9 -0
- package/src/workspace/WorkspaceEditor.tsx +17 -0
- package/src/workspace/useFolderListing.ts +24 -0
- package/src/workspace/useWorkspaceEntries.ts +38 -0
- package/styles.css +1 -1
- package/usage/OrgUsagePanel.d.ts +24 -0
- package/usage/OrgUsagePanel.d.ts.map +1 -0
- package/usage/OrgUsagePanel.js +134 -0
- package/usage/OrgUsagePanel.js.map +1 -0
- package/usage/date-range.d.ts +36 -0
- package/usage/date-range.d.ts.map +1 -0
- package/usage/date-range.js +69 -0
- package/usage/date-range.js.map +1 -0
- package/usage/index.d.ts +7 -0
- package/usage/index.d.ts.map +1 -0
- package/usage/index.js +4 -0
- package/usage/index.js.map +1 -0
- package/usage/useOrgUsageReport.d.ts +48 -0
- package/usage/useOrgUsageReport.d.ts.map +1 -0
- package/usage/useOrgUsageReport.js +72 -0
- package/usage/useOrgUsageReport.js.map +1 -0
- package/workspace/FolderBrowser.d.ts +9 -0
- package/workspace/FolderBrowser.d.ts.map +1 -1
- package/workspace/FolderBrowser.js +9 -0
- package/workspace/FolderBrowser.js.map +1 -1
- package/workspace/WorkspaceEditor.d.ts +17 -0
- package/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/workspace/WorkspaceEditor.js +17 -0
- package/workspace/WorkspaceEditor.js.map +1 -1
- package/workspace/useFolderListing.d.ts +24 -0
- package/workspace/useFolderListing.d.ts.map +1 -1
- package/workspace/useFolderListing.js +24 -0
- package/workspace/useFolderListing.js.map +1 -1
- package/workspace/useWorkspaceEntries.d.ts +38 -0
- package/workspace/useWorkspaceEntries.d.ts.map +1 -1
- package/workspace/useWorkspaceEntries.js +25 -0
- package/workspace/useWorkspaceEntries.js.map +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider presets for well-known OIDC identity providers.
|
|
3
|
+
*
|
|
4
|
+
* Each preset defines URL templates and required user variables for a
|
|
5
|
+
* specific provider. The {@link ProviderPreset.buildConfig} function
|
|
6
|
+
* constructs the full OIDC configuration from the user's input without
|
|
7
|
+
* any network calls — URL patterns are deterministic for known providers.
|
|
8
|
+
*
|
|
9
|
+
* The "custom" preset is a special case: it collects an issuer URL and
|
|
10
|
+
* delegates to OIDC Discovery for auto-population.
|
|
11
|
+
*/
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Auth0
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
const auth0Preset = {
|
|
16
|
+
id: "auth0",
|
|
17
|
+
label: "Auth0",
|
|
18
|
+
description: "Auth0 by Okta — universal login and identity platform",
|
|
19
|
+
variables: [
|
|
20
|
+
{
|
|
21
|
+
key: "tenant",
|
|
22
|
+
label: "Tenant name",
|
|
23
|
+
placeholder: "acme-prod",
|
|
24
|
+
hint: "The subdomain from your Auth0 tenant URL",
|
|
25
|
+
type: "text",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: "region",
|
|
29
|
+
label: "Region",
|
|
30
|
+
placeholder: "us",
|
|
31
|
+
type: "select",
|
|
32
|
+
options: [
|
|
33
|
+
{ value: "us", label: "US" },
|
|
34
|
+
{ value: "eu", label: "EU" },
|
|
35
|
+
{ value: "au", label: "AU" },
|
|
36
|
+
{ value: "jp", label: "JP" },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
buildConfig(vars) {
|
|
41
|
+
const { tenant, region } = vars;
|
|
42
|
+
if (!tenant || !region)
|
|
43
|
+
return null;
|
|
44
|
+
const domain = `${tenant}.${region}.auth0.com`;
|
|
45
|
+
const issuer = `https://${domain}/`;
|
|
46
|
+
return {
|
|
47
|
+
issuer,
|
|
48
|
+
jwksUri: `https://${domain}/.well-known/jwks.json`,
|
|
49
|
+
allowedIssuers: [issuer],
|
|
50
|
+
userinfoEndpoint: `https://${domain}/userinfo`,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Okta
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
const oktaPreset = {
|
|
58
|
+
id: "okta",
|
|
59
|
+
label: "Okta",
|
|
60
|
+
description: "Okta — enterprise identity and access management",
|
|
61
|
+
variables: [
|
|
62
|
+
{
|
|
63
|
+
key: "domain",
|
|
64
|
+
label: "Okta domain",
|
|
65
|
+
placeholder: "acme.okta.com",
|
|
66
|
+
hint: "Your Okta organization domain (e.g., acme.okta.com)",
|
|
67
|
+
type: "text",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
buildConfig(vars) {
|
|
71
|
+
const { domain } = vars;
|
|
72
|
+
if (!domain)
|
|
73
|
+
return null;
|
|
74
|
+
const base = `https://${domain}/oauth2/default`;
|
|
75
|
+
return {
|
|
76
|
+
issuer: base,
|
|
77
|
+
jwksUri: `${base}/v1/keys`,
|
|
78
|
+
allowedIssuers: [base],
|
|
79
|
+
userinfoEndpoint: `${base}/v1/userinfo`,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Google
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
const googlePreset = {
|
|
87
|
+
id: "google",
|
|
88
|
+
label: "Google",
|
|
89
|
+
description: "Google Identity — Workspace and consumer accounts",
|
|
90
|
+
variables: [],
|
|
91
|
+
buildConfig() {
|
|
92
|
+
return {
|
|
93
|
+
issuer: "https://accounts.google.com",
|
|
94
|
+
jwksUri: "https://www.googleapis.com/oauth2/v3/certs",
|
|
95
|
+
allowedIssuers: ["https://accounts.google.com"],
|
|
96
|
+
userinfoEndpoint: "https://openidconnect.googleapis.com/v1/userinfo",
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// Microsoft Entra ID (Azure AD)
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
const azureAdPreset = {
|
|
104
|
+
id: "azure-ad",
|
|
105
|
+
label: "Microsoft Entra ID",
|
|
106
|
+
description: "Microsoft Entra ID (formerly Azure AD) — enterprise identity",
|
|
107
|
+
variables: [
|
|
108
|
+
{
|
|
109
|
+
key: "tenantId",
|
|
110
|
+
label: "Tenant ID",
|
|
111
|
+
placeholder: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
112
|
+
hint: "Your Entra ID / Azure AD tenant identifier (GUID)",
|
|
113
|
+
type: "text",
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
buildConfig(vars) {
|
|
117
|
+
const { tenantId } = vars;
|
|
118
|
+
if (!tenantId)
|
|
119
|
+
return null;
|
|
120
|
+
const issuer = `https://login.microsoftonline.com/${tenantId}/v2.0`;
|
|
121
|
+
return {
|
|
122
|
+
issuer,
|
|
123
|
+
jwksUri: `https://login.microsoftonline.com/${tenantId}/discovery/v2.0/keys`,
|
|
124
|
+
allowedIssuers: [issuer],
|
|
125
|
+
userinfoEndpoint: "https://graph.microsoft.com/oidc/userinfo",
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// AWS Cognito
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
const cognitoPreset = {
|
|
133
|
+
id: "aws-cognito",
|
|
134
|
+
label: "AWS Cognito",
|
|
135
|
+
description: "Amazon Cognito — user pools for AWS applications",
|
|
136
|
+
variables: [
|
|
137
|
+
{
|
|
138
|
+
key: "region",
|
|
139
|
+
label: "AWS region",
|
|
140
|
+
placeholder: "us-east-1",
|
|
141
|
+
hint: "The AWS region of your Cognito user pool",
|
|
142
|
+
type: "text",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: "userPoolId",
|
|
146
|
+
label: "User Pool ID",
|
|
147
|
+
placeholder: "us-east-1_aBcDeFgHi",
|
|
148
|
+
hint: "Your Cognito user pool identifier",
|
|
149
|
+
type: "text",
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
buildConfig(vars) {
|
|
153
|
+
const { region, userPoolId } = vars;
|
|
154
|
+
if (!region || !userPoolId)
|
|
155
|
+
return null;
|
|
156
|
+
const base = `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`;
|
|
157
|
+
return {
|
|
158
|
+
issuer: base,
|
|
159
|
+
jwksUri: `${base}/.well-known/jwks.json`,
|
|
160
|
+
allowedIssuers: [base],
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
// Custom OIDC
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
const customPreset = {
|
|
168
|
+
id: "custom",
|
|
169
|
+
label: "Custom OIDC",
|
|
170
|
+
description: "Any OpenID Connect compliant identity provider",
|
|
171
|
+
variables: [
|
|
172
|
+
{
|
|
173
|
+
key: "issuerUrl",
|
|
174
|
+
label: "Issuer URL",
|
|
175
|
+
placeholder: "https://idp.example.com",
|
|
176
|
+
hint: "The OIDC issuer URL — configuration will be auto-discovered",
|
|
177
|
+
type: "text",
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
buildConfig() {
|
|
181
|
+
return null;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
// Public API
|
|
186
|
+
// ---------------------------------------------------------------------------
|
|
187
|
+
/** All available provider presets in display order. */
|
|
188
|
+
export const PROVIDER_PRESETS = [
|
|
189
|
+
auth0Preset,
|
|
190
|
+
oktaPreset,
|
|
191
|
+
googlePreset,
|
|
192
|
+
azureAdPreset,
|
|
193
|
+
cognitoPreset,
|
|
194
|
+
customPreset,
|
|
195
|
+
];
|
|
196
|
+
/** Look up a preset by ID. Returns `undefined` if not found. */
|
|
197
|
+
export function getPreset(id) {
|
|
198
|
+
return PROVIDER_PRESETS.find((p) => p.id === id);
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/identity-provider/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsDH,8EAA8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,WAAW;YAChB,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,6DAA6D;YACnE,IAAI,EAAE,MAAM;SACb;KACF;IACD,WAAW;QACT,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,uDAAuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD,WAAW;IACX,UAAU;IACV,YAAY;IACZ,aAAa;IACb,aAAa;IACb,YAAY;CACb,CAAC;AAEF,gEAAgE;AAChE,MAAM,UAAU,SAAS,CAAC,EAAU;IAClC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IdentityProviderInput } from "@stigmer/sdk";
|
|
2
|
+
import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
|
|
3
|
+
/** Return value of {@link useCreateIdentityProvider}. */
|
|
4
|
+
export interface UseCreateIdentityProviderReturn {
|
|
5
|
+
/** Submit an {@link IdentityProviderInput} to create a new identity provider. Resolves with the server-created resource. */
|
|
6
|
+
readonly create: (input: IdentityProviderInput) => Promise<IdentityProvider>;
|
|
7
|
+
/** `true` while the create request is in flight. */
|
|
8
|
+
readonly isCreating: boolean;
|
|
9
|
+
/** Error from the last failed create, or `null` when healthy. */
|
|
10
|
+
readonly error: Error | null;
|
|
11
|
+
/** Reset `error` to `null`. */
|
|
12
|
+
readonly clearError: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Mutation hook that wraps `identityProvider.create()` with loading
|
|
16
|
+
* and error state.
|
|
17
|
+
*
|
|
18
|
+
* Creates an identity provider resource within an organization. The
|
|
19
|
+
* caller provides an {@link IdentityProviderInput} with the required
|
|
20
|
+
* metadata (name, org) and spec fields (JWKS URI, allowed issuers,
|
|
21
|
+
* expected audience).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { create, isCreating, error } = useCreateIdentityProvider();
|
|
26
|
+
*
|
|
27
|
+
* const idp = await create({
|
|
28
|
+
* name: "Acme Corp SSO",
|
|
29
|
+
* org: "acme",
|
|
30
|
+
* jwksUri: "https://acme.us.auth0.com/.well-known/jwks.json",
|
|
31
|
+
* allowedIssuers: ["https://acme.us.auth0.com/"],
|
|
32
|
+
* expectedAudience: "stigmer-api",
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function useCreateIdentityProvider(): UseCreateIdentityProviderReturn;
|
|
37
|
+
//# sourceMappingURL=useCreateIdentityProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateIdentityProvider.d.ts","sourceRoot":"","sources":["../../src/identity-provider/useCreateIdentityProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAIlG,yDAAyD;AACzD,MAAM,WAAW,+BAA+B;IAC9C,4HAA4H;IAC5H,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7E,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,IAAI,+BAA+B,CAyB3E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Mutation hook that wraps `identityProvider.create()` with loading
|
|
7
|
+
* and error state.
|
|
8
|
+
*
|
|
9
|
+
* Creates an identity provider resource within an organization. The
|
|
10
|
+
* caller provides an {@link IdentityProviderInput} with the required
|
|
11
|
+
* metadata (name, org) and spec fields (JWKS URI, allowed issuers,
|
|
12
|
+
* expected audience).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { create, isCreating, error } = useCreateIdentityProvider();
|
|
17
|
+
*
|
|
18
|
+
* const idp = await create({
|
|
19
|
+
* name: "Acme Corp SSO",
|
|
20
|
+
* org: "acme",
|
|
21
|
+
* jwksUri: "https://acme.us.auth0.com/.well-known/jwks.json",
|
|
22
|
+
* allowedIssuers: ["https://acme.us.auth0.com/"],
|
|
23
|
+
* expectedAudience: "stigmer-api",
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function useCreateIdentityProvider() {
|
|
28
|
+
const stigmer = useStigmer();
|
|
29
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
30
|
+
const [error, setError] = useState(null);
|
|
31
|
+
const clearError = useCallback(() => setError(null), []);
|
|
32
|
+
const create = useCallback(async (input) => {
|
|
33
|
+
setIsCreating(true);
|
|
34
|
+
setError(null);
|
|
35
|
+
try {
|
|
36
|
+
return await stigmer.identityProvider.create(input);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
setError(toError(err));
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
setIsCreating(false);
|
|
44
|
+
}
|
|
45
|
+
}, [stigmer]);
|
|
46
|
+
return { create, isCreating, error, clearError };
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=useCreateIdentityProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateIdentityProvider.js","sourceRoot":"","sources":["../../src/identity-provider/useCreateIdentityProvider.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAA4B,EAA6B,EAAE;QAChE,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DeleteResourceInput } from "@stigmer/sdk";
|
|
2
|
+
import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
|
|
3
|
+
/** Return value of {@link useDeleteIdentityProvider}. */
|
|
4
|
+
export interface UseDeleteIdentityProviderReturn {
|
|
5
|
+
/** Delete an identity provider. Resolves with the deleted resource for confirmation display. */
|
|
6
|
+
readonly deleteProvider: (input: DeleteResourceInput) => Promise<IdentityProvider>;
|
|
7
|
+
/** `true` while the delete request is in flight. */
|
|
8
|
+
readonly isDeleting: boolean;
|
|
9
|
+
/** Error from the last failed delete, or `null` when healthy. */
|
|
10
|
+
readonly error: Error | null;
|
|
11
|
+
/** Reset `error` to `null`. */
|
|
12
|
+
readonly clearError: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Mutation hook that wraps `identityProvider.delete()` with loading
|
|
16
|
+
* and error state.
|
|
17
|
+
*
|
|
18
|
+
* Deletes an identity provider by its resource ID. Returns the deleted
|
|
19
|
+
* {@link IdentityProvider} on success so callers can confirm which
|
|
20
|
+
* provider was removed.
|
|
21
|
+
*
|
|
22
|
+
* Deletion is blocked by the backend if any platform-managed
|
|
23
|
+
* organizations still reference this identity provider.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const { deleteProvider, isDeleting, error } = useDeleteIdentityProvider();
|
|
28
|
+
*
|
|
29
|
+
* await deleteProvider({ resourceId: "idp-abc123" });
|
|
30
|
+
* refetch(); // refresh the list after deletion
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDeleteIdentityProvider(): UseDeleteIdentityProviderReturn;
|
|
34
|
+
//# sourceMappingURL=useDeleteIdentityProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteIdentityProvider.d.ts","sourceRoot":"","sources":["../../src/identity-provider/useDeleteIdentityProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAIlG,yDAAyD;AACzD,MAAM,WAAW,+BAA+B;IAC9C,gGAAgG;IAChG,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnF,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,IAAI,+BAA+B,CAyB3E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Mutation hook that wraps `identityProvider.delete()` with loading
|
|
7
|
+
* and error state.
|
|
8
|
+
*
|
|
9
|
+
* Deletes an identity provider by its resource ID. Returns the deleted
|
|
10
|
+
* {@link IdentityProvider} on success so callers can confirm which
|
|
11
|
+
* provider was removed.
|
|
12
|
+
*
|
|
13
|
+
* Deletion is blocked by the backend if any platform-managed
|
|
14
|
+
* organizations still reference this identity provider.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { deleteProvider, isDeleting, error } = useDeleteIdentityProvider();
|
|
19
|
+
*
|
|
20
|
+
* await deleteProvider({ resourceId: "idp-abc123" });
|
|
21
|
+
* refetch(); // refresh the list after deletion
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useDeleteIdentityProvider() {
|
|
25
|
+
const stigmer = useStigmer();
|
|
26
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
27
|
+
const [error, setError] = useState(null);
|
|
28
|
+
const clearError = useCallback(() => setError(null), []);
|
|
29
|
+
const deleteProvider = useCallback(async (input) => {
|
|
30
|
+
setIsDeleting(true);
|
|
31
|
+
setError(null);
|
|
32
|
+
try {
|
|
33
|
+
return await stigmer.identityProvider.delete(input);
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
setError(toError(err));
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
setIsDeleting(false);
|
|
41
|
+
}
|
|
42
|
+
}, [stigmer]);
|
|
43
|
+
return { deleteProvider, isDeleting, error, clearError };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=useDeleteIdentityProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteIdentityProvider.js","sourceRoot":"","sources":["../../src/identity-provider/useDeleteIdentityProvider.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,cAAc,GAAG,WAAW,CAChC,KAAK,EAAE,KAA0B,EAA6B,EAAE;QAC9D,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
|
|
2
|
+
/** Return value of {@link useIdentityProvider}. */
|
|
3
|
+
export interface UseIdentityProviderReturn {
|
|
4
|
+
/** The fetched IdentityProvider, or `null` while loading or on error. */
|
|
5
|
+
readonly identityProvider: IdentityProvider | null;
|
|
6
|
+
/** `true` while the initial fetch or a refetch is in flight. */
|
|
7
|
+
readonly isLoading: boolean;
|
|
8
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
9
|
+
readonly error: Error | null;
|
|
10
|
+
/** Discard cached data and re-fetch from the server. */
|
|
11
|
+
readonly refetch: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Data hook that fetches a single IdentityProvider by ID.
|
|
15
|
+
*
|
|
16
|
+
* Pass `null` to skip fetching (stable no-op). When the `id` changes,
|
|
17
|
+
* the previous in-flight request is discarded and a fresh fetch begins.
|
|
18
|
+
*
|
|
19
|
+
* Returns the full proto {@link IdentityProvider} resource so consumers
|
|
20
|
+
* have access to metadata, spec (JWKS URI, issuers, SSO config), and
|
|
21
|
+
* status without additional calls.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* function IdpDetail({ idpId }: { idpId: string }) {
|
|
26
|
+
* const { identityProvider, isLoading, error } = useIdentityProvider(idpId);
|
|
27
|
+
*
|
|
28
|
+
* if (isLoading) return <Skeleton />;
|
|
29
|
+
* if (error) return <ErrorMessage error={error} />;
|
|
30
|
+
* if (!identityProvider) return <NotFound />;
|
|
31
|
+
*
|
|
32
|
+
* return <h1>{identityProvider.spec?.displayName}</h1>;
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function useIdentityProvider(id: string | null): UseIdentityProviderReturn;
|
|
37
|
+
//# sourceMappingURL=useIdentityProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIdentityProvider.d.ts","sourceRoot":"","sources":["../../src/identity-provider/useIdentityProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAIlG,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC,yEAAyE;IACzE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnD,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,GAAG,IAAI,GAChB,yBAAyB,CAyC3B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Data hook that fetches a single IdentityProvider by ID.
|
|
7
|
+
*
|
|
8
|
+
* Pass `null` to skip fetching (stable no-op). When the `id` changes,
|
|
9
|
+
* the previous in-flight request is discarded and a fresh fetch begins.
|
|
10
|
+
*
|
|
11
|
+
* Returns the full proto {@link IdentityProvider} resource so consumers
|
|
12
|
+
* have access to metadata, spec (JWKS URI, issuers, SSO config), and
|
|
13
|
+
* status without additional calls.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* function IdpDetail({ idpId }: { idpId: string }) {
|
|
18
|
+
* const { identityProvider, isLoading, error } = useIdentityProvider(idpId);
|
|
19
|
+
*
|
|
20
|
+
* if (isLoading) return <Skeleton />;
|
|
21
|
+
* if (error) return <ErrorMessage error={error} />;
|
|
22
|
+
* if (!identityProvider) return <NotFound />;
|
|
23
|
+
*
|
|
24
|
+
* return <h1>{identityProvider.spec?.displayName}</h1>;
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function useIdentityProvider(id) {
|
|
29
|
+
const stigmer = useStigmer();
|
|
30
|
+
const [identityProvider, setIdentityProvider] = useState(null);
|
|
31
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
32
|
+
const [error, setError] = useState(null);
|
|
33
|
+
const [fetchKey, setFetchKey] = useState(0);
|
|
34
|
+
const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!id) {
|
|
37
|
+
setIdentityProvider(null);
|
|
38
|
+
setIsLoading(false);
|
|
39
|
+
setError(null);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const cancelled = { current: false };
|
|
43
|
+
setIsLoading(true);
|
|
44
|
+
setError(null);
|
|
45
|
+
stigmer.identityProvider.get(id).then((result) => {
|
|
46
|
+
if (cancelled.current)
|
|
47
|
+
return;
|
|
48
|
+
setIdentityProvider(result);
|
|
49
|
+
setIsLoading(false);
|
|
50
|
+
}, (err) => {
|
|
51
|
+
if (cancelled.current)
|
|
52
|
+
return;
|
|
53
|
+
setError(toError(err));
|
|
54
|
+
setIsLoading(false);
|
|
55
|
+
});
|
|
56
|
+
return () => {
|
|
57
|
+
cancelled.current = true;
|
|
58
|
+
};
|
|
59
|
+
}, [id, stigmer, fetchKey]);
|
|
60
|
+
return { identityProvider, isLoading, error, refetch };
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=useIdentityProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIdentityProvider.js","sourceRoot":"","sources":["../../src/identity-provider/useIdentityProvider.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,mBAAmB,CACjC,EAAiB;IAEjB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAC3C,QAAQ,CAA0B,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEjE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAC1B,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,OAAO;QACT,CAAC;QAED,MAAM,SAAS,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CACnC,CAAC,MAAM,EAAE,EAAE;YACT,IAAI,SAAS,CAAC,OAAO;gBAAE,OAAO;YAC9B,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAC5B,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,EACD,CAAC,GAAG,EAAE,EAAE;YACN,IAAI,SAAS,CAAC,OAAO;gBAAE,OAAO;YAC9B,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CACF,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
|
|
2
|
+
/** Return value of {@link useIdentityProviderList}. */
|
|
3
|
+
export interface UseIdentityProviderListReturn {
|
|
4
|
+
/** All identity providers for the organization. Empty while loading or on error. */
|
|
5
|
+
readonly identityProviders: readonly IdentityProvider[];
|
|
6
|
+
/** `true` while the initial fetch or a refetch is in flight. */
|
|
7
|
+
readonly isLoading: boolean;
|
|
8
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
9
|
+
readonly error: Error | null;
|
|
10
|
+
/** Discard cached data and re-fetch from the server. */
|
|
11
|
+
readonly refetch: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Data hook that fetches all identity providers for an organization.
|
|
15
|
+
*
|
|
16
|
+
* Identity providers are admin-level resources with small cardinality
|
|
17
|
+
* (typically 1–3 per org), so results are returned as a flat list
|
|
18
|
+
* without pagination.
|
|
19
|
+
*
|
|
20
|
+
* Pass `null` to skip fetching (stable no-op). Call `refetch()` to
|
|
21
|
+
* re-query after mutations (create / update / delete).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* function IdpSettings({ orgId }: { orgId: string }) {
|
|
26
|
+
* const { identityProviders, isLoading, error } = useIdentityProviderList(orgId);
|
|
27
|
+
*
|
|
28
|
+
* if (isLoading) return <Skeleton />;
|
|
29
|
+
* if (error) return <ErrorMessage error={error} />;
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <ul>
|
|
33
|
+
* {identityProviders.map((idp) => (
|
|
34
|
+
* <li key={idp.metadata?.id}>{idp.metadata?.name}</li>
|
|
35
|
+
* ))}
|
|
36
|
+
* </ul>
|
|
37
|
+
* );
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Skip fetching until org is known
|
|
44
|
+
* const { identityProviders } = useIdentityProviderList(org ?? null);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function useIdentityProviderList(org: string | null): UseIdentityProviderListReturn;
|
|
48
|
+
//# sourceMappingURL=useIdentityProviderList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIdentityProviderList.d.ts","sourceRoot":"","sources":["../../src/identity-provider/useIdentityProviderList.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAKlG,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,GAAG,IAAI,GACjB,6BAA6B,CA0C/B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import { ListIdentityProvidersByOrgInputSchema } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/io_pb";
|
|
5
|
+
import { useStigmer } from "../hooks";
|
|
6
|
+
import { toError } from "../internal/toError";
|
|
7
|
+
/**
|
|
8
|
+
* Data hook that fetches all identity providers for an organization.
|
|
9
|
+
*
|
|
10
|
+
* Identity providers are admin-level resources with small cardinality
|
|
11
|
+
* (typically 1–3 per org), so results are returned as a flat list
|
|
12
|
+
* without pagination.
|
|
13
|
+
*
|
|
14
|
+
* Pass `null` to skip fetching (stable no-op). Call `refetch()` to
|
|
15
|
+
* re-query after mutations (create / update / delete).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* function IdpSettings({ orgId }: { orgId: string }) {
|
|
20
|
+
* const { identityProviders, isLoading, error } = useIdentityProviderList(orgId);
|
|
21
|
+
*
|
|
22
|
+
* if (isLoading) return <Skeleton />;
|
|
23
|
+
* if (error) return <ErrorMessage error={error} />;
|
|
24
|
+
*
|
|
25
|
+
* return (
|
|
26
|
+
* <ul>
|
|
27
|
+
* {identityProviders.map((idp) => (
|
|
28
|
+
* <li key={idp.metadata?.id}>{idp.metadata?.name}</li>
|
|
29
|
+
* ))}
|
|
30
|
+
* </ul>
|
|
31
|
+
* );
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* // Skip fetching until org is known
|
|
38
|
+
* const { identityProviders } = useIdentityProviderList(org ?? null);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function useIdentityProviderList(org) {
|
|
42
|
+
const stigmer = useStigmer();
|
|
43
|
+
const [identityProviders, setIdentityProviders] = useState([]);
|
|
44
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
45
|
+
const [error, setError] = useState(null);
|
|
46
|
+
const [fetchKey, setFetchKey] = useState(0);
|
|
47
|
+
const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!org) {
|
|
50
|
+
setIdentityProviders([]);
|
|
51
|
+
setIsLoading(false);
|
|
52
|
+
setError(null);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const cancelled = { current: false };
|
|
56
|
+
setIsLoading(true);
|
|
57
|
+
setError(null);
|
|
58
|
+
stigmer.identityProvider.listByOrg(create(ListIdentityProvidersByOrgInputSchema, { org })).then((result) => {
|
|
59
|
+
if (cancelled.current)
|
|
60
|
+
return;
|
|
61
|
+
setIdentityProviders([...result.entries]);
|
|
62
|
+
setIsLoading(false);
|
|
63
|
+
}, (err) => {
|
|
64
|
+
if (cancelled.current)
|
|
65
|
+
return;
|
|
66
|
+
setError(toError(err));
|
|
67
|
+
setIsLoading(false);
|
|
68
|
+
});
|
|
69
|
+
return () => {
|
|
70
|
+
cancelled.current = true;
|
|
71
|
+
};
|
|
72
|
+
}, [org, stigmer, fetchKey]);
|
|
73
|
+
return { identityProviders, isLoading, error, refetch };
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=useIdentityProviderList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIdentityProviderList.js","sourceRoot":"","sources":["../../src/identity-provider/useIdentityProviderList.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AACjH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,uBAAuB,CACrC,GAAkB;IAElB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAExD,EAAE,CAAC,CAAC;IACN,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAA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