@atlaskit/profilecard 26.19.9 → 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 +66 -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
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { HttpError } from '../util/errors';
|
|
4
|
-
import { handleAGGErrors, handleDirectoryGraphQLErrors } from './errorUtils';
|
|
5
|
-
var buildHeaders = function buildHeaders() {
|
|
6
|
-
var headers = new Headers();
|
|
7
|
-
headers.append('Content-Type', 'application/json');
|
|
8
|
-
return headers;
|
|
9
|
-
};
|
|
10
|
-
var id = function id(headers) {
|
|
11
|
-
return headers;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {string} serviceUrl - GraphQL service endpoint
|
|
16
|
-
* @param {Query} query - GraphQL query
|
|
17
|
-
* @param {HeaderProcessor} processHeaders - a function to add extra headers to the request
|
|
18
|
-
*/
|
|
19
|
-
export function directoryGraphqlQuery(_x, _x2) {
|
|
20
|
-
return _directoryGraphqlQuery.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {string} serviceUrl - GraphQL service endpoint
|
|
25
|
-
* @param {Query} query - GraphQL query
|
|
26
|
-
* @param {HeaderProcessor} processHeaders - a function to add extra headers to the request
|
|
27
|
-
*/
|
|
28
|
-
function _directoryGraphqlQuery() {
|
|
29
|
-
_directoryGraphqlQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(serviceUrl, query) {
|
|
30
|
-
var processHeaders,
|
|
31
|
-
_args = arguments;
|
|
32
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
33
|
-
while (1) switch (_context.prev = _context.next) {
|
|
34
|
-
case 0:
|
|
35
|
-
processHeaders = _args.length > 2 && _args[2] !== undefined ? _args[2] : id;
|
|
36
|
-
return _context.abrupt("return", graphQLQuery(serviceUrl, query, processHeaders, handleDirectoryGraphQLErrors));
|
|
37
|
-
case 1:
|
|
38
|
-
case "end":
|
|
39
|
-
return _context.stop();
|
|
40
|
-
}
|
|
41
|
-
}, _callee);
|
|
42
|
-
}));
|
|
43
|
-
return _directoryGraphqlQuery.apply(this, arguments);
|
|
44
|
-
}
|
|
45
|
-
export function AGGQuery(_x3, _x4) {
|
|
46
|
-
return _AGGQuery.apply(this, arguments);
|
|
47
|
-
}
|
|
48
|
-
function _AGGQuery() {
|
|
49
|
-
_AGGQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(serviceUrl, query) {
|
|
50
|
-
var processHeaders,
|
|
51
|
-
_args2 = arguments;
|
|
52
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
53
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
54
|
-
case 0:
|
|
55
|
-
processHeaders = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : id;
|
|
56
|
-
return _context2.abrupt("return", graphQLQuery(serviceUrl, query, processHeaders, handleAGGErrors));
|
|
57
|
-
case 1:
|
|
58
|
-
case "end":
|
|
59
|
-
return _context2.stop();
|
|
60
|
-
}
|
|
61
|
-
}, _callee2);
|
|
62
|
-
}));
|
|
63
|
-
return _AGGQuery.apply(this, arguments);
|
|
64
|
-
}
|
|
65
|
-
function graphQLQuery(_x5, _x6) {
|
|
66
|
-
return _graphQLQuery.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
function _graphQLQuery() {
|
|
69
|
-
_graphQLQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(serviceUrl, query) {
|
|
70
|
-
var _response$headers;
|
|
71
|
-
var processHeaders,
|
|
72
|
-
handleErrors,
|
|
73
|
-
headers,
|
|
74
|
-
response,
|
|
75
|
-
traceIdFromHeaders,
|
|
76
|
-
json,
|
|
77
|
-
_json$extensions$gate,
|
|
78
|
-
_json$extensions,
|
|
79
|
-
_args3 = arguments;
|
|
80
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
81
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
82
|
-
case 0:
|
|
83
|
-
processHeaders = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : id;
|
|
84
|
-
handleErrors = _args3.length > 3 ? _args3[3] : undefined;
|
|
85
|
-
headers = processHeaders(buildHeaders());
|
|
86
|
-
_context3.next = 1;
|
|
87
|
-
return fetch(new Request(serviceUrl, {
|
|
88
|
-
method: 'POST',
|
|
89
|
-
credentials: 'include',
|
|
90
|
-
mode: 'cors',
|
|
91
|
-
headers: headers,
|
|
92
|
-
body: JSON.stringify(query)
|
|
93
|
-
}));
|
|
94
|
-
case 1:
|
|
95
|
-
response = _context3.sent;
|
|
96
|
-
traceIdFromHeaders = response === null || response === void 0 || (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('atl-traceid');
|
|
97
|
-
if (response.ok) {
|
|
98
|
-
_context3.next = 2;
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
throw new HttpError(response.status, response.statusText, traceIdFromHeaders);
|
|
102
|
-
case 2:
|
|
103
|
-
_context3.next = 3;
|
|
104
|
-
return response.json();
|
|
105
|
-
case 3:
|
|
106
|
-
json = _context3.sent;
|
|
107
|
-
if (json.errors) {
|
|
108
|
-
handleErrors(json.errors, (_json$extensions$gate = (_json$extensions = json.extensions) === null || _json$extensions === void 0 || (_json$extensions = _json$extensions.gateway) === null || _json$extensions === void 0 ? void 0 : _json$extensions.request_id) !== null && _json$extensions$gate !== void 0 ? _json$extensions$gate : traceIdFromHeaders);
|
|
109
|
-
}
|
|
110
|
-
return _context3.abrupt("return", json.data);
|
|
111
|
-
case 4:
|
|
112
|
-
case "end":
|
|
113
|
-
return _context3.stop();
|
|
114
|
-
}
|
|
115
|
-
}, _callee3);
|
|
116
|
-
}));
|
|
117
|
-
return _graphQLQuery.apply(this, arguments);
|
|
118
|
-
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
// for typing `process`
|
|
3
|
+
|
|
4
|
+
import { ARI_PREFIX } from './ariPrefix';
|
|
5
|
+
import { idToAri } from './idToAri';
|
|
6
|
+
export var idToAriSafe = function idToAriSafe(teamIdOrTeamAri) {
|
|
7
|
+
return teamIdOrTeamAri.startsWith(ARI_PREFIX) ? teamIdOrTeamAri : idToAri(teamIdOrTeamAri);
|
|
8
|
+
};
|
package/dist/esm/client/index.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
1
2
|
import CachingClient from './CachingClient';
|
|
2
3
|
import ProfileCardClient from './ProfileCardClient';
|
|
3
4
|
import TeamProfileClient from './TeamProfileCardClient';
|
|
4
|
-
import UserProfileClient
|
|
5
|
-
|
|
5
|
+
import UserProfileClient from './UserProfileCardClient';
|
|
6
|
+
import { modifyResponse } from './modifyResponse';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import CachingClient from '@atlaskit/profilecard/caching-client'` instead.
|
|
10
|
+
*/
|
|
11
|
+
export { CachingClient };
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `import { modifyResponse } from '@atlaskit/profilecard/modify-response'` instead.
|
|
14
|
+
*/
|
|
15
|
+
export { modifyResponse };
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use `import TeamProfileClient from '@atlaskit/profilecard/team-profile-card-client'` instead.
|
|
18
|
+
*/
|
|
19
|
+
export { TeamProfileClient };
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `import UserProfileClient from '@atlaskit/profilecard/user-profile-card-client'` instead.
|
|
22
|
+
*/
|
|
23
|
+
export { UserProfileClient };
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-re-exports
|
|
6
26
|
export default ProfileCardClient;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
|
+
import { isFedRamp } from '@atlaskit/atlassian-context/is-fedramp';
|
|
5
|
+
import { default as TeamCentralCardClient } from './TeamCentralCardClient';
|
|
6
|
+
export function maybeCreateTeamCentralClient(config, clients) {
|
|
7
|
+
if (isFedRamp()) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (clients !== null && clients !== void 0 && clients.teamCentralClient) {
|
|
11
|
+
return clients.teamCentralClient;
|
|
12
|
+
}
|
|
13
|
+
var teamCentralEnabled = config.teamCentralDisabled !== true;
|
|
14
|
+
return teamCentralEnabled ? new TeamCentralCardClient(_objectSpread({}, config)) : undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
|
+
/**
|
|
5
|
+
* Transform response from GraphQL
|
|
6
|
+
* - Prefix `timestring` with `remoteWeekdayString` depending on `remoteWeekdayIndex`
|
|
7
|
+
* - Remove properties which will be not used later
|
|
8
|
+
* @ignore
|
|
9
|
+
* @param {object} response
|
|
10
|
+
* @return {object}
|
|
11
|
+
*/
|
|
12
|
+
export var modifyResponse = function modifyResponse(response) {
|
|
13
|
+
var data = _objectSpread({}, response.User);
|
|
14
|
+
var localWeekdayIndex = new Date().getDay().toString();
|
|
15
|
+
if (data.remoteWeekdayIndex && data.remoteWeekdayIndex !== localWeekdayIndex) {
|
|
16
|
+
data.remoteTimeString = "".concat(data.remoteWeekdayString, " ").concat(data.remoteTimeString);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
isBot: data.isBot,
|
|
20
|
+
isCurrentUser: data.isCurrentUser,
|
|
21
|
+
status: data.status,
|
|
22
|
+
statusModifiedDate: data.statusModifiedDate || undefined,
|
|
23
|
+
avatarUrl: data.avatarUrl || undefined,
|
|
24
|
+
email: data.email || undefined,
|
|
25
|
+
fullName: data.fullName || undefined,
|
|
26
|
+
location: data.location || undefined,
|
|
27
|
+
meta: data.meta || undefined,
|
|
28
|
+
nickname: data.nickname || undefined,
|
|
29
|
+
companyName: data.companyName || undefined,
|
|
30
|
+
timestring: data.remoteTimeString || undefined,
|
|
31
|
+
accountType: data.accountType || undefined
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -23,12 +23,12 @@ import { TeamsLink } from '@atlaskit/teams-app-internal-navigation/teams-link';
|
|
|
23
23
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
24
24
|
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
25
25
|
import { getPageTime } from '../../util/performance';
|
|
26
|
+
import { default as ErrorMessage } from '../Error/ErrorMessage';
|
|
26
27
|
import { LoadingState } from '../common/LoadingState';
|
|
27
|
-
import { ErrorMessage } from '../Error';
|
|
28
28
|
import { AgentActions } from './Actions';
|
|
29
29
|
import { AgentProfileCardWrapper } from './AgentProfileCardWrapper';
|
|
30
30
|
import { ConversationStarters } from './ConversationStarters';
|
|
31
|
-
import { useAgentUrlActions } from './hooks/
|
|
31
|
+
import { useAgentUrlActions } from './hooks/useAgentUrlActions';
|
|
32
32
|
import { messages } from './messages';
|
|
33
33
|
var styles = {
|
|
34
34
|
detailWrapper: "_1q511ejb",
|
|
@@ -10,7 +10,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
|
10
10
|
import { getAgentCreator } from '@atlaskit/rovo-agent-components/ui/AgentProfileInfo';
|
|
11
11
|
import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
|
|
12
12
|
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
13
|
-
import { AgentForbiddenError } from '../../client/
|
|
13
|
+
import { AgentForbiddenError } from '../../client/AgentForbiddenError';
|
|
14
14
|
import { getAAIDFromARI } from '../../util/rovoAgentUtils';
|
|
15
15
|
import ErrorMessage from '../Error/ErrorMessage';
|
|
16
16
|
import { AgentProfileCardWrapper } from './AgentProfileCardWrapper';
|
|
@@ -1,167 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
var GRAPHQL_ENDPOINT = '/gateway/api/graphql';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Fetches version capability for a site via raw GraphQL fetch.
|
|
7
|
-
* Returns true only if versioning migration has completed.
|
|
8
|
-
*
|
|
9
|
-
* TODO remove after versioning rollout complete
|
|
10
|
-
* See: https://product-fabric.atlassian.net/browse/RAGE-2822
|
|
11
|
-
*/
|
|
12
|
-
export var fetchHasVersionCapability = /*#__PURE__*/function () {
|
|
13
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(cloudId) {
|
|
14
|
-
var _json$data, response, json, result, _t;
|
|
15
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
16
|
-
while (1) switch (_context.prev = _context.next) {
|
|
17
|
-
case 0:
|
|
18
|
-
_context.prev = 0;
|
|
19
|
-
_context.next = 1;
|
|
20
|
-
return fetch(GRAPHQL_ENDPOINT, {
|
|
21
|
-
method: 'POST',
|
|
22
|
-
credentials: 'include',
|
|
23
|
-
headers: {
|
|
24
|
-
'Content-Type': 'application/json'
|
|
25
|
-
},
|
|
26
|
-
body: JSON.stringify({
|
|
27
|
-
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}",
|
|
28
|
-
variables: {
|
|
29
|
-
cloudId: cloudId
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
case 1:
|
|
34
|
-
response = _context.sent;
|
|
35
|
-
_context.next = 2;
|
|
36
|
-
return response.json();
|
|
37
|
-
case 2:
|
|
38
|
-
json = _context.sent;
|
|
39
|
-
result = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data.agentStudio_hasVersionCapability;
|
|
40
|
-
return _context.abrupt("return", (result === null || result === void 0 ? void 0 : result.__typename) === 'AgentStudioHasVersionCapability' ? Boolean(result.hasVersionCapability) : false);
|
|
41
|
-
case 3:
|
|
42
|
-
_context.prev = 3;
|
|
43
|
-
_t = _context["catch"](0);
|
|
44
|
-
return _context.abrupt("return", false);
|
|
45
|
-
case 4:
|
|
46
|
-
case "end":
|
|
47
|
-
return _context.stop();
|
|
48
|
-
}
|
|
49
|
-
}, _callee, null, [[0, 3]]);
|
|
50
|
-
}));
|
|
51
|
-
return function fetchHasVersionCapability(_x) {
|
|
52
|
-
return _ref.apply(this, arguments);
|
|
53
|
-
};
|
|
54
|
-
}();
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Fetches the Rovo activation ID for a given cloud ID.
|
|
58
|
-
* Used to construct the agent ARI when not available.
|
|
59
|
-
*/
|
|
60
|
-
export var fetchActivationId = /*#__PURE__*/function () {
|
|
61
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(cloudId) {
|
|
62
|
-
var _json$data$tenantCont, _json$data2, response, json, _t2;
|
|
63
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
64
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
65
|
-
case 0:
|
|
66
|
-
_context2.prev = 0;
|
|
67
|
-
_context2.next = 1;
|
|
68
|
-
return fetch(GRAPHQL_ENDPOINT, {
|
|
69
|
-
method: 'POST',
|
|
70
|
-
credentials: 'include',
|
|
71
|
-
headers: {
|
|
72
|
-
'Content-Type': 'application/json'
|
|
73
|
-
},
|
|
74
|
-
body: JSON.stringify({
|
|
75
|
-
query: "query profilecardActivationQuery($cloudId: ID!, $product: String!) {\n\t\t\t\t\ttenantContexts(cloudIds: [$cloudId]) {\n\t\t\t\t\t\tactivationIdByProduct(product: $product) {\n\t\t\t\t\t\t\tactive\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
|
|
76
|
-
variables: {
|
|
77
|
-
cloudId: cloudId,
|
|
78
|
-
product: 'rovo'
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
});
|
|
82
|
-
case 1:
|
|
83
|
-
response = _context2.sent;
|
|
84
|
-
_context2.next = 2;
|
|
85
|
-
return response.json();
|
|
86
|
-
case 2:
|
|
87
|
-
json = _context2.sent;
|
|
88
|
-
return _context2.abrupt("return", (_json$data$tenantCont = json === null || json === void 0 || (_json$data2 = json.data) === null || _json$data2 === void 0 || (_json$data2 = _json$data2.tenantContexts) === null || _json$data2 === void 0 || (_json$data2 = _json$data2[0]) === null || _json$data2 === void 0 || (_json$data2 = _json$data2.activationIdByProduct) === null || _json$data2 === void 0 ? void 0 : _json$data2.active) !== null && _json$data$tenantCont !== void 0 ? _json$data$tenantCont : null);
|
|
89
|
-
case 3:
|
|
90
|
-
_context2.prev = 3;
|
|
91
|
-
_t2 = _context2["catch"](0);
|
|
92
|
-
return _context2.abrupt("return", null);
|
|
93
|
-
case 4:
|
|
94
|
-
case "end":
|
|
95
|
-
return _context2.stop();
|
|
96
|
-
}
|
|
97
|
-
}, _callee2, null, [[0, 3]]);
|
|
98
|
-
}));
|
|
99
|
-
return function fetchActivationId(_x2) {
|
|
100
|
-
return _ref2.apply(this, arguments);
|
|
101
|
-
};
|
|
102
|
-
}();
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Calls the agentStudio_duplicateAgent mutation via raw GraphQL fetch.
|
|
106
|
-
*
|
|
107
|
-
* TODO: Add SLO tracking and Sentry error reporting.
|
|
108
|
-
* See: https://product-fabric.atlassian.net/browse/RAGE-2822
|
|
109
|
-
*/
|
|
110
|
-
export var fetchDuplicateAgentMutation = /*#__PURE__*/function () {
|
|
111
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(agentAri) {
|
|
112
|
-
var _json$data3, _result$agent, _result$errors$0$mess, _result$errors, response, json, result, _t3;
|
|
113
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
114
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
115
|
-
case 0:
|
|
116
|
-
_context3.prev = 0;
|
|
117
|
-
_context3.next = 1;
|
|
118
|
-
return fetch(GRAPHQL_ENDPOINT, {
|
|
119
|
-
method: 'POST',
|
|
120
|
-
credentials: 'include',
|
|
121
|
-
headers: {
|
|
122
|
-
'Content-Type': 'application/json'
|
|
123
|
-
},
|
|
124
|
-
body: JSON.stringify({
|
|
125
|
-
query: "mutation profilecardDuplicateAgentMutation($agentId: ID!) {\n\t\t\t\t\tagentStudio_duplicateAgent(id: $agentId) @optIn(to: \"AgentStudio\") {\n\t\t\t\t\t\tagent { id }\n\t\t\t\t\t\tsuccess\n\t\t\t\t\t\terrors { message }\n\t\t\t\t\t}\n\t\t\t\t}",
|
|
126
|
-
variables: {
|
|
127
|
-
agentId: agentAri
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
});
|
|
131
|
-
case 1:
|
|
132
|
-
response = _context3.sent;
|
|
133
|
-
_context3.next = 2;
|
|
134
|
-
return response.json();
|
|
135
|
-
case 2:
|
|
136
|
-
json = _context3.sent;
|
|
137
|
-
result = json === null || json === void 0 || (_json$data3 = json.data) === null || _json$data3 === void 0 ? void 0 : _json$data3.agentStudio_duplicateAgent;
|
|
138
|
-
if (!(result !== null && result !== void 0 && result.success && result !== null && result !== void 0 && (_result$agent = result.agent) !== null && _result$agent !== void 0 && _result$agent.id)) {
|
|
139
|
-
_context3.next = 3;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
return _context3.abrupt("return", {
|
|
143
|
-
success: true,
|
|
144
|
-
newAgentAri: result.agent.id
|
|
145
|
-
});
|
|
146
|
-
case 3:
|
|
147
|
-
return _context3.abrupt("return", {
|
|
148
|
-
success: false,
|
|
149
|
-
errorMessage: (_result$errors$0$mess = result === null || result === void 0 || (_result$errors = result.errors) === null || _result$errors === void 0 || (_result$errors = _result$errors[0]) === null || _result$errors === void 0 ? void 0 : _result$errors.message) !== null && _result$errors$0$mess !== void 0 ? _result$errors$0$mess : 'Duplicate agent mutation failed'
|
|
150
|
-
});
|
|
151
|
-
case 4:
|
|
152
|
-
_context3.prev = 4;
|
|
153
|
-
_t3 = _context3["catch"](0);
|
|
154
|
-
return _context3.abrupt("return", {
|
|
155
|
-
success: false,
|
|
156
|
-
errorMessage: _t3 instanceof Error ? _t3.message : 'Network error during duplication'
|
|
157
|
-
});
|
|
158
|
-
case 5:
|
|
159
|
-
case "end":
|
|
160
|
-
return _context3.stop();
|
|
161
|
-
}
|
|
162
|
-
}, _callee3, null, [[0, 4]]);
|
|
163
|
-
}));
|
|
164
|
-
return function fetchDuplicateAgentMutation(_x3) {
|
|
165
|
-
return _ref3.apply(this, arguments);
|
|
166
|
-
};
|
|
167
|
-
}();
|
|
1
|
+
export var GRAPHQL_ENDPOINT = '/gateway/api/graphql';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { GRAPHQL_ENDPOINT } from './duplicateFetch';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Fetches the Rovo activation ID for a given cloud ID.
|
|
7
|
+
* Used to construct the agent ARI when not available.
|
|
8
|
+
*/
|
|
9
|
+
export var fetchActivationId = /*#__PURE__*/function () {
|
|
10
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(cloudId) {
|
|
11
|
+
var _json$data$tenantCont, _json$data, response, json, _t;
|
|
12
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
13
|
+
while (1) switch (_context.prev = _context.next) {
|
|
14
|
+
case 0:
|
|
15
|
+
_context.prev = 0;
|
|
16
|
+
_context.next = 1;
|
|
17
|
+
return fetch(GRAPHQL_ENDPOINT, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
credentials: 'include',
|
|
20
|
+
headers: {
|
|
21
|
+
'Content-Type': 'application/json'
|
|
22
|
+
},
|
|
23
|
+
body: JSON.stringify({
|
|
24
|
+
query: "query profilecardActivationQuery($cloudId: ID!, $product: String!) {\n\t\t\t\t\ttenantContexts(cloudIds: [$cloudId]) {\n\t\t\t\t\t\tactivationIdByProduct(product: $product) {\n\t\t\t\t\t\t\tactive\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
|
|
25
|
+
variables: {
|
|
26
|
+
cloudId: cloudId,
|
|
27
|
+
product: 'rovo'
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
case 1:
|
|
32
|
+
response = _context.sent;
|
|
33
|
+
_context.next = 2;
|
|
34
|
+
return response.json();
|
|
35
|
+
case 2:
|
|
36
|
+
json = _context.sent;
|
|
37
|
+
return _context.abrupt("return", (_json$data$tenantCont = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 || (_json$data = _json$data.tenantContexts) === null || _json$data === void 0 || (_json$data = _json$data[0]) === null || _json$data === void 0 || (_json$data = _json$data.activationIdByProduct) === null || _json$data === void 0 ? void 0 : _json$data.active) !== null && _json$data$tenantCont !== void 0 ? _json$data$tenantCont : null);
|
|
38
|
+
case 3:
|
|
39
|
+
_context.prev = 3;
|
|
40
|
+
_t = _context["catch"](0);
|
|
41
|
+
return _context.abrupt("return", null);
|
|
42
|
+
case 4:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee, null, [[0, 3]]);
|
|
47
|
+
}));
|
|
48
|
+
return function fetchActivationId(_x) {
|
|
49
|
+
return _ref.apply(this, arguments);
|
|
50
|
+
};
|
|
51
|
+
}();
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { GRAPHQL_ENDPOINT } from './duplicateFetch';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Calls the agentStudio_duplicateAgent mutation via raw GraphQL fetch.
|
|
7
|
+
*
|
|
8
|
+
* TODO: Add SLO tracking and Sentry error reporting.
|
|
9
|
+
* See: https://product-fabric.atlassian.net/browse/RAGE-2822
|
|
10
|
+
*/
|
|
11
|
+
export var fetchDuplicateAgentMutation = /*#__PURE__*/function () {
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(agentAri) {
|
|
13
|
+
var _json$data, _result$agent, _result$errors$0$mess, _result$errors, response, json, result, _t;
|
|
14
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16
|
+
case 0:
|
|
17
|
+
_context.prev = 0;
|
|
18
|
+
_context.next = 1;
|
|
19
|
+
return fetch(GRAPHQL_ENDPOINT, {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
credentials: 'include',
|
|
22
|
+
headers: {
|
|
23
|
+
'Content-Type': 'application/json'
|
|
24
|
+
},
|
|
25
|
+
body: JSON.stringify({
|
|
26
|
+
query: "mutation profilecardDuplicateAgentMutation($agentId: ID!) {\n\t\t\t\t\tagentStudio_duplicateAgent(id: $agentId) @optIn(to: \"AgentStudio\") {\n\t\t\t\t\t\tagent { id }\n\t\t\t\t\t\tsuccess\n\t\t\t\t\t\terrors { message }\n\t\t\t\t\t}\n\t\t\t\t}",
|
|
27
|
+
variables: {
|
|
28
|
+
agentId: agentAri
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
case 1:
|
|
33
|
+
response = _context.sent;
|
|
34
|
+
_context.next = 2;
|
|
35
|
+
return response.json();
|
|
36
|
+
case 2:
|
|
37
|
+
json = _context.sent;
|
|
38
|
+
result = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data.agentStudio_duplicateAgent;
|
|
39
|
+
if (!(result !== null && result !== void 0 && result.success && result !== null && result !== void 0 && (_result$agent = result.agent) !== null && _result$agent !== void 0 && _result$agent.id)) {
|
|
40
|
+
_context.next = 3;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return _context.abrupt("return", {
|
|
44
|
+
success: true,
|
|
45
|
+
newAgentAri: result.agent.id
|
|
46
|
+
});
|
|
47
|
+
case 3:
|
|
48
|
+
return _context.abrupt("return", {
|
|
49
|
+
success: false,
|
|
50
|
+
errorMessage: (_result$errors$0$mess = result === null || result === void 0 || (_result$errors = result.errors) === null || _result$errors === void 0 || (_result$errors = _result$errors[0]) === null || _result$errors === void 0 ? void 0 : _result$errors.message) !== null && _result$errors$0$mess !== void 0 ? _result$errors$0$mess : 'Duplicate agent mutation failed'
|
|
51
|
+
});
|
|
52
|
+
case 4:
|
|
53
|
+
_context.prev = 4;
|
|
54
|
+
_t = _context["catch"](0);
|
|
55
|
+
return _context.abrupt("return", {
|
|
56
|
+
success: false,
|
|
57
|
+
errorMessage: _t instanceof Error ? _t.message : 'Network error during duplication'
|
|
58
|
+
});
|
|
59
|
+
case 5:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context.stop();
|
|
62
|
+
}
|
|
63
|
+
}, _callee, null, [[0, 4]]);
|
|
64
|
+
}));
|
|
65
|
+
return function fetchDuplicateAgentMutation(_x) {
|
|
66
|
+
return _ref.apply(this, arguments);
|
|
67
|
+
};
|
|
68
|
+
}();
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { GRAPHQL_ENDPOINT } from './duplicateFetch';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Fetches version capability for a site via raw GraphQL fetch.
|
|
7
|
+
* Returns true only if versioning migration has completed.
|
|
8
|
+
*
|
|
9
|
+
* TODO remove after versioning rollout complete
|
|
10
|
+
* See: https://product-fabric.atlassian.net/browse/RAGE-2822
|
|
11
|
+
*/
|
|
12
|
+
export var fetchHasVersionCapability = /*#__PURE__*/function () {
|
|
13
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(cloudId) {
|
|
14
|
+
var _json$data, response, json, result, _t;
|
|
15
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
_context.prev = 0;
|
|
19
|
+
_context.next = 1;
|
|
20
|
+
return fetch(GRAPHQL_ENDPOINT, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
credentials: 'include',
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': 'application/json'
|
|
25
|
+
},
|
|
26
|
+
body: JSON.stringify({
|
|
27
|
+
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}",
|
|
28
|
+
variables: {
|
|
29
|
+
cloudId: cloudId
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
case 1:
|
|
34
|
+
response = _context.sent;
|
|
35
|
+
_context.next = 2;
|
|
36
|
+
return response.json();
|
|
37
|
+
case 2:
|
|
38
|
+
json = _context.sent;
|
|
39
|
+
result = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data.agentStudio_hasVersionCapability;
|
|
40
|
+
return _context.abrupt("return", (result === null || result === void 0 ? void 0 : result.__typename) === 'AgentStudioHasVersionCapability' ? Boolean(result.hasVersionCapability) : false);
|
|
41
|
+
case 3:
|
|
42
|
+
_context.prev = 3;
|
|
43
|
+
_t = _context["catch"](0);
|
|
44
|
+
return _context.abrupt("return", false);
|
|
45
|
+
case 4:
|
|
46
|
+
case "end":
|
|
47
|
+
return _context.stop();
|
|
48
|
+
}
|
|
49
|
+
}, _callee, null, [[0, 3]]);
|
|
50
|
+
}));
|
|
51
|
+
return function fetchHasVersionCapability(_x) {
|
|
52
|
+
return _ref.apply(this, arguments);
|
|
53
|
+
};
|
|
54
|
+
}();
|