@backstage-community/plugin-azure-devops 0.4.4 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/alpha/package.json +2 -2
  3. package/dist/alpha/plugin.esm.js +69 -0
  4. package/dist/alpha/plugin.esm.js.map +1 -0
  5. package/dist/alpha.esm.js +1 -68
  6. package/dist/alpha.esm.js.map +1 -1
  7. package/dist/api/AzureDevOpsApi.esm.js +8 -0
  8. package/dist/api/AzureDevOpsApi.esm.js.map +1 -0
  9. package/dist/{esm/AzureDevOpsApi-GBxs-uQ7.esm.js → api/AzureDevOpsClient.esm.js} +11 -36
  10. package/dist/api/AzureDevOpsClient.esm.js.map +1 -0
  11. package/dist/components/AzureGitTagsIcon/AzureGitTagsIcon.esm.js +7 -0
  12. package/dist/components/AzureGitTagsIcon/AzureGitTagsIcon.esm.js.map +1 -0
  13. package/dist/components/AzurePipelinesIcon/AzurePipelinesIcon.esm.js +27 -0
  14. package/dist/components/AzurePipelinesIcon/AzurePipelinesIcon.esm.js.map +1 -0
  15. package/dist/{esm/AzurePullRequestsIcon-DOAkj-X3.esm.js → components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js} +2 -2
  16. package/dist/components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js.map +1 -0
  17. package/dist/{esm/index-Bwu2-Sgs.esm.js → components/BuildTable/BuildTable.esm.js} +7 -107
  18. package/dist/components/BuildTable/BuildTable.esm.js.map +1 -0
  19. package/dist/components/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js +22 -0
  20. package/dist/components/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js.map +1 -0
  21. package/dist/components/EntityPageAzureGitTags/index.esm.js +2 -0
  22. package/dist/components/EntityPageAzureGitTags/index.esm.js.map +1 -0
  23. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js +32 -0
  24. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js.map +1 -0
  25. package/dist/components/EntityPageAzurePipelines/index.esm.js +2 -0
  26. package/dist/components/EntityPageAzurePipelines/index.esm.js.map +1 -0
  27. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js +22 -0
  28. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js.map +1 -0
  29. package/dist/components/EntityPageAzurePullRequests/index.esm.js +2 -0
  30. package/dist/components/EntityPageAzurePullRequests/index.esm.js.map +1 -0
  31. package/dist/components/GitTagTable/GitTagTable.esm.js +53 -0
  32. package/dist/components/GitTagTable/GitTagTable.esm.js.map +1 -0
  33. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js +41 -0
  34. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js.map +1 -0
  35. package/dist/components/PullRequestTable/PullRequestTable.esm.js +90 -0
  36. package/dist/components/PullRequestTable/PullRequestTable.esm.js.map +1 -0
  37. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js +79 -0
  38. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js.map +1 -0
  39. package/dist/components/PullRequestsPage/index.esm.js +6 -0
  40. package/dist/components/PullRequestsPage/index.esm.js.map +1 -0
  41. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js +16 -0
  42. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js.map +1 -0
  43. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js +85 -0
  44. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js.map +1 -0
  45. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js +10 -0
  46. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js.map +1 -0
  47. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js +66 -0
  48. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js.map +1 -0
  49. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js +33 -0
  50. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js.map +1 -0
  51. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js +17 -0
  52. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js.map +1 -0
  53. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js +29 -0
  54. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js.map +1 -0
  55. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js +50 -0
  56. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js.map +1 -0
  57. package/dist/components/PullRequestsPage/lib/filters/allFilter.esm.js +6 -0
  58. package/dist/components/PullRequestsPage/lib/filters/allFilter.esm.js.map +1 -0
  59. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamFilter.esm.js +17 -0
  60. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamFilter.esm.js.map +1 -0
  61. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamsFilter.esm.js +20 -0
  62. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamsFilter.esm.js.map +1 -0
  63. package/dist/components/PullRequestsPage/lib/filters/assignedToUserFilter.esm.js +20 -0
  64. package/dist/components/PullRequestsPage/lib/filters/assignedToUserFilter.esm.js.map +1 -0
  65. package/dist/components/PullRequestsPage/lib/filters/createFilter.esm.js +45 -0
  66. package/dist/components/PullRequestsPage/lib/filters/createFilter.esm.js.map +1 -0
  67. package/dist/components/PullRequestsPage/lib/filters/createdByTeamFilter.esm.js +17 -0
  68. package/dist/components/PullRequestsPage/lib/filters/createdByTeamFilter.esm.js.map +1 -0
  69. package/dist/components/PullRequestsPage/lib/filters/createdByTeamsFilter.esm.js +32 -0
  70. package/dist/components/PullRequestsPage/lib/filters/createdByTeamsFilter.esm.js.map +1 -0
  71. package/dist/components/PullRequestsPage/lib/filters/createdByUserFilter.esm.js +18 -0
  72. package/dist/components/PullRequestsPage/lib/filters/createdByUserFilter.esm.js.map +1 -0
  73. package/dist/components/PullRequestsPage/lib/filters/types.esm.js +17 -0
  74. package/dist/components/PullRequestsPage/lib/filters/types.esm.js.map +1 -0
  75. package/dist/components/PullRequestsPage/lib/hooks/useFilterProcessor.esm.js +37 -0
  76. package/dist/components/PullRequestsPage/lib/hooks/useFilterProcessor.esm.js.map +1 -0
  77. package/dist/components/PullRequestsPage/lib/utils.esm.js +47 -0
  78. package/dist/components/PullRequestsPage/lib/utils.esm.js.map +1 -0
  79. package/dist/{esm/index-BJ_pWnMh.esm.js → components/ReadmeCard/ReadmeCard.esm.js} +8 -31
  80. package/dist/components/ReadmeCard/ReadmeCard.esm.js.map +1 -0
  81. package/dist/components/ReadmeCard/index.esm.js +2 -0
  82. package/dist/components/ReadmeCard/index.esm.js.map +1 -0
  83. package/dist/hooks/useBuildRuns.esm.js +37 -0
  84. package/dist/hooks/useBuildRuns.esm.js.map +1 -0
  85. package/dist/hooks/useDashboardPullRequests.esm.js +43 -0
  86. package/dist/hooks/useDashboardPullRequests.esm.js.map +1 -0
  87. package/dist/hooks/useGitTags.esm.js +30 -0
  88. package/dist/hooks/useGitTags.esm.js.map +1 -0
  89. package/dist/hooks/usePullRequests.esm.js +41 -0
  90. package/dist/hooks/usePullRequests.esm.js.map +1 -0
  91. package/dist/hooks/useReadme.esm.js +32 -0
  92. package/dist/hooks/useReadme.esm.js.map +1 -0
  93. package/dist/hooks/useUserEmail.esm.js +11 -0
  94. package/dist/hooks/useUserEmail.esm.js.map +1 -0
  95. package/dist/hooks/useUserTeamIds.esm.js +23 -0
  96. package/dist/hooks/useUserTeamIds.esm.js.map +1 -0
  97. package/dist/index.esm.js +7 -92
  98. package/dist/index.esm.js.map +1 -1
  99. package/dist/plugin.esm.js +68 -0
  100. package/dist/plugin.esm.js.map +1 -0
  101. package/dist/routes.esm.js +17 -0
  102. package/dist/routes.esm.js.map +1 -0
  103. package/dist/utils/arrayHas.esm.js +15 -0
  104. package/dist/utils/arrayHas.esm.js.map +1 -0
  105. package/dist/utils/equalsIgnoreCase.esm.js +6 -0
  106. package/dist/utils/equalsIgnoreCase.esm.js.map +1 -0
  107. package/dist/{esm/getAnnotationValuesFromEntity-G8YVs-3R.esm.js → utils/getAnnotationValuesFromEntity.esm.js} +7 -8
  108. package/dist/utils/getAnnotationValuesFromEntity.esm.js.map +1 -0
  109. package/dist/utils/getDurationFromDates.esm.js +34 -0
  110. package/dist/utils/getDurationFromDates.esm.js.map +1 -0
  111. package/package.json +19 -13
  112. package/dist/esm/AzureDevOpsApi-GBxs-uQ7.esm.js.map +0 -1
  113. package/dist/esm/AzurePullRequestsIcon-DOAkj-X3.esm.js.map +0 -1
  114. package/dist/esm/PullRequestsPage-CkhRQsgx.esm.js +0 -610
  115. package/dist/esm/PullRequestsPage-CkhRQsgx.esm.js.map +0 -1
  116. package/dist/esm/getAnnotationValuesFromEntity-G8YVs-3R.esm.js.map +0 -1
  117. package/dist/esm/index-1Rl7C23d.esm.js +0 -102
  118. package/dist/esm/index-1Rl7C23d.esm.js.map +0 -1
  119. package/dist/esm/index-BJ_pWnMh.esm.js.map +0 -1
  120. package/dist/esm/index-Bo-6jkQA.esm.js +0 -178
  121. package/dist/esm/index-Bo-6jkQA.esm.js.map +0 -1
  122. package/dist/esm/index-Bwu2-Sgs.esm.js.map +0 -1
  123. package/dist/esm/index-W1pvc5vi.esm.js +0 -25
  124. package/dist/esm/index-W1pvc5vi.esm.js.map +0 -1
@@ -4,38 +4,17 @@ import { makeStyles } from '@material-ui/core/styles';
4
4
  import { Progress, InfoCard, MarkdownContent, EmptyState, ErrorPanel } from '@backstage/core-components';
5
5
  import { useEntity } from '@backstage/plugin-catalog-react';
6
6
  import React from 'react';
7
- import { a as azureDevOpsApiRef } from './AzureDevOpsApi-GBxs-uQ7.esm.js';
7
+ import '../../api/AzureDevOpsApi.esm.js';
8
8
  import '@backstage/errors';
9
- import { useApi } from '@backstage/core-plugin-api';
10
- import useAsync from 'react-use/esm/useAsync';
9
+ import '@backstage/core-plugin-api';
10
+ import 'react-use/esm/useAsync';
11
11
  import 'react-use/esm/useAsyncRetry';
12
12
  import 'react-use/esm/useInterval';
13
13
  import '@backstage-community/plugin-azure-devops-common';
14
- import { stringifyEntityRef } from '@backstage/catalog-model';
14
+ import '@backstage/catalog-model';
15
15
  import 'luxon';
16
16
  import 'humanize-duration';
17
- import { g as getAnnotationValuesFromEntity } from './getAnnotationValuesFromEntity-G8YVs-3R.esm.js';
18
-
19
- function useReadme(entity) {
20
- const api = useApi(azureDevOpsApiRef);
21
- const { value, loading, error } = useAsync(() => {
22
- const { project, repo, host, org, readmePath } = getAnnotationValuesFromEntity(entity);
23
- const entityRef = stringifyEntityRef(entity);
24
- return api.getReadme({
25
- project,
26
- repo,
27
- entityRef,
28
- host,
29
- org,
30
- path: readmePath
31
- });
32
- }, [api]);
33
- return {
34
- item: value,
35
- loading,
36
- error
37
- };
38
- }
17
+ import { useReadme } from '../../hooks/useReadme.esm.js';
39
18
 
40
19
  const useStyles = makeStyles((theme) => ({
41
20
  readMe: {
@@ -58,8 +37,7 @@ const useStyles = makeStyles((theme) => ({
58
37
  }
59
38
  }));
60
39
  function isNotFoundError(error) {
61
- var _a;
62
- return ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) === 404;
40
+ return error?.response?.status === 404;
63
41
  }
64
42
  const ReadmeCardError = ({ error }) => {
65
43
  if (isNotFoundError(error)) {
@@ -84,7 +62,6 @@ const ReadmeCardError = ({ error }) => {
84
62
  return /* @__PURE__ */ React.createElement(ErrorPanel, { title: error.message, error });
85
63
  };
86
64
  const ReadmeCard = (props) => {
87
- var _a;
88
65
  const classes = useStyles();
89
66
  const { entity } = useEntity();
90
67
  const { loading, error, item: value } = useReadme(entity);
@@ -102,9 +79,9 @@ const ReadmeCard = (props) => {
102
79
  title: "Readme"
103
80
  }
104
81
  },
105
- /* @__PURE__ */ React.createElement(Box, { className: classes.readMe, sx: { maxHeight: props.maxHeight } }, /* @__PURE__ */ React.createElement(MarkdownContent, { content: (_a = value == null ? void 0 : value.content) != null ? _a : "" }))
82
+ /* @__PURE__ */ React.createElement(Box, { className: classes.readMe, sx: { maxHeight: props.maxHeight } }, /* @__PURE__ */ React.createElement(MarkdownContent, { content: value?.content ?? "" }))
106
83
  );
107
84
  };
108
85
 
109
86
  export { ReadmeCard };
110
- //# sourceMappingURL=index-BJ_pWnMh.esm.js.map
87
+ //# sourceMappingURL=ReadmeCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadmeCard.esm.js","sources":["../../../src/components/ReadmeCard/ReadmeCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n InfoCard,\n Progress,\n MarkdownContent,\n EmptyState,\n ErrorPanel,\n} from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport React from 'react';\n\nimport { useReadme } from '../../hooks';\n\nconst useStyles = makeStyles(theme => ({\n readMe: {\n overflowY: 'auto',\n paddingRight: theme.spacing(1),\n '&::-webkit-scrollbar-track': {\n backgroundColor: '#F5F5F5',\n borderRadius: '5px',\n },\n '&::-webkit-scrollbar': {\n width: '5px',\n backgroundColor: '#F5F5F5',\n borderRadius: '5px',\n },\n '&::-webkit-scrollbar-thumb': {\n border: '1px solid #555555',\n backgroundColor: '#555',\n borderRadius: '4px',\n },\n },\n}));\n\ntype Props = {\n maxHeight?: number;\n};\n\ntype ErrorProps = {\n error: Error;\n};\n\nfunction isNotFoundError(error: any): boolean {\n return error?.response?.status === 404;\n}\n\nconst ReadmeCardError = ({ error }: ErrorProps) => {\n if (isNotFoundError(error)) {\n return (\n <EmptyState\n title=\"No README available for this entity\"\n missing=\"field\"\n description=\"You can add a README to your entity by following the Azure DevOps documentation.\"\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops\"\n >\n Read more\n </Button>\n }\n />\n );\n }\n return <ErrorPanel title={error.message} error={error} />;\n};\n\nexport const ReadmeCard = (props: Props) => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { loading, error, item: value } = useReadme(entity);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ReadmeCardError error={error} />;\n }\n\n return (\n <InfoCard\n title=\"Readme\"\n deepLink={{\n link: value!.url,\n title: 'Readme',\n }}\n >\n <Box className={classes.readMe} sx={{ maxHeight: props.maxHeight }}>\n <MarkdownContent content={value?.content ?? ''} />\n </Box>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA,MAAA;AAAA,IACX,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC7B,4BAA8B,EAAA;AAAA,MAC5B,eAAiB,EAAA,SAAA;AAAA,MACjB,YAAc,EAAA,KAAA;AAAA,KAChB;AAAA,IACA,sBAAwB,EAAA;AAAA,MACtB,KAAO,EAAA,KAAA;AAAA,MACP,eAAiB,EAAA,SAAA;AAAA,MACjB,YAAc,EAAA,KAAA;AAAA,KAChB;AAAA,IACA,4BAA8B,EAAA;AAAA,MAC5B,MAAQ,EAAA,mBAAA;AAAA,MACR,eAAiB,EAAA,MAAA;AAAA,MACjB,YAAc,EAAA,KAAA;AAAA,KAChB;AAAA,GACF;AACF,CAAE,CAAA,CAAA,CAAA;AAUF,SAAS,gBAAgB,KAAqB,EAAA;AAC5C,EAAO,OAAA,KAAA,EAAO,UAAU,MAAW,KAAA,GAAA,CAAA;AACrC,CAAA;AAEA,MAAM,eAAkB,GAAA,CAAC,EAAE,KAAA,EAAwB,KAAA;AACjD,EAAI,IAAA,eAAA,CAAgB,KAAK,CAAG,EAAA;AAC1B,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,qCAAA;AAAA,QACN,OAAQ,EAAA,OAAA;AAAA,QACR,WAAY,EAAA,kFAAA;AAAA,QACZ,MACE,kBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,WAAA;AAAA,YACR,KAAM,EAAA,SAAA;AAAA,YACN,IAAK,EAAA,2FAAA;AAAA,WAAA;AAAA,UACN,WAAA;AAAA,SAED;AAAA,OAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ;AACA,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,KAAO,EAAA,KAAA,CAAM,SAAS,KAAc,EAAA,CAAA,CAAA;AACzD,CAAA,CAAA;AAEa,MAAA,UAAA,GAAa,CAAC,KAAiB,KAAA;AAC1C,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,OAAS,EAAA,KAAA,EAAO,MAAM,KAAM,EAAA,GAAI,UAAU,MAAM,CAAA,CAAA;AAExD,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,mBAAgB,KAAc,EAAA,CAAA,CAAA;AAAA,GACxC;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,QAAA;AAAA,MACN,QAAU,EAAA;AAAA,QACR,MAAM,KAAO,CAAA,GAAA;AAAA,QACb,KAAO,EAAA,QAAA;AAAA,OACT;AAAA,KAAA;AAAA,wCAEC,GAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,MAAA,EAAQ,IAAI,EAAE,SAAA,EAAW,KAAM,CAAA,SAAA,sBACpD,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,SAAS,KAAO,EAAA,OAAA,IAAW,IAAI,CAClD,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ReadmeCard } from './ReadmeCard.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { AZURE_DEVOPS_DEFAULT_TOP } from '@backstage-community/plugin-azure-devops-common';
2
+ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
3
+ import '@backstage/errors';
4
+ import { useApi } from '@backstage/core-plugin-api';
5
+ import useAsync from 'react-use/esm/useAsync';
6
+ import 'luxon';
7
+ import 'humanize-duration';
8
+ import { getAnnotationValuesFromEntity } from '../utils/getAnnotationValuesFromEntity.esm.js';
9
+ import { stringifyEntityRef } from '@backstage/catalog-model';
10
+
11
+ function useBuildRuns(entity, defaultLimit) {
12
+ const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;
13
+ const options = {
14
+ top
15
+ };
16
+ const api = useApi(azureDevOpsApiRef);
17
+ const { value, loading, error } = useAsync(() => {
18
+ const { project, repo, definition, host, org } = getAnnotationValuesFromEntity(entity);
19
+ return api.getBuildRuns(
20
+ project,
21
+ stringifyEntityRef(entity),
22
+ repo,
23
+ definition,
24
+ host,
25
+ org,
26
+ options
27
+ );
28
+ }, [api]);
29
+ return {
30
+ items: value?.items,
31
+ loading,
32
+ error
33
+ };
34
+ }
35
+
36
+ export { useBuildRuns };
37
+ //# sourceMappingURL=useBuildRuns.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBuildRuns.esm.js","sources":["../../src/hooks/useBuildRuns.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AZURE_DEVOPS_DEFAULT_TOP,\n BuildRun,\n BuildRunOptions,\n} from '@backstage-community/plugin-azure-devops-common';\n\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\n\nexport function useBuildRuns(\n entity: Entity,\n defaultLimit?: number,\n): {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n} {\n const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;\n const options: BuildRunOptions = {\n top: top,\n };\n\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, definition, host, org } =\n getAnnotationValuesFromEntity(entity);\n return api.getBuildRuns(\n project,\n stringifyEntityRef(entity),\n repo,\n definition,\n host,\n org,\n options,\n );\n }, [api]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AA4BgB,SAAA,YAAA,CACd,QACA,YAKA,EAAA;AACA,EAAA,MAAM,MAAM,YAAgB,IAAA,wBAAA,CAAA;AAC5B,EAAA,MAAM,OAA2B,GAAA;AAAA,IAC/B,GAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAM,MAAA,EAAE,SAAS,IAAM,EAAA,UAAA,EAAY,MAAM,GAAI,EAAA,GAC3C,8BAA8B,MAAM,CAAA,CAAA;AACtC,IAAA,OAAO,GAAI,CAAA,YAAA;AAAA,MACT,OAAA;AAAA,MACA,mBAAmB,MAAM,CAAA;AAAA,MACzB,IAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,OAAA;AAAA,KACF,CAAA;AAAA,GACF,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,43 @@
1
+ import { useApi, errorApiRef } from '@backstage/core-plugin-api';
2
+ import useAsyncRetry from 'react-use/esm/useAsyncRetry';
3
+ import useInterval from 'react-use/esm/useInterval';
4
+ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
5
+ import '@backstage/errors';
6
+ import { useCallback } from 'react';
7
+
8
+ const POLLING_INTERVAL = 1e4;
9
+ function useDashboardPullRequests(project, pollingInterval = POLLING_INTERVAL, teamsLimit) {
10
+ const api = useApi(azureDevOpsApiRef);
11
+ const errorApi = useApi(errorApiRef);
12
+ const getDashboardPullRequests = useCallback(async () => {
13
+ if (!project) {
14
+ return Promise.reject(new Error("Missing project name"));
15
+ }
16
+ try {
17
+ return await api.getDashboardPullRequests(project, teamsLimit);
18
+ } catch (error2) {
19
+ if (error2 instanceof Error) {
20
+ errorApi.post(error2);
21
+ }
22
+ return Promise.reject(error2);
23
+ }
24
+ }, [project, api, teamsLimit, errorApi]);
25
+ const {
26
+ value: pullRequests,
27
+ loading,
28
+ error,
29
+ retry
30
+ } = useAsyncRetry(
31
+ () => getDashboardPullRequests(),
32
+ [getDashboardPullRequests]
33
+ );
34
+ useInterval(() => retry(), pollingInterval);
35
+ return {
36
+ pullRequests,
37
+ loading,
38
+ error
39
+ };
40
+ }
41
+
42
+ export { useDashboardPullRequests };
43
+ //# sourceMappingURL=useDashboardPullRequests.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDashboardPullRequests.esm.js","sources":["../../src/hooks/useDashboardPullRequests.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport useInterval from 'react-use/esm/useInterval';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { azureDevOpsApiRef } from '../api';\nimport { useCallback } from 'react';\n\nconst POLLING_INTERVAL = 10000;\n\nexport function useDashboardPullRequests(\n project?: string,\n pollingInterval: number = POLLING_INTERVAL,\n teamsLimit?: number,\n): {\n pullRequests?: DashboardPullRequest[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n const errorApi = useApi(errorApiRef);\n\n const getDashboardPullRequests = useCallback(async (): Promise<\n DashboardPullRequest[]\n > => {\n if (!project) {\n return Promise.reject(new Error('Missing project name'));\n }\n\n try {\n return await api.getDashboardPullRequests(project, teamsLimit);\n } catch (error) {\n if (error instanceof Error) {\n errorApi.post(error);\n }\n\n return Promise.reject(error);\n }\n }, [project, api, teamsLimit, errorApi]);\n\n const {\n value: pullRequests,\n loading,\n error,\n retry,\n } = useAsyncRetry(\n () => getDashboardPullRequests(),\n [getDashboardPullRequests],\n );\n\n useInterval(() => retry(), pollingInterval);\n\n return {\n pullRequests,\n loading,\n error,\n };\n}\n"],"names":["error"],"mappings":";;;;;;;AAwBA,MAAM,gBAAmB,GAAA,GAAA,CAAA;AAElB,SAAS,wBACd,CAAA,OAAA,EACA,eAA0B,GAAA,gBAAA,EAC1B,UAKA,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AACpC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA,CAAA;AAEnC,EAAM,MAAA,wBAAA,GAA2B,YAAY,YAExC;AACH,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,sBAAsB,CAAC,CAAA,CAAA;AAAA,KACzD;AAEA,IAAI,IAAA;AACF,MAAA,OAAO,MAAM,GAAA,CAAI,wBAAyB,CAAA,OAAA,EAAS,UAAU,CAAA,CAAA;AAAA,aACtDA,MAAO,EAAA;AACd,MAAA,IAAIA,kBAAiB,KAAO,EAAA;AAC1B,QAAA,QAAA,CAAS,KAAKA,MAAK,CAAA,CAAA;AAAA,OACrB;AAEA,MAAO,OAAA,OAAA,CAAQ,OAAOA,MAAK,CAAA,CAAA;AAAA,KAC7B;AAAA,KACC,CAAC,OAAA,EAAS,GAAK,EAAA,UAAA,EAAY,QAAQ,CAAC,CAAA,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,YAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,GACE,GAAA,aAAA;AAAA,IACF,MAAM,wBAAyB,EAAA;AAAA,IAC/B,CAAC,wBAAwB,CAAA;AAAA,GAC3B,CAAA;AAEA,EAAY,WAAA,CAAA,MAAM,KAAM,EAAA,EAAG,eAAe,CAAA,CAAA;AAE1C,EAAO,OAAA;AAAA,IACL,YAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,30 @@
1
+ import { stringifyEntityRef } from '@backstage/catalog-model';
2
+ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
3
+ import '@backstage/errors';
4
+ import { useApi } from '@backstage/core-plugin-api';
5
+ import useAsync from 'react-use/esm/useAsync';
6
+ import 'luxon';
7
+ import 'humanize-duration';
8
+ import { getAnnotationValuesFromEntity } from '../utils/getAnnotationValuesFromEntity.esm.js';
9
+
10
+ function useGitTags(entity) {
11
+ const api = useApi(azureDevOpsApiRef);
12
+ const { value, loading, error } = useAsync(() => {
13
+ const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);
14
+ return api.getGitTags(
15
+ project,
16
+ repo,
17
+ stringifyEntityRef(entity),
18
+ host,
19
+ org
20
+ );
21
+ }, [api]);
22
+ return {
23
+ items: value?.items,
24
+ loading,
25
+ error
26
+ };
27
+ }
28
+
29
+ export { useGitTags };
30
+ //# sourceMappingURL=useGitTags.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGitTags.esm.js","sources":["../../src/hooks/useGitTags.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GitTag } from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function useGitTags(entity: Entity): {\n items?: GitTag[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);\n return api.getGitTags(\n project,\n repo as string,\n stringifyEntityRef(entity),\n host,\n org,\n );\n }, [api]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,WAAW,MAIzB,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,MAAM,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,GAAI,EAAA,GAAI,8BAA8B,MAAM,CAAA,CAAA;AACzE,IAAA,OAAO,GAAI,CAAA,UAAA;AAAA,MACT,OAAA;AAAA,MACA,IAAA;AAAA,MACA,mBAAmB,MAAM,CAAA;AAAA,MACzB,IAAA;AAAA,MACA,GAAA;AAAA,KACF,CAAA;AAAA,GACF,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,41 @@
1
+ import { PullRequestStatus, AZURE_DEVOPS_DEFAULT_TOP } from '@backstage-community/plugin-azure-devops-common';
2
+ import { stringifyEntityRef } from '@backstage/catalog-model';
3
+ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
4
+ import '@backstage/errors';
5
+ import { useApi } from '@backstage/core-plugin-api';
6
+ import useAsync from 'react-use/esm/useAsync';
7
+ import 'luxon';
8
+ import 'humanize-duration';
9
+ import { getAnnotationValuesFromEntity } from '../utils/getAnnotationValuesFromEntity.esm.js';
10
+
11
+ function usePullRequests(entity, defaultLimit, requestedStatus, defaultTeamsLimit) {
12
+ const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;
13
+ const teamsLimit = defaultTeamsLimit ?? void 0;
14
+ const status = requestedStatus ?? PullRequestStatus.Active;
15
+ const options = {
16
+ top,
17
+ status,
18
+ teamsLimit
19
+ };
20
+ const api = useApi(azureDevOpsApiRef);
21
+ const { value, loading, error } = useAsync(() => {
22
+ const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);
23
+ const entityRef = stringifyEntityRef(entity);
24
+ return api.getPullRequests(
25
+ project,
26
+ repo,
27
+ entityRef,
28
+ host,
29
+ org,
30
+ options
31
+ );
32
+ }, [api, top, status]);
33
+ return {
34
+ items: value?.items,
35
+ loading,
36
+ error
37
+ };
38
+ }
39
+
40
+ export { usePullRequests };
41
+ //# sourceMappingURL=usePullRequests.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePullRequests.esm.js","sources":["../../src/hooks/usePullRequests.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AZURE_DEVOPS_DEFAULT_TOP,\n PullRequest,\n PullRequestOptions,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function usePullRequests(\n entity: Entity,\n defaultLimit?: number,\n requestedStatus?: PullRequestStatus,\n defaultTeamsLimit?: number,\n): {\n items?: PullRequest[];\n loading: boolean;\n error?: Error;\n} {\n const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;\n const teamsLimit = defaultTeamsLimit ?? undefined;\n const status = requestedStatus ?? PullRequestStatus.Active;\n const options: PullRequestOptions = {\n top,\n status,\n teamsLimit,\n };\n\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);\n const entityRef = stringifyEntityRef(entity);\n return api.getPullRequests(\n project,\n repo as string,\n entityRef,\n host,\n org,\n options,\n );\n }, [api, top, status]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AA6BO,SAAS,eACd,CAAA,MAAA,EACA,YACA,EAAA,eAAA,EACA,iBAKA,EAAA;AACA,EAAA,MAAM,MAAM,YAAgB,IAAA,wBAAA,CAAA;AAC5B,EAAA,MAAM,aAAa,iBAAqB,IAAA,KAAA,CAAA,CAAA;AACxC,EAAM,MAAA,MAAA,GAAS,mBAAmB,iBAAkB,CAAA,MAAA,CAAA;AACpD,EAAA,MAAM,OAA8B,GAAA;AAAA,IAClC,GAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,MAAM,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,GAAI,EAAA,GAAI,8BAA8B,MAAM,CAAA,CAAA;AACzE,IAAM,MAAA,SAAA,GAAY,mBAAmB,MAAM,CAAA,CAAA;AAC3C,IAAA,OAAO,GAAI,CAAA,eAAA;AAAA,MACT,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,OAAA;AAAA,KACF,CAAA;AAAA,GACC,EAAA,CAAC,GAAK,EAAA,GAAA,EAAK,MAAM,CAAC,CAAA,CAAA;AAErB,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,32 @@
1
+ import { stringifyEntityRef } from '@backstage/catalog-model';
2
+ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
3
+ import '@backstage/errors';
4
+ import { useApi } from '@backstage/core-plugin-api';
5
+ import useAsync from 'react-use/esm/useAsync';
6
+ import 'luxon';
7
+ import 'humanize-duration';
8
+ import { getAnnotationValuesFromEntity } from '../utils/getAnnotationValuesFromEntity.esm.js';
9
+
10
+ function useReadme(entity) {
11
+ const api = useApi(azureDevOpsApiRef);
12
+ const { value, loading, error } = useAsync(() => {
13
+ const { project, repo, host, org, readmePath } = getAnnotationValuesFromEntity(entity);
14
+ const entityRef = stringifyEntityRef(entity);
15
+ return api.getReadme({
16
+ project,
17
+ repo,
18
+ entityRef,
19
+ host,
20
+ org,
21
+ path: readmePath
22
+ });
23
+ }, [api]);
24
+ return {
25
+ item: value,
26
+ loading,
27
+ error
28
+ };
29
+ }
30
+
31
+ export { useReadme };
32
+ //# sourceMappingURL=useReadme.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReadme.esm.js","sources":["../../src/hooks/useReadme.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Readme } from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function useReadme(entity: Entity): {\n item?: Readme;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org, readmePath } =\n getAnnotationValuesFromEntity(entity);\n const entityRef = stringifyEntityRef(entity);\n return api.getReadme({\n project,\n repo: repo as string,\n entityRef,\n host,\n org,\n path: readmePath,\n });\n }, [api]);\n\n return {\n item: value,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,UAAU,MAIxB,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAM,MAAA,EAAE,SAAS,IAAM,EAAA,IAAA,EAAM,KAAK,UAAW,EAAA,GAC3C,8BAA8B,MAAM,CAAA,CAAA;AACtC,IAAM,MAAA,SAAA,GAAY,mBAAmB,MAAM,CAAA,CAAA;AAC3C,IAAA,OAAO,IAAI,SAAU,CAAA;AAAA,MACnB,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,IAAM,EAAA,UAAA;AAAA,KACP,CAAA,CAAA;AAAA,GACH,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,KAAA;AAAA,IACN,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,11 @@
1
+ import { useApi, identityApiRef } from '@backstage/core-plugin-api';
2
+ import useAsync from 'react-use/esm/useAsync';
3
+
4
+ function useUserEmail() {
5
+ const identityApi = useApi(identityApiRef);
6
+ const state = useAsync(() => identityApi.getProfileInfo(), [identityApi]);
7
+ return state.value?.email;
8
+ }
9
+
10
+ export { useUserEmail };
11
+ //# sourceMappingURL=useUserEmail.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUserEmail.esm.js","sources":["../../src/hooks/useUserEmail.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\nexport function useUserEmail(): string | undefined {\n const identityApi = useApi(identityApiRef);\n const state = useAsync(() => identityApi.getProfileInfo(), [identityApi]);\n return state.value?.email;\n}\n"],"names":[],"mappings":";;;AAmBO,SAAS,YAAmC,GAAA;AACjD,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA,CAAA;AACzC,EAAM,MAAA,KAAA,GAAQ,SAAS,MAAM,WAAA,CAAY,gBAAkB,EAAA,CAAC,WAAW,CAAC,CAAA,CAAA;AACxE,EAAA,OAAO,MAAM,KAAO,EAAA,KAAA,CAAA;AACtB;;;;"}
@@ -0,0 +1,23 @@
1
+ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
2
+ import '@backstage/errors';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import useAsync from 'react-use/esm/useAsync';
5
+
6
+ function useUserTeamIds(userId) {
7
+ const api = useApi(azureDevOpsApiRef);
8
+ const {
9
+ value: teamIds,
10
+ loading,
11
+ error
12
+ } = useAsync(() => {
13
+ return userId ? api.getUserTeamIds(userId) : Promise.resolve(void 0);
14
+ }, [userId, api]);
15
+ return {
16
+ teamIds,
17
+ loading,
18
+ error
19
+ };
20
+ }
21
+
22
+ export { useUserTeamIds };
23
+ //# sourceMappingURL=useUserTeamIds.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUserTeamIds.esm.js","sources":["../../src/hooks/useUserTeamIds.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\nexport function useUserTeamIds(userId: string | undefined): {\n teamIds?: string[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const {\n value: teamIds,\n loading,\n error,\n } = useAsync(() => {\n return userId ? api.getUserTeamIds(userId) : Promise.resolve(undefined);\n }, [userId, api]);\n\n return {\n teamIds,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AAoBO,SAAS,eAAe,MAI7B,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,OAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,SAAS,MAAM;AACjB,IAAA,OAAO,SAAS,GAAI,CAAA,cAAA,CAAe,MAAM,CAAI,GAAA,OAAA,CAAQ,QAAQ,KAAS,CAAA,CAAA,CAAA;AAAA,GACrE,EAAA,CAAC,MAAQ,EAAA,GAAG,CAAC,CAAA,CAAA;AAEhB,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,95 +1,10 @@
1
- import { a as azureDevOpsApiRef, A as AzureDevOpsClient, b as azurePullRequestDashboardRouteRef, c as azurePipelinesEntityContentRouteRef, d as azureGitTagsEntityContentRouteRef, e as azurePullRequestsEntityContentRouteRef } from './esm/AzureDevOpsApi-GBxs-uQ7.esm.js';
2
- import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
3
- import { AZURE_DEVOPS_REPO_ANNOTATION, AZURE_DEVOPS_PROJECT_ANNOTATION, AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION } from '@backstage-community/plugin-azure-devops-common';
4
- export { A as AzurePullRequestsIcon } from './esm/AzurePullRequestsIcon-DOAkj-X3.esm.js';
5
- export { F as FilterType } from './esm/PullRequestsPage-CkhRQsgx.esm.js';
1
+ export { AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable } from './plugin.esm.js';
2
+ export { AzurePullRequestsIcon } from './components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js';
3
+ export { azureDevOpsApiRef } from './api/AzureDevOpsApi.esm.js';
4
+ export { AzureDevOpsClient } from './api/AzureDevOpsClient.esm.js';
5
+ import './components/PullRequestsPage/PullRequestsPage.esm.js';
6
+ export { FilterType } from './components/PullRequestsPage/lib/filters/types.esm.js';
6
7
  import 'luxon';
7
8
  import 'humanize-duration';
8
- import '@backstage/errors';
9
- import 'react';
10
- import '@material-ui/core/SvgIcon';
11
- import '@backstage/core-components';
12
- import '@material-ui/core/Paper';
13
- import '@material-ui/core/Typography';
14
- import '@material-ui/core/styles';
15
- import '@material-ui/core/Card';
16
- import '@material-ui/core/CardContent';
17
- import '@material-ui/core/CardHeader';
18
- import '@material-ui/icons/DoneAll';
19
- import '@material-ui/icons/Cancel';
20
- import '@material-ui/icons/GroupWork';
21
- import '@material-ui/icons/WatchLater';
22
- import 'react-use/esm/useAsync';
23
- import 'react-use/esm/useAsyncRetry';
24
- import 'react-use/esm/useInterval';
25
- import '@backstage/catalog-model';
26
- import '@backstage/plugin-permission-react';
27
-
28
- const isAzureDevOpsAvailable = (entity) => {
29
- var _a;
30
- return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[AZURE_DEVOPS_REPO_ANNOTATION]);
31
- };
32
- const isAzurePipelinesAvailable = (entity) => {
33
- var _a, _b, _c;
34
- return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[AZURE_DEVOPS_REPO_ANNOTATION]) || Boolean((_b = entity.metadata.annotations) == null ? void 0 : _b[AZURE_DEVOPS_PROJECT_ANNOTATION]) && Boolean(
35
- (_c = entity.metadata.annotations) == null ? void 0 : _c[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION]
36
- );
37
- };
38
- const azureDevOpsPlugin = createPlugin({
39
- id: "azureDevOps",
40
- apis: [
41
- createApiFactory({
42
- api: azureDevOpsApiRef,
43
- deps: {
44
- discoveryApi: discoveryApiRef,
45
- fetchApi: fetchApiRef
46
- },
47
- factory: ({ discoveryApi, fetchApi }) => new AzureDevOpsClient({ discoveryApi, fetchApi })
48
- })
49
- ]
50
- });
51
- const AzurePullRequestsPage = azureDevOpsPlugin.provide(
52
- createRoutableExtension({
53
- name: "AzurePullRequestsPage",
54
- component: () => import('./esm/index-W1pvc5vi.esm.js').then((m) => m.PullRequestsPage),
55
- mountPoint: azurePullRequestDashboardRouteRef
56
- })
57
- );
58
- const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(
59
- createRoutableExtension({
60
- name: "EntityAzurePipelinesContent",
61
- component: () => import('./esm/index-Bwu2-Sgs.esm.js').then(
62
- (m) => m.EntityPageAzurePipelines
63
- ),
64
- mountPoint: azurePipelinesEntityContentRouteRef
65
- })
66
- );
67
- const EntityAzureGitTagsContent = azureDevOpsPlugin.provide(
68
- createRoutableExtension({
69
- name: "EntityAzureGitTagsContent",
70
- component: () => import('./esm/index-1Rl7C23d.esm.js').then(
71
- (m) => m.EntityPageAzureGitTags
72
- ),
73
- mountPoint: azureGitTagsEntityContentRouteRef
74
- })
75
- );
76
- const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(
77
- createRoutableExtension({
78
- name: "EntityAzurePullRequestsContent",
79
- component: () => import('./esm/index-Bo-6jkQA.esm.js').then(
80
- (m) => m.EntityPageAzurePullRequests
81
- ),
82
- mountPoint: azurePullRequestsEntityContentRouteRef
83
- })
84
- );
85
- const EntityAzureReadmeCard = azureDevOpsPlugin.provide(
86
- createComponentExtension({
87
- name: "EntityAzureReadmeCard",
88
- component: {
89
- lazy: () => import('./esm/index-BJ_pWnMh.esm.js').then((m) => m.ReadmeCard)
90
- }
91
- })
92
- );
93
-
94
- export { AzureDevOpsClient, AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsApiRef, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
9
+ import '@backstage-community/plugin-azure-devops-common';
95
10
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n azurePipelinesEntityContentRouteRef,\n azurePullRequestDashboardRouteRef,\n azureGitTagsEntityContentRouteRef,\n azurePullRequestsEntityContentRouteRef,\n} from './routes';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n createComponentExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { AzureDevOpsClient } from './api/AzureDevOpsClient';\nimport { Entity } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from './api/AzureDevOpsApi';\nimport {\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport const isAzureDevOpsAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);\n\n/** @public */\nexport const isAzurePipelinesAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) ||\n (Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) &&\n Boolean(\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION],\n ));\n\n/** @public */\nexport const azureDevOpsPlugin = createPlugin({\n id: 'azureDevOps',\n apis: [\n createApiFactory({\n api: azureDevOpsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new AzureDevOpsClient({ discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const AzurePullRequestsPage = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'AzurePullRequestsPage',\n component: () =>\n import('./components/PullRequestsPage').then(m => m.PullRequestsPage),\n mountPoint: azurePullRequestDashboardRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePipelinesContent',\n component: () =>\n import('./components/EntityPageAzurePipelines').then(\n m => m.EntityPageAzurePipelines,\n ),\n mountPoint: azurePipelinesEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureGitTagsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzureGitTagsContent',\n component: () =>\n import('./components/EntityPageAzureGitTags').then(\n m => m.EntityPageAzureGitTags,\n ),\n mountPoint: azureGitTagsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePullRequestsContent',\n component: () =>\n import('./components/EntityPageAzurePullRequests').then(\n m => m.EntityPageAzurePullRequests,\n ),\n mountPoint: azurePullRequestsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureReadmeCard = azureDevOpsPlugin.provide(\n createComponentExtension({\n name: 'EntityAzureReadmeCard',\n component: {\n lazy: () => import('./components/ReadmeCard').then(m => m.ReadmeCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCa,MAAA,sBAAA,GAAyB,CAAC,MAAgB,KAAA;AAzCvD,EAAA,IAAA,EAAA,CAAA;AA0CE,EAAA,OAAA,OAAA,CAAA,CAAQ,EAAO,GAAA,MAAA,CAAA,QAAA,CAAS,WAAhB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAA8B,4BAA6B,CAAA,CAAA,CAAA;AAAA,EAAA;AAGxD,MAAA,yBAAA,GAA4B,CAAC,MAAgB,KAAA;AA7C1D,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AA8CE,EAAA,OAAA,OAAA,CAAA,CAAQ,EAAO,GAAA,MAAA,CAAA,QAAA,CAAS,WAAhB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAA8B,4BAA6B,CAAA,CAAA,IAClE,OAAQ,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,KAAhB,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,+BAAA,CAAgC,CACrE,IAAA,OAAA;AAAA,IACE,CAAA,EAAA,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,KAAhB,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,wCAAA,CAAA;AAAA,GAChC,CAAA;AAAA,EAAA;AAGG,MAAM,oBAAoB,YAAa,CAAA;AAAA,EAC5C,EAAI,EAAA,aAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,iBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,iBAAkB,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,CAAA;AAAA,KACnD,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAGM,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6BAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAY,EAAA,iCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,8BAA8B,iBAAkB,CAAA,OAAA;AAAA,EAC3D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,6BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,6BAAuC,CAAE,CAAA,IAAA;AAAA,MAC9C,OAAK,CAAE,CAAA,wBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,mCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,4BAA4B,iBAAkB,CAAA,OAAA;AAAA,EACzD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,6BAAqC,CAAE,CAAA,IAAA;AAAA,MAC5C,OAAK,CAAE,CAAA,sBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,iCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,iCAAiC,iBAAkB,CAAA,OAAA;AAAA,EAC9D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gCAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,6BAA0C,CAAE,CAAA,IAAA;AAAA,MACjD,OAAK,CAAE,CAAA,2BAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,sCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,6BAAyB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,UAAU,CAAA;AAAA,KACtE;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,68 @@
1
+ import { azurePullRequestDashboardRouteRef, azurePipelinesEntityContentRouteRef, azureGitTagsEntityContentRouteRef, azurePullRequestsEntityContentRouteRef } from './routes.esm.js';
2
+ import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
3
+ import { AzureDevOpsClient } from './api/AzureDevOpsClient.esm.js';
4
+ import { azureDevOpsApiRef } from './api/AzureDevOpsApi.esm.js';
5
+ import { AZURE_DEVOPS_REPO_ANNOTATION, AZURE_DEVOPS_PROJECT_ANNOTATION, AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION } from '@backstage-community/plugin-azure-devops-common';
6
+
7
+ const isAzureDevOpsAvailable = (entity) => Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);
8
+ const isAzurePipelinesAvailable = (entity) => Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) || Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) && Boolean(
9
+ entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION]
10
+ );
11
+ const azureDevOpsPlugin = createPlugin({
12
+ id: "azureDevOps",
13
+ apis: [
14
+ createApiFactory({
15
+ api: azureDevOpsApiRef,
16
+ deps: {
17
+ discoveryApi: discoveryApiRef,
18
+ fetchApi: fetchApiRef
19
+ },
20
+ factory: ({ discoveryApi, fetchApi }) => new AzureDevOpsClient({ discoveryApi, fetchApi })
21
+ })
22
+ ]
23
+ });
24
+ const AzurePullRequestsPage = azureDevOpsPlugin.provide(
25
+ createRoutableExtension({
26
+ name: "AzurePullRequestsPage",
27
+ component: () => import('./components/PullRequestsPage/index.esm.js').then((m) => m.PullRequestsPage),
28
+ mountPoint: azurePullRequestDashboardRouteRef
29
+ })
30
+ );
31
+ const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(
32
+ createRoutableExtension({
33
+ name: "EntityAzurePipelinesContent",
34
+ component: () => import('./components/EntityPageAzurePipelines/index.esm.js').then(
35
+ (m) => m.EntityPageAzurePipelines
36
+ ),
37
+ mountPoint: azurePipelinesEntityContentRouteRef
38
+ })
39
+ );
40
+ const EntityAzureGitTagsContent = azureDevOpsPlugin.provide(
41
+ createRoutableExtension({
42
+ name: "EntityAzureGitTagsContent",
43
+ component: () => import('./components/EntityPageAzureGitTags/index.esm.js').then(
44
+ (m) => m.EntityPageAzureGitTags
45
+ ),
46
+ mountPoint: azureGitTagsEntityContentRouteRef
47
+ })
48
+ );
49
+ const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(
50
+ createRoutableExtension({
51
+ name: "EntityAzurePullRequestsContent",
52
+ component: () => import('./components/EntityPageAzurePullRequests/index.esm.js').then(
53
+ (m) => m.EntityPageAzurePullRequests
54
+ ),
55
+ mountPoint: azurePullRequestsEntityContentRouteRef
56
+ })
57
+ );
58
+ const EntityAzureReadmeCard = azureDevOpsPlugin.provide(
59
+ createComponentExtension({
60
+ name: "EntityAzureReadmeCard",
61
+ component: {
62
+ lazy: () => import('./components/ReadmeCard/index.esm.js').then((m) => m.ReadmeCard)
63
+ }
64
+ })
65
+ );
66
+
67
+ export { AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
68
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n azurePipelinesEntityContentRouteRef,\n azurePullRequestDashboardRouteRef,\n azureGitTagsEntityContentRouteRef,\n azurePullRequestsEntityContentRouteRef,\n} from './routes';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n createComponentExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { AzureDevOpsClient } from './api/AzureDevOpsClient';\nimport { Entity } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from './api/AzureDevOpsApi';\nimport {\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport const isAzureDevOpsAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);\n\n/** @public */\nexport const isAzurePipelinesAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) ||\n (Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) &&\n Boolean(\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION],\n ));\n\n/** @public */\nexport const azureDevOpsPlugin = createPlugin({\n id: 'azureDevOps',\n apis: [\n createApiFactory({\n api: azureDevOpsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new AzureDevOpsClient({ discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const AzurePullRequestsPage = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'AzurePullRequestsPage',\n component: () =>\n import('./components/PullRequestsPage').then(m => m.PullRequestsPage),\n mountPoint: azurePullRequestDashboardRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePipelinesContent',\n component: () =>\n import('./components/EntityPageAzurePipelines').then(\n m => m.EntityPageAzurePipelines,\n ),\n mountPoint: azurePipelinesEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureGitTagsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzureGitTagsContent',\n component: () =>\n import('./components/EntityPageAzureGitTags').then(\n m => m.EntityPageAzureGitTags,\n ),\n mountPoint: azureGitTagsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePullRequestsContent',\n component: () =>\n import('./components/EntityPageAzurePullRequests').then(\n m => m.EntityPageAzurePullRequests,\n ),\n mountPoint: azurePullRequestsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureReadmeCard = azureDevOpsPlugin.provide(\n createComponentExtension({\n name: 'EntityAzureReadmeCard',\n component: {\n lazy: () => import('./components/ReadmeCard').then(m => m.ReadmeCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;AAyCa,MAAA,sBAAA,GAAyB,CAAC,MACrC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,4BAA4B,CAAC,EAAA;AAG9D,MAAM,4BAA4B,CAAC,MAAA,KACxC,OAAQ,CAAA,MAAA,CAAO,SAAS,WAAc,GAAA,4BAA4B,CAAC,CAAA,IAClE,QAAQ,MAAO,CAAA,QAAA,CAAS,WAAc,GAAA,+BAA+B,CAAC,CACrE,IAAA,OAAA;AAAA,EACE,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,wCAAwC,CAAA;AACxE,EAAA;AAGG,MAAM,oBAAoB,YAAa,CAAA;AAAA,EAC5C,EAAI,EAAA,aAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,iBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,iBAAkB,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,CAAA;AAAA,KACnD,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAGM,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,4CAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAY,EAAA,iCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,8BAA8B,iBAAkB,CAAA,OAAA;AAAA,EAC3D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,6BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,oDAAuC,CAAE,CAAA,IAAA;AAAA,MAC9C,OAAK,CAAE,CAAA,wBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,mCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,4BAA4B,iBAAkB,CAAA,OAAA;AAAA,EACzD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,kDAAqC,CAAE,CAAA,IAAA;AAAA,MAC5C,OAAK,CAAE,CAAA,sBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,iCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,iCAAiC,iBAAkB,CAAA,OAAA;AAAA,EAC9D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gCAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,uDAA0C,CAAE,CAAA,IAAA;AAAA,MACjD,OAAK,CAAE,CAAA,2BAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,sCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,sCAAyB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,UAAU,CAAA;AAAA,KACtE;AAAA,GACD,CAAA;AACH;;;;"}
@@ -0,0 +1,17 @@
1
+ import { createRouteRef } from '@backstage/core-plugin-api';
2
+
3
+ const azurePullRequestDashboardRouteRef = createRouteRef({
4
+ id: "azure-pull-request-dashboard"
5
+ });
6
+ const azurePipelinesEntityContentRouteRef = createRouteRef({
7
+ id: "azure-pipelines-entity-content"
8
+ });
9
+ const azureGitTagsEntityContentRouteRef = createRouteRef({
10
+ id: "azure-git-tags-entity-content"
11
+ });
12
+ const azurePullRequestsEntityContentRouteRef = createRouteRef({
13
+ id: "azure-pull-requests-entity-content"
14
+ });
15
+
16
+ export { azureGitTagsEntityContentRouteRef, azurePipelinesEntityContentRouteRef, azurePullRequestDashboardRouteRef, azurePullRequestsEntityContentRouteRef };
17
+ //# sourceMappingURL=routes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const azurePullRequestDashboardRouteRef = createRouteRef({\n id: 'azure-pull-request-dashboard',\n});\n\nexport const azurePipelinesEntityContentRouteRef = createRouteRef({\n id: 'azure-pipelines-entity-content',\n});\n\nexport const azureGitTagsEntityContentRouteRef = createRouteRef({\n id: 'azure-git-tags-entity-content',\n});\n\nexport const azurePullRequestsEntityContentRouteRef = createRouteRef({\n id: 'azure-pull-requests-entity-content',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,oCAAoC,cAAe,CAAA;AAAA,EAC9D,EAAI,EAAA,8BAAA;AACN,CAAC,EAAA;AAEM,MAAM,sCAAsC,cAAe,CAAA;AAAA,EAChE,EAAI,EAAA,gCAAA;AACN,CAAC,EAAA;AAEM,MAAM,oCAAoC,cAAe,CAAA;AAAA,EAC9D,EAAI,EAAA,+BAAA;AACN,CAAC,EAAA;AAEM,MAAM,yCAAyC,cAAe,CAAA;AAAA,EACnE,EAAI,EAAA,oCAAA;AACN,CAAC;;;;"}
@@ -0,0 +1,15 @@
1
+ function arrayHas(arr, value) {
2
+ return new Set(arr).has(value);
3
+ }
4
+ function stringArrayHas(arr, value, ignoreCase = false) {
5
+ if (ignoreCase) {
6
+ return arrayHas(
7
+ arr.map((a) => a?.toLocaleLowerCase("en-US")),
8
+ value?.toLocaleLowerCase("en-US")
9
+ );
10
+ }
11
+ return arrayHas(arr, value);
12
+ }
13
+
14
+ export { arrayHas, stringArrayHas };
15
+ //# sourceMappingURL=arrayHas.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayHas.esm.js","sources":["../../src/utils/arrayHas.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function arrayHas<T>(arr: T[], value: T): boolean {\n return new Set<T>(arr).has(value);\n}\n\nexport function stringArrayHas(\n arr: Array<string | undefined>,\n value: string | undefined,\n ignoreCase: boolean = false,\n): boolean {\n if (ignoreCase) {\n return arrayHas(\n arr.map(a => a?.toLocaleLowerCase('en-US')),\n value?.toLocaleLowerCase('en-US'),\n );\n }\n\n return arrayHas(arr, value);\n}\n"],"names":[],"mappings":"AAgBgB,SAAA,QAAA,CAAY,KAAU,KAAmB,EAAA;AACvD,EAAA,OAAO,IAAI,GAAA,CAAO,GAAG,CAAA,CAAE,IAAI,KAAK,CAAA,CAAA;AAClC,CAAA;AAEO,SAAS,cACd,CAAA,GAAA,EACA,KACA,EAAA,UAAA,GAAsB,KACb,EAAA;AACT,EAAA,IAAI,UAAY,EAAA;AACd,IAAO,OAAA,QAAA;AAAA,MACL,IAAI,GAAI,CAAA,CAAA,CAAA,KAAK,CAAG,EAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA,MAC1C,KAAA,EAAO,kBAAkB,OAAO,CAAA;AAAA,KAClC,CAAA;AAAA,GACF;AAEA,EAAO,OAAA,QAAA,CAAS,KAAK,KAAK,CAAA,CAAA;AAC5B;;;;"}
@@ -0,0 +1,6 @@
1
+ function equalsIgnoreCase(str1, str2) {
2
+ return str1.toLocaleLowerCase("en-US") === str2.toLocaleLowerCase("en-US");
3
+ }
4
+
5
+ export { equalsIgnoreCase };
6
+ //# sourceMappingURL=equalsIgnoreCase.esm.js.map