@atlaskit/profilecard 26.19.8 → 26.20.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.
- package/CHANGELOG.md +72 -0
- package/build-agg-user-query/package.json +10 -0
- package/dist/cjs/client/AGGQuery.js +37 -0
- package/dist/cjs/client/AgentForbiddenError.js +28 -0
- package/dist/cjs/client/HeaderProcessor.js +1 -0
- package/dist/cjs/client/ProfileCardClient.js +11 -20
- package/dist/cjs/client/Query.js +1 -0
- package/dist/cjs/client/RovoAgentCardClient.js +38 -50
- package/dist/cjs/client/TeamCentralCardClient.js +5 -12
- package/dist/cjs/client/TeamProfileCardClient.js +2 -2
- package/dist/cjs/client/UserProfileCardClient.js +30 -54
- package/dist/cjs/client/addHeaders.js +16 -0
- package/dist/cjs/client/aggUserQuery.js +11 -0
- package/dist/cjs/client/aggUserQueryString.js +7 -0
- package/dist/cjs/client/ariPrefix.js +7 -0
- package/dist/cjs/client/buildAggUserQuery.js +18 -0
- package/dist/cjs/client/buildGatewayQuery.js +22 -0
- package/dist/cjs/client/buildHeaders.js +11 -0
- package/dist/cjs/client/buildReportingLinesQuery.js +14 -0
- package/dist/cjs/client/convertTeam.js +27 -0
- package/dist/cjs/client/defaultConfig.js +9 -0
- package/dist/cjs/client/directoryGraphqlQuery.js +37 -0
- package/dist/cjs/client/extractIdFromAri.js +14 -0
- package/dist/cjs/client/gatewayQueryV2.js +11 -0
- package/dist/cjs/client/{errorUtils.js → getErrorAttributes.js} +12 -15
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +3 -3
- package/dist/cjs/client/getTeamFromAGG.js +8 -64
- package/dist/cjs/client/graphQLQuery.js +66 -0
- package/dist/cjs/client/graphqlUtils.js +1 -125
- package/dist/cjs/client/handleAGGErrors.js +10 -0
- package/dist/cjs/client/handleDirectoryGraphQLErrors.js +10 -0
- package/dist/cjs/client/id.js +9 -0
- package/dist/cjs/client/idToAri.js +15 -0
- package/dist/cjs/client/idToAriSafe.js +14 -0
- package/dist/cjs/client/index.js +17 -4
- package/dist/cjs/client/maybeCreateTeamCentralClient.js +22 -0
- package/dist/cjs/client/modifyResponse.js +40 -0
- package/dist/cjs/components/Agent/AgentProfileCard.js +4 -4
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +2 -2
- package/dist/cjs/components/Agent/hooks/duplicateFetch.js +2 -169
- package/dist/cjs/components/Agent/hooks/fetchActivationId.js +57 -0
- package/dist/cjs/components/Agent/hooks/fetchDuplicateAgentMutation.js +74 -0
- package/dist/cjs/components/Agent/hooks/fetchHasVersionCapability.js +60 -0
- package/dist/cjs/components/Agent/hooks/firstCharUpper.js +9 -0
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +2 -212
- package/dist/cjs/components/Agent/hooks/useAgentUrlActions.js +219 -0
- package/dist/cjs/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.js +10 -0
- package/dist/cjs/components/Agent/utils/getAtlassianStudioAgentEditUrl.js +10 -0
- package/dist/cjs/components/Agent/utils/getStudioHost.js +14 -0
- package/dist/cjs/components/Agent/utils/getStudioPath.js +19 -0
- package/dist/cjs/components/Agent/utils/index.js +3 -28
- package/dist/cjs/components/Team/TeamProfileCard.js +2 -2
- package/dist/cjs/components/Team/index.js +5 -0
- package/dist/cjs/components/User/LoadingView.js +31 -0
- package/dist/cjs/components/User/ProfileCard.js +21 -242
- package/dist/cjs/components/User/ProfileCardDetails.js +6 -6
- package/dist/cjs/components/User/ProfileCardResourced.js +2 -2
- package/dist/cjs/components/User/ProfilecardInternal.js +234 -0
- package/dist/cjs/components/User/index.js +7 -0
- package/dist/cjs/components/common/LoadingState.js +2 -1
- package/dist/cjs/components/common/ProfileCardTrigger.js +2 -1
- package/dist/cjs/components/team-profile-card/main.js +9 -3
- package/dist/cjs/components/team-profile-card/team-actions/index.js +2 -2
- package/dist/cjs/index.js +5 -6
- package/dist/cjs/internal/isValidDate.js +12 -0
- package/dist/cjs/internal/relative-date.js +2 -7
- package/dist/cjs/mocks/get-time-string.js +16 -0
- package/dist/cjs/mocks/get-weekday.js +15 -0
- package/dist/cjs/mocks/mock-profile-client.js +7 -5
- package/dist/cjs/mocks/mock-team-client.js +2 -2
- package/dist/cjs/mocks/profile-data.js +32 -31
- package/dist/cjs/mocks/random.js +9 -0
- package/dist/cjs/mocks/simple-mock-clients.js +4 -3
- package/dist/cjs/mocks/static-team-data.js +33 -0
- package/dist/cjs/mocks/team-data.js +8 -33
- package/dist/cjs/styled/Card.js +1 -0
- package/dist/cjs/styled/Error.js +1 -0
- package/dist/cjs/styled/ReportingLines.js +1 -0
- package/dist/cjs/styled/TeamCard.js +1 -0
- package/dist/cjs/styled/TeamTrigger.js +1 -0
- package/dist/cjs/styled/UserTrigger.js +1 -0
- package/dist/cjs/util/AGGError.js +37 -0
- package/dist/cjs/util/AGGErrors.js +34 -0
- package/dist/cjs/util/AnalyticsEventPayload.js +1 -0
- package/dist/cjs/util/DirectoryGraphQLError.js +36 -0
- package/dist/cjs/util/DirectoryGraphQLErrors.js +34 -0
- package/dist/cjs/util/GenericAttributes.js +1 -0
- package/dist/cjs/util/HttpError.js +27 -0
- package/dist/cjs/util/actionClicked.js +15 -0
- package/dist/cjs/util/agentRequestAnalytics.js +15 -0
- package/dist/cjs/util/analytics.js +5 -134
- package/dist/cjs/util/cardTriggered.js +23 -0
- package/dist/cjs/util/createEvent.js +30 -0
- package/dist/cjs/util/errorRetryClicked.js +15 -0
- package/dist/cjs/util/getActionSubject.js +19 -0
- package/dist/cjs/util/moreActionsClicked.js +15 -0
- package/dist/cjs/util/moreMembersClicked.js +15 -0
- package/dist/cjs/util/profileCardRendered.js +15 -0
- package/dist/cjs/util/reportingLinesClicked.js +15 -0
- package/dist/cjs/util/teamAvatarClicked.js +15 -0
- package/dist/cjs/util/teamRequestAnalytics.js +15 -0
- package/dist/cjs/util/userRequestAnalytics.js +15 -0
- package/dist/es2019/client/AGGQuery.js +12 -0
- package/dist/es2019/client/AgentForbiddenError.js +8 -0
- package/dist/es2019/client/HeaderProcessor.js +0 -0
- package/dist/es2019/client/ProfileCardClient.js +10 -19
- package/dist/es2019/client/Query.js +0 -0
- package/dist/es2019/client/RovoAgentCardClient.js +3 -10
- package/dist/es2019/client/TeamCentralCardClient.js +2 -31
- package/dist/es2019/client/TeamProfileCardClient.js +1 -1
- package/dist/es2019/client/UserProfileCardClient.js +15 -102
- package/dist/es2019/client/addHeaders.js +10 -0
- package/dist/es2019/client/aggUserQuery.js +31 -0
- package/dist/es2019/client/aggUserQueryString.js +28 -0
- package/dist/es2019/client/ariPrefix.js +1 -0
- package/dist/es2019/client/buildAggUserQuery.js +10 -0
- package/dist/es2019/client/buildGatewayQuery.js +15 -0
- package/dist/es2019/client/buildHeaders.js +5 -0
- package/dist/es2019/client/buildReportingLinesQuery.js +30 -0
- package/dist/es2019/client/convertTeam.js +21 -0
- package/dist/es2019/client/defaultConfig.js +3 -0
- package/dist/es2019/client/directoryGraphqlQuery.js +12 -0
- package/dist/es2019/client/extractIdFromAri.js +8 -0
- package/dist/es2019/client/gatewayQueryV2.js +30 -0
- package/dist/es2019/client/{errorUtils.js → getErrorAttributes.js} +4 -7
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +2 -2
- package/dist/es2019/client/getTeamFromAGG.js +4 -80
- package/dist/es2019/client/graphQLQuery.js +24 -0
- package/dist/es2019/client/graphqlUtils.js +0 -47
- package/dist/es2019/client/handleAGGErrors.js +4 -0
- package/dist/es2019/client/handleDirectoryGraphQLErrors.js +4 -0
- package/dist/es2019/client/id.js +1 -0
- package/dist/es2019/client/idToAri.js +9 -0
- package/dist/es2019/client/idToAriSafe.js +6 -0
- package/dist/es2019/client/index.js +22 -2
- package/dist/es2019/client/maybeCreateTeamCentralClient.js +14 -0
- package/dist/es2019/client/modifyResponse.js +32 -0
- package/dist/es2019/components/Agent/AgentProfileCard.js +2 -2
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +1 -1
- package/dist/es2019/components/Agent/hooks/duplicateFetch.js +1 -121
- package/dist/es2019/components/Agent/hooks/fetchActivationId.js +35 -0
- package/dist/es2019/components/Agent/hooks/fetchDuplicateAgentMutation.js +49 -0
- package/dist/es2019/components/Agent/hooks/fetchHasVersionCapability.js +39 -0
- package/dist/es2019/components/Agent/hooks/firstCharUpper.js +1 -0
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +1 -182
- package/dist/es2019/components/Agent/hooks/useAgentUrlActions.js +186 -0
- package/dist/es2019/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.js +2 -0
- package/dist/es2019/components/Agent/utils/getAtlassianStudioAgentEditUrl.js +2 -0
- package/dist/es2019/components/Agent/utils/getStudioHost.js +8 -0
- package/dist/es2019/components/Agent/utils/getStudioPath.js +13 -0
- package/dist/es2019/components/Agent/utils/index.js +2 -23
- package/dist/es2019/components/Team/TeamProfileCard.js +1 -1
- package/dist/es2019/components/Team/index.js +6 -0
- package/dist/es2019/components/User/LoadingView.js +19 -0
- package/dist/es2019/components/User/ProfileCard.js +12 -221
- package/dist/es2019/components/User/ProfileCardDetails.js +1 -1
- package/dist/es2019/components/User/ProfileCardResourced.js +1 -1
- package/dist/es2019/components/User/ProfilecardInternal.js +207 -0
- package/dist/es2019/components/User/index.js +8 -0
- package/dist/es2019/components/common/LoadingState.js +2 -1
- package/dist/es2019/components/common/ProfileCardTrigger.js +2 -1
- package/dist/es2019/components/team-profile-card/main.js +8 -1
- package/dist/es2019/components/team-profile-card/team-actions/index.js +1 -1
- package/dist/es2019/i18n/index.js +91 -0
- package/dist/es2019/index.js +4 -2
- package/dist/es2019/internal/isValidDate.js +4 -0
- package/dist/es2019/internal/relative-date.js +1 -4
- package/dist/es2019/mocks/{util.js → get-time-string.js} +1 -9
- package/dist/es2019/mocks/get-weekday.js +9 -0
- package/dist/es2019/mocks/index.js +13 -0
- package/dist/es2019/mocks/mock-profile-client.js +4 -2
- package/dist/es2019/mocks/mock-team-client.js +1 -1
- package/dist/es2019/mocks/profile-data.js +2 -1
- package/dist/es2019/mocks/random.js +1 -0
- package/dist/es2019/mocks/simple-mock-clients.js +3 -2
- package/dist/es2019/mocks/static-team-data.js +21 -0
- package/dist/es2019/mocks/team-data.js +6 -26
- package/dist/es2019/styled/Card.js +1 -0
- package/dist/es2019/styled/Error.js +1 -0
- package/dist/es2019/styled/ReportingLines.js +1 -0
- package/dist/es2019/styled/TeamCard.js +1 -0
- package/dist/es2019/styled/TeamTrigger.js +1 -0
- package/dist/es2019/styled/UserTrigger.js +1 -0
- package/dist/es2019/util/AGGError.js +16 -0
- package/dist/es2019/util/AGGErrors.js +12 -0
- package/dist/es2019/util/AnalyticsEventPayload.js +0 -0
- package/dist/es2019/util/DirectoryGraphQLError.js +14 -0
- package/dist/es2019/util/DirectoryGraphQLErrors.js +12 -0
- package/dist/es2019/util/GenericAttributes.js +0 -0
- package/dist/es2019/util/HttpError.js +7 -0
- package/dist/es2019/util/actionClicked.js +8 -0
- package/dist/es2019/util/agentRequestAnalytics.js +7 -0
- package/dist/es2019/util/analytics.js +4 -107
- package/dist/es2019/util/cardTriggered.js +15 -0
- package/dist/es2019/util/createEvent.js +18 -0
- package/dist/es2019/util/errorRetryClicked.js +8 -0
- package/dist/es2019/util/getActionSubject.js +13 -0
- package/dist/es2019/util/moreActionsClicked.js +8 -0
- package/dist/es2019/util/moreMembersClicked.js +8 -0
- package/dist/es2019/util/profileCardRendered.js +8 -0
- package/dist/es2019/util/reportingLinesClicked.js +8 -0
- package/dist/es2019/util/teamAvatarClicked.js +8 -0
- package/dist/es2019/util/teamRequestAnalytics.js +7 -0
- package/dist/es2019/util/userRequestAnalytics.js +7 -0
- package/dist/esm/client/AGGQuery.js +31 -0
- package/dist/esm/client/AgentForbiddenError.js +21 -0
- package/dist/esm/client/HeaderProcessor.js +0 -0
- package/dist/esm/client/ProfileCardClient.js +10 -17
- package/dist/esm/client/Query.js +0 -0
- package/dist/esm/client/RovoAgentCardClient.js +27 -39
- package/dist/esm/client/TeamCentralCardClient.js +2 -9
- package/dist/esm/client/TeamProfileCardClient.js +1 -1
- package/dist/esm/client/UserProfileCardClient.js +17 -51
- package/dist/esm/client/addHeaders.js +10 -0
- package/dist/esm/client/aggUserQuery.js +4 -0
- package/dist/esm/client/aggUserQueryString.js +1 -0
- package/dist/esm/client/ariPrefix.js +1 -0
- package/dist/esm/client/buildAggUserQuery.js +12 -0
- package/dist/esm/client/buildGatewayQuery.js +16 -0
- package/dist/esm/client/buildHeaders.js +5 -0
- package/dist/esm/client/buildReportingLinesQuery.js +8 -0
- package/dist/esm/client/convertTeam.js +22 -0
- package/dist/esm/client/defaultConfig.js +3 -0
- package/dist/esm/client/directoryGraphqlQuery.js +31 -0
- package/dist/esm/client/extractIdFromAri.js +8 -0
- package/dist/esm/client/gatewayQueryV2.js +5 -0
- package/dist/esm/client/{errorUtils.js → getErrorAttributes.js} +5 -8
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +2 -2
- package/dist/esm/client/getTeamFromAGG.js +4 -59
- package/dist/esm/client/graphQLQuery.js +59 -0
- package/dist/esm/client/graphqlUtils.js +0 -118
- package/dist/esm/client/handleAGGErrors.js +4 -0
- package/dist/esm/client/handleDirectoryGraphQLErrors.js +4 -0
- package/dist/esm/client/id.js +3 -0
- package/dist/esm/client/idToAri.js +9 -0
- package/dist/esm/client/idToAriSafe.js +8 -0
- package/dist/esm/client/index.js +22 -2
- package/dist/esm/client/maybeCreateTeamCentralClient.js +15 -0
- package/dist/esm/client/modifyResponse.js +33 -0
- package/dist/esm/components/Agent/AgentProfileCard.js +2 -2
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +1 -1
- package/dist/esm/components/Agent/hooks/duplicateFetch.js +1 -167
- package/dist/esm/components/Agent/hooks/fetchActivationId.js +51 -0
- package/dist/esm/components/Agent/hooks/fetchDuplicateAgentMutation.js +68 -0
- package/dist/esm/components/Agent/hooks/fetchHasVersionCapability.js +54 -0
- package/dist/esm/components/Agent/hooks/firstCharUpper.js +3 -0
- package/dist/esm/components/Agent/hooks/useAgentActions.js +1 -210
- package/dist/esm/components/Agent/hooks/useAgentUrlActions.js +212 -0
- package/dist/esm/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.js +4 -0
- package/dist/esm/components/Agent/utils/getAtlassianStudioAgentEditUrl.js +4 -0
- package/dist/esm/components/Agent/utils/getStudioHost.js +8 -0
- package/dist/esm/components/Agent/utils/getStudioPath.js +13 -0
- package/dist/esm/components/Agent/utils/index.js +2 -27
- package/dist/esm/components/Team/TeamProfileCard.js +1 -1
- package/dist/esm/components/Team/index.js +6 -0
- package/dist/esm/components/User/LoadingView.js +22 -0
- package/dist/esm/components/User/ProfileCard.js +12 -239
- package/dist/esm/components/User/ProfileCardDetails.js +1 -1
- package/dist/esm/components/User/ProfileCardResourced.js +1 -1
- package/dist/esm/components/User/ProfilecardInternal.js +225 -0
- package/dist/esm/components/User/index.js +8 -0
- package/dist/esm/components/common/LoadingState.js +2 -1
- package/dist/esm/components/common/ProfileCardTrigger.js +2 -1
- package/dist/esm/components/team-profile-card/main.js +8 -1
- package/dist/esm/components/team-profile-card/team-actions/index.js +1 -1
- package/dist/esm/i18n/index.js +91 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/internal/isValidDate.js +5 -0
- package/dist/esm/internal/relative-date.js +1 -5
- package/dist/esm/mocks/{util.js → get-time-string.js} +1 -11
- package/dist/esm/mocks/get-weekday.js +9 -0
- package/dist/esm/mocks/index.js +13 -0
- package/dist/esm/mocks/mock-profile-client.js +4 -2
- package/dist/esm/mocks/mock-team-client.js +1 -1
- package/dist/esm/mocks/profile-data.js +2 -1
- package/dist/esm/mocks/random.js +3 -0
- package/dist/esm/mocks/simple-mock-clients.js +3 -2
- package/dist/esm/mocks/static-team-data.js +27 -0
- package/dist/esm/mocks/team-data.js +6 -32
- package/dist/esm/styled/Card.js +1 -0
- package/dist/esm/styled/Error.js +1 -0
- package/dist/esm/styled/ReportingLines.js +1 -0
- package/dist/esm/styled/TeamCard.js +1 -0
- package/dist/esm/styled/TeamTrigger.js +1 -0
- package/dist/esm/styled/UserTrigger.js +1 -0
- package/dist/esm/util/AGGError.js +30 -0
- package/dist/esm/util/AGGErrors.js +27 -0
- package/dist/esm/util/AnalyticsEventPayload.js +0 -0
- package/dist/esm/util/DirectoryGraphQLError.js +29 -0
- package/dist/esm/util/DirectoryGraphQLErrors.js +27 -0
- package/dist/esm/util/GenericAttributes.js +0 -0
- package/dist/esm/util/HttpError.js +20 -0
- package/dist/esm/util/actionClicked.js +10 -0
- package/dist/esm/util/agentRequestAnalytics.js +9 -0
- package/dist/esm/util/analytics.js +4 -132
- package/dist/esm/util/cardTriggered.js +17 -0
- package/dist/esm/util/createEvent.js +24 -0
- package/dist/esm/util/errorRetryClicked.js +10 -0
- package/dist/esm/util/getActionSubject.js +13 -0
- package/dist/esm/util/moreActionsClicked.js +10 -0
- package/dist/esm/util/moreMembersClicked.js +10 -0
- package/dist/esm/util/profileCardRendered.js +10 -0
- package/dist/esm/util/reportingLinesClicked.js +10 -0
- package/dist/esm/util/teamAvatarClicked.js +10 -0
- package/dist/esm/util/teamRequestAnalytics.js +9 -0
- package/dist/esm/util/userRequestAnalytics.js +9 -0
- package/dist/types/client/AGGQuery.d.ts +8 -0
- package/dist/types/client/AgentForbiddenError.d.ts +4 -0
- package/dist/types/client/HeaderProcessor.d.ts +1 -0
- package/dist/types/client/ProfileCardClient.d.ts +8 -3
- package/dist/types/client/Query.d.ts +4 -0
- package/dist/types/client/RovoAgentCardClient.d.ts +0 -4
- package/dist/types/client/TeamCentralCardClient.d.ts +0 -6
- package/dist/types/client/UserProfileCardClient.d.ts +9 -16
- package/dist/types/client/addHeaders.d.ts +1 -0
- package/dist/types/client/aggUserQuery.d.ts +2 -0
- package/dist/types/client/aggUserQueryString.d.ts +1 -0
- package/dist/types/client/ariPrefix.d.ts +1 -0
- package/dist/types/client/buildAggUserQuery.d.ts +6 -0
- package/dist/types/client/buildGatewayQuery.d.ts +12 -0
- package/dist/types/client/buildHeaders.d.ts +1 -0
- package/dist/types/client/buildReportingLinesQuery.d.ts +6 -0
- package/dist/types/client/convertTeam.d.ts +3 -0
- package/dist/types/client/defaultConfig.d.ts +3 -0
- package/dist/types/client/directoryGraphqlQuery.d.ts +8 -0
- package/dist/types/client/extractIdFromAri.d.ts +1 -0
- package/dist/types/client/gatewayQueryV2.d.ts +1 -0
- package/dist/types/client/getErrorAttributes.d.ts +6 -0
- package/dist/types/client/getTeamFromAGG.d.ts +1 -21
- package/dist/types/client/graphQLQuery.d.ts +3 -0
- package/dist/types/client/graphqlUtils.d.ts +0 -18
- package/dist/types/client/handleAGGErrors.d.ts +1 -0
- package/dist/types/client/handleDirectoryGraphQLErrors.d.ts +1 -0
- package/dist/types/client/id.d.ts +2 -0
- package/dist/types/client/idToAri.d.ts +4 -0
- package/dist/types/client/idToAriSafe.d.ts +1 -0
- package/dist/types/client/index.d.ts +18 -2
- package/dist/types/client/maybeCreateTeamCentralClient.d.ts +3 -0
- package/dist/types/client/modifyResponse.d.ts +10 -0
- package/dist/types/components/Agent/hooks/duplicateFetch.d.ts +1 -24
- package/dist/types/components/Agent/hooks/fetchActivationId.d.ts +5 -0
- package/dist/types/components/Agent/hooks/fetchDuplicateAgentMutation.d.ts +11 -0
- package/dist/types/components/Agent/hooks/fetchHasVersionCapability.d.ts +8 -0
- package/dist/types/components/Agent/hooks/firstCharUpper.d.ts +1 -0
- package/dist/types/components/Agent/hooks/useAgentActions.d.ts +1 -16
- package/dist/types/components/Agent/hooks/useAgentUrlActions.d.ts +15 -0
- package/dist/types/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.d.ts +1 -0
- package/dist/types/components/Agent/utils/getAtlassianStudioAgentEditUrl.d.ts +1 -0
- package/dist/types/components/Agent/utils/getStudioHost.d.ts +1 -0
- package/dist/types/components/Agent/utils/getStudioPath.d.ts +1 -0
- package/dist/types/components/Agent/utils/index.d.ts +2 -4
- package/dist/types/components/Team/index.d.ts +3 -0
- package/dist/types/components/User/LoadingView.d.ts +3 -0
- package/dist/types/components/User/ProfileCard.d.ts +9 -4
- package/dist/types/components/User/ProfilecardInternal.d.ts +3 -0
- package/dist/types/components/User/index.d.ts +6 -0
- package/dist/types/components/team-profile-card/main.d.ts +5 -0
- package/dist/types/i18n/index.d.ts +90 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/internal/isValidDate.d.ts +1 -0
- package/dist/types/internal/relative-date.d.ts +0 -1
- package/dist/types/mocks/get-time-string.d.ts +1 -0
- package/dist/types/mocks/get-weekday.d.ts +4 -0
- package/dist/types/mocks/index.d.ts +12 -0
- package/dist/types/mocks/random.d.ts +1 -0
- package/dist/types/mocks/simple-mock-clients.d.ts +1 -1
- package/dist/types/mocks/static-team-data.d.ts +8 -0
- package/dist/types/mocks/team-data.d.ts +10 -7
- package/dist/types/types.d.ts +1 -1
- package/dist/types/util/AGGError.d.ts +15 -0
- package/dist/types/util/AGGErrors.d.ts +6 -0
- package/dist/types/util/AnalyticsEventPayload.d.ts +1 -0
- package/dist/types/util/DirectoryGraphQLError.d.ts +14 -0
- package/dist/types/util/DirectoryGraphQLErrors.d.ts +6 -0
- package/dist/types/util/GenericAttributes.d.ts +1 -0
- package/dist/types/util/HttpError.d.ts +5 -0
- package/dist/types/util/actionClicked.d.ts +13 -0
- package/dist/types/util/agentRequestAnalytics.d.ts +9 -0
- package/dist/types/util/analytics.d.ts +3 -97
- package/dist/types/util/cardTriggered.d.ts +7 -0
- package/dist/types/util/createEvent.d.ts +7 -0
- package/dist/types/util/errorRetryClicked.d.ts +8 -0
- package/dist/types/util/getActionSubject.d.ts +1 -0
- package/dist/types/util/moreActionsClicked.d.ts +10 -0
- package/dist/types/util/moreMembersClicked.d.ts +9 -0
- package/dist/types/util/profileCardRendered.d.ts +16 -0
- package/dist/types/util/reportingLinesClicked.d.ts +9 -0
- package/dist/types/util/teamAvatarClicked.d.ts +11 -0
- package/dist/types/util/teamRequestAnalytics.d.ts +9 -0
- package/dist/types/util/userRequestAnalytics.d.ts +9 -0
- package/loading-view/package.json +10 -0
- package/main/package.json +4 -4
- package/modify-response/package.json +10 -0
- package/package.json +2 -2
- package/profile-card-client/package.json +4 -4
- package/profile-card-resourced/package.json +10 -0
- package/profilecard-internal/package.json +10 -0
- package/dist/cjs/components/Error/index.js +0 -27
- package/dist/cjs/components/Icon/index.js +0 -13
- package/dist/cjs/components/team-profile-card/index.js +0 -12
- package/dist/cjs/entry-points/ProfileCardClient.js +0 -13
- package/dist/cjs/entry-points/main.js +0 -12
- package/dist/cjs/mocks/util.js +0 -26
- package/dist/cjs/util/errors.js +0 -105
- package/dist/es2019/components/Error/index.js +0 -3
- package/dist/es2019/components/Icon/index.js +0 -1
- package/dist/es2019/components/team-profile-card/index.js +0 -1
- package/dist/es2019/entry-points/ProfileCardClient.js +0 -1
- package/dist/es2019/entry-points/main.js +0 -1
- package/dist/es2019/util/errors.js +0 -59
- package/dist/esm/components/Error/index.js +0 -3
- package/dist/esm/components/Icon/index.js +0 -1
- package/dist/esm/components/team-profile-card/index.js +0 -1
- package/dist/esm/entry-points/ProfileCardClient.js +0 -1
- package/dist/esm/entry-points/main.js +0 -1
- package/dist/esm/util/errors.js +0 -98
- package/dist/types/client/errorUtils.d.ts +0 -5
- package/dist/types/components/Error/index.d.ts +0 -3
- package/dist/types/components/Icon/index.d.ts +0 -1
- package/dist/types/components/team-profile-card/index.d.ts +0 -1
- package/dist/types/entry-points/ProfileCardClient.d.ts +0 -1
- package/dist/types/entry-points/main.d.ts +0 -1
- package/dist/types/mocks/util.d.ts +0 -6
- package/dist/types/util/errors.d.ts +0 -43
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.fetchHasVersionCapability = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _duplicateFetch = require("./duplicateFetch");
|
|
11
|
+
/**
|
|
12
|
+
* Fetches version capability for a site via raw GraphQL fetch.
|
|
13
|
+
* Returns true only if versioning migration has completed.
|
|
14
|
+
*
|
|
15
|
+
* TODO remove after versioning rollout complete
|
|
16
|
+
* See: https://product-fabric.atlassian.net/browse/RAGE-2822
|
|
17
|
+
*/
|
|
18
|
+
var fetchHasVersionCapability = exports.fetchHasVersionCapability = /*#__PURE__*/function () {
|
|
19
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(cloudId) {
|
|
20
|
+
var _json$data, response, json, result, _t;
|
|
21
|
+
return _regenerator.default.wrap(function (_context) {
|
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
_context.prev = 0;
|
|
25
|
+
_context.next = 1;
|
|
26
|
+
return fetch(_duplicateFetch.GRAPHQL_ENDPOINT, {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
credentials: 'include',
|
|
29
|
+
headers: {
|
|
30
|
+
'Content-Type': 'application/json'
|
|
31
|
+
},
|
|
32
|
+
body: JSON.stringify({
|
|
33
|
+
query: "query profilecardHasVersionCapabilityQuery($cloudId: String!) {\n\t\t\t\t\tagentStudio_hasVersionCapability(cloudId: $cloudId) @optIn(to: \"AgentStudio\") {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t... on AgentStudioHasVersionCapability {\n\t\t\t\t\t\t\thasVersionCapability\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
|
|
34
|
+
variables: {
|
|
35
|
+
cloudId: cloudId
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
case 1:
|
|
40
|
+
response = _context.sent;
|
|
41
|
+
_context.next = 2;
|
|
42
|
+
return response.json();
|
|
43
|
+
case 2:
|
|
44
|
+
json = _context.sent;
|
|
45
|
+
result = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data.agentStudio_hasVersionCapability;
|
|
46
|
+
return _context.abrupt("return", (result === null || result === void 0 ? void 0 : result.__typename) === 'AgentStudioHasVersionCapability' ? Boolean(result.hasVersionCapability) : false);
|
|
47
|
+
case 3:
|
|
48
|
+
_context.prev = 3;
|
|
49
|
+
_t = _context["catch"](0);
|
|
50
|
+
return _context.abrupt("return", false);
|
|
51
|
+
case 4:
|
|
52
|
+
case "end":
|
|
53
|
+
return _context.stop();
|
|
54
|
+
}
|
|
55
|
+
}, _callee, null, [[0, 3]]);
|
|
56
|
+
}));
|
|
57
|
+
return function fetchHasVersionCapability(_x) {
|
|
58
|
+
return _ref.apply(this, arguments);
|
|
59
|
+
};
|
|
60
|
+
}();
|
|
@@ -1,217 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
var _react = require("react");
|
|
13
|
-
var _getAtlContextUrl = require("@atlaskit/atlassian-context/get-atl-context-url");
|
|
14
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
|
-
var _postMessageToPubsub = require("@atlaskit/rovo-triggers/post-message-to-pubsub");
|
|
16
|
-
var _navigation = require("@atlaskit/teams-app-config/navigation");
|
|
17
|
-
var _useAnalyticsEvents2 = require("@atlaskit/teams-app-internal-analytics/use-analytics-events");
|
|
18
|
-
var _url = require("../../../util/url");
|
|
19
|
-
var _utils = require("../utils");
|
|
20
|
-
var _duplicateFetch = require("./duplicateFetch");
|
|
21
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
-
var firstCharUpper = exports.firstCharUpper = function firstCharUpper(str) {
|
|
24
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
25
|
-
};
|
|
26
|
-
var ROVO_PARAM_PREFIX = 'rovoChat';
|
|
27
|
-
var createRovoParams = function createRovoParams(params) {
|
|
28
|
-
var rovoParams = {};
|
|
29
|
-
Object.entries(params).forEach(function (_ref) {
|
|
30
|
-
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
31
|
-
key = _ref2[0],
|
|
32
|
-
value = _ref2[1];
|
|
33
|
-
rovoParams["".concat(ROVO_PARAM_PREFIX).concat(firstCharUpper(key))] = encodeURIComponent(value);
|
|
34
|
-
});
|
|
35
|
-
return rovoParams;
|
|
36
|
-
};
|
|
37
|
-
var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
38
|
-
var cloudId = _ref3.cloudId,
|
|
39
|
-
email = _ref3.email,
|
|
40
|
-
source = _ref3.source;
|
|
41
|
-
var _useRovoPostMessageTo = (0, _postMessageToPubsub.useRovoPostMessageToPubsub)(),
|
|
42
|
-
publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
|
|
43
|
-
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
44
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
45
|
-
var onEditAgent = (0, _react.useCallback)(function (agentId) {
|
|
46
|
-
var url = (0, _utils.getAtlassianStudioAgentEditUrl)(cloudId, agentId, email);
|
|
47
|
-
window.open(url, '_blank', 'noopener, noreferrer');
|
|
48
|
-
fireEvent('ui.button.clicked.editAgentButton', {
|
|
49
|
-
agentId: agentId,
|
|
50
|
-
source: source
|
|
51
|
-
});
|
|
52
|
-
}, [cloudId, email, fireEvent, source]);
|
|
53
|
-
var onCopyAgent = function onCopyAgent(agentId) {
|
|
54
|
-
var url = "".concat(window.location.origin, "/people/agent/").concat(agentId);
|
|
55
|
-
var urlWithParams = (0, _url.encodeParamsToUrl)(url, {
|
|
56
|
-
cloudId: cloudId
|
|
57
|
-
});
|
|
58
|
-
navigator.clipboard.writeText(urlWithParams);
|
|
59
|
-
fireEvent('ui.button.clicked.copyAgentLinkButton', {
|
|
60
|
-
agentId: agentId,
|
|
61
|
-
source: source
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
var onDuplicateAgent = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
65
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(agentId) {
|
|
66
|
-
var legacyDuplicateUrl, hasVersionCapability, activationId, agentAri, result;
|
|
67
|
-
return _regenerator.default.wrap(function (_context) {
|
|
68
|
-
while (1) switch (_context.prev = _context.next) {
|
|
69
|
-
case 0:
|
|
70
|
-
fireEvent('ui.button.clicked.duplicateAgentButton', {
|
|
71
|
-
agentId: agentId,
|
|
72
|
-
source: source
|
|
73
|
-
});
|
|
74
|
-
legacyDuplicateUrl = (0, _utils.getAtlassianStudioAgentDuplicateUrl)(cloudId, agentId, email); // When versioning FG is off, use legacy duplicate flow
|
|
75
|
-
if ((0, _fg.fg)('rovo_agent_versioning_enabled')) {
|
|
76
|
-
_context.next = 1;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
window.open(legacyDuplicateUrl, '_blank', 'noopener, noreferrer');
|
|
80
|
-
return _context.abrupt("return");
|
|
81
|
-
case 1:
|
|
82
|
-
_context.next = 2;
|
|
83
|
-
return (0, _duplicateFetch.fetchHasVersionCapability)(cloudId);
|
|
84
|
-
case 2:
|
|
85
|
-
hasVersionCapability = _context.sent;
|
|
86
|
-
if (hasVersionCapability) {
|
|
87
|
-
_context.next = 3;
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
91
|
-
window.location.assign(legacyDuplicateUrl);
|
|
92
|
-
return _context.abrupt("return");
|
|
93
|
-
case 3:
|
|
94
|
-
_context.next = 4;
|
|
95
|
-
return (0, _duplicateFetch.fetchActivationId)(cloudId);
|
|
96
|
-
case 4:
|
|
97
|
-
activationId = _context.sent;
|
|
98
|
-
if (activationId) {
|
|
99
|
-
_context.next = 5;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
103
|
-
window.location.assign(legacyDuplicateUrl);
|
|
104
|
-
return _context.abrupt("return");
|
|
105
|
-
case 5:
|
|
106
|
-
agentAri = "ari:cloud:rovo::agent/activation/".concat(activationId, "/").concat(agentId); // Call BE mutation to duplicate the agent
|
|
107
|
-
_context.next = 6;
|
|
108
|
-
return (0, _duplicateFetch.fetchDuplicateAgentMutation)(agentAri);
|
|
109
|
-
case 6:
|
|
110
|
-
result = _context.sent;
|
|
111
|
-
if (result.success && result.newAgentAri) {
|
|
112
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
113
|
-
window.location.assign((0, _utils.getStudioPath)("/s/".concat(cloudId, "/agents/").concat(encodeURIComponent(result.newAgentAri), "/v/draft/details")));
|
|
114
|
-
} else {
|
|
115
|
-
// Fallback to legacy on error
|
|
116
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
117
|
-
window.location.assign(legacyDuplicateUrl);
|
|
118
|
-
}
|
|
119
|
-
case 7:
|
|
120
|
-
case "end":
|
|
121
|
-
return _context.stop();
|
|
122
|
-
}
|
|
123
|
-
}, _callee);
|
|
124
|
-
}));
|
|
125
|
-
return function (_x) {
|
|
126
|
-
return _ref4.apply(this, arguments);
|
|
127
|
-
};
|
|
128
|
-
}(), [cloudId, email, fireEvent, source]);
|
|
129
|
-
var onConversationStarter = function onConversationStarter(_ref5) {
|
|
130
|
-
var agentId = _ref5.agentId,
|
|
131
|
-
prompt = _ref5.prompt;
|
|
132
|
-
var startConversationInNewTab = function startConversationInNewTab() {
|
|
133
|
-
var baseUrl = "".concat((0, _getAtlContextUrl.getATLContextUrl)('home'), "/chat");
|
|
134
|
-
var urlWithParams = (0, _url.encodeParamsToUrl)(baseUrl, _objectSpread({
|
|
135
|
-
cloudId: cloudId
|
|
136
|
-
}, createRovoParams({
|
|
137
|
-
cloudId: cloudId,
|
|
138
|
-
agentId: agentId,
|
|
139
|
-
prompt: prompt,
|
|
140
|
-
pathway: 'chat'
|
|
141
|
-
})));
|
|
142
|
-
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
143
|
-
};
|
|
144
|
-
publishWithPostMessage({
|
|
145
|
-
targetWindow: window,
|
|
146
|
-
payload: {
|
|
147
|
-
type: 'chat-new',
|
|
148
|
-
source: 'AgentProfileCard',
|
|
149
|
-
data: {
|
|
150
|
-
name: prompt.slice(0, 50),
|
|
151
|
-
prompt: prompt,
|
|
152
|
-
agentId: agentId,
|
|
153
|
-
dialogues: []
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
157
|
-
startConversationInNewTab();
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
var onOpenChat = function onOpenChat(agentId, agentName) {
|
|
162
|
-
var openChatInNewTab = function openChatInNewTab() {
|
|
163
|
-
var baseUrl = "".concat((0, _getAtlContextUrl.getATLContextUrl)('home'), "/chat");
|
|
164
|
-
var urlWithParams = (0, _url.encodeParamsToUrl)(baseUrl, _objectSpread({
|
|
165
|
-
cloudId: cloudId
|
|
166
|
-
}, createRovoParams({
|
|
167
|
-
cloudId: cloudId,
|
|
168
|
-
agentId: agentId,
|
|
169
|
-
pathway: 'chat'
|
|
170
|
-
})));
|
|
171
|
-
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
172
|
-
};
|
|
173
|
-
publishWithPostMessage({
|
|
174
|
-
targetWindow: window,
|
|
175
|
-
payload: {
|
|
176
|
-
type: 'chat-new',
|
|
177
|
-
source: 'AgentProfileCard',
|
|
178
|
-
data: {
|
|
179
|
-
agentId: agentId,
|
|
180
|
-
dialogues: [],
|
|
181
|
-
name: "Chat with ".concat(agentName)
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
185
|
-
openChatInNewTab();
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
var onViewFullProfile = function onViewFullProfile(agentId) {
|
|
190
|
-
var _navigateToTeamsApp = (0, _navigation.navigateToTeamsApp)({
|
|
191
|
-
type: 'AGENT',
|
|
192
|
-
payload: {
|
|
193
|
-
agentId: agentId
|
|
194
|
-
},
|
|
195
|
-
cloudId: cloudId,
|
|
196
|
-
shouldOpenInSameTab: false
|
|
197
|
-
}),
|
|
198
|
-
onNavigate = _navigateToTeamsApp.onNavigate;
|
|
199
|
-
if ((0, _fg.fg)('platform-adopt-teams-nav-config')) {
|
|
200
|
-
onNavigate();
|
|
201
|
-
} else {
|
|
202
|
-
window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
|
|
203
|
-
}
|
|
204
|
-
fireEvent('ui.button.clicked.viewAgentFullProfileButton', {
|
|
205
|
-
agentId: agentId,
|
|
206
|
-
source: source
|
|
207
|
-
});
|
|
208
|
-
};
|
|
209
|
-
return {
|
|
210
|
-
onEditAgent: onEditAgent,
|
|
211
|
-
onCopyAgent: onCopyAgent,
|
|
212
|
-
onDuplicateAgent: onDuplicateAgent,
|
|
213
|
-
onOpenChat: onOpenChat,
|
|
214
|
-
onConversationStarter: onConversationStarter,
|
|
215
|
-
onViewFullProfile: onViewFullProfile
|
|
216
|
-
};
|
|
217
|
-
};
|
|
6
|
+
exports.ROVO_PARAM_PREFIX = void 0;
|
|
7
|
+
var ROVO_PARAM_PREFIX = exports.ROVO_PARAM_PREFIX = 'rovoChat';
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useAgentUrlActions = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var _getAtlContextUrl = require("@atlaskit/atlassian-context/get-atl-context-url");
|
|
14
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
|
+
var _postMessageToPubsub = require("@atlaskit/rovo-triggers/post-message-to-pubsub");
|
|
16
|
+
var _navigation = require("@atlaskit/teams-app-config/navigation");
|
|
17
|
+
var _useAnalyticsEvents2 = require("@atlaskit/teams-app-internal-analytics/use-analytics-events");
|
|
18
|
+
var _url = require("../../../util/url");
|
|
19
|
+
var _getAtlassianStudioAgentDuplicateUrl = require("../utils/getAtlassianStudioAgentDuplicateUrl");
|
|
20
|
+
var _getAtlassianStudioAgentEditUrl = require("../utils/getAtlassianStudioAgentEditUrl");
|
|
21
|
+
var _getStudioPath = require("../utils/getStudioPath");
|
|
22
|
+
var _fetchActivationId = require("./fetchActivationId");
|
|
23
|
+
var _fetchDuplicateAgentMutation = require("./fetchDuplicateAgentMutation");
|
|
24
|
+
var _fetchHasVersionCapability = require("./fetchHasVersionCapability");
|
|
25
|
+
var _firstCharUpper = require("./firstCharUpper");
|
|
26
|
+
var _useAgentActions = require("./useAgentActions");
|
|
27
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
+
var createRovoParams = function createRovoParams(params) {
|
|
30
|
+
var rovoParams = {};
|
|
31
|
+
Object.entries(params).forEach(function (_ref) {
|
|
32
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
33
|
+
key = _ref2[0],
|
|
34
|
+
value = _ref2[1];
|
|
35
|
+
rovoParams["".concat(_useAgentActions.ROVO_PARAM_PREFIX).concat((0, _firstCharUpper.firstCharUpper)(key))] = encodeURIComponent(value);
|
|
36
|
+
});
|
|
37
|
+
return rovoParams;
|
|
38
|
+
};
|
|
39
|
+
var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
40
|
+
var cloudId = _ref3.cloudId,
|
|
41
|
+
email = _ref3.email,
|
|
42
|
+
source = _ref3.source;
|
|
43
|
+
var _useRovoPostMessageTo = (0, _postMessageToPubsub.useRovoPostMessageToPubsub)(),
|
|
44
|
+
publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
|
|
45
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
46
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
47
|
+
var onEditAgent = (0, _react.useCallback)(function (agentId) {
|
|
48
|
+
var url = (0, _getAtlassianStudioAgentEditUrl.getAtlassianStudioAgentEditUrl)(cloudId, agentId, email);
|
|
49
|
+
window.open(url, '_blank', 'noopener, noreferrer');
|
|
50
|
+
fireEvent('ui.button.clicked.editAgentButton', {
|
|
51
|
+
agentId: agentId,
|
|
52
|
+
source: source
|
|
53
|
+
});
|
|
54
|
+
}, [cloudId, email, fireEvent, source]);
|
|
55
|
+
var onCopyAgent = function onCopyAgent(agentId) {
|
|
56
|
+
var url = "".concat(window.location.origin, "/people/agent/").concat(agentId);
|
|
57
|
+
var urlWithParams = (0, _url.encodeParamsToUrl)(url, {
|
|
58
|
+
cloudId: cloudId
|
|
59
|
+
});
|
|
60
|
+
navigator.clipboard.writeText(urlWithParams);
|
|
61
|
+
fireEvent('ui.button.clicked.copyAgentLinkButton', {
|
|
62
|
+
agentId: agentId,
|
|
63
|
+
source: source
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
var onDuplicateAgent = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
67
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(agentId) {
|
|
68
|
+
var legacyDuplicateUrl, hasVersionCapability, activationId, agentAri, result;
|
|
69
|
+
return _regenerator.default.wrap(function (_context) {
|
|
70
|
+
while (1) switch (_context.prev = _context.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
fireEvent('ui.button.clicked.duplicateAgentButton', {
|
|
73
|
+
agentId: agentId,
|
|
74
|
+
source: source
|
|
75
|
+
});
|
|
76
|
+
legacyDuplicateUrl = (0, _getAtlassianStudioAgentDuplicateUrl.getAtlassianStudioAgentDuplicateUrl)(cloudId, agentId, email); // When versioning FG is off, use legacy duplicate flow
|
|
77
|
+
if ((0, _fg.fg)('rovo_agent_versioning_enabled')) {
|
|
78
|
+
_context.next = 1;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
window.open(legacyDuplicateUrl, '_blank', 'noopener, noreferrer');
|
|
82
|
+
return _context.abrupt("return");
|
|
83
|
+
case 1:
|
|
84
|
+
_context.next = 2;
|
|
85
|
+
return (0, _fetchHasVersionCapability.fetchHasVersionCapability)(cloudId);
|
|
86
|
+
case 2:
|
|
87
|
+
hasVersionCapability = _context.sent;
|
|
88
|
+
if (hasVersionCapability) {
|
|
89
|
+
_context.next = 3;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
93
|
+
window.location.assign(legacyDuplicateUrl);
|
|
94
|
+
return _context.abrupt("return");
|
|
95
|
+
case 3:
|
|
96
|
+
_context.next = 4;
|
|
97
|
+
return (0, _fetchActivationId.fetchActivationId)(cloudId);
|
|
98
|
+
case 4:
|
|
99
|
+
activationId = _context.sent;
|
|
100
|
+
if (activationId) {
|
|
101
|
+
_context.next = 5;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
105
|
+
window.location.assign(legacyDuplicateUrl);
|
|
106
|
+
return _context.abrupt("return");
|
|
107
|
+
case 5:
|
|
108
|
+
agentAri = "ari:cloud:rovo::agent/activation/".concat(activationId, "/").concat(agentId); // Call BE mutation to duplicate the agent
|
|
109
|
+
_context.next = 6;
|
|
110
|
+
return (0, _fetchDuplicateAgentMutation.fetchDuplicateAgentMutation)(agentAri);
|
|
111
|
+
case 6:
|
|
112
|
+
result = _context.sent;
|
|
113
|
+
if (result.success && result.newAgentAri) {
|
|
114
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
115
|
+
window.location.assign((0, _getStudioPath.getStudioPath)("/s/".concat(cloudId, "/agents/").concat(encodeURIComponent(result.newAgentAri), "/v/draft/details")));
|
|
116
|
+
} else {
|
|
117
|
+
// Fallback to legacy on error
|
|
118
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
119
|
+
window.location.assign(legacyDuplicateUrl);
|
|
120
|
+
}
|
|
121
|
+
case 7:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee);
|
|
126
|
+
}));
|
|
127
|
+
return function (_x) {
|
|
128
|
+
return _ref4.apply(this, arguments);
|
|
129
|
+
};
|
|
130
|
+
}(), [cloudId, email, fireEvent, source]);
|
|
131
|
+
var onConversationStarter = function onConversationStarter(_ref5) {
|
|
132
|
+
var agentId = _ref5.agentId,
|
|
133
|
+
prompt = _ref5.prompt;
|
|
134
|
+
var startConversationInNewTab = function startConversationInNewTab() {
|
|
135
|
+
var baseUrl = "".concat((0, _getAtlContextUrl.getATLContextUrl)('home'), "/chat");
|
|
136
|
+
var urlWithParams = (0, _url.encodeParamsToUrl)(baseUrl, _objectSpread({
|
|
137
|
+
cloudId: cloudId
|
|
138
|
+
}, createRovoParams({
|
|
139
|
+
cloudId: cloudId,
|
|
140
|
+
agentId: agentId,
|
|
141
|
+
prompt: prompt,
|
|
142
|
+
pathway: 'chat'
|
|
143
|
+
})));
|
|
144
|
+
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
145
|
+
};
|
|
146
|
+
publishWithPostMessage({
|
|
147
|
+
targetWindow: window,
|
|
148
|
+
payload: {
|
|
149
|
+
type: 'chat-new',
|
|
150
|
+
source: 'AgentProfileCard',
|
|
151
|
+
data: {
|
|
152
|
+
name: prompt.slice(0, 50),
|
|
153
|
+
prompt: prompt,
|
|
154
|
+
agentId: agentId,
|
|
155
|
+
dialogues: []
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
159
|
+
startConversationInNewTab();
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
var onOpenChat = function onOpenChat(agentId, agentName) {
|
|
164
|
+
var openChatInNewTab = function openChatInNewTab() {
|
|
165
|
+
var baseUrl = "".concat((0, _getAtlContextUrl.getATLContextUrl)('home'), "/chat");
|
|
166
|
+
var urlWithParams = (0, _url.encodeParamsToUrl)(baseUrl, _objectSpread({
|
|
167
|
+
cloudId: cloudId
|
|
168
|
+
}, createRovoParams({
|
|
169
|
+
cloudId: cloudId,
|
|
170
|
+
agentId: agentId,
|
|
171
|
+
pathway: 'chat'
|
|
172
|
+
})));
|
|
173
|
+
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
174
|
+
};
|
|
175
|
+
publishWithPostMessage({
|
|
176
|
+
targetWindow: window,
|
|
177
|
+
payload: {
|
|
178
|
+
type: 'chat-new',
|
|
179
|
+
source: 'AgentProfileCard',
|
|
180
|
+
data: {
|
|
181
|
+
agentId: agentId,
|
|
182
|
+
dialogues: [],
|
|
183
|
+
name: "Chat with ".concat(agentName)
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
187
|
+
openChatInNewTab();
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
var onViewFullProfile = function onViewFullProfile(agentId) {
|
|
192
|
+
var _navigateToTeamsApp = (0, _navigation.navigateToTeamsApp)({
|
|
193
|
+
type: 'AGENT',
|
|
194
|
+
payload: {
|
|
195
|
+
agentId: agentId
|
|
196
|
+
},
|
|
197
|
+
cloudId: cloudId,
|
|
198
|
+
shouldOpenInSameTab: false
|
|
199
|
+
}),
|
|
200
|
+
onNavigate = _navigateToTeamsApp.onNavigate;
|
|
201
|
+
if ((0, _fg.fg)('platform-adopt-teams-nav-config')) {
|
|
202
|
+
onNavigate();
|
|
203
|
+
} else {
|
|
204
|
+
window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
|
|
205
|
+
}
|
|
206
|
+
fireEvent('ui.button.clicked.viewAgentFullProfileButton', {
|
|
207
|
+
agentId: agentId,
|
|
208
|
+
source: source
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
onEditAgent: onEditAgent,
|
|
213
|
+
onCopyAgent: onCopyAgent,
|
|
214
|
+
onDuplicateAgent: onDuplicateAgent,
|
|
215
|
+
onOpenChat: onOpenChat,
|
|
216
|
+
onConversationStarter: onConversationStarter,
|
|
217
|
+
onViewFullProfile: onViewFullProfile
|
|
218
|
+
};
|
|
219
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAtlassianStudioAgentDuplicateUrl = void 0;
|
|
7
|
+
var _getStudioPath = require("./getStudioPath");
|
|
8
|
+
var getAtlassianStudioAgentDuplicateUrl = exports.getAtlassianStudioAgentDuplicateUrl = function getAtlassianStudioAgentDuplicateUrl(siteId, agentId, email) {
|
|
9
|
+
return (0, _getStudioPath.getStudioPath)("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/create')), email);
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAtlassianStudioAgentEditUrl = void 0;
|
|
7
|
+
var _getStudioPath = require("./getStudioPath");
|
|
8
|
+
var getAtlassianStudioAgentEditUrl = exports.getAtlassianStudioAgentEditUrl = function getAtlassianStudioAgentEditUrl(siteId, agentId, email) {
|
|
9
|
+
return (0, _getStudioPath.getStudioPath)("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/:agentId/overview')), email);
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getStudioHost = void 0;
|
|
7
|
+
var _index = require("./index");
|
|
8
|
+
var isStaging = function isStaging() {
|
|
9
|
+
var host = window.location.host;
|
|
10
|
+
return host.includes('localhost') || host.includes('.stg.atlassian') || host.includes('.stg-east.frontend.public.atl-paas.net') || host.includes('jira-dev.com');
|
|
11
|
+
};
|
|
12
|
+
var getStudioHost = exports.getStudioHost = function getStudioHost() {
|
|
13
|
+
return isStaging() ? _index.STUDIO_STAGING_URL : _index.STUDIO_PROD_URL;
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getStudioPath = void 0;
|
|
7
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
8
|
+
var _getStudioHost = require("./getStudioHost");
|
|
9
|
+
var getStudioSessionSyncUrl = function getStudioSessionSyncUrl(path, email) {
|
|
10
|
+
var url = new URL("".concat((0, _getStudioHost.getStudioHost)()).concat(path));
|
|
11
|
+
url.searchParams.set('login_hint', email);
|
|
12
|
+
return url.toString();
|
|
13
|
+
};
|
|
14
|
+
var getStudioPath = exports.getStudioPath = function getStudioPath(path, email) {
|
|
15
|
+
if (email && (0, _fg.fg)('manual-studio-entry-link')) {
|
|
16
|
+
return getStudioSessionSyncUrl(path, email);
|
|
17
|
+
}
|
|
18
|
+
return "".concat((0, _getStudioHost.getStudioHost)()).concat(path);
|
|
19
|
+
};
|
|
@@ -3,31 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var STUDIO_STAGING_URL = 'https://atlassian-studio.stg-east.frontend.public.atl-paas.net';
|
|
10
|
-
var isStaging = function isStaging() {
|
|
11
|
-
var host = window.location.host;
|
|
12
|
-
return host.includes('localhost') || host.includes('.stg.atlassian') || host.includes('.stg-east.frontend.public.atl-paas.net') || host.includes('jira-dev.com');
|
|
13
|
-
};
|
|
14
|
-
var getStudioHost = exports.getStudioHost = function getStudioHost() {
|
|
15
|
-
return isStaging() ? STUDIO_STAGING_URL : STUDIO_PROD_URL;
|
|
16
|
-
};
|
|
17
|
-
var getStudioSessionSyncUrl = function getStudioSessionSyncUrl(path, email) {
|
|
18
|
-
var url = new URL("".concat(getStudioHost()).concat(path));
|
|
19
|
-
url.searchParams.set('login_hint', email);
|
|
20
|
-
return url.toString();
|
|
21
|
-
};
|
|
22
|
-
var getStudioPath = exports.getStudioPath = function getStudioPath(path, email) {
|
|
23
|
-
if (email && (0, _fg.fg)('manual-studio-entry-link')) {
|
|
24
|
-
return getStudioSessionSyncUrl(path, email);
|
|
25
|
-
}
|
|
26
|
-
return "".concat(getStudioHost()).concat(path);
|
|
27
|
-
};
|
|
28
|
-
var getAtlassianStudioAgentEditUrl = exports.getAtlassianStudioAgentEditUrl = function getAtlassianStudioAgentEditUrl(siteId, agentId, email) {
|
|
29
|
-
return getStudioPath("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/:agentId/overview')), email);
|
|
30
|
-
};
|
|
31
|
-
var getAtlassianStudioAgentDuplicateUrl = exports.getAtlassianStudioAgentDuplicateUrl = function getAtlassianStudioAgentDuplicateUrl(siteId, agentId, email) {
|
|
32
|
-
return getStudioPath("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/create')), email);
|
|
33
|
-
};
|
|
6
|
+
exports.STUDIO_STAGING_URL = exports.STUDIO_PROD_URL = void 0;
|
|
7
|
+
var STUDIO_PROD_URL = exports.STUDIO_PROD_URL = 'https://studio.atlassian.com';
|
|
8
|
+
var STUDIO_STAGING_URL = exports.STUDIO_STAGING_URL = 'https://atlassian-studio.stg-east.frontend.public.atl-paas.net';
|
|
@@ -34,7 +34,7 @@ var _TeamTrigger = require("../../styled/TeamTrigger");
|
|
|
34
34
|
var _analytics = require("../../util/analytics");
|
|
35
35
|
var _click = require("../../util/click");
|
|
36
36
|
var _performance = require("../../util/performance");
|
|
37
|
-
var
|
|
37
|
+
var _ErrorIllustration = require("../Error/ErrorIllustration");
|
|
38
38
|
var _TeamForbiddenErrorState = _interopRequireDefault(require("./TeamForbiddenErrorState"));
|
|
39
39
|
var _TeamLoadingState = _interopRequireDefault(require("./TeamLoadingState"));
|
|
40
40
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -334,7 +334,7 @@ var ErrorMessage = function ErrorMessage(_ref6) {
|
|
|
334
334
|
}, [analytics, clientFetchProfile]);
|
|
335
335
|
return /*#__PURE__*/_react.default.createElement(_Error.ErrorWrapper, {
|
|
336
336
|
testId: "team-profilecard-error"
|
|
337
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
337
|
+
}, /*#__PURE__*/_react.default.createElement(_ErrorIllustration.ErrorIllustration, null), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
338
338
|
as: "p",
|
|
339
339
|
weight: "semibold"
|
|
340
340
|
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.default.teamErrorTitle)), /*#__PURE__*/_react.default.createElement(_Error.TeamErrorText, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.default.teamErrorText)), clientFetchProfile && /*#__PURE__*/_react.default.createElement(_TeamCard.ActionButtons, null, /*#__PURE__*/_react.default.createElement(_TeamCard.WrappedButton, null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
@@ -19,5 +19,10 @@ Object.defineProperty(exports, "DELAY_MS_SHOW", {
|
|
|
19
19
|
exports.default = void 0;
|
|
20
20
|
var _config = require("../../util/config");
|
|
21
21
|
var _TeamProfileCardTrigger = _interopRequireDefault(require("./TeamProfileCardTrigger"));
|
|
22
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
22
23
|
// Do not export TeamProfileCard here as it will break lazy-loading for the team trigger.
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '@atlaskit/profilecard/config'` instead.
|
|
26
|
+
*/
|
|
27
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-re-exports
|
|
23
28
|
var _default = exports.default = _TeamProfileCardTrigger.default;
|