@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,37 @@
|
|
|
1
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
2
|
+
import type { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
3
|
+
/** Props for {@link RoleSelector}. */
|
|
4
|
+
export interface RoleSelectorProps {
|
|
5
|
+
/** The resource kind whose grantable roles to display. */
|
|
6
|
+
readonly kind: ApiResourceKind | null;
|
|
7
|
+
/** Fired when the user selects a role. */
|
|
8
|
+
readonly onSelect?: (role: IamRole) => void;
|
|
9
|
+
/** Externally controlled selected role — makes this a controlled component. */
|
|
10
|
+
readonly selected?: IamRole | null;
|
|
11
|
+
/** Initial role to select (uncontrolled mode). */
|
|
12
|
+
readonly defaultRole?: IamRole;
|
|
13
|
+
/** Disable all role options. */
|
|
14
|
+
readonly disabled?: boolean;
|
|
15
|
+
/** Additional CSS class names for the root container. */
|
|
16
|
+
readonly className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Styled radio-group for selecting an IAM role.
|
|
20
|
+
*
|
|
21
|
+
* Displays all grantable roles for the given resource kind as
|
|
22
|
+
* selectable pills, each showing the role name and description.
|
|
23
|
+
*
|
|
24
|
+
* For a headless alternative, use {@link useRoleSelector} directly.
|
|
25
|
+
*
|
|
26
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <RoleSelector
|
|
31
|
+
* kind={ApiResourceKind.organization}
|
|
32
|
+
* onSelect={(role) => setRole(role)}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function RoleSelector({ kind, onSelect, selected: controlledSelected, defaultRole, disabled, className, }: RoleSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
//# sourceMappingURL=RoleSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelector.d.ts","sourceRoot":"","sources":["../../src/iam-policy/RoleSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAC3H,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAIzE,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,kDAAkD;IAClD,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,QAAQ,EACR,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EACX,QAAgB,EAChB,SAAS,GACV,EAAE,iBAAiB,kDAwDnB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { useRoleSelector } from "./useRoleSelector";
|
|
5
|
+
/**
|
|
6
|
+
* Styled radio-group for selecting an IAM role.
|
|
7
|
+
*
|
|
8
|
+
* Displays all grantable roles for the given resource kind as
|
|
9
|
+
* selectable pills, each showing the role name and description.
|
|
10
|
+
*
|
|
11
|
+
* For a headless alternative, use {@link useRoleSelector} directly.
|
|
12
|
+
*
|
|
13
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <RoleSelector
|
|
18
|
+
* kind={ApiResourceKind.organization}
|
|
19
|
+
* onSelect={(role) => setRole(role)}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function RoleSelector({ kind, onSelect, selected: controlledSelected, defaultRole, disabled = false, className, }) {
|
|
24
|
+
const { options, selected: internalSelected, select } = useRoleSelector(kind, defaultRole);
|
|
25
|
+
const currentSelected = controlledSelected !== undefined
|
|
26
|
+
? controlledSelected
|
|
27
|
+
: internalSelected;
|
|
28
|
+
const handleSelect = (role) => {
|
|
29
|
+
select(role);
|
|
30
|
+
onSelect?.(role);
|
|
31
|
+
};
|
|
32
|
+
if (options.length === 0) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return (_jsxs("fieldset", { className: cn("space-y-1.5", className), children: [_jsx("legend", { className: "text-xs font-medium text-foreground", children: "Role" }), _jsx("div", { className: "flex flex-wrap gap-2", children: options.map((opt) => {
|
|
36
|
+
const isChecked = currentSelected === opt.role;
|
|
37
|
+
return (_jsxs("label", { title: opt.description, className: cn("inline-flex cursor-pointer flex-col rounded-md border px-3 py-1.5 text-xs transition-colors", isChecked
|
|
38
|
+
? "border-primary bg-primary-subtle text-primary font-medium"
|
|
39
|
+
: "border-input bg-background text-muted-foreground hover:border-border hover:text-foreground", disabled && "pointer-events-none opacity-50"), children: [_jsx("input", { type: "radio", name: "stgm-role-selector", value: opt.value, checked: isChecked, disabled: disabled, onChange: () => handleSelect(opt.role), className: "sr-only" }), _jsx("span", { children: opt.label }), _jsx("span", { className: "text-[0.625rem] text-muted-foreground font-normal mt-0.5", children: opt.description })] }, opt.value));
|
|
40
|
+
}) })] }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=RoleSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelector.js","sourceRoot":"","sources":["../../src/iam-policy/RoleSelector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAkBpD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EACJ,QAAQ,EAC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GACnB,EACF,yBAAO,GAAG,CAAC,KAAK,GAAQ,EACxB,eAAM,SAAS,EAAC,0DAA0D,YACvE,GAAG,CAAC,WAAW,GACX,KAtBF,GAAG,CAAC,KAAK,CAuBR,CACT,CAAC;gBACJ,CAAC,CAAC,GACE,IACG,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { useGrantableRoles, type UseGrantableRolesReturn, } from "./useGrantableRoles";
|
|
2
|
+
export { useRoleSelector, type RoleOption, type UseRoleSelectorReturn, } from "./useRoleSelector";
|
|
3
|
+
export { useResourceAccess, type ResourceAccessRef, type UseResourceAccessOptions, type UseResourceAccessReturn, } from "./useResourceAccess";
|
|
4
|
+
export { usePrincipalsCount, type UsePrincipalsCountReturn, } from "./usePrincipalsCount";
|
|
5
|
+
export { useWhoAmI, type UseWhoAmIReturn, } from "./useWhoAmI";
|
|
6
|
+
export { useCreateIamPolicy, type UseCreateIamPolicyReturn, } from "./useCreateIamPolicy";
|
|
7
|
+
export { useDeleteIamPolicy, type UseDeleteIamPolicyReturn, } from "./useDeleteIamPolicy";
|
|
8
|
+
export { useRevokeOrgAccess, type UseRevokeOrgAccessReturn, } from "./useRevokeOrgAccess";
|
|
9
|
+
export { RoleSelector, type RoleSelectorProps } from "./RoleSelector";
|
|
10
|
+
export { GrantAccessForm, type GrantAccessFormProps } from "./GrantAccessForm";
|
|
11
|
+
export { OrgMembersPanel, type OrgMembersPanelProps, } from "./OrgMembersPanel";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/iam-policy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,KAAK,UAAU,EACf,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { useGrantableRoles, } from "./useGrantableRoles";
|
|
2
|
+
export { useRoleSelector, } from "./useRoleSelector";
|
|
3
|
+
export { useResourceAccess, } from "./useResourceAccess";
|
|
4
|
+
export { usePrincipalsCount, } from "./usePrincipalsCount";
|
|
5
|
+
export { useWhoAmI, } from "./useWhoAmI";
|
|
6
|
+
export { useCreateIamPolicy, } from "./useCreateIamPolicy";
|
|
7
|
+
export { useDeleteIamPolicy, } from "./useDeleteIamPolicy";
|
|
8
|
+
export { useRevokeOrgAccess, } from "./useRevokeOrgAccess";
|
|
9
|
+
export { RoleSelector } from "./RoleSelector";
|
|
10
|
+
export { GrantAccessForm } from "./GrantAccessForm";
|
|
11
|
+
export { OrgMembersPanel, } from "./OrgMembersPanel";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iam-policy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,GAGhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,GAIlB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,GAEV,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAA6B,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EACL,eAAe,GAEhB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IamPolicy } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
2
|
+
import type { IamPolicySpec } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/spec_pb";
|
|
3
|
+
/** Return value of {@link useCreateIamPolicy}. */
|
|
4
|
+
export interface UseCreateIamPolicyReturn {
|
|
5
|
+
/** Grant access by creating an IAM policy binding. */
|
|
6
|
+
readonly create: (spec: IamPolicySpec) => Promise<IamPolicy>;
|
|
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
|
+
* Behavior hook that wraps `iamPolicy.create()` with loading/error
|
|
16
|
+
* state.
|
|
17
|
+
*
|
|
18
|
+
* Creates an IAM policy binding — granting a principal (identity
|
|
19
|
+
* account, team, etc.) a specific role on a resource. The caller
|
|
20
|
+
* provides the full {@link IamPolicySpec} with `principal`, `resource`,
|
|
21
|
+
* and `relation` (the role string, e.g. "admin").
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { create, isCreating, error } = useCreateIamPolicy();
|
|
26
|
+
*
|
|
27
|
+
* await create({
|
|
28
|
+
* principal: { kind: "identity_account", id: accountId },
|
|
29
|
+
* resource: { kind: "organization", id: orgId },
|
|
30
|
+
* relation: "admin",
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function useCreateIamPolicy(): UseCreateIamPolicyReturn;
|
|
35
|
+
//# sourceMappingURL=useCreateIamPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateIamPolicy.d.ts","sourceRoot":"","sources":["../../src/iam-policy/useCreateIamPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAIzF,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7D,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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CAyB7D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Behavior hook that wraps `iamPolicy.create()` with loading/error
|
|
7
|
+
* state.
|
|
8
|
+
*
|
|
9
|
+
* Creates an IAM policy binding — granting a principal (identity
|
|
10
|
+
* account, team, etc.) a specific role on a resource. The caller
|
|
11
|
+
* provides the full {@link IamPolicySpec} with `principal`, `resource`,
|
|
12
|
+
* and `relation` (the role string, e.g. "admin").
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { create, isCreating, error } = useCreateIamPolicy();
|
|
17
|
+
*
|
|
18
|
+
* await create({
|
|
19
|
+
* principal: { kind: "identity_account", id: accountId },
|
|
20
|
+
* resource: { kind: "organization", id: orgId },
|
|
21
|
+
* relation: "admin",
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function useCreateIamPolicy() {
|
|
26
|
+
const stigmer = useStigmer();
|
|
27
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
28
|
+
const [error, setError] = useState(null);
|
|
29
|
+
const clearError = useCallback(() => setError(null), []);
|
|
30
|
+
const create = useCallback(async (spec) => {
|
|
31
|
+
setIsCreating(true);
|
|
32
|
+
setError(null);
|
|
33
|
+
try {
|
|
34
|
+
return await stigmer.iamPolicy.create(spec);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
setError(toError(err));
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setIsCreating(false);
|
|
42
|
+
}
|
|
43
|
+
}, [stigmer]);
|
|
44
|
+
return { create, isCreating, error, clearError };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=useCreateIamPolicy.js.map
|
|
@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0,0 +1,34 @@
|
|
|
1
|
+
import type { IamPolicy } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
2
|
+
import type { IamPolicySpec } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/spec_pb";
|
|
3
|
+
/** Return value of {@link useDeleteIamPolicy}. */
|
|
4
|
+
export interface UseDeleteIamPolicyReturn {
|
|
5
|
+
/** Revoke access by deleting an IAM policy binding. */
|
|
6
|
+
readonly remove: (spec: IamPolicySpec) => Promise<IamPolicy>;
|
|
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
|
+
* Behavior hook that wraps `iamPolicy.delete()` with loading/error
|
|
16
|
+
* state.
|
|
17
|
+
*
|
|
18
|
+
* Removes an IAM policy binding — revoking a principal's role on a
|
|
19
|
+
* resource. The caller provides the same {@link IamPolicySpec} that was
|
|
20
|
+
* used when creating the binding.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { remove, isDeleting, error } = useDeleteIamPolicy();
|
|
25
|
+
*
|
|
26
|
+
* await remove({
|
|
27
|
+
* principal: { kind: "identity_account", id: accountId },
|
|
28
|
+
* resource: { kind: "organization", id: orgId },
|
|
29
|
+
* relation: "admin",
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDeleteIamPolicy(): UseDeleteIamPolicyReturn;
|
|
34
|
+
//# sourceMappingURL=useDeleteIamPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteIamPolicy.d.ts","sourceRoot":"","sources":["../../src/iam-policy/useDeleteIamPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAIzF,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7D,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,kBAAkB,IAAI,wBAAwB,CAyB7D"}
|
|
@@ -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
|
+
* Behavior hook that wraps `iamPolicy.delete()` with loading/error
|
|
7
|
+
* state.
|
|
8
|
+
*
|
|
9
|
+
* Removes an IAM policy binding — revoking a principal's role on a
|
|
10
|
+
* resource. The caller provides the same {@link IamPolicySpec} that was
|
|
11
|
+
* used when creating the binding.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { remove, isDeleting, error } = useDeleteIamPolicy();
|
|
16
|
+
*
|
|
17
|
+
* await remove({
|
|
18
|
+
* principal: { kind: "identity_account", id: accountId },
|
|
19
|
+
* resource: { kind: "organization", id: orgId },
|
|
20
|
+
* relation: "admin",
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useDeleteIamPolicy() {
|
|
25
|
+
const stigmer = useStigmer();
|
|
26
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
27
|
+
const [error, setError] = useState(null);
|
|
28
|
+
const clearError = useCallback(() => setError(null), []);
|
|
29
|
+
const remove = useCallback(async (spec) => {
|
|
30
|
+
setIsDeleting(true);
|
|
31
|
+
setError(null);
|
|
32
|
+
try {
|
|
33
|
+
return await stigmer.iamPolicy.delete(spec);
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
setError(toError(err));
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
setIsDeleting(false);
|
|
41
|
+
}
|
|
42
|
+
}, [stigmer]);
|
|
43
|
+
return { remove, isDeleting, error, clearError };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=useDeleteIamPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteIamPolicy.js","sourceRoot":"","sources":["../../src/iam-policy/useDeleteIamPolicy.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,kBAAkB;IAChC,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,IAAmB,EAAsB,EAAE;QAChD,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9C,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,28 @@
|
|
|
1
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
2
|
+
import type { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
3
|
+
/** Return value of {@link useGrantableRoles}. */
|
|
4
|
+
export interface UseGrantableRolesReturn {
|
|
5
|
+
/** Roles that can be granted on the given resource kind. Empty if none. */
|
|
6
|
+
readonly roles: readonly IamRole[];
|
|
7
|
+
/** Whether the kind has at least one user-grantable role. */
|
|
8
|
+
readonly hasRoles: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns the list of IAM roles that can be granted on the given
|
|
12
|
+
* resource kind.
|
|
13
|
+
*
|
|
14
|
+
* This is a local read — no network call. The data comes from the
|
|
15
|
+
* `grantable_roles` field in each `ApiResourceKind`'s proto metadata,
|
|
16
|
+
* generated at build time.
|
|
17
|
+
*
|
|
18
|
+
* @param kind - The resource kind to query, or `null` while loading.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { roles, hasRoles } = useGrantableRoles(ApiResourceKind.agent);
|
|
23
|
+
* // roles = [IamRole.owner, IamRole.viewer]
|
|
24
|
+
* // hasRoles = true
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useGrantableRoles(kind: ApiResourceKind | null): UseGrantableRolesReturn;
|
|
28
|
+
//# sourceMappingURL=useGrantableRoles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGrantableRoles.d.ts","sourceRoot":"","sources":["../../src/iam-policy/useGrantableRoles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAC3H,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAGzE,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,GAAG,IAAI,GAC3B,uBAAuB,CAUzB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getGrantableRoles, hasGrantableRoles } from "@stigmer/sdk";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the list of IAM roles that can be granted on the given
|
|
6
|
+
* resource kind.
|
|
7
|
+
*
|
|
8
|
+
* This is a local read — no network call. The data comes from the
|
|
9
|
+
* `grantable_roles` field in each `ApiResourceKind`'s proto metadata,
|
|
10
|
+
* generated at build time.
|
|
11
|
+
*
|
|
12
|
+
* @param kind - The resource kind to query, or `null` while loading.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { roles, hasRoles } = useGrantableRoles(ApiResourceKind.agent);
|
|
17
|
+
* // roles = [IamRole.owner, IamRole.viewer]
|
|
18
|
+
* // hasRoles = true
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function useGrantableRoles(kind) {
|
|
22
|
+
return useMemo(() => {
|
|
23
|
+
if (kind === null) {
|
|
24
|
+
return { roles: [], hasRoles: false };
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
roles: getGrantableRoles(kind),
|
|
28
|
+
hasRoles: hasGrantableRoles(kind),
|
|
29
|
+
};
|
|
30
|
+
}, [kind]);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=useGrantableRoles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGrantableRoles.js","sourceRoot":"","sources":["../../src/iam-policy/useGrantableRoles.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAA4B;IAE5B,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACxC,CAAC;QACD,OAAO;YACL,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC;YAC9B,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC;SAClC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Return value of {@link usePrincipalsCount}. */
|
|
2
|
+
export interface UsePrincipalsCountReturn {
|
|
3
|
+
/** Number of distinct principals with access. `0` while loading. */
|
|
4
|
+
readonly count: number;
|
|
5
|
+
/** `true` while the fetch is in flight. */
|
|
6
|
+
readonly isLoading: boolean;
|
|
7
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
8
|
+
readonly error: Error | null;
|
|
9
|
+
/** Re-fetch the count from the server. */
|
|
10
|
+
readonly refetch: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Data hook that fetches the count of principals with access to an
|
|
14
|
+
* organization.
|
|
15
|
+
*
|
|
16
|
+
* Wraps `iamPolicy.getPrincipalsCount()`. Useful for member count
|
|
17
|
+
* badges in navigation and summary statistics.
|
|
18
|
+
*
|
|
19
|
+
* Pass `null` as `orgId` to skip fetching (stable no-op).
|
|
20
|
+
*
|
|
21
|
+
* @param orgId - Organization ID, or `null` to skip.
|
|
22
|
+
* @param principalKind - Kind of principals to count. Defaults to `"identity_account"`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const { count, isLoading } = usePrincipalsCount(orgId);
|
|
27
|
+
* // count = 5
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function usePrincipalsCount(orgId: string | null, principalKind?: string): UsePrincipalsCountReturn;
|
|
31
|
+
//# sourceMappingURL=usePrincipalsCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrincipalsCount.d.ts","sourceRoot":"","sources":["../../src/iam-policy/usePrincipalsCount.ts"],"names":[],"mappings":"AAQA,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,aAAa,GAAE,MAA2B,GACzC,wBAAwB,CAsD1B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import { GetPrincipalsCountInputSchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
5
|
+
import { useStigmer } from "../hooks";
|
|
6
|
+
import { toError } from "../internal/toError";
|
|
7
|
+
/**
|
|
8
|
+
* Data hook that fetches the count of principals with access to an
|
|
9
|
+
* organization.
|
|
10
|
+
*
|
|
11
|
+
* Wraps `iamPolicy.getPrincipalsCount()`. Useful for member count
|
|
12
|
+
* badges in navigation and summary statistics.
|
|
13
|
+
*
|
|
14
|
+
* Pass `null` as `orgId` to skip fetching (stable no-op).
|
|
15
|
+
*
|
|
16
|
+
* @param orgId - Organization ID, or `null` to skip.
|
|
17
|
+
* @param principalKind - Kind of principals to count. Defaults to `"identity_account"`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { count, isLoading } = usePrincipalsCount(orgId);
|
|
22
|
+
* // count = 5
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function usePrincipalsCount(orgId, principalKind = "identity_account") {
|
|
26
|
+
const stigmer = useStigmer();
|
|
27
|
+
const [count, setCount] = useState(0);
|
|
28
|
+
const [isLoading, setIsLoading] = useState(!!orgId);
|
|
29
|
+
const [error, setError] = useState(null);
|
|
30
|
+
const [fetchKey, setFetchKey] = useState(0);
|
|
31
|
+
const [prevOrgId, setPrevOrgId] = useState(orgId);
|
|
32
|
+
if (orgId !== prevOrgId) {
|
|
33
|
+
setPrevOrgId(orgId);
|
|
34
|
+
if (orgId) {
|
|
35
|
+
setIsLoading(true);
|
|
36
|
+
setCount(0);
|
|
37
|
+
setError(null);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
setIsLoading(false);
|
|
41
|
+
setCount(0);
|
|
42
|
+
setError(null);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!orgId)
|
|
48
|
+
return;
|
|
49
|
+
const cancelled = { current: false };
|
|
50
|
+
stigmer.iamPolicy
|
|
51
|
+
.getPrincipalsCount(create(GetPrincipalsCountInputSchema, {
|
|
52
|
+
orgId,
|
|
53
|
+
principalKind,
|
|
54
|
+
}))
|
|
55
|
+
.then((result) => {
|
|
56
|
+
if (cancelled.current)
|
|
57
|
+
return;
|
|
58
|
+
setCount(result.count);
|
|
59
|
+
setIsLoading(false);
|
|
60
|
+
}, (err) => {
|
|
61
|
+
if (cancelled.current)
|
|
62
|
+
return;
|
|
63
|
+
setError(toError(err));
|
|
64
|
+
setIsLoading(false);
|
|
65
|
+
});
|
|
66
|
+
return () => {
|
|
67
|
+
cancelled.current = true;
|
|
68
|
+
};
|
|
69
|
+
}, [orgId, principalKind, stigmer, fetchKey]);
|
|
70
|
+
return { count, isLoading, error, refetch };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=usePrincipalsCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrincipalsCount.js","sourceRoot":"","sources":["../../src/iam-policy/usePrincipalsCount.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;AAC5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,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AK;YACL,aAAa;SACd,CAAC,CACH;aACA,IAAI,CACH,CAAC,MAAM,EAAE,EAAE;YACT,IAAI,SAAS,CAAC,OAAO;gBAAE,OAAO;YAC9B,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvB,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;QAEJ,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE9C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PrincipalAccess } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
2
|
+
/** Resource reference for the access query. */
|
|
3
|
+
export interface ResourceAccessRef {
|
|
4
|
+
/** Resource kind (e.g. "organization", "agent"). */
|
|
5
|
+
readonly kind: string;
|
|
6
|
+
/** Resource ID. */
|
|
7
|
+
readonly id: string;
|
|
8
|
+
}
|
|
9
|
+
/** Options for {@link useResourceAccess}. */
|
|
10
|
+
export interface UseResourceAccessOptions {
|
|
11
|
+
/** Include roles inherited from parent resources. Defaults to `false`. */
|
|
12
|
+
readonly includeInherited?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Return value of {@link useResourceAccess}. */
|
|
15
|
+
export interface UseResourceAccessReturn {
|
|
16
|
+
/** Principals with their role grants on the resource. */
|
|
17
|
+
readonly members: readonly PrincipalAccess[];
|
|
18
|
+
/** `true` while the fetch is in flight. */
|
|
19
|
+
readonly isLoading: boolean;
|
|
20
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
21
|
+
readonly error: Error | null;
|
|
22
|
+
/** Re-fetch the access list from the server. */
|
|
23
|
+
readonly refetch: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Data hook that fetches the list of principals and their roles on a
|
|
27
|
+
* resource.
|
|
28
|
+
*
|
|
29
|
+
* Wraps `iamPolicy.listResourceAccessByPrincipal()`. Returns each
|
|
30
|
+
* principal with full display information (`ApiResourceRefView`) and
|
|
31
|
+
* all their role grants, optionally including roles inherited from
|
|
32
|
+
* parent resources.
|
|
33
|
+
*
|
|
34
|
+
* Pass `null` as `resource` to skip fetching (stable no-op).
|
|
35
|
+
*
|
|
36
|
+
* **Generic** — works for organizations, agents, environments, or any
|
|
37
|
+
* resource kind that has IAM policies.
|
|
38
|
+
*
|
|
39
|
+
* @param resource - The resource to query access for, or `null` to skip.
|
|
40
|
+
* @param options - Optional configuration.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const { members, isLoading } = useResourceAccess(
|
|
45
|
+
* { kind: "organization", id: orgId },
|
|
46
|
+
* { includeInherited: true },
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function useResourceAccess(resource: ResourceAccessRef | null, options?: UseResourceAccessOptions): UseResourceAccessReturn;
|
|
51
|
+
//# sourceMappingURL=useResourceAccess.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceAccess.d.ts","sourceRoot":"","sources":["../../src/iam-policy/useResourceAccess.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAQzF,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,EAClC,OAAO,CAAC,EAAE,wBAAwB,GACjC,uBAAuB,CA6DzB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import { ListResourceAccessInputSchema, } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
5
|
+
import { ApiResourceRefSchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/spec_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
/**
|
|
9
|
+
* Data hook that fetches the list of principals and their roles on a
|
|
10
|
+
* resource.
|
|
11
|
+
*
|
|
12
|
+
* Wraps `iamPolicy.listResourceAccessByPrincipal()`. Returns each
|
|
13
|
+
* principal with full display information (`ApiResourceRefView`) and
|
|
14
|
+
* all their role grants, optionally including roles inherited from
|
|
15
|
+
* parent resources.
|
|
16
|
+
*
|
|
17
|
+
* Pass `null` as `resource` to skip fetching (stable no-op).
|
|
18
|
+
*
|
|
19
|
+
* **Generic** — works for organizations, agents, environments, or any
|
|
20
|
+
* resource kind that has IAM policies.
|
|
21
|
+
*
|
|
22
|
+
* @param resource - The resource to query access for, or `null` to skip.
|
|
23
|
+
* @param options - Optional configuration.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const { members, isLoading } = useResourceAccess(
|
|
28
|
+
* { kind: "organization", id: orgId },
|
|
29
|
+
* { includeInherited: true },
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function useResourceAccess(resource, options) {
|
|
34
|
+
const stigmer = useStigmer();
|
|
35
|
+
const [members, setMembers] = useState([]);
|
|
36
|
+
const [isLoading, setIsLoading] = useState(!!resource);
|
|
37
|
+
const [error, setError] = useState(null);
|
|
38
|
+
const [fetchKey, setFetchKey] = useState(0);
|
|
39
|
+
const kind = resource?.kind ?? null;
|
|
40
|
+
const id = resource?.id ?? null;
|
|
41
|
+
const includeInherited = options?.includeInherited ?? false;
|
|
42
|
+
const [prevKey, setPrevKey] = useState(kind && id ? `${kind}:${id}` : null);
|
|
43
|
+
const currentKey = kind && id ? `${kind}:${id}` : null;
|
|
44
|
+
if (currentKey !== prevKey) {
|
|
45
|
+
setPrevKey(currentKey);
|
|
46
|
+
if (currentKey) {
|
|
47
|
+
setIsLoading(true);
|
|
48
|
+
setMembers([]);
|
|
49
|
+
setError(null);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
setIsLoading(false);
|
|
53
|
+
setMembers([]);
|
|
54
|
+
setError(null);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!kind || !id)
|
|
60
|
+
return;
|
|
61
|
+
const cancelled = { current: false };
|
|
62
|
+
const input = create(ListResourceAccessInputSchema, {
|
|
63
|
+
resource: create(ApiResourceRefSchema, { kind, id }),
|
|
64
|
+
includeInherited,
|
|
65
|
+
});
|
|
66
|
+
stigmer.iamPolicy
|
|
67
|
+
.listResourceAccessByPrincipal(input)
|
|
68
|
+
.then((result) => {
|
|
69
|
+
if (cancelled.current)
|
|
70
|
+
return;
|
|
71
|
+
setMembers([...result.entries]);
|
|
72
|
+
setIsLoading(false);
|
|
73
|
+
}, (err) => {
|
|
74
|
+
if (cancelled.current)
|
|
75
|
+
return;
|
|
76
|
+
setError(toError(err));
|
|
77
|
+
setIsLoading(false);
|
|
78
|
+
});
|
|
79
|
+
return () => {
|
|
80
|
+
cancelled.current = true;
|
|
81
|
+
};
|
|
82
|
+
}, [kind, id, includeInherited, stigmer, fetchKey]);
|
|
83
|
+
return { members, isLoading, error, refetch };
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=useResourceAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceAccess.js","sourceRoot":"","sources":["../../src/iam-policy/useResourceAccess.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,EACL,6BAA6B,GAC9B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA4B9C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAkC,EAClC,OAAkC;IAElC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAoB,EA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