@thunderid/vue 1.6.0 → 1.7.0

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.
Files changed (116) hide show
  1. package/dist/__tests__/helpers/managementContext.d.ts +4 -2
  2. package/dist/__tests__/helpers/managementContext.d.ts.map +1 -1
  3. package/dist/cjs/index.cjs +3332 -2328
  4. package/dist/components/admin/AgentCreate/AgentCreate.d.ts.map +1 -1
  5. package/dist/components/admin/AgentDetails/AgentDetails.d.ts.map +1 -1
  6. package/dist/components/admin/AgentList/AgentList.d.ts.map +1 -1
  7. package/dist/components/admin/ApplicationCreate/ApplicationCreate.d.ts +21 -0
  8. package/dist/components/admin/ApplicationCreate/ApplicationCreate.d.ts.map +1 -0
  9. package/dist/components/admin/ApplicationCreate/BaseApplicationCreate.d.ts +36 -0
  10. package/dist/components/admin/ApplicationCreate/BaseApplicationCreate.d.ts.map +1 -0
  11. package/dist/components/admin/ApplicationDetails/ApplicationDetails.d.ts +27 -0
  12. package/dist/components/admin/ApplicationDetails/ApplicationDetails.d.ts.map +1 -0
  13. package/dist/components/admin/ApplicationDetails/BaseApplicationDetails.d.ts +43 -0
  14. package/dist/components/admin/ApplicationDetails/BaseApplicationDetails.d.ts.map +1 -0
  15. package/dist/components/admin/ApplicationList/ApplicationList.d.ts +20 -0
  16. package/dist/components/admin/ApplicationList/ApplicationList.d.ts.map +1 -0
  17. package/dist/components/admin/ApplicationList/BaseApplicationList.d.ts +13 -0
  18. package/dist/components/admin/ApplicationList/BaseApplicationList.d.ts.map +1 -0
  19. package/dist/components/admin/GroupCreate/GroupCreate.d.ts.map +1 -1
  20. package/dist/components/admin/GroupList/GroupList.d.ts.map +1 -1
  21. package/dist/components/admin/GroupMembers/GroupMembers.d.ts.map +1 -1
  22. package/dist/components/admin/RoleAssignments/RoleAssignments.d.ts.map +1 -1
  23. package/dist/components/admin/RoleCreate/RoleCreate.d.ts.map +1 -1
  24. package/dist/components/admin/RoleList/RoleList.d.ts.map +1 -1
  25. package/dist/components/admin/RolePermissions/RolePermissions.d.ts.map +1 -1
  26. package/dist/components/admin/UserCreate/UserCreate.d.ts.map +1 -1
  27. package/dist/components/admin/UserDetails/UserDetails.d.ts.map +1 -1
  28. package/dist/components/admin/UserList/UserList.d.ts.map +1 -1
  29. package/dist/components/admin/shared/ClientSecretNotice.d.ts +7 -0
  30. package/dist/components/admin/shared/ClientSecretNotice.d.ts.map +1 -0
  31. package/dist/components/admin/shared/createAdminList.d.ts +2 -2
  32. package/dist/components/admin/shared/createAdminList.d.ts.map +1 -1
  33. package/dist/components/admin/shared/createConnectedAdminList.d.ts +1 -1
  34. package/dist/components/admin/shared/renderApplicationFields.d.ts +34 -0
  35. package/dist/components/admin/shared/renderApplicationFields.d.ts.map +1 -0
  36. package/dist/composables/management/useManagementEndpoint.d.ts +1 -1
  37. package/dist/composables/management/useManagementEndpoint.d.ts.map +1 -1
  38. package/dist/composables/management/useManagementRequestConfig.d.ts +21 -0
  39. package/dist/composables/management/useManagementRequestConfig.d.ts.map +1 -0
  40. package/dist/index.d.ts +15 -55
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +1807 -1708
  43. package/dist/models/contexts.d.ts +3 -3
  44. package/package.json +2 -2
  45. package/dist/composables/management/agents/useCreateAgent.d.ts +0 -11
  46. package/dist/composables/management/agents/useCreateAgent.d.ts.map +0 -1
  47. package/dist/composables/management/agents/useDeleteAgent.d.ts +0 -10
  48. package/dist/composables/management/agents/useDeleteAgent.d.ts.map +0 -1
  49. package/dist/composables/management/agents/useGetAgent.d.ts +0 -13
  50. package/dist/composables/management/agents/useGetAgent.d.ts.map +0 -1
  51. package/dist/composables/management/agents/useGetAgentGroups.d.ts +0 -18
  52. package/dist/composables/management/agents/useGetAgentGroups.d.ts.map +0 -1
  53. package/dist/composables/management/agents/useGetAgentRoles.d.ts +0 -19
  54. package/dist/composables/management/agents/useGetAgentRoles.d.ts.map +0 -1
  55. package/dist/composables/management/agents/useGetAgentTypes.d.ts +0 -16
  56. package/dist/composables/management/agents/useGetAgentTypes.d.ts.map +0 -1
  57. package/dist/composables/management/agents/useGetAgents.d.ts +0 -24
  58. package/dist/composables/management/agents/useGetAgents.d.ts.map +0 -1
  59. package/dist/composables/management/agents/useUpdateAgent.d.ts +0 -18
  60. package/dist/composables/management/agents/useUpdateAgent.d.ts.map +0 -1
  61. package/dist/composables/management/applications/useCreateApplication.d.ts +0 -11
  62. package/dist/composables/management/applications/useCreateApplication.d.ts.map +0 -1
  63. package/dist/composables/management/applications/useDeleteApplication.d.ts +0 -10
  64. package/dist/composables/management/applications/useDeleteApplication.d.ts.map +0 -1
  65. package/dist/composables/management/applications/useGetApplication.d.ts +0 -13
  66. package/dist/composables/management/applications/useGetApplication.d.ts.map +0 -1
  67. package/dist/composables/management/applications/useGetApplications.d.ts +0 -20
  68. package/dist/composables/management/applications/useGetApplications.d.ts.map +0 -1
  69. package/dist/composables/management/applications/useUpdateApplication.d.ts +0 -19
  70. package/dist/composables/management/applications/useUpdateApplication.d.ts.map +0 -1
  71. package/dist/composables/management/groups/useAddGroupMembers.d.ts +0 -25
  72. package/dist/composables/management/groups/useAddGroupMembers.d.ts.map +0 -1
  73. package/dist/composables/management/groups/useCreateGroup.d.ts +0 -11
  74. package/dist/composables/management/groups/useCreateGroup.d.ts.map +0 -1
  75. package/dist/composables/management/groups/useDeleteGroup.d.ts +0 -11
  76. package/dist/composables/management/groups/useDeleteGroup.d.ts.map +0 -1
  77. package/dist/composables/management/groups/useGetGroup.d.ts +0 -13
  78. package/dist/composables/management/groups/useGetGroup.d.ts.map +0 -1
  79. package/dist/composables/management/groups/useGetGroupMembers.d.ts +0 -22
  80. package/dist/composables/management/groups/useGetGroupMembers.d.ts.map +0 -1
  81. package/dist/composables/management/groups/useGetGroups.d.ts +0 -20
  82. package/dist/composables/management/groups/useGetGroups.d.ts.map +0 -1
  83. package/dist/composables/management/groups/useRemoveGroupMembers.d.ts +0 -13
  84. package/dist/composables/management/groups/useRemoveGroupMembers.d.ts.map +0 -1
  85. package/dist/composables/management/groups/useUpdateGroup.d.ts +0 -25
  86. package/dist/composables/management/groups/useUpdateGroup.d.ts.map +0 -1
  87. package/dist/composables/management/roles/useAddRoleAssignments.d.ts +0 -25
  88. package/dist/composables/management/roles/useAddRoleAssignments.d.ts.map +0 -1
  89. package/dist/composables/management/roles/useCreateRole.d.ts +0 -11
  90. package/dist/composables/management/roles/useCreateRole.d.ts.map +0 -1
  91. package/dist/composables/management/roles/useDeleteRole.d.ts +0 -10
  92. package/dist/composables/management/roles/useDeleteRole.d.ts.map +0 -1
  93. package/dist/composables/management/roles/useGetRole.d.ts +0 -13
  94. package/dist/composables/management/roles/useGetRole.d.ts.map +0 -1
  95. package/dist/composables/management/roles/useGetRoleAssignments.d.ts +0 -26
  96. package/dist/composables/management/roles/useGetRoleAssignments.d.ts.map +0 -1
  97. package/dist/composables/management/roles/useGetRoles.d.ts +0 -20
  98. package/dist/composables/management/roles/useGetRoles.d.ts.map +0 -1
  99. package/dist/composables/management/roles/useRemoveRoleAssignments.d.ts +0 -12
  100. package/dist/composables/management/roles/useRemoveRoleAssignments.d.ts.map +0 -1
  101. package/dist/composables/management/roles/useUpdateRole.d.ts +0 -25
  102. package/dist/composables/management/roles/useUpdateRole.d.ts.map +0 -1
  103. package/dist/composables/management/users/useCreateUser.d.ts +0 -11
  104. package/dist/composables/management/users/useCreateUser.d.ts.map +0 -1
  105. package/dist/composables/management/users/useDeleteUser.d.ts +0 -10
  106. package/dist/composables/management/users/useDeleteUser.d.ts.map +0 -1
  107. package/dist/composables/management/users/useGetUser.d.ts +0 -13
  108. package/dist/composables/management/users/useGetUser.d.ts.map +0 -1
  109. package/dist/composables/management/users/useGetUserGroups.d.ts +0 -18
  110. package/dist/composables/management/users/useGetUserGroups.d.ts.map +0 -1
  111. package/dist/composables/management/users/useGetUserTypes.d.ts +0 -16
  112. package/dist/composables/management/users/useGetUserTypes.d.ts.map +0 -1
  113. package/dist/composables/management/users/useGetUsers.d.ts +0 -18
  114. package/dist/composables/management/users/useGetUsers.d.ts.map +0 -1
  115. package/dist/composables/management/users/useUpdateUser.d.ts +0 -18
  116. package/dist/composables/management/users/useUpdateUser.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AgentQueryKeys, AgentQueryKeys as AgentQueryKeys$1, ApplicationQueryKeys, ApplicationQueryKeys as ApplicationQueryKeys$1, AuthFlowSelectConstants, ConsentConstants, CredentialConstants, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, GroupQueryKeys, GroupQueryKeys as GroupQueryKeys$1, RoleQueryKeys, RoleQueryKeys as RoleQueryKeys$1, SPAUtils, SelectConstants, ThunderIDAPIError, ThunderIDAPIError as ThunderIDAPIError$1, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, ThunderIDWordmark, TranslationBundleConstants, UserQueryKeys, UserQueryKeys as UserQueryKeys$1, UserSelectConstants, UserTypeSelectConstants, addGroupMembers, addGroupMembers as addGroupMembers$1, addRoleAssignments, addRoleAssignments as addRoleAssignments$1, arrayBufferToBase64url, base64urlToArrayBuffer, bem, copyTextToClipboard, createAgent, createAgent as createAgent$1, createApplication, createApplication as createApplication$1, createClassObserver, createClassObserver as createClassObserver$1, createGroup, createGroup as createGroup$1, createHttpClientFetcher, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createResourceInvalidator, createResourceInvalidator as createResourceInvalidator$1, createResourceOptionsLoader, createRole, createRole as createRole$1, createTheme, createUser, createUser as createUser$1, deepMerge, deleteAgent, deleteAgent as deleteAgent$1, deleteApplication, deleteApplication as deleteApplication$1, deleteGroup, deleteGroup as deleteGroup$1, deleteRole, deleteRole as deleteRole$1, deleteUser, deleteUser as deleteUser$1, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, fallbackResourceInvalidator, generateFlattenedUserProfile, get, getActiveTheme, getAgent, getAgent as getAgent$1, getAgentGroups, getAgentGroups as getAgentGroups$1, getAgentRoles, getAgentRoles as getAgentRoles$1, getAgentTypes, getAgentTypes as getAgentTypes$1, getAgents, getAgents as getAgents$1, getApplication, getApplication as getApplication$1, getApplications, getApplications as getApplications$1, getDefaultI18nBundles, getFlowMeta, getFlows, getGroup, getGroup as getGroup$1, getGroupMembers, getGroupMembers as getGroupMembers$1, getGroups, getGroups as getGroups$1, getRole, getRole as getRole$1, getRoleAssignments, getRoleAssignments as getRoleAssignments$1, getRoles, getRoles as getRoles$1, getSelectMessages, getTokenPermissions, getTokenPermissions as getTokenPermissions$1, getUser, getUser as getUser$1, getUserGroups, getUserGroups as getUserGroups$1, getUserTypes, getUsers, getUsers as getUsers$1, getUsersMe, getUsersMeMeta, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasPermission, hasPermission as hasPermission$1, hasUnresolvedTranslationParams, http, isEmojiUri, isEmpty, loadUntilOptionsGrow, mapCredentialUpdateError, mergeOptionsBatch, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeSelectOptions, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, removeGroupMembers, removeGroupMembers as removeGroupMembers$1, removeRoleAssignments, removeRoleAssignments as removeRoleAssignments$1, resolveChangeCredentialPolicy, resolveFlowTemplateLiterals, resolveLogoUri, resolveManagedIdentityName, resolvePageSize, resolveResourceEndpoint, startCase, substituteTranslationParams, supportsCredential, toAuthFlowSelectPage, toEqualityFilter, toError, toManagementErrorMessage, toUserSelectPage, toUserTypeSelectPage, updateAgent, updateAgent as updateAgent$1, updateApplication, updateApplication as updateApplication$1, updateGroup, updateGroup as updateGroup$1, updateMeCredentials, updateMeProfile, updateRole, updateRole as updateRole$1, updateUser, updateUser as updateUser$1, withVendorCSSClassPrefix } from "@thunderid/browser";
1
+ import { ADMINISTRATION_FLOW_TYPE, APPLICATION_GRANT_TYPES, AdministrationFlowConfigKey, AdministrationFlowData, AdministrationFlowError, AdministrationFlowInput, AdministrationModes, AgentQueryKeys, AgentQueryKeys as AgentQueryKeys$1, ApplicationQueryKeys, ApplicationQueryKeys as ApplicationQueryKeys$1, AuthFlowSelectConstants, ConsentConstants, CredentialConstants, DEFAULT_APPLICATION_GRANT_TYPES, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, GroupQueryKeys, GroupQueryKeys as GroupQueryKeys$1, RoleQueryKeys, RoleQueryKeys as RoleQueryKeys$1, SPAUtils, SelectConstants, ThunderIDAPIError, ThunderIDAPIError as ThunderIDAPIError$1, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, ThunderIDWordmark, TranslationBundleConstants, UserQueryKeys, UserQueryKeys as UserQueryKeys$1, UserSelectConstants, UserTypeSelectConstants, addGroupMembers, addGroupMembers as addGroupMembers$1, addRoleAssignments, addRoleAssignments as addRoleAssignments$1, applyGatewayConfiguration, arrayBufferToBase64url, base64urlToArrayBuffer, bem, copyTextToClipboard, createAction, createAgent, createAgent as createAgent$1, createAgentType, createApplication, createApplication as createApplication$1, createApplicationSharingPolicy, createClassObserver, createClassObserver as createClassObserver$1, createConfigurationVersion, createConnection, createDesignTheme, createFlow, createGateway, createGatewaySecret, createGatewayVariable, createGroup, createGroup as createGroup$1, createHttpClientFetcher, createLayout, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createNotificationTemplate, createOrganizationUnit, createPackageComponentLogger, createPackageLogger, createResource, createResourceInvalidator, createResourceInvalidator as createResourceInvalidator$1, createResourceOptionsLoader, createResourceServer, createRole, createRole as createRole$1, createSecret, createTheme, createUser, createUser as createUser$1, createUserByPath, createUserSharingPolicy, createUserType, createVariable, deepMerge, deleteAction, deleteAgent, deleteAgent as deleteAgent$1, deleteAgentType, deleteApplication, deleteApplication as deleteApplication$1, deleteApplicationSharingPolicy, deleteConnection, deleteDesignTheme, deleteFlow, deleteGateway, deleteGatewaySecret, deleteGatewayVariable, deleteGroup, deleteImportedConfiguration, deleteLayout, deleteNotificationTemplate, deleteOrganizationUnit, deleteOrganizationUnitByPath, deleteResource, deleteResourceServer, deleteRole, deleteSecret, deleteTranslation, deleteTranslations, deleteUser, deleteUser as deleteUser$1, deleteUserSharingPolicy, deleteUserType, deleteVariable, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeAdministrationFlow, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, exportConfiguration, extractEmojiFromUri, extractUserClaimsFromIdToken, fallbackResourceInvalidator, findAdministrationFlows, generateFlattenedUserProfile, get, getAction, getActions, getActiveTheme, getAgent, getAgent as getAgent$1, getAgentGroups, getAgentGroups as getAgentGroups$1, getAgentRoles, getAgentRoles as getAgentRoles$1, getAgentType, getAgentTypes, getAgentTypes as getAgentTypes$1, getAgents, getAgents as getAgents$1, getApplication, getApplication as getApplication$1, getApplicationClientSecret, getApplicationOAuthConfig, getApplicationOverlayRules, getApplicationSharingPolicies, getApplicationSharingPolicy, getApplications, getApplications as getApplications$1, getConfigurationVersion, getConfigurationVersions, getConnection, getConnectionUsages, getConnections, getConnectionsMeta, getDefaultI18nBundles, getDesignTheme, getDesignThemeUsages, getDesignThemes, getFlow, getFlowMeta, getFlowUsages, getFlowVersion, getFlowVersions, getFlows, getFlows as getFlows$1, getGateway, getGatewayAppliedConfiguration, getGatewayAppliedVersion, getGatewayConfigurationDiff, getGatewaySecret, getGatewaySecrets, getGatewayVariable, getGatewayVariables, getGateways, getGroup, getGroupMembers, getGroupMembers as getGroupMembers$1, getGroups, getGroups as getGroups$1, getLanguages, getLayout, getLayoutUsages, getLayouts, getNotificationTemplate, getNotificationTemplates, getOrganizationUnit, getOrganizationUnitByPath, getOrganizationUnitChildren, getOrganizationUnitGroups, getOrganizationUnitRoles, getOrganizationUnitUsers, getOrganizationUnits, getResource, getResourceServer, getResourceServers, getResources, getRole, getRole as getRole$1, getRoleAssignments, getRoleAssignments as getRoleAssignments$1, getRoles, getRoles as getRoles$1, getSecret, getSecrets, getSelectMessages, getServerConfig, getServerConfigs, getTokenPermissions, getTokenPermissions as getTokenPermissions$1, getUser, getUser as getUser$1, getUserGroups, getUserGroups as getUserGroups$1, getUserOverlayRules, getUserSharingPolicies, getUserSharingPolicy, getUserType, getUserTypes, getUserTypes as getUserTypes$1, getUserUsages, getUsers, getUsers as getUsers$1, getUsersByPath, getUsersMe, getUsersMeMeta, getVariable, getVariables, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasPermission, hasPermission as hasPermission$1, hasUnresolvedTranslationParams, http, importConfiguration, isApplicationSubmissionValid, isEmojiUri, isEmpty, loadUntilOptionsGrow, mapCredentialUpdateError, mergeOptionsBatch, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeSelectOptions, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, parseRedirectUris, previewCimdDocument, regenerateAgentSecret, regenerateClientSecret, regenerateClientSecret as regenerateClientSecret$1, regenerateFlowSecret, removeGroupMembers, removeGroupMembers as removeGroupMembers$1, removeRoleAssignments, removeRoleAssignments as removeRoleAssignments$1, resolveAdministrationFlowHandles, resolveAdministrationFlowId, resolveAdministrationFlows, resolveChangeCredentialPolicy, resolveDesign, resolveFlowTemplateLiterals, resolveLogoUri, resolveManagedIdentityName, resolvePageSize, resolveResourceEndpoint, resolveTranslation, resolveTranslations, restoreFlowVersion, revertGatewayConfiguration, runAdministrationFlow, setTranslation, setTranslations, startCase, substituteTranslationParams, supportsCredential, suspendAgent, suspendApplication, suspendUser, toAuthFlowSelectPage, toCreateApplicationRequest, toEqualityFilter, toError, toManagementErrorMessage, toUpdateApplicationRequest, toUserSelectPage, toUserTypeSelectPage, unlockAgent, unlockUser, unsuspendAgent, unsuspendApplication, unsuspendUser, updateAction, updateAgent, updateAgentType, updateApplication, updateApplication as updateApplication$1, updateApplicationSharingPolicy, updateConnection, updateDesignTheme, updateFlow, updateGateway, updateGatewaySecret, updateGatewayVariable, updateGroup, updateLayout, updateMeCredentials, updateMeProfile, updateNotificationTemplate, updateOrganizationUnit, updateOrganizationUnitByPath, updateResource, updateResourceServer, updateRole, updateSecret, updateServerConfig, updateUser, updateUser as updateUser$1, updateUserCredentials, updateUserSharingPolicy, updateUserType, updateVariable, withVendorCSSClassPrefix } from "@thunderid/browser";
2
2
  import { Comment, Fragment, Teleport, computed, defineComponent, getCurrentInstance, getCurrentScope, h, inject, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, toValue, useId, watch } from "vue";
3
3
  import DOMPurify from "dompurify";
4
4
 
@@ -4466,6 +4466,27 @@ function useOAuthCallback({ currentFlowId, flowIdStorageKey = "thunderid_flow_id
4466
4466
  }, { immediate: true });
4467
4467
  }
4468
4468
 
4469
+ //#endregion
4470
+ //#region src/composables/auth/useFetchAuthFlows.ts
4471
+ /**
4472
+ * A `FetchAuthFlows` backed by the flow list, restricted to authentication flows and authenticated with
4473
+ * the signed-in user's access token.
4474
+ */
4475
+ const useFetchAuthFlows = () => {
4476
+ const { baseUrl, endpoints, instanceId } = useThunderID_default();
4477
+ const flowsUrl = resolveResourceEndpoint("flows", { endpoints });
4478
+ return async ({ limit, offset, signal }) => toAuthFlowSelectPage(await getFlows$1({
4479
+ baseUrl,
4480
+ fetcher: createHttpClientFetcher(instanceId),
4481
+ flowType: AuthFlowSelectConstants.FLOW_TYPE,
4482
+ limit: Math.min(limit, SelectConstants.MAX_PAGE_SIZE),
4483
+ offset,
4484
+ signal,
4485
+ url: flowsUrl
4486
+ }), offset);
4487
+ };
4488
+ var useFetchAuthFlows_default = useFetchAuthFlows;
4489
+
4469
4490
  //#endregion
4470
4491
  //#region src/composables/management/useInfiniteOptions.ts
4471
4492
  const logger$4 = createPackageComponentLogger("@thunderid/vue", "useInfiniteOptions");
@@ -4611,34 +4632,13 @@ const useFetchUsers = () => {
4611
4632
  };
4612
4633
  var useFetchUsers_default = useFetchUsers;
4613
4634
 
4614
- //#endregion
4615
- //#region src/composables/auth/useFetchAuthFlows.ts
4616
- /**
4617
- * A `FetchAuthFlows` backed by the flow list, restricted to authentication flows and authenticated with
4618
- * the signed-in user's access token.
4619
- */
4620
- const useFetchAuthFlows = () => {
4621
- const { baseUrl, endpoints, instanceId } = useThunderID_default();
4622
- const flowsUrl = resolveResourceEndpoint("flows", { endpoints });
4623
- return async ({ limit, offset, signal }) => toAuthFlowSelectPage(await getFlows({
4624
- baseUrl,
4625
- fetcher: createHttpClientFetcher(instanceId),
4626
- flowType: AuthFlowSelectConstants.FLOW_TYPE,
4627
- limit: Math.min(limit, SelectConstants.MAX_PAGE_SIZE),
4628
- offset,
4629
- signal,
4630
- url: flowsUrl
4631
- }), offset);
4632
- };
4633
- var useFetchAuthFlows_default = useFetchAuthFlows;
4634
-
4635
4635
  //#endregion
4636
4636
  //#region src/composables/management/useFetchUserTypes.ts
4637
4637
  /** A `FetchUserTypes` backed by the user type list, authenticated with the signed-in user's access token. */
4638
4638
  const useFetchUserTypes = () => {
4639
4639
  const { baseUrl, endpoints, instanceId } = useThunderID_default();
4640
4640
  const userTypesUrl = resolveResourceEndpoint("userTypes", { endpoints });
4641
- return async ({ limit, offset, signal }) => toUserTypeSelectPage(await getUserTypes({
4641
+ return async ({ limit, offset, signal }) => toUserTypeSelectPage(await getUserTypes$1({
4642
4642
  baseUrl,
4643
4643
  fetcher: createHttpClientFetcher(instanceId),
4644
4644
  limit: Math.min(limit, SelectConstants.MAX_PAGE_SIZE),
@@ -4649,6 +4649,24 @@ const useFetchUserTypes = () => {
4649
4649
  };
4650
4650
  var useFetchUserTypes_default = useFetchUserTypes;
4651
4651
 
4652
+ //#endregion
4653
+ //#region src/composables/management/useManagementEndpoint.ts
4654
+ /**
4655
+ * Resolves where a management resource collection lives, honoring the provider's `endpoints`
4656
+ * override, or `{baseUrl}/{collection}` when none is set.
4657
+ *
4658
+ * @param key - The resource collection.
4659
+ * @returns The base URL and optional collection URL override.
4660
+ */
4661
+ const useManagementEndpoint = (key) => {
4662
+ const { baseUrl, endpoints } = useThunderID_default();
4663
+ return {
4664
+ baseUrl,
4665
+ url: resolveResourceEndpoint(key, { endpoints })
4666
+ };
4667
+ };
4668
+ var useManagementEndpoint_default = useManagementEndpoint;
4669
+
4652
4670
  //#endregion
4653
4671
  //#region src/composables/management/useResourceQuery.ts
4654
4672
  /**
@@ -4731,76 +4749,28 @@ const useResourceQuery = (queryKey, queryFn, { enabled, fetcher } = {}) => {
4731
4749
  var useResourceQuery_default = useResourceQuery;
4732
4750
 
4733
4751
  //#endregion
4734
- //#region src/composables/management/useResourceMutation.ts
4752
+ //#region src/composables/management/useManagementRequestConfig.ts
4735
4753
  /**
4736
- * Runs a management mutation and invalidates the queries whose data it changed. Depends on no data
4737
- * fetching library.
4754
+ * Returns the request config the SDK's management API functions take for a collection: the server URL,
4755
+ * the collection URL when `endpoints` overrides it, and a fetcher that sends the signed-in user's access
4756
+ * token (`ThunderIDProvider`'s `http.fetcher` when set).
4738
4757
  *
4739
- * @param mutationFn - Performs the request with the resolved fetcher.
4740
- * @param getInvalidatedKeys - Returns the query key prefixes to invalidate after a success.
4741
- * @param options - Mutation options.
4742
- * @returns The mutation state.
4743
- */
4744
- const useResourceMutation = (mutationFn, getInvalidatedKeys, { fetcher, onError, onSuccess } = {}) => {
4745
- const context = useThunderID_default();
4746
- const invalidator = resolveInvalidator(context);
4747
- const resolvedFetcher = resolveManagementFetcher(context, fetcher);
4748
- const data = shallowRef(void 0);
4749
- const error = shallowRef(null);
4750
- const isLoading = ref(false);
4751
- const mutateAsync = async (variables) => {
4752
- isLoading.value = true;
4753
- error.value = null;
4754
- try {
4755
- const result = await mutationFn(variables, resolvedFetcher);
4756
- data.value = result;
4757
- getInvalidatedKeys(variables).forEach((key) => {
4758
- invalidator.invalidate(key);
4759
- });
4760
- onSuccess?.(result, variables);
4761
- return result;
4762
- } catch (err) {
4763
- const mutationError = err instanceof Error ? err : new Error(String(err));
4764
- error.value = mutationError;
4765
- onError?.(mutationError, variables);
4766
- throw mutationError;
4767
- } finally {
4768
- isLoading.value = false;
4769
- }
4770
- };
4771
- const mutate = (variables) => mutateAsync(variables).catch(() => void 0);
4772
- const reset = () => {
4773
- data.value = void 0;
4774
- error.value = null;
4775
- };
4776
- return {
4777
- data: readonly(data),
4778
- error: readonly(error),
4779
- isLoading: readonly(isLoading),
4780
- mutate,
4781
- mutateAsync,
4782
- reset
4783
- };
4784
- };
4785
- var useResourceMutation_default = useResourceMutation;
4786
-
4787
- //#endregion
4788
- //#region src/composables/management/useManagementEndpoint.ts
4789
- /**
4790
- * Resolves where a management resource collection lives, honoring the provider's `endpoints`
4791
- * override, or `{baseUrl}/{collection}` when none is set.
4758
+ * Use it to call the API functions from an app's own data layer, such as TanStack Query:
4792
4759
  *
4793
- * @param key - The resource collection.
4794
- * @returns The base URL and optional collection URL override.
4760
+ * @example
4761
+ * ```ts
4762
+ * const config = useManagementRequestConfig('groups');
4763
+ * const groups = useQuery({
4764
+ * queryKey: [GroupQueryKeys.GROUPS, {limit, offset}],
4765
+ * queryFn: () => getGroups({...config, limit, offset}),
4766
+ * });
4767
+ * ```
4795
4768
  */
4796
- const useManagementEndpoint = (key) => {
4797
- const { baseUrl, endpoints } = useThunderID_default();
4798
- return {
4799
- baseUrl,
4800
- url: resolveResourceEndpoint(key, { endpoints })
4801
- };
4802
- };
4803
- var useManagementEndpoint_default = useManagementEndpoint;
4769
+ const useManagementRequestConfig = (collection) => ({
4770
+ ...useManagementEndpoint_default(collection),
4771
+ fetcher: resolveManagementFetcher(useThunderID_default())
4772
+ });
4773
+ var useManagementRequestConfig_default = useManagementRequestConfig;
4804
4774
 
4805
4775
  //#endregion
4806
4776
  //#region src/composables/management/useGrantedPermissions.ts
@@ -4851,999 +4821,99 @@ const useGrantedPermissions = () => {
4851
4821
  var useGrantedPermissions_default = useGrantedPermissions;
4852
4822
 
4853
4823
  //#endregion
4854
- //#region src/composables/management/users/useGetUsers.ts
4855
- /**
4856
- * Fetches a page of users.
4857
- *
4858
- * @param params - Pagination and filter parameters. A ref or getter refetches when it changes.
4859
- * @param options - Query options, including a per-composable `fetcher`.
4860
- * @returns The query state.
4861
- *
4862
- * @example
4863
- * ```ts
4864
- * const {data, isLoading} = useGetUsers({limit: 20, filter: 'username sw "a"'});
4865
- * ```
4866
- */
4867
- const useGetUsers = (params = {}, options) => {
4868
- const endpoint = useManagementEndpoint_default("users");
4869
- return useResourceQuery_default(() => {
4870
- const { filter, limit, offset } = toValue(params);
4871
- return [UserQueryKeys$1.USERS, {
4872
- filter,
4873
- limit,
4874
- offset
4875
- }];
4876
- }, (fetcher) => {
4877
- const { filter, limit, offset } = toValue(params);
4878
- return getUsers$1({
4879
- ...endpoint,
4880
- fetcher,
4881
- filter,
4882
- limit,
4883
- offset
4884
- });
4885
- }, options);
4886
- };
4887
- var useGetUsers_default = useGetUsers;
4888
-
4889
- //#endregion
4890
- //#region src/composables/management/users/useGetUser.ts
4891
- /**
4892
- * Fetches a single user. Does nothing until `userId` is set.
4893
- *
4894
- * @param userId - Identifier of the resource. A ref or getter refetches when it changes.
4895
- * @param options - Query options, including a per-composable `fetcher`.
4896
- * @returns The query state.
4897
- */
4898
- const useGetUser = (userId, options) => {
4899
- const endpoint = useManagementEndpoint_default("users");
4900
- return useResourceQuery_default(() => [UserQueryKeys$1.USER, toValue(userId)], (fetcher) => getUser$1({
4901
- ...endpoint,
4902
- fetcher,
4903
- userId: toValue(userId)
4904
- }), {
4905
- ...options,
4906
- enabled: () => Boolean(toValue(userId)) && toValue(options?.enabled) !== false
4907
- });
4908
- };
4909
- var useGetUser_default = useGetUser;
4910
-
4911
- //#endregion
4912
- //#region src/composables/management/users/useCreateUser.ts
4913
- /**
4914
- * Creates a user, then refetches any mounted user lists. Call `mutate(payload)` to create.
4915
- *
4916
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
4917
- * @returns The mutation state.
4918
- */
4919
- const useCreateUser = (options) => {
4920
- const endpoint = useManagementEndpoint_default("users");
4921
- return useResourceMutation_default((payload, fetcher) => createUser$1({
4922
- ...endpoint,
4923
- fetcher,
4924
- payload
4925
- }), () => [[UserQueryKeys$1.USERS]], options);
4926
- };
4927
- var useCreateUser_default = useCreateUser;
4824
+ //#region src/components/primitives/Button/Button.ts
4825
+ const Button = defineComponent({
4826
+ name: "Button",
4827
+ props: {
4828
+ color: {
4829
+ default: "primary",
4830
+ type: String
4831
+ },
4832
+ disabled: {
4833
+ default: false,
4834
+ type: Boolean
4835
+ },
4836
+ endIcon: {
4837
+ default: void 0,
4838
+ type: Object
4839
+ },
4840
+ fullWidth: {
4841
+ default: false,
4842
+ type: Boolean
4843
+ },
4844
+ loading: {
4845
+ default: false,
4846
+ type: Boolean
4847
+ },
4848
+ size: {
4849
+ default: "medium",
4850
+ type: String
4851
+ },
4852
+ startIcon: {
4853
+ default: void 0,
4854
+ type: Object
4855
+ },
4856
+ type: {
4857
+ default: "button",
4858
+ type: String
4859
+ },
4860
+ variant: {
4861
+ default: "solid",
4862
+ type: String
4863
+ }
4864
+ },
4865
+ emits: ["click"],
4866
+ setup(props, { slots, emit, attrs }) {
4867
+ return () => {
4868
+ return h("button", {
4869
+ class: [
4870
+ withVendorCSSClassPrefix("button"),
4871
+ withVendorCSSClassPrefix(`button--${props.variant}`),
4872
+ withVendorCSSClassPrefix(`button--${props.color}`),
4873
+ withVendorCSSClassPrefix(`button--${props.size}`),
4874
+ props.fullWidth ? withVendorCSSClassPrefix("button--full-width") : "",
4875
+ props.loading ? withVendorCSSClassPrefix("button--loading") : "",
4876
+ attrs.class || ""
4877
+ ].filter(Boolean).join(" "),
4878
+ disabled: props.disabled || props.loading,
4879
+ id: attrs["id"],
4880
+ onClick: (e) => emit("click", e),
4881
+ style: attrs.style,
4882
+ type: props.type
4883
+ }, [
4884
+ props.startIcon ? h("span", { class: withVendorCSSClassPrefix("button__start-icon") }, [props.startIcon]) : null,
4885
+ h("span", { class: withVendorCSSClassPrefix("button__content") }, slots["default"]?.()),
4886
+ props.endIcon ? h("span", { class: withVendorCSSClassPrefix("button__end-icon") }, [props.endIcon]) : null,
4887
+ props.loading ? h("span", {
4888
+ "aria-hidden": "true",
4889
+ class: withVendorCSSClassPrefix("button__spinner")
4890
+ }) : null
4891
+ ]);
4892
+ };
4893
+ }
4894
+ });
4895
+ var Button_default = Button;
4928
4896
 
4929
4897
  //#endregion
4930
- //#region src/composables/management/users/useUpdateUser.ts
4931
- /**
4932
- * Updates a user, then refetches it and any mounted user lists. Call `mutate({userId, data})`.
4933
- *
4934
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
4935
- * @returns The mutation state.
4936
- */
4937
- const useUpdateUser = (options) => {
4938
- const endpoint = useManagementEndpoint_default("users");
4939
- return useResourceMutation_default(({ userId, data }, fetcher) => updateUser$1({
4940
- ...endpoint,
4941
- fetcher,
4942
- payload: data,
4943
- userId
4944
- }), ({ userId }) => [[UserQueryKeys$1.USER, userId], [UserQueryKeys$1.USERS]], options);
4945
- };
4946
- var useUpdateUser_default = useUpdateUser;
4947
-
4948
- //#endregion
4949
- //#region src/composables/management/users/useDeleteUser.ts
4950
- /**
4951
- * Deletes a user, then refetches any mounted user lists. Call `mutate(userId)` to delete.
4952
- *
4953
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
4954
- * @returns The mutation state.
4955
- */
4956
- const useDeleteUser = (options) => {
4957
- const endpoint = useManagementEndpoint_default("users");
4958
- return useResourceMutation_default((userId, fetcher) => deleteUser$1({
4959
- ...endpoint,
4960
- fetcher,
4961
- userId
4962
- }), () => [[UserQueryKeys$1.USERS]], options);
4963
- };
4964
- var useDeleteUser_default = useDeleteUser;
4965
-
4966
- //#endregion
4967
- //#region src/composables/management/users/useGetUserGroups.ts
4968
- /**
4969
- * Fetches a page of the groups a user belongs to.
4970
- *
4971
- * @param userId - Identifier of the parent resource. Fetching waits until it is defined. A ref or
4972
- * getter refetches when it changes.
4973
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
4974
- * @param options - Query options, including a per-composable `fetcher`.
4975
- * @returns The query state.
4976
- */
4977
- const useGetUserGroups = (userId, params = {}, options) => {
4978
- const endpoint = useManagementEndpoint_default("users");
4979
- return useResourceQuery_default(() => {
4980
- const { limit, offset } = toValue(params);
4981
- return [
4982
- GroupQueryKeys$1.MEMBERSHIPS,
4983
- "user",
4984
- toValue(userId),
4985
- {
4986
- limit,
4987
- offset
4988
- }
4989
- ];
4990
- }, (fetcher) => {
4991
- const { limit, offset } = toValue(params);
4992
- return getUserGroups$1({
4993
- ...endpoint,
4994
- fetcher,
4995
- limit,
4996
- offset,
4997
- userId: toValue(userId)
4998
- });
4999
- }, {
5000
- ...options,
5001
- enabled: () => Boolean(toValue(userId)) && toValue(options?.enabled) !== false
5002
- });
5003
- };
5004
- var useGetUserGroups_default = useGetUserGroups;
5005
-
5006
- //#endregion
5007
- //#region src/composables/management/users/useGetUserTypes.ts
5008
- /**
5009
- * Fetches a page of user types.
5010
- *
5011
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5012
- * @param options - Query options, including a per-composable `fetcher`.
5013
- * @returns The query state.
5014
- */
5015
- const useGetUserTypes = (params = {}, options) => {
5016
- const endpoint = useManagementEndpoint_default("userTypes");
5017
- return useResourceQuery_default(() => {
5018
- const { limit, offset } = toValue(params);
5019
- return [UserQueryKeys$1.USER_TYPES, {
5020
- limit,
5021
- offset
5022
- }];
5023
- }, (fetcher) => {
5024
- const { limit, offset } = toValue(params);
5025
- return getUserTypes({
5026
- ...endpoint,
5027
- fetcher,
5028
- limit,
5029
- offset
5030
- });
5031
- }, options);
5032
- };
5033
- var useGetUserTypes_default = useGetUserTypes;
5034
-
5035
- //#endregion
5036
- //#region src/composables/management/groups/useGetGroups.ts
5037
- /**
5038
- * Fetches a page of groups.
5039
- *
5040
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5041
- * @param options - Query options, including a per-composable `fetcher`.
5042
- * @returns The query state.
5043
- */
5044
- const useGetGroups = (params = {}, options) => {
5045
- const endpoint = useManagementEndpoint_default("groups");
5046
- return useResourceQuery_default(() => {
5047
- const { limit, offset } = toValue(params);
5048
- return [GroupQueryKeys$1.GROUPS, {
5049
- limit,
5050
- offset
5051
- }];
5052
- }, (fetcher) => {
5053
- const { limit, offset } = toValue(params);
5054
- return getGroups$1({
5055
- ...endpoint,
5056
- fetcher,
5057
- limit,
5058
- offset
5059
- });
5060
- }, options);
5061
- };
5062
- var useGetGroups_default = useGetGroups;
5063
-
5064
- //#endregion
5065
- //#region src/composables/management/groups/useGetGroup.ts
5066
- /**
5067
- * Fetches a group. Does nothing until `groupId` is set.
5068
- *
5069
- * @param groupId - Identifier of the resource. A ref or getter refetches when it changes.
5070
- * @param options - Query options, including a per-composable `fetcher`.
5071
- * @returns The query state.
5072
- */
5073
- const useGetGroup = (groupId, options) => {
5074
- const endpoint = useManagementEndpoint_default("groups");
5075
- return useResourceQuery_default(() => [GroupQueryKeys$1.GROUP, toValue(groupId)], (fetcher) => getGroup$1({
5076
- ...endpoint,
5077
- fetcher,
5078
- groupId: toValue(groupId)
5079
- }), {
5080
- ...options,
5081
- enabled: () => Boolean(toValue(groupId)) && toValue(options?.enabled) !== false
5082
- });
5083
- };
5084
- var useGetGroup_default = useGetGroup;
5085
-
5086
- //#endregion
5087
- //#region src/composables/management/groups/useCreateGroup.ts
5088
- /**
5089
- * Creates a group, then refetches any mounted group lists and membership lists. Call `mutate(payload)`.
5090
- *
5091
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5092
- * @returns The mutation state.
5093
- */
5094
- const useCreateGroup = (options) => {
5095
- const endpoint = useManagementEndpoint_default("groups");
5096
- return useResourceMutation_default((payload, fetcher) => createGroup$1({
5097
- ...endpoint,
5098
- fetcher,
5099
- payload
5100
- }), () => [[GroupQueryKeys$1.GROUPS], [GroupQueryKeys$1.MEMBERSHIPS]], options);
5101
- };
5102
- var useCreateGroup_default = useCreateGroup;
5103
-
5104
- //#endregion
5105
- //#region src/composables/management/groups/useUpdateGroup.ts
5106
- /**
5107
- * Updates a group, then refetches the group, any mounted group lists and membership lists. Call
5108
- * `mutate({groupId, data})`.
5109
- *
5110
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5111
- * @returns The mutation state.
5112
- */
5113
- const useUpdateGroup = (options) => {
5114
- const endpoint = useManagementEndpoint_default("groups");
5115
- return useResourceMutation_default(({ groupId, data }, fetcher) => updateGroup$1({
5116
- ...endpoint,
5117
- fetcher,
5118
- groupId,
5119
- payload: data
5120
- }), ({ groupId }) => [
5121
- [GroupQueryKeys$1.GROUP, groupId],
5122
- [GroupQueryKeys$1.GROUPS],
5123
- [GroupQueryKeys$1.MEMBERSHIPS]
5124
- ], options);
5125
- };
5126
- var useUpdateGroup_default = useUpdateGroup;
5127
-
5128
- //#endregion
5129
- //#region src/composables/management/groups/useDeleteGroup.ts
5130
- /**
5131
- * Deletes a group, then refetches group lists, membership lists and role assignments, since members
5132
- * lose the roles the group carried. Call `mutate(groupId)`.
5133
- *
5134
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5135
- * @returns The mutation state.
5136
- */
5137
- const useDeleteGroup = (options) => {
5138
- const endpoint = useManagementEndpoint_default("groups");
5139
- return useResourceMutation_default((groupId, fetcher) => deleteGroup$1({
5140
- ...endpoint,
5141
- fetcher,
5142
- groupId
5143
- }), () => [
5144
- [GroupQueryKeys$1.GROUPS],
5145
- [GroupQueryKeys$1.MEMBERSHIPS],
5146
- [RoleQueryKeys$1.ROLE_ASSIGNMENTS]
5147
- ], options);
5148
- };
5149
- var useDeleteGroup_default = useDeleteGroup;
5150
-
5151
- //#endregion
5152
- //#region src/composables/management/groups/useGetGroupMembers.ts
5153
- /**
5154
- * Fetches a page of the users, agents and groups in a group.
5155
- *
5156
- * @param groupId - Identifier of the parent resource. Fetching waits until it is defined. A ref or
5157
- * getter refetches when it changes.
5158
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5159
- * @param options - Query options, including a per-composable `fetcher`.
5160
- * @returns The query state.
5161
- */
5162
- const useGetGroupMembers = (groupId, params = {}, options) => {
5163
- const endpoint = useManagementEndpoint_default("groups");
5164
- return useResourceQuery_default(() => {
5165
- const { limit, offset } = toValue(params);
5166
- return [
5167
- GroupQueryKeys$1.GROUP_MEMBERS,
5168
- toValue(groupId),
5169
- {
5170
- limit,
5171
- offset
5172
- }
5173
- ];
5174
- }, (fetcher) => {
5175
- const { limit, offset } = toValue(params);
5176
- return getGroupMembers$1({
5177
- ...endpoint,
5178
- fetcher,
5179
- limit,
5180
- offset,
5181
- groupId: toValue(groupId)
5182
- });
5183
- }, {
5184
- ...options,
5185
- enabled: () => Boolean(toValue(groupId)) && toValue(options?.enabled) !== false
5186
- });
5187
- };
5188
- var useGetGroupMembers_default = useGetGroupMembers;
5189
-
5190
- //#endregion
5191
- //#region src/composables/management/groups/useAddGroupMembers.ts
5192
- /**
5193
- * Adds users, agents or groups to a group, then refetches the group, its members, membership lists and
5194
- * role assignments, since membership changes the roles a member inherits. Call `mutate({groupId, members})`.
5195
- *
5196
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5197
- * @returns The mutation state.
5198
- */
5199
- const useAddGroupMembers = (options) => {
5200
- const endpoint = useManagementEndpoint_default("groups");
5201
- return useResourceMutation_default(({ groupId, members }, fetcher) => addGroupMembers$1({
5202
- ...endpoint,
5203
- fetcher,
5204
- groupId,
5205
- members
5206
- }), ({ groupId }) => [
5207
- [GroupQueryKeys$1.GROUP, groupId],
5208
- [GroupQueryKeys$1.GROUP_MEMBERS, groupId],
5209
- [GroupQueryKeys$1.MEMBERSHIPS],
5210
- [RoleQueryKeys$1.ROLE_ASSIGNMENTS]
5211
- ], options);
5212
- };
5213
- var useAddGroupMembers_default = useAddGroupMembers;
5214
-
5215
- //#endregion
5216
- //#region src/composables/management/groups/useRemoveGroupMembers.ts
5217
- /**
5218
- * Removes users, agents or groups from a group, then refetches the group, its members, membership lists
5219
- * and role assignments. Call `mutate({groupId, members})`.
5220
- *
5221
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5222
- * @returns The mutation state.
5223
- */
5224
- const useRemoveGroupMembers = (options) => {
5225
- const endpoint = useManagementEndpoint_default("groups");
5226
- return useResourceMutation_default(({ groupId, members }, fetcher) => removeGroupMembers$1({
5227
- ...endpoint,
5228
- fetcher,
5229
- groupId,
5230
- members
5231
- }), ({ groupId }) => [
5232
- [GroupQueryKeys$1.GROUP, groupId],
5233
- [GroupQueryKeys$1.GROUP_MEMBERS, groupId],
5234
- [GroupQueryKeys$1.MEMBERSHIPS],
5235
- [RoleQueryKeys$1.ROLE_ASSIGNMENTS]
5236
- ], options);
5237
- };
5238
- var useRemoveGroupMembers_default = useRemoveGroupMembers;
5239
-
5240
- //#endregion
5241
- //#region src/composables/management/roles/useGetRoles.ts
5242
- /**
5243
- * Fetches a page of roles.
5244
- *
5245
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5246
- * @param options - Query options, including a per-composable `fetcher`.
5247
- * @returns The query state.
5248
- */
5249
- const useGetRoles = (params = {}, options) => {
5250
- const endpoint = useManagementEndpoint_default("roles");
5251
- return useResourceQuery_default(() => {
5252
- const { limit, offset } = toValue(params);
5253
- return [RoleQueryKeys$1.ROLES, {
5254
- limit,
5255
- offset
5256
- }];
5257
- }, (fetcher) => {
5258
- const { limit, offset } = toValue(params);
5259
- return getRoles$1({
5260
- ...endpoint,
5261
- fetcher,
5262
- limit,
5263
- offset
5264
- });
5265
- }, options);
5266
- };
5267
- var useGetRoles_default = useGetRoles;
5268
-
5269
- //#endregion
5270
- //#region src/composables/management/roles/useGetRole.ts
5271
- /**
5272
- * Fetches a role with the permissions it grants. Does nothing until `roleId` is set.
5273
- *
5274
- * @param roleId - Identifier of the resource. A ref or getter refetches when it changes.
5275
- * @param options - Query options, including a per-composable `fetcher`.
5276
- * @returns The query state.
5277
- */
5278
- const useGetRole = (roleId, options) => {
5279
- const endpoint = useManagementEndpoint_default("roles");
5280
- return useResourceQuery_default(() => [RoleQueryKeys$1.ROLE, toValue(roleId)], (fetcher) => getRole$1({
5281
- ...endpoint,
5282
- fetcher,
5283
- roleId: toValue(roleId)
5284
- }), {
5285
- ...options,
5286
- enabled: () => Boolean(toValue(roleId)) && toValue(options?.enabled) !== false
5287
- });
5288
- };
5289
- var useGetRole_default = useGetRole;
5290
-
5291
- //#endregion
5292
- //#region src/composables/management/roles/useCreateRole.ts
5293
- /**
5294
- * Creates a role, then refetches any mounted role lists and assignment lists. Call `mutate(payload)`.
5295
- *
5296
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5297
- * @returns The mutation state.
5298
- */
5299
- const useCreateRole = (options) => {
5300
- const endpoint = useManagementEndpoint_default("roles");
5301
- return useResourceMutation_default((payload, fetcher) => createRole$1({
5302
- ...endpoint,
5303
- fetcher,
5304
- payload
5305
- }), () => [[RoleQueryKeys$1.ROLES], [RoleQueryKeys$1.ROLE_ASSIGNMENTS]], options);
5306
- };
5307
- var useCreateRole_default = useCreateRole;
5308
-
5309
- //#endregion
5310
- //#region src/composables/management/roles/useUpdateRole.ts
5311
- /**
5312
- * Replaces a role's name, description and permissions, then refetches the role and any mounted role
5313
- * lists. Call `mutate({roleId, data})`.
5314
- *
5315
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5316
- * @returns The mutation state.
5317
- */
5318
- const useUpdateRole = (options) => {
5319
- const endpoint = useManagementEndpoint_default("roles");
5320
- return useResourceMutation_default(({ roleId, data }, fetcher) => updateRole$1({
5321
- ...endpoint,
5322
- fetcher,
5323
- payload: data,
5324
- roleId
5325
- }), ({ roleId }) => [[RoleQueryKeys$1.ROLE, roleId], [RoleQueryKeys$1.ROLES]], options);
5326
- };
5327
- var useUpdateRole_default = useUpdateRole;
5328
-
5329
- //#endregion
5330
- //#region src/composables/management/roles/useDeleteRole.ts
5331
- /**
5332
- * Deletes a role, then refetches any mounted role lists and assignment lists. Call `mutate(roleId)`.
5333
- *
5334
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5335
- * @returns The mutation state.
5336
- */
5337
- const useDeleteRole = (options) => {
5338
- const endpoint = useManagementEndpoint_default("roles");
5339
- return useResourceMutation_default((roleId, fetcher) => deleteRole$1({
5340
- ...endpoint,
5341
- fetcher,
5342
- roleId
5343
- }), () => [[RoleQueryKeys$1.ROLES], [RoleQueryKeys$1.ROLE_ASSIGNMENTS]], options);
5344
- };
5345
- var useDeleteRole_default = useDeleteRole;
5346
-
5347
- //#endregion
5348
- //#region src/composables/management/roles/useGetRoleAssignments.ts
5349
- /**
5350
- * Fetches a page of the users, groups, apps and agents a role is assigned to.
5351
- *
5352
- * @param roleId - Identifier of the parent resource. Fetching waits until it is defined. A ref or
5353
- * getter refetches when it changes.
5354
- * @param params - Pagination and assignee type parameters. A ref or getter refetches when it changes.
5355
- * @param options - Query options, including a per-composable `fetcher`.
5356
- * @returns The query state.
5357
- */
5358
- const useGetRoleAssignments = (roleId, params = {}, options) => {
5359
- const endpoint = useManagementEndpoint_default("roles");
5360
- return useResourceQuery_default(() => {
5361
- const { limit, offset, type } = toValue(params);
5362
- return [
5363
- RoleQueryKeys$1.ROLE_ASSIGNMENTS,
5364
- toValue(roleId),
5365
- {
5366
- limit,
5367
- offset,
5368
- type
5369
- }
5370
- ];
5371
- }, (fetcher) => {
5372
- const { limit, offset, type } = toValue(params);
5373
- return getRoleAssignments$1({
5374
- ...endpoint,
5375
- fetcher,
5376
- limit,
5377
- offset,
5378
- type,
5379
- roleId: toValue(roleId)
5380
- });
5381
- }, {
5382
- ...options,
5383
- enabled: () => Boolean(toValue(roleId)) && toValue(options?.enabled) !== false
5384
- });
5385
- };
5386
- var useGetRoleAssignments_default = useGetRoleAssignments;
5387
-
5388
- //#endregion
5389
- //#region src/composables/management/roles/useAddRoleAssignments.ts
5390
- /**
5391
- * Assigns a role to users, groups, apps or agents, then refetches every mounted assignment list,
5392
- * including the roles listed for an agent. Call `mutate({roleId, assignments})`.
5393
- *
5394
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5395
- * @returns The mutation state.
5396
- */
5397
- const useAddRoleAssignments = (options) => {
5398
- const endpoint = useManagementEndpoint_default("roles");
5399
- return useResourceMutation_default(({ roleId, assignments }, fetcher) => addRoleAssignments$1({
5400
- ...endpoint,
5401
- assignments,
5402
- fetcher,
5403
- roleId
5404
- }), () => [[RoleQueryKeys$1.ROLE_ASSIGNMENTS]], options);
5405
- };
5406
- var useAddRoleAssignments_default = useAddRoleAssignments;
5407
-
5408
- //#endregion
5409
- //#region src/composables/management/roles/useRemoveRoleAssignments.ts
5410
- /**
5411
- * Removes a role from users, groups, apps or agents, then refetches every mounted assignment list.
5412
- * Call `mutate({roleId, assignments})`.
5413
- *
5414
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5415
- * @returns The mutation state.
5416
- */
5417
- const useRemoveRoleAssignments = (options) => {
5418
- const endpoint = useManagementEndpoint_default("roles");
5419
- return useResourceMutation_default(({ roleId, assignments }, fetcher) => removeRoleAssignments$1({
5420
- ...endpoint,
5421
- assignments,
5422
- fetcher,
5423
- roleId
5424
- }), () => [[RoleQueryKeys$1.ROLE_ASSIGNMENTS]], options);
5425
- };
5426
- var useRemoveRoleAssignments_default = useRemoveRoleAssignments;
5427
-
5428
- //#endregion
5429
- //#region src/composables/management/agents/useGetAgents.ts
5430
- /**
5431
- * Fetches a page of agents.
5432
- *
5433
- * @param params - Pagination and filter parameters. A ref or getter refetches when it changes.
5434
- * @param options - Query options, including a per-composable `fetcher`.
5435
- * @returns The query state.
5436
- */
5437
- const useGetAgents = (params = {}, options) => {
5438
- const endpoint = useManagementEndpoint_default("agents");
5439
- return useResourceQuery_default(() => {
5440
- const { filter, limit, offset } = toValue(params);
5441
- return [AgentQueryKeys$1.AGENTS, {
5442
- filter,
5443
- limit,
5444
- offset
5445
- }];
5446
- }, (fetcher) => {
5447
- const { filter, limit, offset } = toValue(params);
5448
- return getAgents$1({
5449
- ...endpoint,
5450
- fetcher,
5451
- filter,
5452
- limit,
5453
- offset
5454
- });
5455
- }, options);
5456
- };
5457
- var useGetAgents_default = useGetAgents;
5458
-
5459
- //#endregion
5460
- //#region src/composables/management/agents/useGetAgent.ts
5461
- /**
5462
- * Fetches a single agent. Does nothing until `agentId` is set.
5463
- *
5464
- * @param agentId - Identifier of the resource. A ref or getter refetches when it changes.
5465
- * @param options - Query options, including a per-composable `fetcher`.
5466
- * @returns The query state.
5467
- */
5468
- const useGetAgent = (agentId, options) => {
5469
- const endpoint = useManagementEndpoint_default("agents");
5470
- return useResourceQuery_default(() => [AgentQueryKeys$1.AGENT, toValue(agentId)], (fetcher) => getAgent$1({
5471
- ...endpoint,
5472
- fetcher,
5473
- agentId: toValue(agentId)
5474
- }), {
5475
- ...options,
5476
- enabled: () => Boolean(toValue(agentId)) && toValue(options?.enabled) !== false
5477
- });
5478
- };
5479
- var useGetAgent_default = useGetAgent;
5480
-
5481
- //#endregion
5482
- //#region src/composables/management/agents/useCreateAgent.ts
5483
- /**
5484
- * Creates an agent, then refetches any mounted agent lists. Call `mutate(payload)`.
5485
- *
5486
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5487
- * @returns The mutation state.
5488
- */
5489
- const useCreateAgent = (options) => {
5490
- const endpoint = useManagementEndpoint_default("agents");
5491
- return useResourceMutation_default((payload, fetcher) => createAgent$1({
5492
- ...endpoint,
5493
- fetcher,
5494
- payload
5495
- }), () => [[AgentQueryKeys$1.AGENTS]], options);
5496
- };
5497
- var useCreateAgent_default = useCreateAgent;
5498
-
5499
- //#endregion
5500
- //#region src/composables/management/agents/useUpdateAgent.ts
5501
- /**
5502
- * Updates an agent, then refetches it and any mounted agent lists. Call `mutate({agentId, data})`.
5503
- *
5504
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5505
- * @returns The mutation state.
5506
- */
5507
- const useUpdateAgent = (options) => {
5508
- const endpoint = useManagementEndpoint_default("agents");
5509
- return useResourceMutation_default(({ agentId, data }, fetcher) => updateAgent$1({
5510
- ...endpoint,
5511
- agentId,
5512
- fetcher,
5513
- payload: data
5514
- }), ({ agentId }) => [[AgentQueryKeys$1.AGENT, agentId], [AgentQueryKeys$1.AGENTS]], options);
5515
- };
5516
- var useUpdateAgent_default = useUpdateAgent;
5517
-
5518
- //#endregion
5519
- //#region src/composables/management/agents/useDeleteAgent.ts
5520
- /**
5521
- * Deletes an agent, then refetches any mounted agent lists. Call `mutate(agentId)` to delete.
5522
- *
5523
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5524
- * @returns The mutation state.
5525
- */
5526
- const useDeleteAgent = (options) => {
5527
- const endpoint = useManagementEndpoint_default("agents");
5528
- return useResourceMutation_default((agentId, fetcher) => deleteAgent$1({
5529
- ...endpoint,
5530
- agentId,
5531
- fetcher
5532
- }), () => [[AgentQueryKeys$1.AGENTS]], options);
5533
- };
5534
- var useDeleteAgent_default = useDeleteAgent;
5535
-
5536
- //#endregion
5537
- //#region src/composables/management/agents/useGetAgentGroups.ts
5538
- /**
5539
- * Fetches a page of the groups an agent belongs to.
5540
- *
5541
- * @param agentId - Identifier of the parent resource. Fetching waits until it is defined. A ref or
5542
- * getter refetches when it changes.
5543
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5544
- * @param options - Query options, including a per-composable `fetcher`.
5545
- * @returns The query state.
5546
- */
5547
- const useGetAgentGroups = (agentId, params = {}, options) => {
5548
- const endpoint = useManagementEndpoint_default("agents");
5549
- return useResourceQuery_default(() => {
5550
- const { limit, offset } = toValue(params);
5551
- return [
5552
- GroupQueryKeys$1.MEMBERSHIPS,
5553
- "agent",
5554
- toValue(agentId),
5555
- {
5556
- limit,
5557
- offset
5558
- }
5559
- ];
5560
- }, (fetcher) => {
5561
- const { limit, offset } = toValue(params);
5562
- return getAgentGroups$1({
5563
- ...endpoint,
5564
- fetcher,
5565
- limit,
5566
- offset,
5567
- agentId: toValue(agentId)
5568
- });
5569
- }, {
5570
- ...options,
5571
- enabled: () => Boolean(toValue(agentId)) && toValue(options?.enabled) !== false
5572
- });
5573
- };
5574
- var useGetAgentGroups_default = useGetAgentGroups;
5575
-
5576
- //#endregion
5577
- //#region src/composables/management/agents/useGetAgentRoles.ts
5578
- /**
5579
- * Fetches a page of the role names assigned to an agent, directly or through its groups. Refetches
5580
- * whenever a role assignment or a group membership changes.
5581
- *
5582
- * @param agentId - Identifier of the parent resource. Fetching waits until it is defined. A ref or
5583
- * getter refetches when it changes.
5584
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5585
- * @param options - Query options, including a per-composable `fetcher`.
5586
- * @returns The query state.
5587
- */
5588
- const useGetAgentRoles = (agentId, params = {}, options) => {
5589
- const endpoint = useManagementEndpoint_default("agents");
5590
- return useResourceQuery_default(() => {
5591
- const { limit, offset } = toValue(params);
5592
- return [
5593
- RoleQueryKeys$1.ROLE_ASSIGNMENTS,
5594
- "agent",
5595
- toValue(agentId),
5596
- {
5597
- limit,
5598
- offset
5599
- }
5600
- ];
5601
- }, (fetcher) => {
5602
- const { limit, offset } = toValue(params);
5603
- return getAgentRoles$1({
5604
- ...endpoint,
5605
- fetcher,
5606
- limit,
5607
- offset,
5608
- agentId: toValue(agentId)
5609
- });
5610
- }, {
5611
- ...options,
5612
- enabled: () => Boolean(toValue(agentId)) && toValue(options?.enabled) !== false
5613
- });
5614
- };
5615
- var useGetAgentRoles_default = useGetAgentRoles;
5616
-
5617
- //#endregion
5618
- //#region src/composables/management/agents/useGetAgentTypes.ts
5619
- /**
5620
- * Fetches a page of agent types.
5621
- *
5622
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5623
- * @param options - Query options, including a per-composable `fetcher`.
5624
- * @returns The query state.
5625
- */
5626
- const useGetAgentTypes = (params = {}, options) => {
5627
- const endpoint = useManagementEndpoint_default("agentTypes");
5628
- return useResourceQuery_default(() => {
5629
- const { limit, offset } = toValue(params);
5630
- return [AgentQueryKeys$1.AGENT_TYPES, {
5631
- limit,
5632
- offset
5633
- }];
5634
- }, (fetcher) => {
5635
- const { limit, offset } = toValue(params);
5636
- return getAgentTypes$1({
5637
- ...endpoint,
5638
- fetcher,
5639
- limit,
5640
- offset
5641
- });
5642
- }, options);
5643
- };
5644
- var useGetAgentTypes_default = useGetAgentTypes;
5645
-
5646
- //#endregion
5647
- //#region src/composables/management/applications/useGetApplications.ts
5648
- /**
5649
- * Fetches a page of applications.
5650
- *
5651
- * @param params - Pagination parameters. A ref or getter refetches when it changes.
5652
- * @param options - Query options, including a per-composable `fetcher`.
5653
- * @returns The query state.
5654
- */
5655
- const useGetApplications = (params = {}, options) => {
5656
- const endpoint = useManagementEndpoint_default("applications");
5657
- return useResourceQuery_default(() => {
5658
- const { limit, offset } = toValue(params);
5659
- return [ApplicationQueryKeys$1.APPLICATIONS, {
5660
- limit,
5661
- offset
5662
- }];
5663
- }, (fetcher) => {
5664
- const { limit, offset } = toValue(params);
5665
- return getApplications$1({
5666
- ...endpoint,
5667
- fetcher,
5668
- limit,
5669
- offset
5670
- });
5671
- }, options);
5672
- };
5673
- var useGetApplications_default = useGetApplications;
5674
-
5675
- //#endregion
5676
- //#region src/composables/management/applications/useGetApplication.ts
5677
- /**
5678
- * Fetches a single application. Does nothing until `applicationId` is set.
5679
- *
5680
- * @param applicationId - Identifier of the resource. A ref or getter refetches when it changes.
5681
- * @param options - Query options, including a per-composable `fetcher`.
5682
- * @returns The query state.
5683
- */
5684
- const useGetApplication = (applicationId, options) => {
5685
- const endpoint = useManagementEndpoint_default("applications");
5686
- return useResourceQuery_default(() => [ApplicationQueryKeys$1.APPLICATION, toValue(applicationId)], (fetcher) => getApplication$1({
5687
- ...endpoint,
5688
- fetcher,
5689
- applicationId: toValue(applicationId)
5690
- }), {
5691
- ...options,
5692
- enabled: () => Boolean(toValue(applicationId)) && toValue(options?.enabled) !== false
5693
- });
5694
- };
5695
- var useGetApplication_default = useGetApplication;
5696
-
5697
- //#endregion
5698
- //#region src/composables/management/applications/useCreateApplication.ts
5699
- /**
5700
- * Creates an application, then refetches any mounted application lists. Call `mutate(payload)`.
5701
- *
5702
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5703
- * @returns The mutation state.
5704
- */
5705
- const useCreateApplication = (options) => {
5706
- const endpoint = useManagementEndpoint_default("applications");
5707
- return useResourceMutation_default((payload, fetcher) => createApplication$1({
5708
- ...endpoint,
5709
- fetcher,
5710
- payload
5711
- }), () => [[ApplicationQueryKeys$1.APPLICATIONS]], options);
5712
- };
5713
- var useCreateApplication_default = useCreateApplication;
5714
-
5715
- //#endregion
5716
- //#region src/composables/management/applications/useUpdateApplication.ts
5717
- /**
5718
- * Updates an application, then refetches it and any mounted application lists. Call
5719
- * `mutate({applicationId, data})`.
5720
- *
5721
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5722
- * @returns The mutation state.
5723
- */
5724
- const useUpdateApplication = (options) => {
5725
- const endpoint = useManagementEndpoint_default("applications");
5726
- return useResourceMutation_default(({ applicationId, data }, fetcher) => updateApplication$1({
5727
- ...endpoint,
5728
- applicationId,
5729
- fetcher,
5730
- payload: data
5731
- }), ({ applicationId }) => [[ApplicationQueryKeys$1.APPLICATION, applicationId], [ApplicationQueryKeys$1.APPLICATIONS]], options);
5732
- };
5733
- var useUpdateApplication_default = useUpdateApplication;
5734
-
5735
- //#endregion
5736
- //#region src/composables/management/applications/useDeleteApplication.ts
5737
- /**
5738
- * Deletes an application, then refetches any mounted application lists. Call `mutate(applicationId)`.
5739
- *
5740
- * @param options - Mutation options, including `onSuccess`, `onError`, and a per-composable `fetcher`.
5741
- * @returns The mutation state.
5742
- */
5743
- const useDeleteApplication = (options) => {
5744
- const endpoint = useManagementEndpoint_default("applications");
5745
- return useResourceMutation_default((applicationId, fetcher) => deleteApplication$1({
5746
- ...endpoint,
5747
- applicationId,
5748
- fetcher
5749
- }), () => [[ApplicationQueryKeys$1.APPLICATIONS]], options);
5750
- };
5751
- var useDeleteApplication_default = useDeleteApplication;
5752
-
5753
- //#endregion
5754
- //#region src/components/primitives/Button/Button.ts
5755
- const Button = defineComponent({
5756
- name: "Button",
5757
- props: {
5758
- color: {
5759
- default: "primary",
5760
- type: String
5761
- },
5762
- disabled: {
5763
- default: false,
5764
- type: Boolean
5765
- },
5766
- endIcon: {
5767
- default: void 0,
5768
- type: Object
5769
- },
5770
- fullWidth: {
5771
- default: false,
5772
- type: Boolean
5773
- },
5774
- loading: {
5775
- default: false,
5776
- type: Boolean
5777
- },
5778
- size: {
5779
- default: "medium",
5780
- type: String
5781
- },
5782
- startIcon: {
5783
- default: void 0,
5784
- type: Object
5785
- },
5786
- type: {
5787
- default: "button",
5788
- type: String
5789
- },
5790
- variant: {
5791
- default: "solid",
5792
- type: String
5793
- }
5794
- },
5795
- emits: ["click"],
5796
- setup(props, { slots, emit, attrs }) {
5797
- return () => {
5798
- return h("button", {
5799
- class: [
5800
- withVendorCSSClassPrefix("button"),
5801
- withVendorCSSClassPrefix(`button--${props.variant}`),
5802
- withVendorCSSClassPrefix(`button--${props.color}`),
5803
- withVendorCSSClassPrefix(`button--${props.size}`),
5804
- props.fullWidth ? withVendorCSSClassPrefix("button--full-width") : "",
5805
- props.loading ? withVendorCSSClassPrefix("button--loading") : "",
5806
- attrs.class || ""
5807
- ].filter(Boolean).join(" "),
5808
- disabled: props.disabled || props.loading,
5809
- id: attrs["id"],
5810
- onClick: (e) => emit("click", e),
5811
- style: attrs.style,
5812
- type: props.type
5813
- }, [
5814
- props.startIcon ? h("span", { class: withVendorCSSClassPrefix("button__start-icon") }, [props.startIcon]) : null,
5815
- h("span", { class: withVendorCSSClassPrefix("button__content") }, slots["default"]?.()),
5816
- props.endIcon ? h("span", { class: withVendorCSSClassPrefix("button__end-icon") }, [props.endIcon]) : null,
5817
- props.loading ? h("span", {
5818
- "aria-hidden": "true",
5819
- class: withVendorCSSClassPrefix("button__spinner")
5820
- }) : null
5821
- ]);
5822
- };
5823
- }
5824
- });
5825
- var Button_default = Button;
5826
-
5827
- //#endregion
5828
- //#region src/components/primitives/Card/Card.ts
5829
- const Card = defineComponent({
5830
- name: "Card",
5831
- props: { variant: {
5832
- default: "elevated",
5833
- type: String
5834
- } },
5835
- setup(props, { slots, attrs }) {
5836
- return () => h("div", {
5837
- class: [
5838
- withVendorCSSClassPrefix("card"),
5839
- withVendorCSSClassPrefix(`card--${props.variant}`),
5840
- attrs.class || ""
5841
- ].filter(Boolean).join(" "),
5842
- style: attrs.style
5843
- }, slots["default"]?.());
5844
- }
5845
- });
5846
- var Card_default = Card;
4898
+ //#region src/components/primitives/Card/Card.ts
4899
+ const Card = defineComponent({
4900
+ name: "Card",
4901
+ props: { variant: {
4902
+ default: "elevated",
4903
+ type: String
4904
+ } },
4905
+ setup(props, { slots, attrs }) {
4906
+ return () => h("div", {
4907
+ class: [
4908
+ withVendorCSSClassPrefix("card"),
4909
+ withVendorCSSClassPrefix(`card--${props.variant}`),
4910
+ attrs.class || ""
4911
+ ].filter(Boolean).join(" "),
4912
+ style: attrs.style
4913
+ }, slots["default"]?.());
4914
+ }
4915
+ });
4916
+ var Card_default = Card;
5847
4917
 
5848
4918
  //#endregion
5849
4919
  //#region src/components/primitives/Alert/Alert.ts
@@ -7861,14 +6931,14 @@ const applyInputRefMapping = (components, refMapping, actionMapping, inputsData
7861
6931
  /**
7862
6932
  * Transform and resolve translations in components from flow response.
7863
6933
  */
7864
- const transformComponents = (response, t, resolveTranslations = true, meta) => {
6934
+ const transformComponents = (response, t, resolveTranslations$1 = true, meta) => {
7865
6935
  if (!response?.data?.meta?.components) return [];
7866
6936
  let { components } = response.data.meta;
7867
6937
  const refMapping = createInputRefMapping(response);
7868
6938
  const actionMapping = createActionRefMapping(response);
7869
6939
  const inputsData = response?.data?.inputs || [];
7870
6940
  if (refMapping.size > 0 || actionMapping.size > 0 || inputsData.length > 0) components = applyInputRefMapping(components, refMapping, actionMapping, inputsData);
7871
- return resolveTranslations ? resolveTranslationsInArray_default(components, t, void 0, meta) : components;
6941
+ return resolveTranslations$1 ? resolveTranslationsInArray_default(components, t, void 0, meta) : components;
7872
6942
  };
7873
6943
  /**
7874
6944
  * Extract error message from flow error response.
@@ -7911,7 +6981,7 @@ const checkForErrorResponse = (response, t, defaultErrorKey = "errors.flow.gener
7911
6981
  * This is the main transformer function that should be used by all flow components.
7912
6982
  */
7913
6983
  const normalizeFlowResponse = (response, t, options = {}, meta) => {
7914
- const { throwOnError = true, defaultErrorKey = "errors.flow.generic", resolveTranslations = true } = options;
6984
+ const { throwOnError = true, defaultErrorKey = "errors.flow.generic", resolveTranslations: resolveTranslations$1 = true } = options;
7915
6985
  if (checkForErrorResponse(response, t, defaultErrorKey) && throwOnError) throw response;
7916
6986
  const additionalData = response?.data?.additionalData ?? {};
7917
6987
  if (typeof additionalData["consentPrompt"] === "string") try {
@@ -7920,7 +6990,7 @@ const normalizeFlowResponse = (response, t, options = {}, meta) => {
7920
6990
  } catch {}
7921
6991
  return {
7922
6992
  additionalData,
7923
- components: transformComponents(response, t, resolveTranslations, meta),
6993
+ components: transformComponents(response, t, resolveTranslations$1, meta),
7924
6994
  executionId: response.executionId
7925
6995
  };
7926
6996
  };
@@ -11381,7 +10451,7 @@ var useAdminTranslation_default = useAdminTranslation;
11381
10451
 
11382
10452
  //#endregion
11383
10453
  //#region src/components/common/attribution/Attribution.ts
11384
- const cls$8 = (suffix) => withVendorCSSClassPrefix(`attribution${suffix}`);
10454
+ const cls$11 = (suffix) => withVendorCSSClassPrefix(`attribution${suffix}`);
11385
10455
  const wordmark = (className) => h("svg", {
11386
10456
  "aria-label": "ThunderID",
11387
10457
  class: className,
@@ -11429,8 +10499,8 @@ const Attribution = defineComponent({
11429
10499
  return () => {
11430
10500
  const isRibbon = props.appearance === "ribbon";
11431
10501
  const label = t(props.variant === "powered" ? "attribution.powered_by" : "attribution.secured_by");
11432
- const className = [cls$8(""), ...isRibbon ? [cls$8("--ribbon")] : []];
11433
- const content = isRibbon ? h("span", { class: cls$8("__ribbon-content") }, [h("span", { class: cls$8("__ribbon-label") }, label), wordmark(cls$8("__ribbon-wordmark"))]) : [h("span", { class: cls$8("__label") }, label), wordmark(cls$8("__wordmark"))];
10502
+ const className = [cls$11(""), ...isRibbon ? [cls$11("--ribbon")] : []];
10503
+ const content = isRibbon ? h("span", { class: cls$11("__ribbon-content") }, [h("span", { class: cls$11("__ribbon-label") }, label), wordmark(cls$11("__ribbon-wordmark"))]) : [h("span", { class: cls$11("__label") }, label), wordmark(cls$11("__wordmark"))];
11434
10504
  if (props.href) return h("a", {
11435
10505
  class: className,
11436
10506
  href: props.href,
@@ -13099,7 +12169,7 @@ var InviteUser_default = InviteUser;
13099
12169
 
13100
12170
  //#endregion
13101
12171
  //#region src/components/common/language-switcher/BaseLanguageSwitcher.ts
13102
- const cls$7 = (name) => withVendorCSSClassPrefix(`language-switcher${name}`);
12172
+ const cls$10 = (name) => withVendorCSSClassPrefix(`language-switcher${name}`);
13103
12173
  /**
13104
12174
  * BaseLanguageSwitcher — unstyled language selection component.
13105
12175
  *
@@ -13149,13 +12219,13 @@ const BaseLanguageSwitcher = defineComponent({
13149
12219
  const triggerButton = h("button", {
13150
12220
  "aria-expanded": isOpen.value,
13151
12221
  "aria-haspopup": "listbox",
13152
- class: cls$7("__trigger"),
12222
+ class: cls$10("__trigger"),
13153
12223
  onClick: toggle,
13154
12224
  type: "button"
13155
12225
  }, [
13156
12226
  h(GlobeIcon, { size: 16 }),
13157
12227
  h(Typography_default, {
13158
- class: cls$7("__trigger-label"),
12228
+ class: cls$10("__trigger-label"),
13159
12229
  variant: "body2"
13160
12230
  }, () => currentLabel),
13161
12231
  h(ChevronDownIcon, { size: 12 })
@@ -13164,17 +12234,17 @@ const BaseLanguageSwitcher = defineComponent({
13164
12234
  const isActive = lang.value === props.currentLanguage;
13165
12235
  return h("button", {
13166
12236
  "aria-selected": isActive,
13167
- class: [cls$7("__item"), isActive ? cls$7("__item--active") : ""],
12237
+ class: [cls$10("__item"), isActive ? cls$10("__item--active") : ""],
13168
12238
  onClick: () => handleSelect(lang.value),
13169
12239
  role: "option",
13170
12240
  type: "button"
13171
12241
  }, [h(Typography_default, { variant: "body2" }, () => lang.label)]);
13172
12242
  });
13173
12243
  const dropdown = isOpen.value ? h("div", {
13174
- class: cls$7("__dropdown"),
12244
+ class: cls$10("__dropdown"),
13175
12245
  role: "listbox"
13176
12246
  }, dropdownItems) : null;
13177
- return h(Card_default, { class: [cls$7(""), props.className].filter(Boolean).join(" ") }, () => [triggerButton, dropdown]);
12247
+ return h(Card_default, { class: [cls$10(""), props.className].filter(Boolean).join(" ") }, () => [triggerButton, dropdown]);
13178
12248
  };
13179
12249
  }
13180
12250
  });
@@ -13291,38 +12361,38 @@ const DataTable = defineComponent({
13291
12361
  setup(props) {
13292
12362
  const { t: fallbackT } = useI18n_default();
13293
12363
  const translate = (key, params) => (props.t ?? fallbackT)(key, params);
13294
- const cls$9 = (element) => withVendorCSSClassPrefix(element ? `data-table__${element}` : "data-table");
12364
+ const cls$12 = (element) => withVendorCSSClassPrefix(element ? `data-table__${element}` : "data-table");
13295
12365
  const renderBody = () => {
13296
12366
  const colSpan = props.columns.length;
13297
12367
  if (props.isLoading) return h("tr", {}, [h("td", {
13298
- class: cls$9("empty"),
12368
+ class: cls$12("empty"),
13299
12369
  colspan: colSpan
13300
12370
  }, [h("span", {
13301
- class: cls$9("loading"),
12371
+ class: cls$12("loading"),
13302
12372
  role: "status"
13303
12373
  }, [h(Spinner_default, {
13304
12374
  "aria-hidden": "true",
13305
12375
  size: "small"
13306
12376
  }), translate("admin.common.loading")])])]);
13307
12377
  if (props.rows.length === 0) return h("tr", {}, [h("td", {
13308
- class: cls$9("empty"),
12378
+ class: cls$12("empty"),
13309
12379
  colspan: colSpan
13310
12380
  }, props.emptyText)]);
13311
12381
  return props.rows.map((row) => {
13312
12382
  const rowId = props.getRowId(row);
13313
12383
  const onRowClick = props.onRowClick;
13314
12384
  return h("tr", {
13315
- class: cls$9("row"),
12385
+ class: cls$12("row"),
13316
12386
  "data-clickable": onRowClick ? "true" : void 0,
13317
12387
  "data-selected": props.selectedRowId === rowId ? "true" : void 0,
13318
12388
  key: rowId,
13319
12389
  onClick: onRowClick ? () => onRowClick(row) : void 0
13320
12390
  }, props.columns.map((column, index) => h("td", {
13321
- class: cls$9("cell"),
12391
+ class: cls$12("cell"),
13322
12392
  key: column.id
13323
12393
  }, index === 0 && onRowClick ? [h("button", {
13324
12394
  "aria-pressed": props.selectedRowId === void 0 ? void 0 : String(props.selectedRowId === rowId),
13325
- class: cls$9("row-button"),
12395
+ class: cls$12("row-button"),
13326
12396
  onClick: (event) => {
13327
12397
  event.stopPropagation();
13328
12398
  onRowClick(row);
@@ -13335,12 +12405,12 @@ const DataTable = defineComponent({
13335
12405
  const { pagination } = props;
13336
12406
  const start = pagination ? Math.min(pagination.offset + 1, pagination.total) : 0;
13337
12407
  const end = pagination ? Math.min(pagination.offset + props.rows.length, pagination.total) : 0;
13338
- return h("div", { class: [cls$9(), props.className].filter(Boolean).join(" ") }, [
12408
+ return h("div", { class: [cls$12(), props.className].filter(Boolean).join(" ") }, [
13339
12409
  props.error ? h(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null,
13340
- h("div", { class: cls$9("scroller") }, [h("table", { class: cls$9("table") }, [
13341
- h("caption", { class: cls$9("caption") }, props.caption),
12410
+ h("div", { class: cls$12("scroller") }, [h("table", { class: cls$12("table") }, [
12411
+ h("caption", { class: cls$12("caption") }, props.caption),
13342
12412
  h("thead", {}, [h("tr", {}, props.columns.map((column) => h("th", {
13343
- class: cls$9("header-cell"),
12413
+ class: cls$12("header-cell"),
13344
12414
  key: column.id,
13345
12415
  scope: "col"
13346
12416
  }, column.header)))]),
@@ -13348,12 +12418,12 @@ const DataTable = defineComponent({
13348
12418
  ])]),
13349
12419
  pagination && pagination.total > pagination.limit ? h("nav", {
13350
12420
  "aria-label": translate("admin.common.pagination.label"),
13351
- class: cls$9("footer")
12421
+ class: cls$12("footer")
13352
12422
  }, [h("span", { "aria-live": "polite" }, translate("admin.common.pagination.range", {
13353
12423
  end,
13354
12424
  start,
13355
12425
  total: pagination.total
13356
- })), h("div", { class: cls$9("footer-actions") }, [h(Button_default, {
12426
+ })), h("div", { class: cls$12("footer-actions") }, [h(Button_default, {
13357
12427
  disabled: pagination.offset === 0 || props.isLoading,
13358
12428
  onClick: () => pagination.onChange(Math.max(0, pagination.offset - pagination.limit)),
13359
12429
  size: "small",
@@ -13372,7 +12442,7 @@ var DataTable_default = DataTable;
13372
12442
 
13373
12443
  //#endregion
13374
12444
  //#region src/components/admin/shared/AdminAvatar.ts
13375
- const cls$6 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
12445
+ const cls$9 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
13376
12446
  /**
13377
12447
  * A decorative circle with a name's initials. Hidden from assistive technology, since the name is
13378
12448
  * always rendered next to it.
@@ -13394,7 +12464,7 @@ const AdminAvatar = defineComponent({
13394
12464
  const initials = props.name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part.charAt(0).toUpperCase()).join("");
13395
12465
  return h("span", {
13396
12466
  "aria-hidden": "true",
13397
- class: cls$6("avatar"),
12467
+ class: cls$9("avatar"),
13398
12468
  style: {
13399
12469
  fontSize: `${Math.round(props.size * .4)}px`,
13400
12470
  height: `${props.size}px`,
@@ -13639,7 +12709,7 @@ const createAdminList = (definition) => defineComponent({
13639
12709
  const rows = props[definition.rowsProp];
13640
12710
  const title = props["title"];
13641
12711
  const onPageChange = props["onPageChange"];
13642
- const columns = definition.columns(t);
12712
+ const columns = definition.columns(t, rows);
13643
12713
  const search = props["search"];
13644
12714
  const searchAttributes = props["searchAttributes"];
13645
12715
  const onSearch = props["onSearch"];
@@ -13743,7 +12813,7 @@ var BaseUserList_default = BaseUserList;
13743
12813
  //#endregion
13744
12814
  //#region src/components/admin/shared/createConnectedAdminList.ts
13745
12815
  /**
13746
- * Creates a list that fetches its own pages through a management composable and renders the given
12816
+ * Creates a list that fetches its own pages through `useResourceQuery` and renders the given
13747
12817
  * presentational list. Server errors are mapped to translated messages; raw server text is never shown.
13748
12818
  *
13749
12819
  * @param definition - What the list fetches and renders.
@@ -13854,7 +12924,26 @@ const UserList = createConnectedAdminList_default({
13854
12924
  type: String
13855
12925
  } },
13856
12926
  name: "UserList",
13857
- query: (params) => useGetUsers_default(() => params()),
12927
+ query: (params) => {
12928
+ const endpoint = useManagementEndpoint_default("users");
12929
+ return useResourceQuery_default(() => {
12930
+ const { filter, limit, offset } = params();
12931
+ return [UserQueryKeys$1.USERS, {
12932
+ filter,
12933
+ limit,
12934
+ offset
12935
+ }];
12936
+ }, (fetcher) => {
12937
+ const { filter, limit, offset } = params();
12938
+ return getUsers$1({
12939
+ ...endpoint,
12940
+ fetcher,
12941
+ filter,
12942
+ limit,
12943
+ offset
12944
+ });
12945
+ });
12946
+ },
13858
12947
  rows: (data) => data?.users ?? [],
13859
12948
  rowsProp: "users",
13860
12949
  searchAttributes: (t) => [{
@@ -14079,6 +13168,60 @@ const BaseUserCreate = defineComponent({
14079
13168
  });
14080
13169
  var BaseUserCreate_default = BaseUserCreate;
14081
13170
 
13171
+ //#endregion
13172
+ //#region src/composables/management/useResourceMutation.ts
13173
+ /**
13174
+ * Runs a management mutation and invalidates the queries whose data it changed. Depends on no data
13175
+ * fetching library.
13176
+ *
13177
+ * @param mutationFn - Performs the request with the resolved fetcher.
13178
+ * @param getInvalidatedKeys - Returns the query key prefixes to invalidate after a success.
13179
+ * @param options - Mutation options.
13180
+ * @returns The mutation state.
13181
+ */
13182
+ const useResourceMutation = (mutationFn, getInvalidatedKeys, { fetcher, onError, onSuccess } = {}) => {
13183
+ const context = useThunderID_default();
13184
+ const invalidator = resolveInvalidator(context);
13185
+ const resolvedFetcher = resolveManagementFetcher(context, fetcher);
13186
+ const data = shallowRef(void 0);
13187
+ const error = shallowRef(null);
13188
+ const isLoading = ref(false);
13189
+ const mutateAsync = async (variables) => {
13190
+ isLoading.value = true;
13191
+ error.value = null;
13192
+ try {
13193
+ const result = await mutationFn(variables, resolvedFetcher);
13194
+ data.value = result;
13195
+ getInvalidatedKeys(variables).forEach((key) => {
13196
+ invalidator.invalidate(key);
13197
+ });
13198
+ onSuccess?.(result, variables);
13199
+ return result;
13200
+ } catch (err) {
13201
+ const mutationError = err instanceof Error ? err : new Error(String(err));
13202
+ error.value = mutationError;
13203
+ onError?.(mutationError, variables);
13204
+ throw mutationError;
13205
+ } finally {
13206
+ isLoading.value = false;
13207
+ }
13208
+ };
13209
+ const mutate = (variables) => mutateAsync(variables).catch(() => void 0);
13210
+ const reset = () => {
13211
+ data.value = void 0;
13212
+ error.value = null;
13213
+ };
13214
+ return {
13215
+ data: readonly(data),
13216
+ error: readonly(error),
13217
+ isLoading: readonly(isLoading),
13218
+ mutate,
13219
+ mutateAsync,
13220
+ reset
13221
+ };
13222
+ };
13223
+ var useResourceMutation_default = useResourceMutation;
13224
+
14082
13225
  //#endregion
14083
13226
  //#region src/components/admin/shared/useDefaultOuId.ts
14084
13227
  /**
@@ -14140,8 +13283,18 @@ const UserCreate = defineComponent({
14140
13283
  setup(props, { emit, slots }) {
14141
13284
  const t = useAdminTranslation_default(() => props.preferences);
14142
13285
  const resolvedOuId = useDefaultOuId_default(() => props.ouId);
14143
- const userTypes = useGetUserTypes_default({ limit: 100 }, { enabled: () => props.mode === "api" });
14144
- const creation = useCreateUser_default({ onSuccess: (user) => emit("created", user) });
13286
+ const userTypesEndpoint = useManagementEndpoint_default("userTypes");
13287
+ const usersEndpoint = useManagementEndpoint_default("users");
13288
+ const userTypes = useResourceQuery_default(() => [UserQueryKeys$1.USER_TYPES, { limit: 100 }], (fetcher) => getUserTypes$1({
13289
+ ...userTypesEndpoint,
13290
+ fetcher,
13291
+ limit: 100
13292
+ }), { enabled: () => props.mode === "api" });
13293
+ const creation = useResourceMutation_default((payload, fetcher) => createUser$1({
13294
+ ...usersEndpoint,
13295
+ fetcher,
13296
+ payload
13297
+ }), () => [[UserQueryKeys$1.USERS]], { onSuccess: (user) => emit("created", user) });
14145
13298
  const options = computed(() => (userTypes.data.value?.types ?? []).map((userType) => ({
14146
13299
  label: userType.displayName ?? userType.handle,
14147
13300
  value: userType.handle
@@ -14174,7 +13327,7 @@ var UserCreate_default = UserCreate;
14174
13327
 
14175
13328
  //#endregion
14176
13329
  //#region src/components/admin/shared/ChipList.ts
14177
- const cls$5 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
13330
+ const cls$8 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
14178
13331
  /**
14179
13332
  * Renders a list of named items, each optionally removable.
14180
13333
  */
@@ -14196,12 +13349,12 @@ const ChipList = defineComponent({
14196
13349
  },
14197
13350
  setup(props) {
14198
13351
  return () => {
14199
- if (props.items.length === 0) return h("span", { class: cls$5("muted") }, props.emptyText);
13352
+ if (props.items.length === 0) return h("span", { class: cls$8("muted") }, props.emptyText);
14200
13353
  return h("ul", {
14201
13354
  "aria-label": props.label,
14202
- class: cls$5("chip-list")
13355
+ class: cls$8("chip-list")
14203
13356
  }, props.items.map((item) => h("li", {
14204
- class: cls$5("chip"),
13357
+ class: cls$8("chip"),
14205
13358
  key: item.id
14206
13359
  }, [item.label, item.onRemove ? h(Button_default, {
14207
13360
  "aria-label": item.removeLabel,
@@ -14216,7 +13369,7 @@ var ChipList_default = ChipList;
14216
13369
 
14217
13370
  //#endregion
14218
13371
  //#region src/components/admin/shared/ConfirmButton.ts
14219
- const cls$4 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
13372
+ const cls$7 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
14220
13373
  /**
14221
13374
  * A destructive action that asks for confirmation inline before it runs. The default slot is the
14222
13375
  * label of the button that starts the action.
@@ -14255,7 +13408,7 @@ const ConfirmButton = defineComponent({
14255
13408
  }, { default: () => slots["default"]?.() });
14256
13409
  return h("span", {
14257
13410
  "aria-label": props.confirmText,
14258
- class: cls$4("confirm"),
13411
+ class: cls$7("confirm"),
14259
13412
  role: "group"
14260
13413
  }, [
14261
13414
  h("span", {}, props.confirmText),
@@ -14282,7 +13435,7 @@ var ConfirmButton_default = ConfirmButton;
14282
13435
 
14283
13436
  //#endregion
14284
13437
  //#region src/components/admin/shared/DetailList.ts
14285
- const cls$3 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
13438
+ const cls$6 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
14286
13439
  /**
14287
13440
  * Renders label and value pairs as a description list.
14288
13441
  */
@@ -14293,17 +13446,17 @@ const DetailList = defineComponent({
14293
13446
  type: Array
14294
13447
  } },
14295
13448
  setup(props) {
14296
- return () => h("dl", { class: cls$3("detail") }, props.items.map((item) => h("div", {
13449
+ return () => h("dl", { class: cls$6("detail") }, props.items.map((item) => h("div", {
14297
13450
  key: item.label,
14298
13451
  style: { display: "contents" }
14299
- }, [h("dt", { class: cls$3("detail-label") }, item.label), h("dd", { class: cls$3("detail-value") }, [item.value])])));
13452
+ }, [h("dt", { class: cls$6("detail-label") }, item.label), h("dd", { class: cls$6("detail-value") }, [item.value])])));
14300
13453
  }
14301
13454
  });
14302
13455
  var DetailList_default = DetailList;
14303
13456
 
14304
13457
  //#endregion
14305
13458
  //#region src/components/admin/shared/Panel.ts
14306
- const cls$2 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
13459
+ const cls$5 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
14307
13460
  /**
14308
13461
  * A bordered block with a heading, used to group parts of a details view. Accepts an `actions` slot
14309
13462
  * rendered next to the heading.
@@ -14315,7 +13468,7 @@ const Panel = defineComponent({
14315
13468
  type: String
14316
13469
  } },
14317
13470
  setup(props, { slots }) {
14318
- return () => h("section", { class: cls$2("panel") }, [h("div", { class: cls$2("panel-header") }, [h("h3", { class: cls$2("panel-title") }, props.title), slots["actions"]?.()]), slots["default"]?.()]);
13471
+ return () => h("section", { class: cls$5("panel") }, [h("div", { class: cls$5("panel-header") }, [h("h3", { class: cls$5("panel-title") }, props.title), slots["actions"]?.()]), slots["default"]?.()]);
14319
13472
  }
14320
13473
  });
14321
13474
  var Panel_default = Panel;
@@ -14326,7 +13479,7 @@ const stringify = (value) => {
14326
13479
  if (value === null || value === void 0) return "";
14327
13480
  return typeof value === "object" ? JSON.stringify(value) : String(value);
14328
13481
  };
14329
- const cls$1 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
13482
+ const cls$4 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
14330
13483
  /**
14331
13484
  * Shows a user's attributes, type, organization unit and groups. Holds no data of its own: pass the
14332
13485
  * user and handle deletion and editing.
@@ -14408,7 +13561,7 @@ const BaseUserDetails = defineComponent({
14408
13561
  block: "user-details",
14409
13562
  className: props.className
14410
13563
  }, { default: () => h("span", {
14411
- class: cls$1("muted"),
13564
+ class: cls$4("muted"),
14412
13565
  role: "status"
14413
13566
  }, [h(Spinner_default, {
14414
13567
  "aria-hidden": "true",
@@ -14426,7 +13579,7 @@ const BaseUserDetails = defineComponent({
14426
13579
  if (draft.value) {
14427
13580
  const current = draft.value;
14428
13581
  return h("form", {
14429
- class: cls$1("edit-form"),
13582
+ class: cls$4("edit-form"),
14430
13583
  onSubmit: (event) => {
14431
13584
  event.preventDefault();
14432
13585
  props.onUpdate?.({
@@ -14446,7 +13599,7 @@ const BaseUserDetails = defineComponent({
14446
13599
  [name]: value
14447
13600
  };
14448
13601
  }
14449
- })), h("div", { class: cls$1("form-actions") }, [h(Button_default, {
13602
+ })), h("div", { class: cls$4("form-actions") }, [h(Button_default, {
14450
13603
  disabled: props.isUpdating,
14451
13604
  onClick: () => {
14452
13605
  draft.value = null;
@@ -14463,7 +13616,7 @@ const BaseUserDetails = defineComponent({
14463
13616
  label: name,
14464
13617
  value: stringify(value)
14465
13618
  })) });
14466
- return h("span", { class: cls$1("muted") }, t("admin.users.details.no_attributes"));
13619
+ return h("span", { class: cls$4("muted") }, t("admin.users.details.no_attributes"));
14467
13620
  };
14468
13621
  return h(AdminSection_default, {
14469
13622
  block: "user-details",
@@ -14479,10 +13632,10 @@ const BaseUserDetails = defineComponent({
14479
13632
  }, { default: () => t("admin.users.details.delete.action") }) : null],
14480
13633
  default: () => [
14481
13634
  props.error ? h(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null,
14482
- h("div", { class: cls$1("row") }, [h(AdminAvatar_default, {
13635
+ h("div", { class: cls$4("row") }, [h(AdminAvatar_default, {
14483
13636
  name: displayName,
14484
13637
  size: 48
14485
- }), h("span", { class: cls$1("muted") }, user.ouHandle ?? user.ouId)]),
13638
+ }), h("span", { class: cls$4("muted") }, user.ouHandle ?? user.ouId)]),
14486
13639
  h(Panel_default, { title: t("admin.users.details.attributes") }, {
14487
13640
  actions: () => canEdit && !draft.value ? h(Button_default, {
14488
13641
  onClick: () => {
@@ -14552,10 +13705,35 @@ const UserDetails = defineComponent({
14552
13705
  emits: ["deleted"],
14553
13706
  setup(props, { emit, slots }) {
14554
13707
  const t = useAdminTranslation_default(() => props.preferences);
14555
- const user = useGetUser_default(() => props.userId);
14556
- const groups = useGetUserGroups_default(() => props.userId, { limit: 100 });
14557
- const deletion = useDeleteUser_default({ onSuccess: () => emit("deleted") });
14558
- const update = useUpdateUser_default();
13708
+ const endpoint = useManagementEndpoint_default("users");
13709
+ const hasUserId = () => Boolean(props.userId);
13710
+ const user = useResourceQuery_default(() => [UserQueryKeys$1.USER, props.userId], (fetcher) => getUser$1({
13711
+ ...endpoint,
13712
+ fetcher,
13713
+ userId: props.userId
13714
+ }), { enabled: hasUserId });
13715
+ const groups = useResourceQuery_default(() => [
13716
+ GroupQueryKeys$1.MEMBERSHIPS,
13717
+ "user",
13718
+ props.userId,
13719
+ { limit: 100 }
13720
+ ], (fetcher) => getUserGroups$1({
13721
+ ...endpoint,
13722
+ fetcher,
13723
+ limit: 100,
13724
+ userId: props.userId
13725
+ }), { enabled: hasUserId });
13726
+ const deletion = useResourceMutation_default((userId, fetcher) => deleteUser$1({
13727
+ ...endpoint,
13728
+ fetcher,
13729
+ userId
13730
+ }), () => [[UserQueryKeys$1.USERS]], { onSuccess: () => emit("deleted") });
13731
+ const update = useResourceMutation_default(({ userId, data }, fetcher) => updateUser$1({
13732
+ ...endpoint,
13733
+ fetcher,
13734
+ payload: data,
13735
+ userId
13736
+ }), ({ userId }) => [[UserQueryKeys$1.USER, userId], [UserQueryKeys$1.USERS]]);
14559
13737
  return () => {
14560
13738
  const current = user.data.value;
14561
13739
  return h(BaseUserDetails_default, {
@@ -14640,7 +13818,24 @@ const GroupList = createConnectedAdminList_default({
14640
13818
  base: BaseGroupList_default,
14641
13819
  errorKey: "admin.groups.list.error",
14642
13820
  name: "GroupList",
14643
- query: (params) => useGetGroups_default(() => params()),
13821
+ query: (params) => {
13822
+ const endpoint = useManagementEndpoint_default("groups");
13823
+ return useResourceQuery_default(() => {
13824
+ const { limit, offset } = params();
13825
+ return [GroupQueryKeys$1.GROUPS, {
13826
+ limit,
13827
+ offset
13828
+ }];
13829
+ }, (fetcher) => {
13830
+ const { limit, offset } = params();
13831
+ return getGroups$1({
13832
+ ...endpoint,
13833
+ fetcher,
13834
+ limit,
13835
+ offset
13836
+ });
13837
+ });
13838
+ },
14644
13839
  rows: (data) => data?.groups ?? [],
14645
13840
  rowsProp: "groups",
14646
13841
  selectedProp: "selectedGroupId",
@@ -14738,7 +13933,12 @@ const GroupCreate = defineComponent({
14738
13933
  setup(props, { emit, slots }) {
14739
13934
  const t = useAdminTranslation_default(() => props.preferences);
14740
13935
  const resolvedOuId = useDefaultOuId_default(() => props.ouId);
14741
- const creation = useCreateGroup_default({ onSuccess: (created) => emit("created", created) });
13936
+ const endpoint = useManagementEndpoint_default("groups");
13937
+ const creation = useResourceMutation_default((payload, fetcher) => createGroup$1({
13938
+ ...endpoint,
13939
+ fetcher,
13940
+ payload
13941
+ }), () => [[GroupQueryKeys$1.GROUPS], [GroupQueryKeys$1.MEMBERSHIPS]], { onSuccess: (created) => emit("created", created) });
14742
13942
  const handleSubmit = ({ description, name }) => {
14743
13943
  if (resolvedOuId.value) creation.mutate({
14744
13944
  description,
@@ -15024,11 +14224,48 @@ const GroupMembers = defineComponent({
15024
14224
  },
15025
14225
  setup(props, { slots }) {
15026
14226
  const t = useAdminTranslation_default(() => props.preferences);
15027
- const members = useGetGroupMembers_default(() => props.groupId, { limit: 100 });
15028
- const users = useGetUsers_default({ limit: 100 }, { enabled: () => props.editable });
15029
- const agents = useGetAgents_default({ limit: 100 }, { enabled: () => props.editable });
15030
- const add = useAddGroupMembers_default();
15031
- const remove = useRemoveGroupMembers_default();
14227
+ const groupsEndpoint = useManagementEndpoint_default("groups");
14228
+ const usersEndpoint = useManagementEndpoint_default("users");
14229
+ const agentsEndpoint = useManagementEndpoint_default("agents");
14230
+ const editable = () => props.editable;
14231
+ const invalidatedByMembership = ({ groupId }) => [
14232
+ [GroupQueryKeys$1.GROUP, groupId],
14233
+ [GroupQueryKeys$1.GROUP_MEMBERS, groupId],
14234
+ [GroupQueryKeys$1.MEMBERSHIPS],
14235
+ [RoleQueryKeys$1.ROLE_ASSIGNMENTS]
14236
+ ];
14237
+ const members = useResourceQuery_default(() => [
14238
+ GroupQueryKeys$1.GROUP_MEMBERS,
14239
+ props.groupId,
14240
+ { limit: 100 }
14241
+ ], (fetcher) => getGroupMembers$1({
14242
+ ...groupsEndpoint,
14243
+ fetcher,
14244
+ groupId: props.groupId,
14245
+ limit: 100
14246
+ }), { enabled: () => Boolean(props.groupId) });
14247
+ const users = useResourceQuery_default(() => [UserQueryKeys$1.USERS, { limit: 100 }], (fetcher) => getUsers$1({
14248
+ ...usersEndpoint,
14249
+ fetcher,
14250
+ limit: 100
14251
+ }), { enabled: editable });
14252
+ const agents = useResourceQuery_default(() => [AgentQueryKeys$1.AGENTS, { limit: 100 }], (fetcher) => getAgents$1({
14253
+ ...agentsEndpoint,
14254
+ fetcher,
14255
+ limit: 100
14256
+ }), { enabled: editable });
14257
+ const add = useResourceMutation_default(({ groupId, members: added }, fetcher) => addGroupMembers$1({
14258
+ ...groupsEndpoint,
14259
+ fetcher,
14260
+ groupId,
14261
+ members: added
14262
+ }), invalidatedByMembership);
14263
+ const remove = useResourceMutation_default(({ groupId, members: removed }, fetcher) => removeGroupMembers$1({
14264
+ ...groupsEndpoint,
14265
+ fetcher,
14266
+ groupId,
14267
+ members: removed
14268
+ }), invalidatedByMembership);
15032
14269
  return () => {
15033
14270
  const candidates = {
15034
14271
  agent: (agents.data.value?.agents ?? []).map((agent) => ({
@@ -15124,7 +14361,24 @@ const RoleList = createConnectedAdminList_default({
15124
14361
  base: BaseRoleList_default,
15125
14362
  errorKey: "admin.roles.list.error",
15126
14363
  name: "RoleList",
15127
- query: (params) => useGetRoles_default(() => params()),
14364
+ query: (params) => {
14365
+ const endpoint = useManagementEndpoint_default("roles");
14366
+ return useResourceQuery_default(() => {
14367
+ const { limit, offset } = params();
14368
+ return [RoleQueryKeys$1.ROLES, {
14369
+ limit,
14370
+ offset
14371
+ }];
14372
+ }, (fetcher) => {
14373
+ const { limit, offset } = params();
14374
+ return getRoles$1({
14375
+ ...endpoint,
14376
+ fetcher,
14377
+ limit,
14378
+ offset
14379
+ });
14380
+ });
14381
+ },
15128
14382
  rows: (data) => data?.roles ?? [],
15129
14383
  rowsProp: "roles",
15130
14384
  selectedProp: "selectedRoleId",
@@ -15192,85 +14446,475 @@ const BaseRoleCreate = defineComponent({
15192
14446
  };
15193
14447
  }
15194
14448
  });
15195
- var BaseRoleCreate_default = BaseRoleCreate;
14449
+ var BaseRoleCreate_default = BaseRoleCreate;
14450
+
14451
+ //#endregion
14452
+ //#region src/components/admin/RoleCreate/RoleCreate.ts
14453
+ /**
14454
+ * Creates a role through the management API in the given organization unit, or the signed-in user's
14455
+ * own. Emits `created` with the created role.
14456
+ *
14457
+ * @example
14458
+ * ```vue
14459
+ * <RoleCreate @created="(role) => (selectedRoleId = role.id)" />
14460
+ * ```
14461
+ */
14462
+ const RoleCreate = defineComponent({
14463
+ name: "RoleCreate",
14464
+ props: {
14465
+ className: adminFormProps.className,
14466
+ description: adminFormProps.description,
14467
+ onCancel: adminFormProps.onCancel,
14468
+ ouId: {
14469
+ default: void 0,
14470
+ type: String
14471
+ },
14472
+ preferences: adminFormProps.preferences,
14473
+ title: adminFormProps.title
14474
+ },
14475
+ emits: ["created"],
14476
+ setup(props, { emit, slots }) {
14477
+ const t = useAdminTranslation_default(() => props.preferences);
14478
+ const resolvedOuId = useDefaultOuId_default(() => props.ouId);
14479
+ const endpoint = useManagementEndpoint_default("roles");
14480
+ const creation = useResourceMutation_default((payload, fetcher) => createRole$1({
14481
+ ...endpoint,
14482
+ fetcher,
14483
+ payload
14484
+ }), () => [[RoleQueryKeys$1.ROLES], [RoleQueryKeys$1.ROLE_ASSIGNMENTS]], { onSuccess: (created) => emit("created", created) });
14485
+ const handleSubmit = ({ description, name }) => {
14486
+ if (resolvedOuId.value) creation.mutate({
14487
+ description,
14488
+ name,
14489
+ ouId: resolvedOuId.value
14490
+ });
14491
+ };
14492
+ return () => h(BaseRoleCreate_default, {
14493
+ className: props.className,
14494
+ description: props.description,
14495
+ error: resolvedOuId.value ? toManagementErrorMessage(t, creation.error.value, "admin.roles.create.error") : t("admin.common.errors.no_ou"),
14496
+ isSubmitting: creation.isLoading.value,
14497
+ onCancel: props.onCancel,
14498
+ onSubmit: handleSubmit,
14499
+ preferences: props.preferences,
14500
+ title: props.title
14501
+ }, { ...slots });
14502
+ }
14503
+ });
14504
+ var RoleCreate_default = RoleCreate;
14505
+
14506
+ //#endregion
14507
+ //#region src/components/admin/RoleAssignments/BaseRoleAssignments.ts
14508
+ const ASSIGNEE_TYPES = [
14509
+ "user",
14510
+ "group",
14511
+ "agent",
14512
+ "app"
14513
+ ];
14514
+ /**
14515
+ * Lists the users, groups, apps and agents a role is assigned to and optionally assigns and unassigns
14516
+ * it. Holds no data of its own: pass the assignments, the identities that can be assigned, and handle
14517
+ * the changes.
14518
+ *
14519
+ * Slots: `default`, a scoped slot that replaces the table and picker with custom UI and receives
14520
+ * {@link BaseRoleAssignmentsRenderProps}.
14521
+ */
14522
+ const BaseRoleAssignments = defineComponent({
14523
+ name: "BaseRoleAssignments",
14524
+ props: {
14525
+ assignments: {
14526
+ required: true,
14527
+ type: Array
14528
+ },
14529
+ candidates: {
14530
+ default: void 0,
14531
+ type: Object
14532
+ },
14533
+ className: {
14534
+ default: "",
14535
+ type: String
14536
+ },
14537
+ description: {
14538
+ default: void 0,
14539
+ type: String
14540
+ },
14541
+ error: {
14542
+ default: null,
14543
+ type: String
14544
+ },
14545
+ isLoading: {
14546
+ default: false,
14547
+ type: Boolean
14548
+ },
14549
+ isMutating: {
14550
+ default: false,
14551
+ type: Boolean
14552
+ },
14553
+ onAssign: {
14554
+ default: void 0,
14555
+ type: Function
14556
+ },
14557
+ onTypeFilterChange: {
14558
+ default: void 0,
14559
+ type: Function
14560
+ },
14561
+ onUnassign: {
14562
+ default: void 0,
14563
+ type: Function
14564
+ },
14565
+ preferences: {
14566
+ default: void 0,
14567
+ type: Object
14568
+ },
14569
+ title: {
14570
+ default: void 0,
14571
+ type: String
14572
+ },
14573
+ typeFilter: {
14574
+ default: null,
14575
+ type: String
14576
+ }
14577
+ },
14578
+ setup(props, { slots }) {
14579
+ const t = useAdminTranslation_default(() => props.preferences);
14580
+ return () => {
14581
+ const { candidates, onAssign, onUnassign } = props;
14582
+ const columns = [{
14583
+ header: t("admin.roles.assignments.columns.assignee"),
14584
+ id: "assignee",
14585
+ render: (assignment) => assignment.display ?? assignment.id
14586
+ }, {
14587
+ header: t("admin.roles.assignments.columns.type"),
14588
+ id: "type",
14589
+ render: (assignment) => t(`admin.common.identity_types.${assignment.type}`)
14590
+ }];
14591
+ if (onUnassign) columns.push({
14592
+ header: t("admin.common.columns.actions"),
14593
+ id: "actions",
14594
+ render: (assignment) => h(Button_default, {
14595
+ "aria-label": t("admin.roles.assignments.remove_label", { name: assignment.display ?? assignment.id }),
14596
+ color: "danger",
14597
+ disabled: props.isMutating,
14598
+ onClick: () => onUnassign(assignment),
14599
+ size: "small",
14600
+ variant: "text"
14601
+ }, { default: () => t("admin.common.actions.remove") })
14602
+ });
14603
+ if (slots["default"]) {
14604
+ const renderProps = {
14605
+ assignments: props.assignments,
14606
+ candidates: onAssign ? candidates : void 0,
14607
+ columns,
14608
+ error: props.error,
14609
+ isLoading: props.isLoading,
14610
+ isMutating: props.isMutating,
14611
+ onAssign: candidates ? onAssign : void 0,
14612
+ onTypeFilterChange: props.onTypeFilterChange,
14613
+ onUnassign,
14614
+ typeFilter: props.typeFilter
14615
+ };
14616
+ return h("div", { class: props.className }, slots["default"](renderProps));
14617
+ }
14618
+ return h(AdminSection_default, {
14619
+ block: "role-assignments",
14620
+ className: props.className,
14621
+ description: props.description,
14622
+ headingLevel: 3,
14623
+ title: props.title ?? t("admin.roles.assignments.title")
14624
+ }, { default: () => [
14625
+ onAssign && candidates ? h(IdentityPicker_default, {
14626
+ addLabel: t("admin.roles.assignments.add"),
14627
+ candidates,
14628
+ excludedIds: props.assignments.map((assignment) => assignment.id),
14629
+ isSubmitting: props.isMutating,
14630
+ onAdd: onAssign,
14631
+ t,
14632
+ types: ASSIGNEE_TYPES.filter((type) => candidates[type] !== void 0).map((type) => ({
14633
+ label: t(`admin.common.identity_types.${type}`),
14634
+ value: type
14635
+ }))
14636
+ }) : null,
14637
+ props.onTypeFilterChange ? h("div", { style: { maxWidth: "16rem" } }, [h(Select_default, {
14638
+ label: t("admin.common.filters.type"),
14639
+ modelValue: props.typeFilter ?? "",
14640
+ name: "assigneeType",
14641
+ "onUpdate:modelValue": (value) => props.onTypeFilterChange?.(value || null),
14642
+ options: [{
14643
+ label: t("admin.common.filters.all_types"),
14644
+ value: ""
14645
+ }, ...[
14646
+ "user",
14647
+ "group",
14648
+ "agent",
14649
+ "app"
14650
+ ].map((type) => ({
14651
+ label: t(`admin.common.identity_types.${type}`),
14652
+ value: type
14653
+ }))]
14654
+ })]) : null,
14655
+ h(DataTable_default, {
14656
+ caption: props.title?.length ? props.title : t("admin.roles.assignments.title"),
14657
+ columns,
14658
+ emptyText: t("admin.roles.assignments.empty"),
14659
+ error: props.error,
14660
+ getRowId: (assignment) => `${assignment.type}:${assignment.id}`,
14661
+ isLoading: props.isLoading,
14662
+ rows: props.assignments,
14663
+ t
14664
+ })
14665
+ ] });
14666
+ };
14667
+ }
14668
+ });
14669
+ var BaseRoleAssignments_default = BaseRoleAssignments;
15196
14670
 
15197
14671
  //#endregion
15198
- //#region src/components/admin/RoleCreate/RoleCreate.ts
14672
+ //#region src/components/admin/RoleAssignments/RoleAssignments.ts
15199
14673
  /**
15200
- * Creates a role through the management API in the given organization unit, or the signed-in user's
15201
- * own. Emits `created` with the created role.
14674
+ * Lists who a role is assigned to and, unless `editable` is `false`, lets the signed-in user assign it
14675
+ * to users, groups and agents or remove assignments.
15202
14676
  *
15203
14677
  * @example
15204
14678
  * ```vue
15205
- * <RoleCreate @created="(role) => (selectedRoleId = role.id)" />
14679
+ * <RoleAssignments :role-id="roleId" />
15206
14680
  * ```
15207
14681
  */
15208
- const RoleCreate = defineComponent({
15209
- name: "RoleCreate",
14682
+ const RoleAssignments = defineComponent({
14683
+ name: "RoleAssignments",
15210
14684
  props: {
15211
- className: adminFormProps.className,
15212
- description: adminFormProps.description,
15213
- onCancel: adminFormProps.onCancel,
15214
- ouId: {
14685
+ className: {
14686
+ default: "",
14687
+ type: String
14688
+ },
14689
+ description: {
15215
14690
  default: void 0,
15216
14691
  type: String
15217
14692
  },
15218
- preferences: adminFormProps.preferences,
15219
- title: adminFormProps.title
14693
+ editable: {
14694
+ default: false,
14695
+ type: Boolean
14696
+ },
14697
+ preferences: {
14698
+ default: void 0,
14699
+ type: Object
14700
+ },
14701
+ filterable: {
14702
+ default: true,
14703
+ type: Boolean
14704
+ },
14705
+ roleId: {
14706
+ required: true,
14707
+ type: String
14708
+ },
14709
+ title: {
14710
+ default: void 0,
14711
+ type: String
14712
+ }
15220
14713
  },
15221
- emits: ["created"],
15222
- setup(props, { emit, slots }) {
14714
+ setup(props, { slots }) {
15223
14715
  const t = useAdminTranslation_default(() => props.preferences);
15224
- const resolvedOuId = useDefaultOuId_default(() => props.ouId);
15225
- const creation = useCreateRole_default({ onSuccess: (created) => emit("created", created) });
15226
- const handleSubmit = ({ description, name }) => {
15227
- if (resolvedOuId.value) creation.mutate({
15228
- description,
15229
- name,
15230
- ouId: resolvedOuId.value
15231
- });
14716
+ const typeFilter = ref(null);
14717
+ const rolesEndpoint = useManagementEndpoint_default("roles");
14718
+ const usersEndpoint = useManagementEndpoint_default("users");
14719
+ const groupsEndpoint = useManagementEndpoint_default("groups");
14720
+ const agentsEndpoint = useManagementEndpoint_default("agents");
14721
+ const assignments = useResourceQuery_default(() => [
14722
+ RoleQueryKeys$1.ROLE_ASSIGNMENTS,
14723
+ props.roleId,
14724
+ {
14725
+ limit: 100,
14726
+ type: typeFilter.value ?? void 0
14727
+ }
14728
+ ], (fetcher) => getRoleAssignments$1({
14729
+ ...rolesEndpoint,
14730
+ fetcher,
14731
+ limit: 100,
14732
+ roleId: props.roleId,
14733
+ type: typeFilter.value ?? void 0
14734
+ }), { enabled: () => Boolean(props.roleId) });
14735
+ const editable = () => props.editable;
14736
+ const users = useResourceQuery_default(() => [UserQueryKeys$1.USERS, { limit: 100 }], (fetcher) => getUsers$1({
14737
+ ...usersEndpoint,
14738
+ fetcher,
14739
+ limit: 100
14740
+ }), { enabled: editable });
14741
+ const groups = useResourceQuery_default(() => [GroupQueryKeys$1.GROUPS, { limit: 100 }], (fetcher) => getGroups$1({
14742
+ ...groupsEndpoint,
14743
+ fetcher,
14744
+ limit: 100
14745
+ }), { enabled: editable });
14746
+ const agents = useResourceQuery_default(() => [AgentQueryKeys$1.AGENTS, { limit: 100 }], (fetcher) => getAgents$1({
14747
+ ...agentsEndpoint,
14748
+ fetcher,
14749
+ limit: 100
14750
+ }), { enabled: editable });
14751
+ const assign = useResourceMutation_default(({ roleId, assignments: added }, fetcher) => addRoleAssignments$1({
14752
+ ...rolesEndpoint,
14753
+ assignments: added,
14754
+ fetcher,
14755
+ roleId
14756
+ }), () => [[RoleQueryKeys$1.ROLE_ASSIGNMENTS]]);
14757
+ const unassign = useResourceMutation_default(({ roleId, assignments: removed }, fetcher) => removeRoleAssignments$1({
14758
+ ...rolesEndpoint,
14759
+ assignments: removed,
14760
+ fetcher,
14761
+ roleId
14762
+ }), () => [[RoleQueryKeys$1.ROLE_ASSIGNMENTS]]);
14763
+ return () => {
14764
+ const candidates = {
14765
+ agent: (agents.data.value?.agents ?? []).map((agent) => ({
14766
+ id: agent.id,
14767
+ label: agent.name
14768
+ })),
14769
+ group: (groups.data.value?.groups ?? []).map((group) => ({
14770
+ id: group.id,
14771
+ label: group.name
14772
+ })),
14773
+ user: (users.data.value?.users ?? []).map((user) => ({
14774
+ id: user.id,
14775
+ label: resolveManagedIdentityName(user)
14776
+ }))
14777
+ };
14778
+ return h(BaseRoleAssignments_default, {
14779
+ assignments: assignments.data.value?.assignments ?? [],
14780
+ candidates: props.editable ? candidates : void 0,
14781
+ className: props.className,
14782
+ description: props.description,
14783
+ error: toManagementErrorMessage(t, assignments.error.value, "admin.roles.assignments.error") ?? toManagementErrorMessage(t, assign.error.value ?? unassign.error.value, "admin.roles.assignments.update_error"),
14784
+ isLoading: assignments.isLoading.value,
14785
+ isMutating: assign.isLoading.value || unassign.isLoading.value,
14786
+ onAssign: props.editable ? (assignment) => void assign.mutate({
14787
+ assignments: [assignment],
14788
+ roleId: props.roleId
14789
+ }) : void 0,
14790
+ onUnassign: props.editable ? (assignment) => void unassign.mutate({
14791
+ assignments: [{
14792
+ id: assignment.id,
14793
+ type: assignment.type
14794
+ }],
14795
+ roleId: props.roleId
14796
+ }) : void 0,
14797
+ onTypeFilterChange: props.filterable ? (type) => {
14798
+ typeFilter.value = type;
14799
+ } : void 0,
14800
+ preferences: props.preferences,
14801
+ title: props.title,
14802
+ typeFilter: typeFilter.value
14803
+ }, { ...slots });
15232
14804
  };
15233
- return () => h(BaseRoleCreate_default, {
15234
- className: props.className,
15235
- description: props.description,
15236
- error: resolvedOuId.value ? toManagementErrorMessage(t, creation.error.value, "admin.roles.create.error") : t("admin.common.errors.no_ou"),
15237
- isSubmitting: creation.isLoading.value,
15238
- onCancel: props.onCancel,
15239
- onSubmit: handleSubmit,
15240
- preferences: props.preferences,
15241
- title: props.title
15242
- }, { ...slots });
15243
14805
  }
15244
14806
  });
15245
- var RoleCreate_default = RoleCreate;
14807
+ var RoleAssignments_default = RoleAssignments;
15246
14808
 
15247
14809
  //#endregion
15248
- //#region src/components/admin/RoleAssignments/BaseRoleAssignments.ts
15249
- const ASSIGNEE_TYPES = [
15250
- "user",
15251
- "group",
15252
- "agent",
15253
- "app"
15254
- ];
14810
+ //#region src/components/admin/RolePermissions/BaseRolePermissions.ts
15255
14811
  /**
15256
- * Lists the users, groups, apps and agents a role is assigned to and optionally assigns and unassigns
15257
- * it. Holds no data of its own: pass the assignments, the identities that can be assigned, and handle
15258
- * the changes.
14812
+ * Shows the permissions a role grants, grouped by resource server. Holds no data of its own: pass the
14813
+ * permissions.
15259
14814
  *
15260
- * Slots: `default`, a scoped slot that replaces the table and picker with custom UI and receives
15261
- * {@link BaseRoleAssignmentsRenderProps}.
14815
+ * Slots: `default`, a scoped slot that replaces the view with custom UI and receives
14816
+ * {@link BaseRolePermissionsRenderProps}.
14817
+ */
14818
+ const BaseRolePermissions = defineComponent({
14819
+ name: "BaseRolePermissions",
14820
+ props: {
14821
+ className: {
14822
+ default: "",
14823
+ type: String
14824
+ },
14825
+ description: {
14826
+ default: void 0,
14827
+ type: String
14828
+ },
14829
+ error: {
14830
+ default: null,
14831
+ type: String
14832
+ },
14833
+ isLoading: {
14834
+ default: false,
14835
+ type: Boolean
14836
+ },
14837
+ permissions: {
14838
+ required: true,
14839
+ type: Array
14840
+ },
14841
+ preferences: {
14842
+ default: void 0,
14843
+ type: Object
14844
+ },
14845
+ resourceServerNames: {
14846
+ default: void 0,
14847
+ type: Object
14848
+ },
14849
+ title: {
14850
+ default: void 0,
14851
+ type: String
14852
+ }
14853
+ },
14854
+ setup(props, { slots }) {
14855
+ const t = useAdminTranslation_default(() => props.preferences);
14856
+ const resolveResourceServerName = (resourceServerId) => props.resourceServerNames?.[resourceServerId] ?? resourceServerId;
14857
+ const renderContent = () => {
14858
+ if (props.isLoading) return h("span", {
14859
+ class: withVendorCSSClassPrefix("admin__muted"),
14860
+ role: "status"
14861
+ }, [h(Spinner_default, {
14862
+ "aria-hidden": "true",
14863
+ size: "small"
14864
+ }), t("admin.common.loading")]);
14865
+ if (props.error) return h(Alert_default, { severity: "error" }, { default: () => [props.error] });
14866
+ const granted = props.permissions.filter((entry) => entry.permissions.length > 0);
14867
+ if (granted.length === 0) return h("span", { class: withVendorCSSClassPrefix("admin__muted") }, t("admin.roles.permissions.empty"));
14868
+ return granted.map((entry) => {
14869
+ const name = resolveResourceServerName(entry.resourceServerId);
14870
+ return h(Panel_default, {
14871
+ key: entry.resourceServerId,
14872
+ title: name
14873
+ }, { default: () => h(ChipList_default, {
14874
+ emptyText: t("admin.roles.permissions.empty"),
14875
+ items: entry.permissions.map((permission) => ({
14876
+ id: permission,
14877
+ label: permission
14878
+ })),
14879
+ label: name
14880
+ }) });
14881
+ });
14882
+ };
14883
+ return () => {
14884
+ if (slots["default"]) {
14885
+ const renderProps = {
14886
+ error: props.error,
14887
+ isLoading: props.isLoading,
14888
+ permissions: props.permissions.filter((entry) => entry.permissions.length > 0),
14889
+ resolveResourceServerName
14890
+ };
14891
+ return h("div", { class: props.className }, slots["default"](renderProps));
14892
+ }
14893
+ return h(AdminSection_default, {
14894
+ block: "role-permissions",
14895
+ className: props.className,
14896
+ description: props.description,
14897
+ headingLevel: 3,
14898
+ title: props.title ?? t("admin.roles.permissions.title")
14899
+ }, { default: renderContent });
14900
+ };
14901
+ }
14902
+ });
14903
+ var BaseRolePermissions_default = BaseRolePermissions;
14904
+
14905
+ //#endregion
14906
+ //#region src/components/admin/RolePermissions/RolePermissions.ts
14907
+ /**
14908
+ * Shows the permissions a role grants, grouped by resource server.
14909
+ *
14910
+ * @example
14911
+ * ```vue
14912
+ * <RolePermissions :role-id="roleId" />
14913
+ * ```
15262
14914
  */
15263
- const BaseRoleAssignments = defineComponent({
15264
- name: "BaseRoleAssignments",
14915
+ const RolePermissions = defineComponent({
14916
+ name: "RolePermissions",
15265
14917
  props: {
15266
- assignments: {
15267
- required: true,
15268
- type: Array
15269
- },
15270
- candidates: {
15271
- default: void 0,
15272
- type: Object
15273
- },
15274
14918
  className: {
15275
14919
  default: "",
15276
14920
  type: String
@@ -15279,566 +14923,842 @@ const BaseRoleAssignments = defineComponent({
15279
14923
  default: void 0,
15280
14924
  type: String
15281
14925
  },
15282
- error: {
15283
- default: null,
15284
- type: String
15285
- },
15286
- isLoading: {
15287
- default: false,
15288
- type: Boolean
15289
- },
15290
- isMutating: {
15291
- default: false,
15292
- type: Boolean
15293
- },
15294
- onAssign: {
15295
- default: void 0,
15296
- type: Function
15297
- },
15298
- onTypeFilterChange: {
15299
- default: void 0,
15300
- type: Function
15301
- },
15302
- onUnassign: {
15303
- default: void 0,
15304
- type: Function
15305
- },
15306
14926
  preferences: {
15307
14927
  default: void 0,
15308
14928
  type: Object
15309
14929
  },
15310
- title: {
14930
+ resourceServerNames: {
15311
14931
  default: void 0,
14932
+ type: Object
14933
+ },
14934
+ roleId: {
14935
+ required: true,
15312
14936
  type: String
15313
14937
  },
15314
- typeFilter: {
15315
- default: null,
14938
+ title: {
14939
+ default: void 0,
15316
14940
  type: String
15317
14941
  }
15318
14942
  },
15319
14943
  setup(props, { slots }) {
15320
14944
  const t = useAdminTranslation_default(() => props.preferences);
15321
- return () => {
15322
- const { candidates, onAssign, onUnassign } = props;
15323
- const columns = [{
15324
- header: t("admin.roles.assignments.columns.assignee"),
15325
- id: "assignee",
15326
- render: (assignment) => assignment.display ?? assignment.id
15327
- }, {
15328
- header: t("admin.roles.assignments.columns.type"),
15329
- id: "type",
15330
- render: (assignment) => t(`admin.common.identity_types.${assignment.type}`)
14945
+ const endpoint = useManagementEndpoint_default("roles");
14946
+ const role = useResourceQuery_default(() => [RoleQueryKeys$1.ROLE, props.roleId], (fetcher) => getRole$1({
14947
+ ...endpoint,
14948
+ fetcher,
14949
+ roleId: props.roleId
14950
+ }), { enabled: () => Boolean(props.roleId) });
14951
+ return () => h(BaseRolePermissions_default, {
14952
+ className: props.className,
14953
+ description: props.description,
14954
+ error: toManagementErrorMessage(t, role.error.value, "admin.roles.permissions.error"),
14955
+ isLoading: role.isLoading.value,
14956
+ permissions: role.data.value?.permissions ?? [],
14957
+ preferences: props.preferences,
14958
+ resourceServerNames: props.resourceServerNames,
14959
+ title: props.title
14960
+ }, { ...slots });
14961
+ }
14962
+ });
14963
+ var RolePermissions_default = RolePermissions;
14964
+
14965
+ //#endregion
14966
+ //#region src/components/admin/AgentList/BaseAgentList.ts
14967
+ /**
14968
+ * Lists agents with their type, client identifier and organization unit. Holds no data of its own:
14969
+ * pass the page of agents and handle selection and pagination.
14970
+ *
14971
+ * Props: `agents` (required), `selectedAgentId`, `isLoading`, `error`, `limit`, `offset`, `totalResults`,
14972
+ * `onPageChange`, `onSelect` (`@select`), `title`, `description`, `className`, `preferences`.
14973
+ * Slots: `actions`, rendered next to the title; `default`, a scoped slot that replaces the table with custom UI and
14974
+ * receives `AdminListRenderProps` (rows, default columns, loading and error state, pagination and selection).
14975
+ */
14976
+ const BaseAgentList = createAdminList_default({
14977
+ block: "agent-list",
14978
+ columns: (t) => [
14979
+ {
14980
+ header: t("admin.agents.list.columns.name"),
14981
+ id: "name",
14982
+ render: (agent) => agent.name
14983
+ },
14984
+ {
14985
+ header: t("admin.agents.list.columns.type"),
14986
+ id: "type",
14987
+ render: (agent) => agent.type
14988
+ },
14989
+ {
14990
+ header: t("admin.agents.list.columns.client_id"),
14991
+ id: "clientId",
14992
+ render: (agent) => h("code", {}, agent.clientId ?? "")
14993
+ },
14994
+ {
14995
+ header: t("admin.common.columns.organization_unit"),
14996
+ id: "ou",
14997
+ render: (agent) => agent.ouHandle ?? agent.ouId
14998
+ }
14999
+ ],
15000
+ emptyKey: "admin.agents.list.empty",
15001
+ getRowId: (row) => row.id,
15002
+ name: "BaseAgentList",
15003
+ rowsProp: "agents",
15004
+ selectedProp: "selectedAgentId",
15005
+ titleKey: "admin.agents.list.title"
15006
+ });
15007
+ var BaseAgentList_default = BaseAgentList;
15008
+
15009
+ //#endregion
15010
+ //#region src/components/admin/AgentList/AgentList.ts
15011
+ /**
15012
+ * Lists the agents the signed-in user is allowed to see, a page at a time.
15013
+ *
15014
+ * Props: `searchable` (default `true`; shows a search form the server matches exactly), `searchAttributes`, `limit`, `selectedAgentId`, `onSelect` (`@select`), `title`, `description`, `className`,
15015
+ * `preferences`. Slots: `actions`; `default`, a scoped slot that replaces the table with custom UI and
15016
+ * receives `AdminListRenderProps` (rows, default columns, loading and error state, pagination and selection).
15017
+ *
15018
+ * @example
15019
+ * ```vue
15020
+ * <AgentList @select="(agent) => (selectedAgentId = agent.id)" />
15021
+ * ```
15022
+ */
15023
+ const AgentList = createConnectedAdminList_default({
15024
+ base: BaseAgentList_default,
15025
+ errorKey: "admin.agents.list.error",
15026
+ name: "AgentList",
15027
+ query: (params) => {
15028
+ const endpoint = useManagementEndpoint_default("agents");
15029
+ return useResourceQuery_default(() => {
15030
+ const { filter, limit, offset } = params();
15031
+ return [AgentQueryKeys$1.AGENTS, {
15032
+ filter,
15033
+ limit,
15034
+ offset
15331
15035
  }];
15332
- if (onUnassign) columns.push({
15333
- header: t("admin.common.columns.actions"),
15334
- id: "actions",
15335
- render: (assignment) => h(Button_default, {
15336
- "aria-label": t("admin.roles.assignments.remove_label", { name: assignment.display ?? assignment.id }),
15337
- color: "danger",
15338
- disabled: props.isMutating,
15339
- onClick: () => onUnassign(assignment),
15340
- size: "small",
15341
- variant: "text"
15342
- }, { default: () => t("admin.common.actions.remove") })
15036
+ }, (fetcher) => {
15037
+ const { filter, limit, offset } = params();
15038
+ return getAgents$1({
15039
+ ...endpoint,
15040
+ fetcher,
15041
+ filter,
15042
+ limit,
15043
+ offset
15044
+ });
15045
+ });
15046
+ },
15047
+ rows: (data) => data?.agents ?? [],
15048
+ rowsProp: "agents",
15049
+ searchAttributes: (t) => [{
15050
+ label: t("admin.agents.list.search.name"),
15051
+ value: "name"
15052
+ }],
15053
+ selectedProp: "selectedAgentId",
15054
+ total: (data) => data?.totalResults
15055
+ });
15056
+ var AgentList_default = AgentList;
15057
+
15058
+ //#endregion
15059
+ //#region src/components/admin/AgentCreate/BaseAgentCreate.ts
15060
+ /**
15061
+ * A form that collects a new agent's name, type and description. Holds no data of its own: handle the
15062
+ * `submit` event, which carries a {@link AgentCreateSubmission}. Slots: `default`, a scoped slot that
15063
+ * replaces the form with custom UI and receives {@link BaseAgentCreateRenderProps}.
15064
+ */
15065
+ const BaseAgentCreate = defineComponent({
15066
+ name: "BaseAgentCreate",
15067
+ props: {
15068
+ ...adminFormProps,
15069
+ agentTypes: {
15070
+ required: true,
15071
+ type: Array
15072
+ }
15073
+ },
15074
+ emits: ["submit"],
15075
+ setup(props, { emit, slots }) {
15076
+ const t = useAdminTranslation_default(() => props.preferences);
15077
+ const uid = useId();
15078
+ const name = ref("");
15079
+ const description = ref("");
15080
+ const chosenType = ref("");
15081
+ return () => {
15082
+ const type = chosenType.value || (props.agentTypes[0]?.value ?? "");
15083
+ return renderAdminForm_default({
15084
+ block: "agent-create",
15085
+ canSubmit: Boolean(name.value.trim()) && Boolean(type),
15086
+ fields: [
15087
+ h(TextField_default, {
15088
+ label: t("admin.agents.create.fields.name"),
15089
+ modelValue: name.value,
15090
+ name: `${uid}-name`,
15091
+ "onUpdate:modelValue": (value) => {
15092
+ name.value = value;
15093
+ },
15094
+ required: true
15095
+ }),
15096
+ h(Select_default, {
15097
+ label: t("admin.agents.create.fields.type"),
15098
+ modelValue: type,
15099
+ name: `${uid}-type`,
15100
+ "onUpdate:modelValue": (value) => {
15101
+ chosenType.value = value;
15102
+ },
15103
+ options: props.agentTypes,
15104
+ required: true
15105
+ }),
15106
+ h(TextField_default, {
15107
+ label: t("admin.agents.create.fields.description"),
15108
+ modelValue: description.value,
15109
+ name: `${uid}-description`,
15110
+ "onUpdate:modelValue": (value) => {
15111
+ description.value = value;
15112
+ }
15113
+ })
15114
+ ],
15115
+ onSubmit: () => {
15116
+ emit("submit", {
15117
+ description: description.value.trim() || void 0,
15118
+ name: name.value.trim(),
15119
+ type
15120
+ });
15121
+ },
15122
+ props,
15123
+ renderProps: {
15124
+ agentTypes: props.agentTypes,
15125
+ handleInputChange: (field, value) => {
15126
+ ({
15127
+ description,
15128
+ name,
15129
+ type: chosenType
15130
+ })[field].value = value;
15131
+ },
15132
+ values: {
15133
+ description: description.value,
15134
+ name: name.value,
15135
+ type
15136
+ }
15137
+ },
15138
+ slot: slots["default"],
15139
+ submitLabel: t("admin.agents.create.submit"),
15140
+ t,
15141
+ title: t("admin.agents.create.title")
15343
15142
  });
15344
- if (slots["default"]) {
15345
- const renderProps = {
15346
- assignments: props.assignments,
15347
- candidates: onAssign ? candidates : void 0,
15348
- columns,
15349
- error: props.error,
15350
- isLoading: props.isLoading,
15351
- isMutating: props.isMutating,
15352
- onAssign: candidates ? onAssign : void 0,
15353
- onTypeFilterChange: props.onTypeFilterChange,
15354
- onUnassign,
15355
- typeFilter: props.typeFilter
15356
- };
15357
- return h("div", { class: props.className }, slots["default"](renderProps));
15358
- }
15359
- return h(AdminSection_default, {
15360
- block: "role-assignments",
15361
- className: props.className,
15362
- description: props.description,
15363
- headingLevel: 3,
15364
- title: props.title ?? t("admin.roles.assignments.title")
15365
- }, { default: () => [
15366
- onAssign && candidates ? h(IdentityPicker_default, {
15367
- addLabel: t("admin.roles.assignments.add"),
15368
- candidates,
15369
- excludedIds: props.assignments.map((assignment) => assignment.id),
15370
- isSubmitting: props.isMutating,
15371
- onAdd: onAssign,
15372
- t,
15373
- types: ASSIGNEE_TYPES.filter((type) => candidates[type] !== void 0).map((type) => ({
15374
- label: t(`admin.common.identity_types.${type}`),
15375
- value: type
15376
- }))
15377
- }) : null,
15378
- props.onTypeFilterChange ? h("div", { style: { maxWidth: "16rem" } }, [h(Select_default, {
15379
- label: t("admin.common.filters.type"),
15380
- modelValue: props.typeFilter ?? "",
15381
- name: "assigneeType",
15382
- "onUpdate:modelValue": (value) => props.onTypeFilterChange?.(value || null),
15383
- options: [{
15384
- label: t("admin.common.filters.all_types"),
15385
- value: ""
15386
- }, ...[
15387
- "user",
15388
- "group",
15389
- "agent",
15390
- "app"
15391
- ].map((type) => ({
15392
- label: t(`admin.common.identity_types.${type}`),
15393
- value: type
15394
- }))]
15395
- })]) : null,
15396
- h(DataTable_default, {
15397
- caption: props.title?.length ? props.title : t("admin.roles.assignments.title"),
15398
- columns,
15399
- emptyText: t("admin.roles.assignments.empty"),
15400
- error: props.error,
15401
- getRowId: (assignment) => `${assignment.type}:${assignment.id}`,
15402
- isLoading: props.isLoading,
15403
- rows: props.assignments,
15404
- t
15405
- })
15406
- ] });
15407
15143
  };
15408
15144
  }
15409
15145
  });
15410
- var BaseRoleAssignments_default = BaseRoleAssignments;
15146
+ var BaseAgentCreate_default = BaseAgentCreate;
15411
15147
 
15412
15148
  //#endregion
15413
- //#region src/components/admin/RoleAssignments/RoleAssignments.ts
15149
+ //#region src/components/admin/AgentCreate/AgentCreate.ts
15414
15150
  /**
15415
- * Lists who a role is assigned to and, unless `editable` is `false`, lets the signed-in user assign it
15416
- * to users, groups and agents or remove assignments.
15151
+ * Creates a agent through the management API in the given organization unit, or the signed-in user's
15152
+ * own. Emits `created` with the created agent.
15417
15153
  *
15418
15154
  * @example
15419
15155
  * ```vue
15420
- * <RoleAssignments :role-id="roleId" />
15156
+ * <AgentCreate @created="(agent) => (selectedAgentId = agent.id)" />
15421
15157
  * ```
15422
15158
  */
15423
- const RoleAssignments = defineComponent({
15424
- name: "RoleAssignments",
15159
+ const AgentCreate = defineComponent({
15160
+ name: "AgentCreate",
15425
15161
  props: {
15426
- className: {
15427
- default: "",
15428
- type: String
15429
- },
15430
- description: {
15162
+ className: adminFormProps.className,
15163
+ description: adminFormProps.description,
15164
+ onCancel: adminFormProps.onCancel,
15165
+ ouId: {
15431
15166
  default: void 0,
15432
15167
  type: String
15433
15168
  },
15434
- editable: {
15435
- default: false,
15436
- type: Boolean
15437
- },
15438
- preferences: {
15169
+ owner: {
15439
15170
  default: void 0,
15440
- type: Object
15441
- },
15442
- filterable: {
15443
- default: true,
15444
- type: Boolean
15445
- },
15446
- roleId: {
15447
- required: true,
15448
15171
  type: String
15449
15172
  },
15450
- title: {
15451
- default: void 0,
15452
- type: String
15453
- }
15173
+ preferences: adminFormProps.preferences,
15174
+ title: adminFormProps.title
15454
15175
  },
15455
- setup(props, { slots }) {
15176
+ emits: ["created"],
15177
+ setup(props, { emit, slots }) {
15456
15178
  const t = useAdminTranslation_default(() => props.preferences);
15457
- const typeFilter = ref(null);
15458
- const assignments = useGetRoleAssignments_default(() => props.roleId, () => ({
15459
- limit: 100,
15460
- type: typeFilter.value ?? void 0
15179
+ const resolvedOuId = useDefaultOuId_default(() => props.ouId);
15180
+ const agentTypesEndpoint = useManagementEndpoint_default("agentTypes");
15181
+ const agentsEndpoint = useManagementEndpoint_default("agents");
15182
+ const agentTypes = useResourceQuery_default(() => [AgentQueryKeys$1.AGENT_TYPES, { limit: 100 }], (fetcher) => getAgentTypes$1({
15183
+ ...agentTypesEndpoint,
15184
+ fetcher,
15185
+ limit: 100
15461
15186
  }));
15462
- const editable = () => props.editable;
15463
- const users = useGetUsers_default({ limit: 100 }, { enabled: editable });
15464
- const groups = useGetGroups_default({ limit: 100 }, { enabled: editable });
15465
- const agents = useGetAgents_default({ limit: 100 }, { enabled: editable });
15466
- const assign = useAddRoleAssignments_default();
15467
- const unassign = useRemoveRoleAssignments_default();
15468
- return () => {
15469
- const candidates = {
15470
- agent: (agents.data.value?.agents ?? []).map((agent) => ({
15471
- id: agent.id,
15472
- label: agent.name
15473
- })),
15474
- group: (groups.data.value?.groups ?? []).map((group) => ({
15475
- id: group.id,
15476
- label: group.name
15477
- })),
15478
- user: (users.data.value?.users ?? []).map((user) => ({
15479
- id: user.id,
15480
- label: resolveManagedIdentityName(user)
15481
- }))
15482
- };
15483
- return h(BaseRoleAssignments_default, {
15484
- assignments: assignments.data.value?.assignments ?? [],
15485
- candidates: props.editable ? candidates : void 0,
15486
- className: props.className,
15487
- description: props.description,
15488
- error: toManagementErrorMessage(t, assignments.error.value, "admin.roles.assignments.error") ?? toManagementErrorMessage(t, assign.error.value ?? unassign.error.value, "admin.roles.assignments.update_error"),
15489
- isLoading: assignments.isLoading.value,
15490
- isMutating: assign.isLoading.value || unassign.isLoading.value,
15491
- onAssign: props.editable ? (assignment) => void assign.mutate({
15492
- assignments: [assignment],
15493
- roleId: props.roleId
15494
- }) : void 0,
15495
- onUnassign: props.editable ? (assignment) => void unassign.mutate({
15496
- assignments: [{
15497
- id: assignment.id,
15498
- type: assignment.type
15499
- }],
15500
- roleId: props.roleId
15501
- }) : void 0,
15502
- onTypeFilterChange: props.filterable ? (type) => {
15503
- typeFilter.value = type;
15504
- } : void 0,
15505
- preferences: props.preferences,
15506
- title: props.title,
15507
- typeFilter: typeFilter.value
15508
- }, { ...slots });
15187
+ const options = computed(() => (agentTypes.data.value?.types ?? []).map((agentType) => ({
15188
+ label: agentType.displayName,
15189
+ value: agentType.handle
15190
+ })));
15191
+ const creation = useResourceMutation_default((payload, fetcher) => createAgent$1({
15192
+ ...agentsEndpoint,
15193
+ fetcher,
15194
+ payload
15195
+ }), () => [[AgentQueryKeys$1.AGENTS]], { onSuccess: (created) => emit("created", created) });
15196
+ const handleSubmit = ({ description, name, type }) => {
15197
+ if (resolvedOuId.value) creation.mutate({
15198
+ description,
15199
+ name,
15200
+ ouId: resolvedOuId.value,
15201
+ owner: props.owner,
15202
+ type
15203
+ });
15509
15204
  };
15205
+ return () => h(BaseAgentCreate_default, {
15206
+ agentTypes: options.value,
15207
+ className: props.className,
15208
+ description: props.description,
15209
+ error: resolvedOuId.value ? toManagementErrorMessage(t, creation.error.value, "admin.agents.create.error") : t("admin.common.errors.no_ou"),
15210
+ isSubmitting: creation.isLoading.value,
15211
+ onCancel: props.onCancel,
15212
+ onSubmit: handleSubmit,
15213
+ preferences: props.preferences,
15214
+ title: props.title
15215
+ }, { ...slots });
15510
15216
  }
15511
15217
  });
15512
- var RoleAssignments_default = RoleAssignments;
15218
+ var AgentCreate_default = AgentCreate;
15513
15219
 
15514
15220
  //#endregion
15515
- //#region src/components/admin/RolePermissions/BaseRolePermissions.ts
15221
+ //#region src/components/admin/AgentDetails/BaseAgentDetails.ts
15222
+ const cls$3 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
15516
15223
  /**
15517
- * Shows the permissions a role grants, grouped by resource server. Holds no data of its own: pass the
15518
- * permissions.
15224
+ * Shows an agent's type, owner, organization unit, client identifier, groups and roles. Holds no data
15225
+ * of its own: pass the agent and handle deletion.
15519
15226
  *
15520
- * Slots: `default`, a scoped slot that replaces the view with custom UI and receives
15521
- * {@link BaseRolePermissionsRenderProps}.
15227
+ * Slots: `actions`, rendered next to the agent's name; `default`, a scoped slot that replaces the view
15228
+ * with custom UI and receives {@link BaseAgentDetailsRenderProps}.
15522
15229
  */
15523
- const BaseRolePermissions = defineComponent({
15524
- name: "BaseRolePermissions",
15230
+ const BaseAgentDetails = defineComponent({
15231
+ name: "BaseAgentDetails",
15525
15232
  props: {
15233
+ agent: {
15234
+ default: void 0,
15235
+ type: Object
15236
+ },
15526
15237
  className: {
15527
15238
  default: "",
15528
15239
  type: String
15529
15240
  },
15530
- description: {
15531
- default: void 0,
15532
- type: String
15533
- },
15534
15241
  error: {
15535
15242
  default: null,
15536
15243
  type: String
15537
15244
  },
15538
- isLoading: {
15245
+ groups: {
15246
+ default: () => [],
15247
+ type: Array
15248
+ },
15249
+ isDeleting: {
15539
15250
  default: false,
15540
15251
  type: Boolean
15541
15252
  },
15542
- permissions: {
15543
- required: true,
15544
- type: Array
15545
- },
15546
- preferences: {
15547
- default: void 0,
15548
- type: Object
15253
+ isLoading: {
15254
+ default: false,
15255
+ type: Boolean
15549
15256
  },
15550
- resourceServerNames: {
15257
+ onDelete: {
15551
15258
  default: void 0,
15552
- type: Object
15259
+ type: Function
15553
15260
  },
15554
- title: {
15555
- default: void 0,
15556
- type: String
15557
- }
15558
- },
15559
- setup(props, { slots }) {
15560
- const t = useAdminTranslation_default(() => props.preferences);
15561
- const resolveResourceServerName = (resourceServerId) => props.resourceServerNames?.[resourceServerId] ?? resourceServerId;
15562
- const renderContent = () => {
15563
- if (props.isLoading) return h("span", {
15564
- class: withVendorCSSClassPrefix("admin__muted"),
15565
- role: "status"
15566
- }, [h(Spinner_default, {
15567
- "aria-hidden": "true",
15568
- size: "small"
15569
- }), t("admin.common.loading")]);
15570
- if (props.error) return h(Alert_default, { severity: "error" }, { default: () => [props.error] });
15571
- const granted = props.permissions.filter((entry) => entry.permissions.length > 0);
15572
- if (granted.length === 0) return h("span", { class: withVendorCSSClassPrefix("admin__muted") }, t("admin.roles.permissions.empty"));
15573
- return granted.map((entry) => {
15574
- const name = resolveResourceServerName(entry.resourceServerId);
15575
- return h(Panel_default, {
15576
- key: entry.resourceServerId,
15577
- title: name
15578
- }, { default: () => h(ChipList_default, {
15579
- emptyText: t("admin.roles.permissions.empty"),
15580
- items: entry.permissions.map((permission) => ({
15581
- id: permission,
15582
- label: permission
15583
- })),
15584
- label: name
15585
- }) });
15586
- });
15587
- };
15261
+ preferences: {
15262
+ default: void 0,
15263
+ type: Object
15264
+ },
15265
+ roles: {
15266
+ default: () => [],
15267
+ type: Array
15268
+ }
15269
+ },
15270
+ setup(props, { slots }) {
15271
+ const t = useAdminTranslation_default(() => props.preferences);
15588
15272
  return () => {
15273
+ const { agent } = props;
15589
15274
  if (slots["default"]) {
15590
15275
  const renderProps = {
15276
+ agent,
15591
15277
  error: props.error,
15278
+ groups: props.groups,
15279
+ isDeleting: props.isDeleting,
15592
15280
  isLoading: props.isLoading,
15593
- permissions: props.permissions.filter((entry) => entry.permissions.length > 0),
15594
- resolveResourceServerName
15281
+ onDelete: agent && !agent.isReadOnly ? props.onDelete : void 0,
15282
+ roles: props.roles
15595
15283
  };
15596
15284
  return h("div", { class: props.className }, slots["default"](renderProps));
15597
15285
  }
15286
+ if (props.isLoading && !agent) return h(AdminSection_default, {
15287
+ block: "agent-details",
15288
+ className: props.className
15289
+ }, { default: () => h("span", {
15290
+ class: cls$3("muted"),
15291
+ role: "status"
15292
+ }, [h(Spinner_default, {
15293
+ "aria-hidden": "true",
15294
+ size: "small"
15295
+ }), t("admin.common.loading")]) });
15296
+ if (!agent) return h(AdminSection_default, {
15297
+ block: "agent-details",
15298
+ className: props.className
15299
+ }, { default: () => h(Alert_default, { severity: "error" }, { default: () => [props.error ?? t("admin.common.errors.not_found")] }) });
15300
+ const details = [
15301
+ {
15302
+ label: t("admin.agents.details.type"),
15303
+ value: agent.type
15304
+ },
15305
+ {
15306
+ label: t("admin.agents.details.owner"),
15307
+ value: agent.owner ?? t("admin.agents.details.no_owner")
15308
+ },
15309
+ {
15310
+ label: t("admin.common.columns.organization_unit"),
15311
+ value: agent.ouHandle ?? agent.ouId
15312
+ }
15313
+ ];
15314
+ if (agent.clientId) details.push({
15315
+ label: t("admin.agents.list.columns.client_id"),
15316
+ value: h(CopyableText_default, { value: agent.clientId })
15317
+ });
15598
15318
  return h(AdminSection_default, {
15599
- block: "role-permissions",
15319
+ block: "agent-details",
15600
15320
  className: props.className,
15601
- description: props.description,
15602
- headingLevel: 3,
15603
- title: props.title ?? t("admin.roles.permissions.title")
15604
- }, { default: renderContent });
15321
+ description: agent.description,
15322
+ title: agent.name
15323
+ }, {
15324
+ actions: () => [slots["actions"]?.(), props.onDelete && !agent.isReadOnly ? h(ConfirmButton_default, {
15325
+ confirmText: t("admin.agents.details.delete.confirm", { name: agent.name }),
15326
+ isLoading: props.isDeleting,
15327
+ onConfirm: props.onDelete,
15328
+ t
15329
+ }, { default: () => t("admin.agents.details.delete.action") }) : null],
15330
+ default: () => [
15331
+ props.error ? h(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null,
15332
+ h(Panel_default, { title: t("admin.agents.details.overview") }, { default: () => h(DetailList_default, { items: details }) }),
15333
+ h(Panel_default, { title: t("admin.agents.details.groups") }, { default: () => h(ChipList_default, {
15334
+ emptyText: t("admin.agents.details.no_groups"),
15335
+ items: props.groups.map((group) => ({
15336
+ id: group.id,
15337
+ label: group.name
15338
+ })),
15339
+ label: t("admin.agents.details.groups")
15340
+ }) }),
15341
+ h(Panel_default, { title: t("admin.agents.details.roles") }, { default: () => h(ChipList_default, {
15342
+ emptyText: t("admin.agents.details.no_roles"),
15343
+ items: props.roles.map((role) => ({
15344
+ id: role,
15345
+ label: role
15346
+ })),
15347
+ label: t("admin.agents.details.roles")
15348
+ }) })
15349
+ ]
15350
+ });
15605
15351
  };
15606
15352
  }
15607
15353
  });
15608
- var BaseRolePermissions_default = BaseRolePermissions;
15354
+ var BaseAgentDetails_default = BaseAgentDetails;
15609
15355
 
15610
15356
  //#endregion
15611
- //#region src/components/admin/RolePermissions/RolePermissions.ts
15357
+ //#region src/components/admin/AgentDetails/AgentDetails.ts
15612
15358
  /**
15613
- * Shows the permissions a role grants, grouped by resource server.
15359
+ * Shows an agent with the groups it belongs to and the roles it holds, and optionally lets the
15360
+ * signed-in user delete it. Emits `deleted` after the agent has been deleted.
15361
+ *
15362
+ * Slots: `actions`, rendered next to the agent's name.
15614
15363
  *
15615
15364
  * @example
15616
15365
  * ```vue
15617
- * <RolePermissions :role-id="roleId" />
15366
+ * <AgentDetails :agent-id="agentId" deletable @deleted="router.push('/agents')" />
15618
15367
  * ```
15619
15368
  */
15620
- const RolePermissions = defineComponent({
15621
- name: "RolePermissions",
15369
+ const AgentDetails = defineComponent({
15370
+ name: "AgentDetails",
15622
15371
  props: {
15372
+ agentId: {
15373
+ required: true,
15374
+ type: String
15375
+ },
15623
15376
  className: {
15624
15377
  default: "",
15625
15378
  type: String
15626
15379
  },
15627
- description: {
15628
- default: void 0,
15629
- type: String
15380
+ deletable: {
15381
+ default: false,
15382
+ type: Boolean
15630
15383
  },
15631
15384
  preferences: {
15632
15385
  default: void 0,
15633
15386
  type: Object
15634
- },
15635
- resourceServerNames: {
15636
- default: void 0,
15637
- type: Object
15638
- },
15639
- roleId: {
15640
- required: true,
15641
- type: String
15642
- },
15643
- title: {
15644
- default: void 0,
15645
- type: String
15646
15387
  }
15647
15388
  },
15648
- setup(props, { slots }) {
15389
+ emits: ["deleted"],
15390
+ setup(props, { emit, slots }) {
15649
15391
  const t = useAdminTranslation_default(() => props.preferences);
15650
- const role = useGetRole_default(() => props.roleId);
15651
- return () => h(BaseRolePermissions_default, {
15392
+ const endpoint = useManagementEndpoint_default("agents");
15393
+ const hasAgentId = () => Boolean(props.agentId);
15394
+ const agent = useResourceQuery_default(() => [AgentQueryKeys$1.AGENT, props.agentId], (fetcher) => getAgent$1({
15395
+ ...endpoint,
15396
+ agentId: props.agentId,
15397
+ fetcher
15398
+ }), { enabled: hasAgentId });
15399
+ const groups = useResourceQuery_default(() => [
15400
+ GroupQueryKeys$1.MEMBERSHIPS,
15401
+ "agent",
15402
+ props.agentId,
15403
+ { limit: 100 }
15404
+ ], (fetcher) => getAgentGroups$1({
15405
+ ...endpoint,
15406
+ agentId: props.agentId,
15407
+ fetcher,
15408
+ limit: 100
15409
+ }), { enabled: hasAgentId });
15410
+ const roles = useResourceQuery_default(() => [
15411
+ RoleQueryKeys$1.ROLE_ASSIGNMENTS,
15412
+ "agent",
15413
+ props.agentId,
15414
+ { limit: 100 }
15415
+ ], (fetcher) => getAgentRoles$1({
15416
+ ...endpoint,
15417
+ agentId: props.agentId,
15418
+ fetcher,
15419
+ limit: 100
15420
+ }), { enabled: hasAgentId });
15421
+ const deletion = useResourceMutation_default((agentId, fetcher) => deleteAgent$1({
15422
+ ...endpoint,
15423
+ agentId,
15424
+ fetcher
15425
+ }), () => [[AgentQueryKeys$1.AGENTS]], { onSuccess: () => emit("deleted") });
15426
+ return () => h(BaseAgentDetails_default, {
15427
+ agent: agent.data.value,
15652
15428
  className: props.className,
15653
- description: props.description,
15654
- error: toManagementErrorMessage(t, role.error.value, "admin.roles.permissions.error"),
15655
- isLoading: role.isLoading.value,
15656
- permissions: role.data.value?.permissions ?? [],
15429
+ error: toManagementErrorMessage(t, agent.error.value, "admin.agents.details.error") ?? toManagementErrorMessage(t, deletion.error.value, "admin.agents.details.delete.error"),
15430
+ groups: groups.data.value?.groups ?? [],
15431
+ isDeleting: deletion.isLoading.value,
15432
+ isLoading: agent.isLoading.value,
15433
+ onDelete: props.deletable ? () => void deletion.mutate(props.agentId) : void 0,
15657
15434
  preferences: props.preferences,
15658
- resourceServerNames: props.resourceServerNames,
15659
- title: props.title
15435
+ roles: roles.data.value?.roles ?? []
15660
15436
  }, { ...slots });
15661
15437
  }
15662
15438
  });
15663
- var RolePermissions_default = RolePermissions;
15439
+ var AgentDetails_default = AgentDetails;
15664
15440
 
15665
15441
  //#endregion
15666
- //#region src/components/admin/AgentList/BaseAgentList.ts
15442
+ //#region src/components/admin/ApplicationList/BaseApplicationList.ts
15667
15443
  /**
15668
- * Lists agents with their type, client identifier and organization unit. Holds no data of its own:
15669
- * pass the page of agents and handle selection and pagination.
15444
+ * The translated access status of an application, or its raw value when the status is one this SDK
15445
+ * does not know.
15446
+ */
15447
+ const getStatusLabel = (application, t) => {
15448
+ const value = application.status?.value;
15449
+ switch (value?.toUpperCase()) {
15450
+ case "ACTIVE": return t("admin.applications.status.active");
15451
+ case "SUSPENDED": return t("admin.applications.status.suspended");
15452
+ default: return value ?? "";
15453
+ }
15454
+ };
15455
+ /**
15456
+ * Lists applications with their client identifier, type and, when the server reports it, access status. Holds no data of its own: pass the page
15457
+ * of applications and handle selection and pagination.
15670
15458
  *
15671
- * Props: `agents` (required), `selectedAgentId`, `isLoading`, `error`, `limit`, `offset`, `totalResults`,
15672
- * `onPageChange`, `onSelect` (`@select`), `title`, `description`, `className`, `preferences`.
15459
+ * Props: `applications` (required), `selectedApplicationId`, `isLoading`, `error`, `limit`, `offset`,
15460
+ * `totalResults`, `onPageChange`, `onSelect` (`@select`), `title`, `description`, `className`, `preferences`.
15673
15461
  * Slots: `actions`, rendered next to the title; `default`, a scoped slot that replaces the table with custom UI and
15674
15462
  * receives `AdminListRenderProps` (rows, default columns, loading and error state, pagination and selection).
15675
15463
  */
15676
- const BaseAgentList = createAdminList_default({
15677
- block: "agent-list",
15678
- columns: (t) => [
15464
+ const BaseApplicationList = createAdminList_default({
15465
+ block: "application-list",
15466
+ columns: (t, applications) => [
15679
15467
  {
15680
- header: t("admin.agents.list.columns.name"),
15468
+ header: t("admin.applications.list.columns.name"),
15681
15469
  id: "name",
15682
- render: (agent) => agent.name
15683
- },
15684
- {
15685
- header: t("admin.agents.list.columns.type"),
15686
- id: "type",
15687
- render: (agent) => agent.type
15470
+ render: (application) => application.name
15688
15471
  },
15689
15472
  {
15690
- header: t("admin.agents.list.columns.client_id"),
15473
+ header: t("admin.applications.list.columns.client_id"),
15691
15474
  id: "clientId",
15692
- render: (agent) => h("code", {}, agent.clientId ?? "")
15475
+ render: (application) => application.clientId ? h("code", {}, application.clientId) : null
15693
15476
  },
15694
15477
  {
15695
- header: t("admin.common.columns.organization_unit"),
15696
- id: "ou",
15697
- render: (agent) => agent.ouHandle ?? agent.ouId
15698
- }
15478
+ header: t("admin.applications.list.columns.type"),
15479
+ id: "type",
15480
+ render: (application) => application.type ?? application.template ?? ""
15481
+ },
15482
+ ...applications.some((application) => application.status?.value) ? [{
15483
+ header: t("admin.applications.list.columns.status"),
15484
+ id: "status",
15485
+ render: (application) => getStatusLabel(application, t)
15486
+ }] : []
15699
15487
  ],
15700
- emptyKey: "admin.agents.list.empty",
15488
+ emptyKey: "admin.applications.list.empty",
15701
15489
  getRowId: (row) => row.id,
15702
- name: "BaseAgentList",
15703
- rowsProp: "agents",
15704
- selectedProp: "selectedAgentId",
15705
- titleKey: "admin.agents.list.title"
15490
+ name: "BaseApplicationList",
15491
+ rowsProp: "applications",
15492
+ selectedProp: "selectedApplicationId",
15493
+ titleKey: "admin.applications.list.title"
15706
15494
  });
15707
- var BaseAgentList_default = BaseAgentList;
15495
+ var BaseApplicationList_default = BaseApplicationList;
15708
15496
 
15709
15497
  //#endregion
15710
- //#region src/components/admin/AgentList/AgentList.ts
15498
+ //#region src/components/admin/ApplicationList/ApplicationList.ts
15711
15499
  /**
15712
- * Lists the agents the signed-in user is allowed to see, a page at a time.
15500
+ * Lists the applications the signed-in user is allowed to see, a page at a time.
15713
15501
  *
15714
- * Props: `searchable` (default `true`; shows a search form the server matches exactly), `searchAttributes`, `limit`, `selectedAgentId`, `onSelect` (`@select`), `title`, `description`, `className`,
15502
+ * The server guards applications with the root `system` permission, for reading and for changes alike;
15503
+ * it defines no application-specific permission. Gate the view and its actions on it with
15504
+ * `useGrantedPermissions().can('system')`.
15505
+ *
15506
+ * Props: `limit`, `selectedApplicationId`, `onSelect` (`@select`), `title`, `description`, `className`,
15715
15507
  * `preferences`. Slots: `actions`; `default`, a scoped slot that replaces the table with custom UI and
15716
15508
  * receives `AdminListRenderProps` (rows, default columns, loading and error state, pagination and selection).
15717
15509
  *
15718
15510
  * @example
15719
15511
  * ```vue
15720
- * <AgentList @select="(agent) => (selectedAgentId = agent.id)" />
15512
+ * <ApplicationList @select="(application) => (selectedApplicationId = application.id)" />
15721
15513
  * ```
15722
15514
  */
15723
- const AgentList = createConnectedAdminList_default({
15724
- base: BaseAgentList_default,
15725
- errorKey: "admin.agents.list.error",
15726
- name: "AgentList",
15727
- query: (params) => useGetAgents_default(() => params()),
15728
- rows: (data) => data?.agents ?? [],
15729
- rowsProp: "agents",
15730
- searchAttributes: (t) => [{
15731
- label: t("admin.agents.list.search.name"),
15732
- value: "name"
15733
- }],
15734
- selectedProp: "selectedAgentId",
15515
+ const ApplicationList = createConnectedAdminList_default({
15516
+ base: BaseApplicationList_default,
15517
+ errorKey: "admin.applications.list.error",
15518
+ name: "ApplicationList",
15519
+ query: (params) => {
15520
+ const endpoint = useManagementEndpoint_default("applications");
15521
+ return useResourceQuery_default(() => {
15522
+ const { limit, offset } = params();
15523
+ return [ApplicationQueryKeys$1.APPLICATIONS, {
15524
+ limit,
15525
+ offset
15526
+ }];
15527
+ }, (fetcher) => {
15528
+ const { limit, offset } = params();
15529
+ return getApplications$1({
15530
+ ...endpoint,
15531
+ fetcher,
15532
+ limit,
15533
+ offset
15534
+ });
15535
+ });
15536
+ },
15537
+ rows: (data) => data?.applications ?? [],
15538
+ rowsProp: "applications",
15539
+ selectedProp: "selectedApplicationId",
15735
15540
  total: (data) => data?.totalResults
15736
15541
  });
15737
- var AgentList_default = AgentList;
15542
+ var ApplicationList_default = ApplicationList;
15738
15543
 
15739
15544
  //#endregion
15740
- //#region src/components/admin/AgentCreate/BaseAgentCreate.ts
15545
+ //#region src/components/admin/shared/ClientSecretNotice.ts
15546
+ const cls$2 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
15741
15547
  /**
15742
- * A form that collects a new agent's name, type and description. Holds no data of its own: handle the
15743
- * `submit` event, which carries a {@link AgentCreateSubmission}. Slots: `default`, a scoped slot that
15744
- * replaces the form with custom UI and receives {@link BaseAgentCreateRenderProps}.
15548
+ * Shows a client secret the one time it can be read, masked until revealed, with a copy button.
15745
15549
  */
15746
- const BaseAgentCreate = defineComponent({
15747
- name: "BaseAgentCreate",
15550
+ const ClientSecretNotice = defineComponent({
15551
+ name: "AdminClientSecretNotice",
15748
15552
  props: {
15749
- ...adminFormProps,
15750
- agentTypes: {
15553
+ onDismiss: {
15554
+ default: void 0,
15555
+ type: Function
15556
+ },
15557
+ secret: {
15751
15558
  required: true,
15752
- type: Array
15559
+ type: String
15560
+ },
15561
+ t: {
15562
+ required: true,
15563
+ type: Function
15564
+ }
15565
+ },
15566
+ setup(props) {
15567
+ return () => h("div", { class: cls$2("edit-form") }, [
15568
+ h(Alert_default, {
15569
+ role: "status",
15570
+ severity: "warning"
15571
+ }, { default: () => [props.t("admin.applications.secret.notice")] }),
15572
+ h(CopyableText_default, {
15573
+ label: props.t("admin.applications.secret.title"),
15574
+ masked: true,
15575
+ value: props.secret
15576
+ }),
15577
+ props.onDismiss ? h("div", { class: cls$2("form-actions") }, [h(Button_default, { onClick: props.onDismiss }, { default: () => props.t("admin.applications.secret.done") })]) : null
15578
+ ]);
15579
+ }
15580
+ });
15581
+ var ClientSecretNotice_default = ClientSecretNotice;
15582
+
15583
+ //#endregion
15584
+ //#region src/components/admin/shared/renderApplicationFields.ts
15585
+ const cls$1 = (element) => withVendorCSSClassPrefix(`admin__${element}`);
15586
+ /**
15587
+ * Renders the general fields and OAuth basics of an application, shared by the create form and the
15588
+ * edit form. The public client choice shows only when `onPublicClientChange` is given.
15589
+ */
15590
+ const renderApplicationFields = ({ onGrantTypesChange, onInputChange, onPublicClientChange, t, uid, values }) => {
15591
+ const text = (field, label, extra = {}) => h(TextField_default, {
15592
+ autoComplete: "off",
15593
+ label,
15594
+ modelValue: values[field],
15595
+ name: `${uid}-${field}`,
15596
+ "onUpdate:modelValue": (value) => onInputChange(field, value),
15597
+ ...extra
15598
+ });
15599
+ return [
15600
+ text("name", t("admin.applications.fields.name"), { required: true }),
15601
+ text("description", t("admin.applications.fields.description")),
15602
+ text("url", t("admin.applications.fields.url")),
15603
+ text("logoUrl", t("admin.applications.fields.logo_url")),
15604
+ text("redirectUris", t("admin.applications.fields.redirect_uris"), { helperText: t("admin.applications.fields.redirect_uris_hint") }),
15605
+ h("fieldset", {
15606
+ class: cls$1("row"),
15607
+ style: {
15608
+ border: 0,
15609
+ flexWrap: "wrap",
15610
+ margin: 0,
15611
+ padding: 0
15612
+ }
15613
+ }, [h("legend", { class: cls$1("muted") }, t("admin.applications.fields.grant_types")), ...APPLICATION_GRANT_TYPES.map((grantType) => h(Checkbox_default, {
15614
+ key: grantType,
15615
+ label: t(`admin.applications.grant_types.${grantType}`),
15616
+ modelValue: values.grantTypes.includes(grantType),
15617
+ name: `${uid}-grant-type-${grantType}`,
15618
+ "onUpdate:modelValue": (checked) => onGrantTypesChange(checked ? [...values.grantTypes, grantType] : values.grantTypes.filter((value) => value !== grantType))
15619
+ }))]),
15620
+ ...onPublicClientChange ? [h(Checkbox_default, {
15621
+ label: t("admin.applications.fields.public_client"),
15622
+ modelValue: values.publicClient,
15623
+ name: `${uid}-public-client`,
15624
+ "onUpdate:modelValue": onPublicClientChange
15625
+ })] : []
15626
+ ];
15627
+ };
15628
+ var renderApplicationFields_default = renderApplicationFields;
15629
+
15630
+ //#endregion
15631
+ //#region src/components/admin/ApplicationCreate/BaseApplicationCreate.ts
15632
+ /**
15633
+ * A form that collects a new application's name, description, links and OAuth basics: redirect URIs,
15634
+ * grant types and whether the client is public. Holds no data of its own: handle the `submit` event,
15635
+ * which carries an {@link ApplicationCreateSubmission}, and pass back the client secret the server
15636
+ * returned as `clientSecret` to show it once. Slots: `default`, a scoped slot that replaces the form
15637
+ * with custom UI and receives {@link BaseApplicationCreateRenderProps}.
15638
+ */
15639
+ const BaseApplicationCreate = defineComponent({
15640
+ name: "BaseApplicationCreate",
15641
+ props: {
15642
+ ...adminFormProps,
15643
+ clientSecret: {
15644
+ default: null,
15645
+ type: String
15646
+ },
15647
+ onSecretDismiss: {
15648
+ default: void 0,
15649
+ type: Function
15753
15650
  }
15754
15651
  },
15755
15652
  emits: ["submit"],
15756
15653
  setup(props, { emit, slots }) {
15757
15654
  const t = useAdminTranslation_default(() => props.preferences);
15758
15655
  const uid = useId();
15759
- const name = ref("");
15760
- const description = ref("");
15761
- const chosenType = ref("");
15656
+ const values = ref({
15657
+ description: "",
15658
+ grantTypes: [...DEFAULT_APPLICATION_GRANT_TYPES],
15659
+ logoUrl: "",
15660
+ name: "",
15661
+ publicClient: false,
15662
+ redirectUris: "",
15663
+ url: ""
15664
+ });
15665
+ const setInput = (field, value) => {
15666
+ values.value = {
15667
+ ...values.value,
15668
+ [field]: value
15669
+ };
15670
+ };
15671
+ const setGrantTypes = (grantTypes) => {
15672
+ values.value = {
15673
+ ...values.value,
15674
+ grantTypes
15675
+ };
15676
+ };
15677
+ const setPublicClient = (publicClient) => {
15678
+ values.value = {
15679
+ ...values.value,
15680
+ publicClient
15681
+ };
15682
+ };
15762
15683
  return () => {
15763
- const type = chosenType.value || (props.agentTypes[0]?.value ?? "");
15684
+ const current = values.value;
15685
+ const submission = {
15686
+ description: current.description.trim() || void 0,
15687
+ grantTypes: current.grantTypes,
15688
+ logoUrl: current.logoUrl.trim() || void 0,
15689
+ name: current.name.trim(),
15690
+ publicClient: current.publicClient,
15691
+ redirectUris: parseRedirectUris(current.redirectUris),
15692
+ url: current.url.trim() || void 0
15693
+ };
15694
+ if (props.clientSecret && !slots["default"]) return h(AdminSection_default, {
15695
+ block: "application-create",
15696
+ className: props.className,
15697
+ description: props.description,
15698
+ title: props.title ?? t("admin.applications.create.title")
15699
+ }, { default: () => h(ClientSecretNotice_default, {
15700
+ onDismiss: props.onSecretDismiss,
15701
+ secret: props.clientSecret,
15702
+ t
15703
+ }) });
15764
15704
  return renderAdminForm_default({
15765
- block: "agent-create",
15766
- canSubmit: Boolean(name.value.trim()) && Boolean(type),
15767
- fields: [
15768
- h(TextField_default, {
15769
- label: t("admin.agents.create.fields.name"),
15770
- modelValue: name.value,
15771
- name: `${uid}-name`,
15772
- "onUpdate:modelValue": (value) => {
15773
- name.value = value;
15774
- },
15775
- required: true
15776
- }),
15777
- h(Select_default, {
15778
- label: t("admin.agents.create.fields.type"),
15779
- modelValue: type,
15780
- name: `${uid}-type`,
15781
- "onUpdate:modelValue": (value) => {
15782
- chosenType.value = value;
15783
- },
15784
- options: props.agentTypes,
15785
- required: true
15786
- }),
15787
- h(TextField_default, {
15788
- label: t("admin.agents.create.fields.description"),
15789
- modelValue: description.value,
15790
- name: `${uid}-description`,
15791
- "onUpdate:modelValue": (value) => {
15792
- description.value = value;
15793
- }
15794
- })
15795
- ],
15705
+ block: "application-create",
15706
+ canSubmit: isApplicationSubmissionValid(submission),
15707
+ fields: renderApplicationFields_default({
15708
+ onGrantTypesChange: setGrantTypes,
15709
+ onInputChange: setInput,
15710
+ onPublicClientChange: setPublicClient,
15711
+ t,
15712
+ uid,
15713
+ values: current
15714
+ }),
15796
15715
  onSubmit: () => {
15797
- emit("submit", {
15798
- description: description.value.trim() || void 0,
15799
- name: name.value.trim(),
15800
- type
15801
- });
15716
+ emit("submit", submission);
15802
15717
  },
15803
15718
  props,
15804
15719
  renderProps: {
15805
- agentTypes: props.agentTypes,
15806
- handleInputChange: (field, value) => {
15807
- ({
15808
- description,
15809
- name,
15810
- type: chosenType
15811
- })[field].value = value;
15812
- },
15813
- values: {
15814
- description: description.value,
15815
- name: name.value,
15816
- type
15817
- }
15720
+ clientSecret: props.clientSecret,
15721
+ grantTypeOptions: APPLICATION_GRANT_TYPES.map((grantType) => ({
15722
+ label: t(`admin.applications.grant_types.${grantType}`),
15723
+ value: grantType
15724
+ })),
15725
+ handleGrantTypesChange: setGrantTypes,
15726
+ handleInputChange: setInput,
15727
+ handlePublicClientChange: setPublicClient,
15728
+ onSecretDismiss: props.clientSecret ? props.onSecretDismiss : void 0,
15729
+ values: current
15818
15730
  },
15819
15731
  slot: slots["default"],
15820
- submitLabel: t("admin.agents.create.submit"),
15732
+ submitLabel: t("admin.applications.create.submit"),
15821
15733
  t,
15822
- title: t("admin.agents.create.title")
15734
+ title: t("admin.applications.create.title")
15823
15735
  });
15824
15736
  };
15825
15737
  }
15826
15738
  });
15827
- var BaseAgentCreate_default = BaseAgentCreate;
15739
+ var BaseApplicationCreate_default = BaseApplicationCreate;
15828
15740
 
15829
15741
  //#endregion
15830
- //#region src/components/admin/AgentCreate/AgentCreate.ts
15742
+ //#region src/components/admin/ApplicationCreate/ApplicationCreate.ts
15831
15743
  /**
15832
- * Creates a agent through the management API in the given organization unit, or the signed-in user's
15833
- * own. Emits `created` with the created agent.
15744
+ * Creates an application with an OAuth client through the management API in the given organization
15745
+ * unit, or the signed-in user's own. When the server returns a client secret, shows it once and emits
15746
+ * `created` with the application after the user has copied it; otherwise emits `created` right away.
15747
+ *
15748
+ * The server guards applications with the root `system` permission, for reading and for changes alike;
15749
+ * it defines no application-specific permission. Gate the view and its actions on it with
15750
+ * `useGrantedPermissions().can('system')`.
15751
+ *
15752
+ * Slots: `default`, a scoped slot that replaces the form with custom UI and receives
15753
+ * `BaseApplicationCreateRenderProps`.
15834
15754
  *
15835
15755
  * @example
15836
15756
  * ```vue
15837
- * <AgentCreate @created="(agent) => (selectedAgentId = agent.id)" />
15757
+ * <ApplicationCreate @created="(application) => (selectedApplicationId = application.id)" />
15838
15758
  * ```
15839
15759
  */
15840
- const AgentCreate = defineComponent({
15841
- name: "AgentCreate",
15760
+ const ApplicationCreate = defineComponent({
15761
+ name: "ApplicationCreate",
15842
15762
  props: {
15843
15763
  className: adminFormProps.className,
15844
15764
  description: adminFormProps.description,
@@ -15847,10 +15767,6 @@ const AgentCreate = defineComponent({
15847
15767
  default: void 0,
15848
15768
  type: String
15849
15769
  },
15850
- owner: {
15851
- default: void 0,
15852
- type: String
15853
- },
15854
15770
  preferences: adminFormProps.preferences,
15855
15771
  title: adminFormProps.title
15856
15772
  },
@@ -15858,50 +15774,82 @@ const AgentCreate = defineComponent({
15858
15774
  setup(props, { emit, slots }) {
15859
15775
  const t = useAdminTranslation_default(() => props.preferences);
15860
15776
  const resolvedOuId = useDefaultOuId_default(() => props.ouId);
15861
- const agentTypes = useGetAgentTypes_default({ limit: 100 });
15862
- const options = computed(() => (agentTypes.data.value?.types ?? []).map((agentType) => ({
15863
- label: agentType.displayName,
15864
- value: agentType.handle
15865
- })));
15866
- const creation = useCreateAgent_default({ onSuccess: (created) => emit("created", created) });
15867
- const handleSubmit = ({ description, name, type }) => {
15868
- if (resolvedOuId.value) creation.mutate({
15869
- description,
15870
- name,
15871
- ouId: resolvedOuId.value,
15872
- owner: props.owner,
15873
- type
15874
- });
15777
+ const endpoint = useManagementEndpoint_default("applications");
15778
+ const created = ref(null);
15779
+ const formKey = ref(0);
15780
+ const creation = useResourceMutation_default((payload, fetcher) => createApplication$1({
15781
+ ...endpoint,
15782
+ fetcher,
15783
+ payload
15784
+ }), () => [[ApplicationQueryKeys$1.APPLICATIONS]], { onSuccess: (application) => {
15785
+ const secret = getApplicationClientSecret(application);
15786
+ if (secret) created.value = {
15787
+ application,
15788
+ secret
15789
+ };
15790
+ else emit("created", application);
15791
+ } });
15792
+ const handleSubmit = (submission) => {
15793
+ if (resolvedOuId.value) creation.mutate(toCreateApplicationRequest(submission, resolvedOuId.value));
15794
+ };
15795
+ const handleSecretDismiss = () => {
15796
+ if (created.value) {
15797
+ const { application } = created.value;
15798
+ created.value = null;
15799
+ formKey.value += 1;
15800
+ emit("created", application);
15801
+ }
15875
15802
  };
15876
- return () => h(BaseAgentCreate_default, {
15877
- agentTypes: options.value,
15803
+ return () => h(BaseApplicationCreate_default, {
15878
15804
  className: props.className,
15805
+ clientSecret: created.value?.secret ?? null,
15879
15806
  description: props.description,
15880
- error: resolvedOuId.value ? toManagementErrorMessage(t, creation.error.value, "admin.agents.create.error") : t("admin.common.errors.no_ou"),
15807
+ error: resolvedOuId.value ? toManagementErrorMessage(t, creation.error.value, "admin.applications.create.error") : t("admin.common.errors.no_ou"),
15881
15808
  isSubmitting: creation.isLoading.value,
15809
+ key: formKey.value,
15882
15810
  onCancel: props.onCancel,
15811
+ onSecretDismiss: handleSecretDismiss,
15883
15812
  onSubmit: handleSubmit,
15884
15813
  preferences: props.preferences,
15885
15814
  title: props.title
15886
15815
  }, { ...slots });
15887
15816
  }
15888
15817
  });
15889
- var AgentCreate_default = AgentCreate;
15818
+ var ApplicationCreate_default = ApplicationCreate;
15890
15819
 
15891
15820
  //#endregion
15892
- //#region src/components/admin/AgentDetails/BaseAgentDetails.ts
15821
+ //#region src/components/admin/ApplicationDetails/BaseApplicationDetails.ts
15893
15822
  const cls = (element) => withVendorCSSClassPrefix(`admin__${element}`);
15823
+ const toFormValues = (application, oauth) => ({
15824
+ description: application.description ?? "",
15825
+ grantTypes: oauth?.grantTypes ?? [],
15826
+ logoUrl: application.logoUrl ?? "",
15827
+ name: application.name,
15828
+ publicClient: Boolean(oauth?.publicClient),
15829
+ redirectUris: (oauth?.redirectUris ?? []).join(", "),
15830
+ url: application.url ?? ""
15831
+ });
15832
+ const toSubmission = (values) => ({
15833
+ description: values.description.trim() || void 0,
15834
+ grantTypes: values.grantTypes,
15835
+ logoUrl: values.logoUrl.trim() || void 0,
15836
+ name: values.name.trim(),
15837
+ publicClient: values.publicClient,
15838
+ redirectUris: parseRedirectUris(values.redirectUris),
15839
+ url: values.url.trim() || void 0
15840
+ });
15894
15841
  /**
15895
- * Shows an agent's type, owner, organization unit, client identifier, groups and roles. Holds no data
15896
- * of its own: pass the agent and handle deletion.
15842
+ * Shows an application's general fields and OAuth configuration. Holds no data of its own: pass the
15843
+ * application and handle editing, deletion and client secret regeneration, each offered only when its
15844
+ * handler is set.
15897
15845
  *
15898
- * Slots: `actions`, rendered next to the agent's name; `default`, a scoped slot that replaces the view
15899
- * with custom UI and receives {@link BaseAgentDetailsRenderProps}.
15846
+ * Slots: `actions`, rendered next to the application's name; `default`, a scoped slot that replaces the
15847
+ * view with custom UI and receives {@link BaseApplicationDetailsRenderProps}.
15900
15848
  */
15901
- const BaseAgentDetails = defineComponent({
15902
- name: "BaseAgentDetails",
15849
+ const BaseApplicationDetails = defineComponent({
15850
+ name: "BaseApplicationDetails",
15903
15851
  props: {
15904
- agent: {
15852
+ application: {
15905
15853
  default: void 0,
15906
15854
  type: Object
15907
15855
  },
@@ -15909,13 +15857,13 @@ const BaseAgentDetails = defineComponent({
15909
15857
  default: "",
15910
15858
  type: String
15911
15859
  },
15912
- error: {
15860
+ clientSecret: {
15913
15861
  default: null,
15914
15862
  type: String
15915
15863
  },
15916
- groups: {
15917
- default: () => [],
15918
- type: Array
15864
+ error: {
15865
+ default: null,
15866
+ type: String
15919
15867
  },
15920
15868
  isDeleting: {
15921
15869
  default: false,
@@ -15925,37 +15873,68 @@ const BaseAgentDetails = defineComponent({
15925
15873
  default: false,
15926
15874
  type: Boolean
15927
15875
  },
15876
+ isRegeneratingSecret: {
15877
+ default: false,
15878
+ type: Boolean
15879
+ },
15880
+ isUpdating: {
15881
+ default: false,
15882
+ type: Boolean
15883
+ },
15928
15884
  onDelete: {
15929
15885
  default: void 0,
15930
15886
  type: Function
15931
15887
  },
15888
+ onRegenerateSecret: {
15889
+ default: void 0,
15890
+ type: Function
15891
+ },
15892
+ onSecretDismiss: {
15893
+ default: void 0,
15894
+ type: Function
15895
+ },
15896
+ onUpdate: {
15897
+ default: void 0,
15898
+ type: Function
15899
+ },
15932
15900
  preferences: {
15933
15901
  default: void 0,
15934
15902
  type: Object
15935
- },
15936
- roles: {
15937
- default: () => [],
15938
- type: Array
15939
15903
  }
15940
15904
  },
15941
15905
  setup(props, { slots }) {
15942
15906
  const t = useAdminTranslation_default(() => props.preferences);
15907
+ const uid = useId();
15908
+ const draft = ref(null);
15943
15909
  return () => {
15944
- const { agent } = props;
15910
+ const { application } = props;
15911
+ const oauthConfig = getApplicationOAuthConfig(application);
15912
+ const isWritable = Boolean(application) && !application?.isReadOnly;
15913
+ const canRegenerate = isWritable && Boolean(oauthConfig) && !oauthConfig?.publicClient;
15945
15914
  if (slots["default"]) {
15915
+ let oauth;
15916
+ if (oauthConfig) {
15917
+ const { clientSecret: storedSecret,...rest } = oauthConfig;
15918
+ oauth = rest;
15919
+ }
15946
15920
  const renderProps = {
15947
- agent,
15921
+ application,
15922
+ clientSecret: props.clientSecret,
15948
15923
  error: props.error,
15949
- groups: props.groups,
15950
15924
  isDeleting: props.isDeleting,
15951
15925
  isLoading: props.isLoading,
15952
- onDelete: agent && !agent.isReadOnly ? props.onDelete : void 0,
15953
- roles: props.roles
15926
+ isRegeneratingSecret: props.isRegeneratingSecret,
15927
+ isUpdating: props.isUpdating,
15928
+ oauth,
15929
+ onDelete: isWritable ? props.onDelete : void 0,
15930
+ onRegenerateSecret: canRegenerate ? props.onRegenerateSecret : void 0,
15931
+ onSecretDismiss: props.clientSecret ? props.onSecretDismiss : void 0,
15932
+ onUpdate: isWritable ? props.onUpdate : void 0
15954
15933
  };
15955
15934
  return h("div", { class: props.className }, slots["default"](renderProps));
15956
15935
  }
15957
- if (props.isLoading && !agent) return h(AdminSection_default, {
15958
- block: "agent-details",
15936
+ if (props.isLoading && !application) return h(AdminSection_default, {
15937
+ block: "application-details",
15959
15938
  className: props.className
15960
15939
  }, { default: () => h("span", {
15961
15940
  class: cls("muted"),
@@ -15964,83 +15943,167 @@ const BaseAgentDetails = defineComponent({
15964
15943
  "aria-hidden": "true",
15965
15944
  size: "small"
15966
15945
  }), t("admin.common.loading")]) });
15967
- if (!agent) return h(AdminSection_default, {
15968
- block: "agent-details",
15946
+ if (!application) return h(AdminSection_default, {
15947
+ block: "application-details",
15969
15948
  className: props.className
15970
15949
  }, { default: () => h(Alert_default, { severity: "error" }, { default: () => [props.error ?? t("admin.common.errors.not_found")] }) });
15971
- const details = [
15950
+ const notSet = t("admin.applications.details.not_set");
15951
+ const overview = [
15972
15952
  {
15973
- label: t("admin.agents.details.type"),
15974
- value: agent.type
15953
+ label: t("admin.applications.list.columns.client_id"),
15954
+ value: oauthConfig?.clientId ? h(CopyableText_default, { value: oauthConfig.clientId }) : notSet
15975
15955
  },
15976
15956
  {
15977
- label: t("admin.agents.details.owner"),
15978
- value: agent.owner ?? t("admin.agents.details.no_owner")
15957
+ label: t("admin.applications.details.type"),
15958
+ value: application.type ?? application.template ?? notSet
15979
15959
  },
15980
15960
  {
15981
15961
  label: t("admin.common.columns.organization_unit"),
15982
- value: agent.ouHandle ?? agent.ouId
15962
+ value: application.ouId ?? notSet
15963
+ },
15964
+ {
15965
+ label: t("admin.applications.fields.url"),
15966
+ value: application.url ?? notSet
15967
+ },
15968
+ {
15969
+ label: t("admin.applications.fields.logo_url"),
15970
+ value: application.logoUrl ?? notSet
15983
15971
  }
15984
15972
  ];
15985
- if (agent.clientId) details.push({
15986
- label: t("admin.agents.list.columns.client_id"),
15987
- value: h(CopyableText_default, { value: agent.clientId })
15973
+ const renderEditForm = (current) => h(Panel_default, { title: t("admin.applications.details.edit.action") }, { default: () => h("form", {
15974
+ class: cls("edit-form"),
15975
+ novalidate: true,
15976
+ onSubmit: (event) => {
15977
+ event.preventDefault();
15978
+ const { publicClient,...submission } = toSubmission(current);
15979
+ props.onUpdate?.(submission);
15980
+ draft.value = null;
15981
+ }
15982
+ }, [...renderApplicationFields_default({
15983
+ onGrantTypesChange: (grantTypes) => {
15984
+ draft.value = {
15985
+ ...current,
15986
+ grantTypes
15987
+ };
15988
+ },
15989
+ onInputChange: (field, value) => {
15990
+ draft.value = {
15991
+ ...current,
15992
+ [field]: value
15993
+ };
15994
+ },
15995
+ t,
15996
+ uid,
15997
+ values: current
15998
+ }), h("div", { class: cls("form-actions") }, [h(Button_default, {
15999
+ disabled: props.isUpdating,
16000
+ onClick: () => {
16001
+ draft.value = null;
16002
+ },
16003
+ type: "button",
16004
+ variant: "text"
16005
+ }, { default: () => t("admin.common.actions.cancel") }), h(Button_default, {
16006
+ disabled: props.isUpdating || !isApplicationSubmissionValid(toSubmission(current)),
16007
+ loading: props.isUpdating,
16008
+ type: "submit"
16009
+ }, { default: () => t("admin.applications.details.edit.save") })])]) });
16010
+ const renderOAuth = (oauth) => h(Panel_default, { title: t("admin.applications.details.oauth") }, {
16011
+ actions: () => props.onRegenerateSecret && canRegenerate && !props.clientSecret ? h(ConfirmButton_default, {
16012
+ confirmText: t("admin.applications.details.secret.confirm", { name: application.name }),
16013
+ isLoading: props.isRegeneratingSecret,
16014
+ onConfirm: props.onRegenerateSecret,
16015
+ t
16016
+ }, { default: () => t("admin.applications.details.secret.action") }) : null,
16017
+ default: () => [props.clientSecret ? h(ClientSecretNotice_default, {
16018
+ onDismiss: props.onSecretDismiss,
16019
+ secret: props.clientSecret,
16020
+ t
16021
+ }) : null, h(DetailList_default, { items: [
16022
+ {
16023
+ label: t("admin.applications.fields.grant_types"),
16024
+ value: h(ChipList_default, {
16025
+ emptyText: t("admin.applications.details.no_grant_types"),
16026
+ items: (oauth.grantTypes ?? []).map((grantType) => ({
16027
+ id: grantType,
16028
+ label: APPLICATION_GRANT_TYPES.includes(grantType) ? t(`admin.applications.grant_types.${grantType}`) : grantType
16029
+ })),
16030
+ label: t("admin.applications.fields.grant_types")
16031
+ })
16032
+ },
16033
+ {
16034
+ label: t("admin.applications.fields.redirect_uris"),
16035
+ value: h(ChipList_default, {
16036
+ emptyText: t("admin.applications.details.no_redirect_uris"),
16037
+ items: (oauth.redirectUris ?? []).map((uri) => ({
16038
+ id: uri,
16039
+ label: uri
16040
+ })),
16041
+ label: t("admin.applications.fields.redirect_uris")
16042
+ })
16043
+ },
16044
+ {
16045
+ label: t("admin.applications.details.public_client"),
16046
+ value: oauth.publicClient ? t("admin.applications.details.yes") : t("admin.applications.details.no")
16047
+ }
16048
+ ] })]
15988
16049
  });
15989
16050
  return h(AdminSection_default, {
15990
- block: "agent-details",
16051
+ block: "application-details",
15991
16052
  className: props.className,
15992
- description: agent.description,
15993
- title: agent.name
16053
+ description: application.description,
16054
+ title: application.name
15994
16055
  }, {
15995
- actions: () => [slots["actions"]?.(), props.onDelete && !agent.isReadOnly ? h(ConfirmButton_default, {
15996
- confirmText: t("admin.agents.details.delete.confirm", { name: agent.name }),
16056
+ actions: () => [slots["actions"]?.(), props.onDelete && isWritable ? h(ConfirmButton_default, {
16057
+ confirmText: t("admin.applications.details.delete.confirm", { name: application.name }),
15997
16058
  isLoading: props.isDeleting,
15998
16059
  onConfirm: props.onDelete,
15999
16060
  t
16000
- }, { default: () => t("admin.agents.details.delete.action") }) : null],
16001
- default: () => [
16002
- props.error ? h(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null,
16003
- h(Panel_default, { title: t("admin.agents.details.overview") }, { default: () => h(DetailList_default, { items: details }) }),
16004
- h(Panel_default, { title: t("admin.agents.details.groups") }, { default: () => h(ChipList_default, {
16005
- emptyText: t("admin.agents.details.no_groups"),
16006
- items: props.groups.map((group) => ({
16007
- id: group.id,
16008
- label: group.name
16009
- })),
16010
- label: t("admin.agents.details.groups")
16011
- }) }),
16012
- h(Panel_default, { title: t("admin.agents.details.roles") }, { default: () => h(ChipList_default, {
16013
- emptyText: t("admin.agents.details.no_roles"),
16014
- items: props.roles.map((role) => ({
16015
- id: role,
16016
- label: role
16017
- })),
16018
- label: t("admin.agents.details.roles")
16019
- }) })
16020
- ]
16061
+ }, { default: () => t("admin.applications.details.delete.action") }) : null],
16062
+ default: () => [props.error ? h(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null, ...draft.value ? [renderEditForm(draft.value)] : [h(Panel_default, { title: t("admin.applications.details.overview") }, {
16063
+ actions: () => props.onUpdate && isWritable ? h(Button_default, {
16064
+ onClick: () => {
16065
+ draft.value = toFormValues(application, oauthConfig);
16066
+ },
16067
+ size: "small",
16068
+ variant: "outline"
16069
+ }, { default: () => t("admin.applications.details.edit.action") }) : null,
16070
+ default: () => h(DetailList_default, { items: overview })
16071
+ }), oauthConfig ? renderOAuth(oauthConfig) : null]]
16021
16072
  });
16022
16073
  };
16023
16074
  }
16024
16075
  });
16025
- var BaseAgentDetails_default = BaseAgentDetails;
16076
+ var BaseApplicationDetails_default = BaseApplicationDetails;
16026
16077
 
16027
16078
  //#endregion
16028
- //#region src/components/admin/AgentDetails/AgentDetails.ts
16079
+ //#region src/components/admin/ApplicationDetails/ApplicationDetails.ts
16029
16080
  /**
16030
- * Shows an agent with the groups it belongs to and the roles it holds, and optionally lets the
16031
- * signed-in user delete it. Emits `deleted` after the agent has been deleted.
16081
+ * Shows an application and its OAuth configuration, and optionally lets the signed-in user edit it,
16082
+ * regenerate its client secret (shown once) or delete it. Emits `deleted` after the application has
16083
+ * been deleted.
16032
16084
  *
16033
- * Slots: `actions`, rendered next to the agent's name.
16085
+ * The server guards applications with the root `system` permission, for reading and for changes alike;
16086
+ * it defines no application-specific permission. Gate the view and its actions on it with
16087
+ * `useGrantedPermissions().can('system')`.
16088
+ *
16089
+ * Slots: `actions`, rendered next to the application's name; `default`, a scoped slot that replaces the
16090
+ * view with custom UI and receives `BaseApplicationDetailsRenderProps`.
16034
16091
  *
16035
16092
  * @example
16036
16093
  * ```vue
16037
- * <AgentDetails :agent-id="agentId" deletable @deleted="router.push('/agents')" />
16094
+ * <ApplicationDetails
16095
+ * :application-id="applicationId"
16096
+ * :editable="can('system')"
16097
+ * :deletable="can('system')"
16098
+ * :secret-regenerable="can('system')"
16099
+ * @deleted="router.push('/applications')"
16100
+ * />
16038
16101
  * ```
16039
16102
  */
16040
- const AgentDetails = defineComponent({
16041
- name: "AgentDetails",
16103
+ const ApplicationDetails = defineComponent({
16104
+ name: "ApplicationDetails",
16042
16105
  props: {
16043
- agentId: {
16106
+ applicationId: {
16044
16107
  required: true,
16045
16108
  type: String
16046
16109
  },
@@ -16052,32 +16115,68 @@ const AgentDetails = defineComponent({
16052
16115
  default: false,
16053
16116
  type: Boolean
16054
16117
  },
16118
+ editable: {
16119
+ default: false,
16120
+ type: Boolean
16121
+ },
16055
16122
  preferences: {
16056
16123
  default: void 0,
16057
16124
  type: Object
16125
+ },
16126
+ secretRegenerable: {
16127
+ default: false,
16128
+ type: Boolean
16058
16129
  }
16059
16130
  },
16060
16131
  emits: ["deleted"],
16061
16132
  setup(props, { emit, slots }) {
16062
16133
  const t = useAdminTranslation_default(() => props.preferences);
16063
- const agent = useGetAgent_default(() => props.agentId);
16064
- const groups = useGetAgentGroups_default(() => props.agentId, { limit: 100 });
16065
- const roles = useGetAgentRoles_default(() => props.agentId, { limit: 100 });
16066
- const deletion = useDeleteAgent_default({ onSuccess: () => emit("deleted") });
16067
- return () => h(BaseAgentDetails_default, {
16068
- agent: agent.data.value,
16069
- className: props.className,
16070
- error: toManagementErrorMessage(t, agent.error.value, "admin.agents.details.error") ?? toManagementErrorMessage(t, deletion.error.value, "admin.agents.details.delete.error"),
16071
- groups: groups.data.value?.groups ?? [],
16072
- isDeleting: deletion.isLoading.value,
16073
- isLoading: agent.isLoading.value,
16074
- onDelete: props.deletable ? () => void deletion.mutate(props.agentId) : void 0,
16075
- preferences: props.preferences,
16076
- roles: roles.data.value?.roles ?? []
16077
- }, { ...slots });
16134
+ const endpoint = useManagementEndpoint_default("applications");
16135
+ const application = useResourceQuery_default(() => [ApplicationQueryKeys$1.APPLICATION, props.applicationId], (fetcher) => getApplication$1({
16136
+ ...endpoint,
16137
+ applicationId: props.applicationId,
16138
+ fetcher
16139
+ }), { enabled: () => Boolean(props.applicationId) });
16140
+ const deletion = useResourceMutation_default((applicationId, fetcher) => deleteApplication$1({
16141
+ ...endpoint,
16142
+ applicationId,
16143
+ fetcher
16144
+ }), () => [[ApplicationQueryKeys$1.APPLICATIONS]], { onSuccess: () => emit("deleted") });
16145
+ const update = useResourceMutation_default(({ application: current, changes }, fetcher) => updateApplication$1({
16146
+ ...endpoint,
16147
+ applicationId: current.id,
16148
+ fetcher,
16149
+ payload: toUpdateApplicationRequest(current, changes)
16150
+ }), ({ application: current }) => [[ApplicationQueryKeys$1.APPLICATION, current.id], [ApplicationQueryKeys$1.APPLICATIONS]]);
16151
+ const regeneration = useResourceMutation_default((applicationId, fetcher) => regenerateClientSecret$1({
16152
+ ...endpoint,
16153
+ applicationId,
16154
+ fetcher
16155
+ }), (applicationId) => [[ApplicationQueryKeys$1.APPLICATION, applicationId], [ApplicationQueryKeys$1.APPLICATIONS]]);
16156
+ return () => {
16157
+ const current = application.data.value;
16158
+ return h(BaseApplicationDetails_default, {
16159
+ application: current,
16160
+ className: props.className,
16161
+ clientSecret: regeneration.data.value?.clientSecret ?? null,
16162
+ error: toManagementErrorMessage(t, application.error.value, "admin.applications.details.error") ?? toManagementErrorMessage(t, deletion.error.value, "admin.applications.details.delete.error") ?? toManagementErrorMessage(t, update.error.value, "admin.applications.details.edit.error") ?? toManagementErrorMessage(t, regeneration.error.value, "admin.applications.details.secret.error"),
16163
+ isDeleting: deletion.isLoading.value,
16164
+ isLoading: application.isLoading.value,
16165
+ isRegeneratingSecret: regeneration.isLoading.value,
16166
+ isUpdating: update.isLoading.value,
16167
+ onDelete: props.deletable ? () => void deletion.mutate(props.applicationId) : void 0,
16168
+ onRegenerateSecret: props.secretRegenerable ? () => void regeneration.mutate(props.applicationId) : void 0,
16169
+ onSecretDismiss: regeneration.reset,
16170
+ onUpdate: props.editable && current ? (changes) => void update.mutate({
16171
+ application: current,
16172
+ changes
16173
+ }) : void 0,
16174
+ preferences: props.preferences
16175
+ }, { ...slots });
16176
+ };
16078
16177
  }
16079
16178
  });
16080
- var AgentDetails_default = AgentDetails;
16179
+ var ApplicationDetails_default = ApplicationDetails;
16081
16180
 
16082
16181
  //#endregion
16083
16182
  //#region src/router/guard.ts
@@ -16215,4 +16314,4 @@ const createCallbackRoute = (options = {}) => {
16215
16314
  };
16216
16315
 
16217
16316
  //#endregion
16218
- export { AcceptInvite_default as AcceptInvite, AgentCreate_default as AgentCreate, AgentDetails_default as AgentDetails, AgentList_default as AgentList, AgentQueryKeys, Alert_default as Alert, ApplicationQueryKeys, ArrowLeftRightIcon, Attribution_default as Attribution, AuthFlowSelect_default as AuthFlowSelect, BaseAcceptInvite_default as BaseAcceptInvite, BaseAgentCreate_default as BaseAgentCreate, BaseAgentDetails_default as BaseAgentDetails, BaseAgentList_default as BaseAgentList, BaseAuthFlowSelect_default as BaseAuthFlowSelect, BaseChangeCredential_default as BaseChangeCredential, BaseGroupCreate_default as BaseGroupCreate, BaseGroupList_default as BaseGroupList, BaseGroupMembers_default as BaseGroupMembers, BaseInviteUser_default as BaseInviteUser, BaseLanguageSwitcher_default as BaseLanguageSwitcher, BaseRoleAssignments_default as BaseRoleAssignments, BaseRoleCreate_default as BaseRoleCreate, BaseRoleList_default as BaseRoleList, BaseRolePermissions_default as BaseRolePermissions, BaseSignIn_default as BaseSignIn, BaseSignInButton_default as BaseSignInButton, BaseSignOutButton_default as BaseSignOutButton, BaseSignUp_default as BaseSignUp, BaseSignUpButton_default as BaseSignUpButton, BaseUserCreate_default as BaseUserCreate, BaseUserDetails_default as BaseUserDetails, BaseUserDropdown_default as BaseUserDropdown, BaseUserList_default as BaseUserList, BaseUserProfile_default as BaseUserProfile, BaseUserSelect_default as BaseUserSelect, BaseUserTypeSelect_default as BaseUserTypeSelect, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, ChangeCredential_default as ChangeCredential, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, CopyableText_default as CopyableText, DEFAULT_USER_CREATE_FIELDS, DataTable_default as DataTable, DatePicker_default as DatePicker, Divider_default as Divider, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowTextVariant, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, EyeIcon, EyeOffIcon, FLOW_KEY, FLOW_META_KEY, FacebookButton_default as FacebookButton, FieldFactory_default as FieldFactory, FieldType, FlowMetaProvider_default as FlowMetaProvider, FlowProvider_default as FlowProvider, GitHubButton_default as GitHubButton, GlobeIcon, GoogleButton_default as GoogleButton, GroupCreate_default as GroupCreate, GroupList_default as GroupList, GroupMembers_default as GroupMembers, GroupQueryKeys, I18N_KEY, I18nProvider_default as I18nProvider, InfoIcon, InviteUser_default as InviteUser, KeyValueList_default as KeyValueList, LanguageSwitcher_default as LanguageSwitcher, Loading_default as Loading, LogOutIcon, Logo_default as Logo, MicrosoftButton_default as MicrosoftButton, OtpField_default as OtpField, PasswordField_default as PasswordField, PencilIcon, PlusIcon, RoleAssignments_default as RoleAssignments, RoleCreate_default as RoleCreate, RoleList_default as RoleList, RolePermissions_default as RolePermissions, RoleQueryKeys, Select_default as Select, SignIn_default as SignIn, SignInButton_default as SignInButton, SignOutButton_default as SignOutButton, SignUp_default as SignUp, SignUpButton_default as SignUpButton, SignedIn_default as SignedIn, SignedOut_default as SignedOut, Spinner_default as Spinner, THEME_KEY, THUNDERID_KEY, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ThunderIDAPIError, ThunderIDPlugin_default as ThunderIDPlugin, ThunderIDProvider_default as ThunderIDProvider, ThunderIDRuntimeError, ThunderIDVueClient_default as ThunderIDVueClient, TriangleAlertIcon, Typography_default as Typography, USER_KEY, User_default as User, UserCreate_default as UserCreate, UserDetails_default as UserDetails, UserDropdown_default as UserDropdown, UserIcon, UserList_default as UserList, UserProfile_default as UserProfile, UserProvider_default as UserProvider, UserQueryKeys, UserSelect_default as UserSelect, UserTypeSelect_default as UserTypeSelect, XIcon, addGroupMembers, addRoleAssignments, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createAgent, createApplication, createCallbackRoute, createClassObserver, createField, createGroup, createMediaQueryListener, createResourceInvalidator, createRole, createThunderIDGuard, createUser, deleteAgent, deleteApplication, deleteGroup, deleteRole, deleteUser, detectThemeMode, extractErrorMessage, getActiveTheme, getAgent, getAgentGroups, getAgentRoles, getAgentTypes, getAgents, getApplication, getApplications, getAuthComponentHeadings_default as getAuthComponentHeadings, getGroup, getGroupMembers, getGroups, getRole, getRoleAssignments, getRoles, getTokenPermissions, getUser, getUserGroups, getUsers, getUsersMeMeta_default as getUsersMeMeta, handlePasskeyAuthentication, handlePasskeyRegistration, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasPermission, http, initiateOAuthRedirect, navigate, normalizeFlowResponse, parseKeyValuePairs, removeGroupMembers, removeRoleAssignments, updateAgent, updateApplication, updateGroup, updateRole, updateUser, useAddGroupMembers_default as useAddGroupMembers, useAddRoleAssignments_default as useAddRoleAssignments, useCreateAgent_default as useCreateAgent, useCreateApplication_default as useCreateApplication, useCreateGroup_default as useCreateGroup, useCreateRole_default as useCreateRole, useCreateUser_default as useCreateUser, useDeleteAgent_default as useDeleteAgent, useDeleteApplication_default as useDeleteApplication, useDeleteGroup_default as useDeleteGroup, useDeleteRole_default as useDeleteRole, useDeleteUser_default as useDeleteUser, useFetchAuthFlows_default as useFetchAuthFlows, useFetchUserTypes_default as useFetchUserTypes, useFetchUsers_default as useFetchUsers, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useGetAgent_default as useGetAgent, useGetAgentGroups_default as useGetAgentGroups, useGetAgentRoles_default as useGetAgentRoles, useGetAgentTypes_default as useGetAgentTypes, useGetAgents_default as useGetAgents, useGetApplication_default as useGetApplication, useGetApplications_default as useGetApplications, useGetGroup_default as useGetGroup, useGetGroupMembers_default as useGetGroupMembers, useGetGroups_default as useGetGroups, useGetRole_default as useGetRole, useGetRoleAssignments_default as useGetRoleAssignments, useGetRoles_default as useGetRoles, useGetUser_default as useGetUser, useGetUserGroups_default as useGetUserGroups, useGetUserTypes_default as useGetUserTypes, useGetUsers_default as useGetUsers, useGrantedPermissions_default as useGrantedPermissions, useI18n_default as useI18n, useInfiniteOptions_default as useInfiniteOptions, useManagementEndpoint_default as useManagementEndpoint, useOAuthCallback, useRemoveGroupMembers_default as useRemoveGroupMembers, useRemoveRoleAssignments_default as useRemoveRoleAssignments, useResourceMutation_default as useResourceMutation, useResourceQuery_default as useResourceQuery, useTheme_default as useTheme, useThunderID_default as useThunderID, useUpdateAgent_default as useUpdateAgent, useUpdateApplication_default as useUpdateApplication, useUpdateGroup_default as useUpdateGroup, useUpdateRole_default as useUpdateRole, useUpdateUser_default as useUpdateUser, useUser_default as useUser, validateFieldValue };
16317
+ export { ADMINISTRATION_FLOW_TYPE, AcceptInvite_default as AcceptInvite, AdministrationFlowConfigKey, AdministrationFlowData, AdministrationFlowError, AdministrationFlowInput, AdministrationModes, AgentCreate_default as AgentCreate, AgentDetails_default as AgentDetails, AgentList_default as AgentList, AgentQueryKeys, Alert_default as Alert, ApplicationCreate_default as ApplicationCreate, ApplicationDetails_default as ApplicationDetails, ApplicationList_default as ApplicationList, ApplicationQueryKeys, ArrowLeftRightIcon, Attribution_default as Attribution, AuthFlowSelect_default as AuthFlowSelect, BaseAcceptInvite_default as BaseAcceptInvite, BaseAgentCreate_default as BaseAgentCreate, BaseAgentDetails_default as BaseAgentDetails, BaseAgentList_default as BaseAgentList, BaseApplicationCreate_default as BaseApplicationCreate, BaseApplicationDetails_default as BaseApplicationDetails, BaseApplicationList_default as BaseApplicationList, BaseAuthFlowSelect_default as BaseAuthFlowSelect, BaseChangeCredential_default as BaseChangeCredential, BaseGroupCreate_default as BaseGroupCreate, BaseGroupList_default as BaseGroupList, BaseGroupMembers_default as BaseGroupMembers, BaseInviteUser_default as BaseInviteUser, BaseLanguageSwitcher_default as BaseLanguageSwitcher, BaseRoleAssignments_default as BaseRoleAssignments, BaseRoleCreate_default as BaseRoleCreate, BaseRoleList_default as BaseRoleList, BaseRolePermissions_default as BaseRolePermissions, BaseSignIn_default as BaseSignIn, BaseSignInButton_default as BaseSignInButton, BaseSignOutButton_default as BaseSignOutButton, BaseSignUp_default as BaseSignUp, BaseSignUpButton_default as BaseSignUpButton, BaseUserCreate_default as BaseUserCreate, BaseUserDetails_default as BaseUserDetails, BaseUserDropdown_default as BaseUserDropdown, BaseUserList_default as BaseUserList, BaseUserProfile_default as BaseUserProfile, BaseUserSelect_default as BaseUserSelect, BaseUserTypeSelect_default as BaseUserTypeSelect, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, ChangeCredential_default as ChangeCredential, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, CopyableText_default as CopyableText, DEFAULT_USER_CREATE_FIELDS, DataTable_default as DataTable, DatePicker_default as DatePicker, Divider_default as Divider, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowTextVariant, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, EyeIcon, EyeOffIcon, FLOW_KEY, FLOW_META_KEY, FacebookButton_default as FacebookButton, FieldFactory_default as FieldFactory, FieldType, FlowMetaProvider_default as FlowMetaProvider, FlowProvider_default as FlowProvider, GitHubButton_default as GitHubButton, GlobeIcon, GoogleButton_default as GoogleButton, GroupCreate_default as GroupCreate, GroupList_default as GroupList, GroupMembers_default as GroupMembers, GroupQueryKeys, I18N_KEY, I18nProvider_default as I18nProvider, InfoIcon, InviteUser_default as InviteUser, KeyValueList_default as KeyValueList, LanguageSwitcher_default as LanguageSwitcher, Loading_default as Loading, LogOutIcon, Logo_default as Logo, MicrosoftButton_default as MicrosoftButton, OtpField_default as OtpField, PasswordField_default as PasswordField, PencilIcon, PlusIcon, RoleAssignments_default as RoleAssignments, RoleCreate_default as RoleCreate, RoleList_default as RoleList, RolePermissions_default as RolePermissions, RoleQueryKeys, Select_default as Select, SignIn_default as SignIn, SignInButton_default as SignInButton, SignOutButton_default as SignOutButton, SignUp_default as SignUp, SignUpButton_default as SignUpButton, SignedIn_default as SignedIn, SignedOut_default as SignedOut, Spinner_default as Spinner, THEME_KEY, THUNDERID_KEY, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ThunderIDAPIError, ThunderIDPlugin_default as ThunderIDPlugin, ThunderIDProvider_default as ThunderIDProvider, ThunderIDRuntimeError, ThunderIDVueClient_default as ThunderIDVueClient, TriangleAlertIcon, Typography_default as Typography, USER_KEY, User_default as User, UserCreate_default as UserCreate, UserDetails_default as UserDetails, UserDropdown_default as UserDropdown, UserIcon, UserList_default as UserList, UserProfile_default as UserProfile, UserProvider_default as UserProvider, UserQueryKeys, UserSelect_default as UserSelect, UserTypeSelect_default as UserTypeSelect, XIcon, addGroupMembers, addRoleAssignments, applyGatewayConfiguration, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createAction, createAgent, createAgentType, createApplication, createApplicationSharingPolicy, createCallbackRoute, createClassObserver, createConfigurationVersion, createConnection, createDesignTheme, createField, createFlow, createGateway, createGatewaySecret, createGatewayVariable, createGroup, createLayout, createMediaQueryListener, createNotificationTemplate, createOrganizationUnit, createResource, createResourceInvalidator, createResourceServer, createRole, createSecret, createThunderIDGuard, createUser, createUserByPath, createUserSharingPolicy, createUserType, createVariable, deleteAction, deleteAgent, deleteAgentType, deleteApplication, deleteApplicationSharingPolicy, deleteConnection, deleteDesignTheme, deleteFlow, deleteGateway, deleteGatewaySecret, deleteGatewayVariable, deleteGroup, deleteImportedConfiguration, deleteLayout, deleteNotificationTemplate, deleteOrganizationUnit, deleteOrganizationUnitByPath, deleteResource, deleteResourceServer, deleteRole, deleteSecret, deleteTranslation, deleteTranslations, deleteUser, deleteUserSharingPolicy, deleteUserType, deleteVariable, detectThemeMode, executeAdministrationFlow, exportConfiguration, extractErrorMessage, findAdministrationFlows, getAction, getActions, getActiveTheme, getAgent, getAgentGroups, getAgentRoles, getAgentType, getAgentTypes, getAgents, getApplication, getApplicationOverlayRules, getApplicationSharingPolicies, getApplicationSharingPolicy, getApplications, getAuthComponentHeadings_default as getAuthComponentHeadings, getConfigurationVersion, getConfigurationVersions, getConnection, getConnectionUsages, getConnections, getConnectionsMeta, getDesignTheme, getDesignThemeUsages, getDesignThemes, getFlow, getFlowUsages, getFlowVersion, getFlowVersions, getFlows, getGateway, getGatewayAppliedConfiguration, getGatewayAppliedVersion, getGatewayConfigurationDiff, getGatewaySecret, getGatewaySecrets, getGatewayVariable, getGatewayVariables, getGateways, getGroup, getGroupMembers, getGroups, getLanguages, getLayout, getLayoutUsages, getLayouts, getNotificationTemplate, getNotificationTemplates, getOrganizationUnit, getOrganizationUnitByPath, getOrganizationUnitChildren, getOrganizationUnitGroups, getOrganizationUnitRoles, getOrganizationUnitUsers, getOrganizationUnits, getResource, getResourceServer, getResourceServers, getResources, getRole, getRoleAssignments, getRoles, getSecret, getSecrets, getServerConfig, getServerConfigs, getTokenPermissions, getUser, getUserGroups, getUserOverlayRules, getUserSharingPolicies, getUserSharingPolicy, getUserType, getUserTypes, getUserUsages, getUsers, getUsersByPath, getUsersMeMeta_default as getUsersMeMeta, getVariable, getVariables, handlePasskeyAuthentication, handlePasskeyRegistration, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasPermission, http, importConfiguration, initiateOAuthRedirect, navigate, normalizeFlowResponse, parseKeyValuePairs, previewCimdDocument, regenerateAgentSecret, regenerateClientSecret, regenerateFlowSecret, removeGroupMembers, removeRoleAssignments, resolveAdministrationFlowHandles, resolveAdministrationFlowId, resolveAdministrationFlows, resolveDesign, resolveTranslation, resolveTranslations, restoreFlowVersion, revertGatewayConfiguration, runAdministrationFlow, setTranslation, setTranslations, suspendAgent, suspendApplication, suspendUser, unlockAgent, unlockUser, unsuspendAgent, unsuspendApplication, unsuspendUser, updateAction, updateAgent, updateAgentType, updateApplication, updateApplicationSharingPolicy, updateConnection, updateDesignTheme, updateFlow, updateGateway, updateGatewaySecret, updateGatewayVariable, updateGroup, updateLayout, updateNotificationTemplate, updateOrganizationUnit, updateOrganizationUnitByPath, updateResource, updateResourceServer, updateRole, updateSecret, updateServerConfig, updateUser, updateUserCredentials, updateUserSharingPolicy, updateUserType, updateVariable, useFetchAuthFlows_default as useFetchAuthFlows, useFetchUserTypes_default as useFetchUserTypes, useFetchUsers_default as useFetchUsers, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useGrantedPermissions_default as useGrantedPermissions, useI18n_default as useI18n, useInfiniteOptions_default as useInfiniteOptions, useManagementEndpoint_default as useManagementEndpoint, useManagementRequestConfig_default as useManagementRequestConfig, useOAuthCallback, useTheme_default as useTheme, useThunderID_default as useThunderID, useUser_default as useUser, validateFieldValue };