@atlaskit/teams-public 0.73.0 → 0.74.1
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 +19 -0
- package/dist/cjs/next/ui/team-containers/add-container-card/index.compiled.css +0 -2
- package/dist/cjs/next/ui/team-containers/add-container-card/index.js +4 -7
- package/dist/cjs/next/ui/team-containers/team-link-card/index.js +28 -6
- package/dist/es2019/next/ui/team-containers/add-container-card/index.compiled.css +0 -2
- package/dist/es2019/next/ui/team-containers/add-container-card/index.js +4 -7
- package/dist/es2019/next/ui/team-containers/team-link-card/index.js +28 -6
- package/dist/esm/next/ui/team-containers/add-container-card/index.compiled.css +0 -2
- package/dist/esm/next/ui/team-containers/add-container-card/index.js +4 -7
- package/dist/esm/next/ui/team-containers/team-link-card/index.js +28 -6
- package/package.json +9 -5
- package/dist/cjs/common/utils/error/index.js +0 -120
- package/dist/cjs/common/utils/http.js +0 -119
- package/dist/cjs/common/utils/status-code-handlers-provider.js +0 -30
- package/dist/cjs/common/utils/team-id-to-ari.js +0 -10
- package/dist/cjs/common/utils/user-ari.js +0 -16
- package/dist/cjs/ui/team-containers/utils.js +0 -81
- package/dist/es2019/common/utils/error/index.js +0 -87
- package/dist/es2019/common/utils/http.js +0 -82
- package/dist/es2019/common/utils/status-code-handlers-provider.js +0 -25
- package/dist/es2019/common/utils/team-id-to-ari.js +0 -2
- package/dist/es2019/common/utils/user-ari.js +0 -8
- package/dist/es2019/ui/team-containers/utils.js +0 -71
- package/dist/esm/common/utils/error/index.js +0 -117
- package/dist/esm/common/utils/http.js +0 -109
- package/dist/esm/common/utils/status-code-handlers-provider.js +0 -23
- package/dist/esm/common/utils/team-id-to-ari.js +0 -4
- package/dist/esm/common/utils/user-ari.js +0 -10
- package/dist/esm/ui/team-containers/utils.js +0 -74
- package/dist/types/common/utils/error/index.d.ts +0 -59
- package/dist/types/common/utils/http.d.ts +0 -31
- package/dist/types/common/utils/status-code-handlers-provider.d.ts +0 -17
- package/dist/types/common/utils/team-id-to-ari.d.ts +0 -2
- package/dist/types/common/utils/user-ari.d.ts +0 -3
- package/dist/types/ui/team-containers/utils.d.ts +0 -25
- package/dist/types-ts4.5/common/utils/error/index.d.ts +0 -59
- package/dist/types-ts4.5/common/utils/http.d.ts +0 -31
- package/dist/types-ts4.5/common/utils/status-code-handlers-provider.d.ts +0 -17
- package/dist/types-ts4.5/common/utils/team-id-to-ari.d.ts +0 -2
- package/dist/types-ts4.5/common/utils/user-ari.d.ts +0 -3
- package/dist/types-ts4.5/ui/team-containers/utils.d.ts +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.74.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bcca5482f4ea4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bcca5482f4ea4) -
|
|
8
|
+
Migrate links to teams anchor
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.74.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`1368864a76f91`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1368864a76f91) -
|
|
16
|
+
Remove dead code from teams-public package
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 0.73.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
._4t3i14no{height:36px}
|
|
7
7
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
8
8
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
9
|
-
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
10
9
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
11
|
-
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
12
10
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
13
11
|
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
14
12
|
._irr319i6:hover{background-color:var(--ds-surface-hovered,#f0f1f2)}
|
|
@@ -9,15 +9,12 @@ exports.AddContainerCard = void 0;
|
|
|
9
9
|
require("./index.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _css = require("@atlaskit/css");
|
|
13
12
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
13
|
var _getContainerProperties = require("../../../../common/utils/get-container-properties");
|
|
15
14
|
var _teamContainerSkeleton = require("../../../common/ui/team-container-skeleton");
|
|
16
15
|
var styles = {
|
|
17
|
-
card: "_4cvr1h6o _1bsb1osq",
|
|
18
|
-
|
|
19
|
-
smallCardContainer: "_ca0q1b66 _n3td1b66",
|
|
20
|
-
container: "_2rkoy0do _ca0qutpp _u5f312x7 _n3tdutpp _19bv12x7 _bfhkvuon _irr319i6",
|
|
16
|
+
card: "_4cvr1h6o _1bsb1osq _4t3i14no",
|
|
17
|
+
container: "_2rkoy0do _ca0q1b66 _u5f312x7 _n3td1b66 _19bv12x7 _bfhkvuon _irr319i6",
|
|
21
18
|
iconWrapper: "_2rko12b0 _syaz1rpy"
|
|
22
19
|
};
|
|
23
20
|
var AddContainerCardWrapper = function AddContainerCardWrapper(_ref) {
|
|
@@ -25,7 +22,7 @@ var AddContainerCardWrapper = function AddContainerCardWrapper(_ref) {
|
|
|
25
22
|
onClick = _ref.onClick,
|
|
26
23
|
isDisabled = _ref.isDisabled;
|
|
27
24
|
return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
28
|
-
xcss:
|
|
25
|
+
xcss: styles.container,
|
|
29
26
|
isDisabled: isDisabled,
|
|
30
27
|
onClick: onClick
|
|
31
28
|
}, children);
|
|
@@ -53,7 +50,7 @@ var AddContainerCard = exports.AddContainerCard = function AddContainerCard(_ref
|
|
|
53
50
|
isDisabled: isDisabled
|
|
54
51
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
55
52
|
space: "space.100",
|
|
56
|
-
xcss:
|
|
53
|
+
xcss: styles.card
|
|
57
54
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
58
55
|
xcss: styles.iconWrapper
|
|
59
56
|
}, icon), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
@@ -12,9 +12,10 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
17
|
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
18
|
+
var _teamsAppInternalNavigation = require("@atlaskit/teams-app-internal-navigation");
|
|
18
19
|
var _containerIcon = require("../../../../common/ui/container-icon");
|
|
19
20
|
var _separator = require("../../../../common/ui/separator");
|
|
20
21
|
var _teamLinkCardActions = require("../../../../common/ui/team-link-card-actions");
|
|
@@ -25,12 +26,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
25
26
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
27
|
var styles = {
|
|
27
28
|
container: "_2rko12b0 _ca0q1b66 _u5f312x7 _n3td1b66 _19bv12x7 _syazi7uo",
|
|
28
|
-
card: "_4cvr1h6o _1bsb1osq",
|
|
29
|
+
card: "_4cvr1h6o _1bsb1osq _4t3i14no",
|
|
29
30
|
anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _2rkoy0do _1bsb1osq _syazi7uo _1053i7uo _1hvwdkaa _nt751v1w _49pcnqa1 _1bg4v77o _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3i7uo",
|
|
30
31
|
crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
|
|
31
32
|
showMoreIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
|
|
32
|
-
linkableContent: "_16jlkb7n _1o9zkb7n _i0dlf1ug"
|
|
33
|
-
cardHeight: "_4t3i14no"
|
|
33
|
+
linkableContent: "_16jlkb7n _1o9zkb7n _i0dlf1ug"
|
|
34
34
|
};
|
|
35
35
|
var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
36
36
|
var containerType = _ref.containerType,
|
|
@@ -119,7 +119,7 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
119
119
|
testId: "team-link-card-inner"
|
|
120
120
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
121
121
|
space: "space.100",
|
|
122
|
-
xcss:
|
|
122
|
+
xcss: styles.card
|
|
123
123
|
}, /*#__PURE__*/_react.default.createElement(_containerIcon.ContainerIcon, {
|
|
124
124
|
containerType: containerType,
|
|
125
125
|
title: title,
|
|
@@ -127,7 +127,29 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
127
127
|
size: "small",
|
|
128
128
|
iconsLoading: iconsLoading,
|
|
129
129
|
iconHasLoaded: iconHasLoaded
|
|
130
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
130
|
+
}), (0, _platformFeatureFlags.fg)('ptc-links-migrate-atlaskit-anchor-to-teams-anchor') ? /*#__PURE__*/_react.default.createElement(_teamsAppInternalNavigation.TeamsAnchor, {
|
|
131
|
+
xcss: styles.anchor,
|
|
132
|
+
href: link || '#',
|
|
133
|
+
onClick: handleLinkClick,
|
|
134
|
+
testId: "team-link-card-linkable-content",
|
|
135
|
+
intent: "unknown" // because links can be internal or external 'unknown' is appropriate here
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
|
|
137
|
+
space: "space.025"
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
139
|
+
maxLines: 1,
|
|
140
|
+
color: "color.text"
|
|
141
|
+
}, title), /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
142
|
+
gap: "space.050",
|
|
143
|
+
alignItems: "center"
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
145
|
+
space: "space.050"
|
|
146
|
+
}, containerTypeText && /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
147
|
+
size: "small",
|
|
148
|
+
color: "color.text.subtle"
|
|
149
|
+
}, containerTypeText), containerTypeText && description && /*#__PURE__*/_react.default.createElement(_separator.Separator, null), description && /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
150
|
+
size: "small",
|
|
151
|
+
color: "color.text.subtle"
|
|
152
|
+
}, description))))) : /*#__PURE__*/_react.default.createElement(_compiled.Anchor, {
|
|
131
153
|
xcss: styles.anchor,
|
|
132
154
|
href: link || '#',
|
|
133
155
|
onClick: handleLinkClick,
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
._4t3i14no{height:36px}
|
|
7
7
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
8
8
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
9
|
-
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
10
9
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
11
|
-
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
12
10
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
13
11
|
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
14
12
|
._irr319i6:hover{background-color:var(--ds-surface-hovered,#f0f1f2)}
|
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { cx } from '@atlaskit/css';
|
|
6
5
|
import { Box, Inline, Pressable, Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { getContainerProperties } from '../../../../common/utils/get-container-properties';
|
|
8
7
|
import { TeamContainerSkeleton } from '../../../common/ui/team-container-skeleton';
|
|
9
8
|
const styles = {
|
|
10
|
-
card: "_4cvr1h6o _1bsb1osq",
|
|
11
|
-
|
|
12
|
-
smallCardContainer: "_ca0q1b66 _n3td1b66",
|
|
13
|
-
container: "_2rkoy0do _ca0qutpp _u5f312x7 _n3tdutpp _19bv12x7 _bfhkvuon _irr319i6",
|
|
9
|
+
card: "_4cvr1h6o _1bsb1osq _4t3i14no",
|
|
10
|
+
container: "_2rkoy0do _ca0q1b66 _u5f312x7 _n3td1b66 _19bv12x7 _bfhkvuon _irr319i6",
|
|
14
11
|
iconWrapper: "_2rko12b0 _syaz1rpy"
|
|
15
12
|
};
|
|
16
13
|
const AddContainerCardWrapper = ({
|
|
@@ -19,7 +16,7 @@ const AddContainerCardWrapper = ({
|
|
|
19
16
|
isDisabled
|
|
20
17
|
}) => {
|
|
21
18
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
22
|
-
xcss:
|
|
19
|
+
xcss: styles.container,
|
|
23
20
|
isDisabled: isDisabled,
|
|
24
21
|
onClick: onClick
|
|
25
22
|
}, children);
|
|
@@ -47,7 +44,7 @@ export const AddContainerCard = ({
|
|
|
47
44
|
isDisabled: isDisabled
|
|
48
45
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
49
46
|
space: "space.100",
|
|
50
|
-
xcss:
|
|
47
|
+
xcss: styles.card
|
|
51
48
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
52
49
|
xcss: styles.iconWrapper
|
|
53
50
|
}, icon), /*#__PURE__*/React.createElement(Text, {
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { Anchor, Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
8
|
+
import { TeamsAnchor } from '@atlaskit/teams-app-internal-navigation';
|
|
8
9
|
import { ContainerIcon } from '../../../../common/ui/container-icon';
|
|
9
10
|
import { Separator } from '../../../../common/ui/separator';
|
|
10
11
|
import { TeamLinkCardActions } from '../../../../common/ui/team-link-card-actions';
|
|
@@ -12,12 +13,11 @@ import { getContainerProperties } from '../../../../common/utils/get-container-p
|
|
|
12
13
|
import { getDomainFromLinkUri } from '../../../../common/utils/get-link-domain';
|
|
13
14
|
const styles = {
|
|
14
15
|
container: "_2rko12b0 _ca0q1b66 _u5f312x7 _n3td1b66 _19bv12x7 _syazi7uo",
|
|
15
|
-
card: "_4cvr1h6o _1bsb1osq",
|
|
16
|
+
card: "_4cvr1h6o _1bsb1osq _4t3i14no",
|
|
16
17
|
anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _2rkoy0do _1bsb1osq _syazi7uo _1053i7uo _1hvwdkaa _nt751v1w _49pcnqa1 _1bg4v77o _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3i7uo",
|
|
17
18
|
crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
|
|
18
19
|
showMoreIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
|
|
19
|
-
linkableContent: "_16jlkb7n _1o9zkb7n _i0dlf1ug"
|
|
20
|
-
cardHeight: "_4t3i14no"
|
|
20
|
+
linkableContent: "_16jlkb7n _1o9zkb7n _i0dlf1ug"
|
|
21
21
|
};
|
|
22
22
|
export const TeamLinkCard = ({
|
|
23
23
|
containerType,
|
|
@@ -98,7 +98,7 @@ export const TeamLinkCard = ({
|
|
|
98
98
|
testId: "team-link-card-inner"
|
|
99
99
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
100
100
|
space: "space.100",
|
|
101
|
-
xcss:
|
|
101
|
+
xcss: styles.card
|
|
102
102
|
}, /*#__PURE__*/React.createElement(ContainerIcon, {
|
|
103
103
|
containerType: containerType,
|
|
104
104
|
title: title,
|
|
@@ -106,7 +106,29 @@ export const TeamLinkCard = ({
|
|
|
106
106
|
size: "small",
|
|
107
107
|
iconsLoading: iconsLoading,
|
|
108
108
|
iconHasLoaded: iconHasLoaded
|
|
109
|
-
}), /*#__PURE__*/React.createElement(
|
|
109
|
+
}), fg('ptc-links-migrate-atlaskit-anchor-to-teams-anchor') ? /*#__PURE__*/React.createElement(TeamsAnchor, {
|
|
110
|
+
xcss: styles.anchor,
|
|
111
|
+
href: link || '#',
|
|
112
|
+
onClick: handleLinkClick,
|
|
113
|
+
testId: "team-link-card-linkable-content",
|
|
114
|
+
intent: "unknown" // because links can be internal or external 'unknown' is appropriate here
|
|
115
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
116
|
+
space: "space.025"
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
118
|
+
maxLines: 1,
|
|
119
|
+
color: "color.text"
|
|
120
|
+
}, title), /*#__PURE__*/React.createElement(Flex, {
|
|
121
|
+
gap: "space.050",
|
|
122
|
+
alignItems: "center"
|
|
123
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
124
|
+
space: "space.050"
|
|
125
|
+
}, containerTypeText && /*#__PURE__*/React.createElement(Text, {
|
|
126
|
+
size: "small",
|
|
127
|
+
color: "color.text.subtle"
|
|
128
|
+
}, containerTypeText), containerTypeText && description && /*#__PURE__*/React.createElement(Separator, null), description && /*#__PURE__*/React.createElement(Text, {
|
|
129
|
+
size: "small",
|
|
130
|
+
color: "color.text.subtle"
|
|
131
|
+
}, description))))) : /*#__PURE__*/React.createElement(Anchor, {
|
|
110
132
|
xcss: styles.anchor,
|
|
111
133
|
href: link || '#',
|
|
112
134
|
onClick: handleLinkClick,
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
._4t3i14no{height:36px}
|
|
7
7
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
8
8
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
9
|
-
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
10
9
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
11
|
-
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
12
10
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
13
11
|
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
14
12
|
._irr319i6:hover{background-color:var(--ds-surface-hovered,#f0f1f2)}
|
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { cx } from '@atlaskit/css';
|
|
6
5
|
import { Box, Inline, Pressable, Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { getContainerProperties } from '../../../../common/utils/get-container-properties';
|
|
8
7
|
import { TeamContainerSkeleton } from '../../../common/ui/team-container-skeleton';
|
|
9
8
|
var styles = {
|
|
10
|
-
card: "_4cvr1h6o _1bsb1osq",
|
|
11
|
-
|
|
12
|
-
smallCardContainer: "_ca0q1b66 _n3td1b66",
|
|
13
|
-
container: "_2rkoy0do _ca0qutpp _u5f312x7 _n3tdutpp _19bv12x7 _bfhkvuon _irr319i6",
|
|
9
|
+
card: "_4cvr1h6o _1bsb1osq _4t3i14no",
|
|
10
|
+
container: "_2rkoy0do _ca0q1b66 _u5f312x7 _n3td1b66 _19bv12x7 _bfhkvuon _irr319i6",
|
|
14
11
|
iconWrapper: "_2rko12b0 _syaz1rpy"
|
|
15
12
|
};
|
|
16
13
|
var AddContainerCardWrapper = function AddContainerCardWrapper(_ref) {
|
|
@@ -18,7 +15,7 @@ var AddContainerCardWrapper = function AddContainerCardWrapper(_ref) {
|
|
|
18
15
|
onClick = _ref.onClick,
|
|
19
16
|
isDisabled = _ref.isDisabled;
|
|
20
17
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
21
|
-
xcss:
|
|
18
|
+
xcss: styles.container,
|
|
22
19
|
isDisabled: isDisabled,
|
|
23
20
|
onClick: onClick
|
|
24
21
|
}, children);
|
|
@@ -46,7 +43,7 @@ export var AddContainerCard = function AddContainerCard(_ref2) {
|
|
|
46
43
|
isDisabled: isDisabled
|
|
47
44
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
48
45
|
space: "space.100",
|
|
49
|
-
xcss:
|
|
46
|
+
xcss: styles.card
|
|
50
47
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
51
48
|
xcss: styles.iconWrapper
|
|
52
49
|
}, icon), /*#__PURE__*/React.createElement(Text, {
|
|
@@ -6,9 +6,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { Anchor, Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
12
|
+
import { TeamsAnchor } from '@atlaskit/teams-app-internal-navigation';
|
|
12
13
|
import { ContainerIcon } from '../../../../common/ui/container-icon';
|
|
13
14
|
import { Separator } from '../../../../common/ui/separator';
|
|
14
15
|
import { TeamLinkCardActions } from '../../../../common/ui/team-link-card-actions';
|
|
@@ -16,12 +17,11 @@ import { getContainerProperties } from '../../../../common/utils/get-container-p
|
|
|
16
17
|
import { getDomainFromLinkUri } from '../../../../common/utils/get-link-domain';
|
|
17
18
|
var styles = {
|
|
18
19
|
container: "_2rko12b0 _ca0q1b66 _u5f312x7 _n3td1b66 _19bv12x7 _syazi7uo",
|
|
19
|
-
card: "_4cvr1h6o _1bsb1osq",
|
|
20
|
+
card: "_4cvr1h6o _1bsb1osq _4t3i14no",
|
|
20
21
|
anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _2rkoy0do _1bsb1osq _syazi7uo _1053i7uo _1hvwdkaa _nt751v1w _49pcnqa1 _1bg4v77o _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3i7uo",
|
|
21
22
|
crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
|
|
22
23
|
showMoreIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
|
|
23
|
-
linkableContent: "_16jlkb7n _1o9zkb7n _i0dlf1ug"
|
|
24
|
-
cardHeight: "_4t3i14no"
|
|
24
|
+
linkableContent: "_16jlkb7n _1o9zkb7n _i0dlf1ug"
|
|
25
25
|
};
|
|
26
26
|
export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
27
27
|
var containerType = _ref.containerType,
|
|
@@ -110,7 +110,7 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
110
110
|
testId: "team-link-card-inner"
|
|
111
111
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
112
112
|
space: "space.100",
|
|
113
|
-
xcss:
|
|
113
|
+
xcss: styles.card
|
|
114
114
|
}, /*#__PURE__*/React.createElement(ContainerIcon, {
|
|
115
115
|
containerType: containerType,
|
|
116
116
|
title: title,
|
|
@@ -118,7 +118,29 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
118
118
|
size: "small",
|
|
119
119
|
iconsLoading: iconsLoading,
|
|
120
120
|
iconHasLoaded: iconHasLoaded
|
|
121
|
-
}), /*#__PURE__*/React.createElement(
|
|
121
|
+
}), fg('ptc-links-migrate-atlaskit-anchor-to-teams-anchor') ? /*#__PURE__*/React.createElement(TeamsAnchor, {
|
|
122
|
+
xcss: styles.anchor,
|
|
123
|
+
href: link || '#',
|
|
124
|
+
onClick: handleLinkClick,
|
|
125
|
+
testId: "team-link-card-linkable-content",
|
|
126
|
+
intent: "unknown" // because links can be internal or external 'unknown' is appropriate here
|
|
127
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
128
|
+
space: "space.025"
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
130
|
+
maxLines: 1,
|
|
131
|
+
color: "color.text"
|
|
132
|
+
}, title), /*#__PURE__*/React.createElement(Flex, {
|
|
133
|
+
gap: "space.050",
|
|
134
|
+
alignItems: "center"
|
|
135
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
136
|
+
space: "space.050"
|
|
137
|
+
}, containerTypeText && /*#__PURE__*/React.createElement(Text, {
|
|
138
|
+
size: "small",
|
|
139
|
+
color: "color.text.subtle"
|
|
140
|
+
}, containerTypeText), containerTypeText && description && /*#__PURE__*/React.createElement(Separator, null), description && /*#__PURE__*/React.createElement(Text, {
|
|
141
|
+
size: "small",
|
|
142
|
+
color: "color.text.subtle"
|
|
143
|
+
}, description))))) : /*#__PURE__*/React.createElement(Anchor, {
|
|
122
144
|
xcss: styles.anchor,
|
|
123
145
|
href: link || '#',
|
|
124
146
|
onClick: handleLinkClick,
|
package/package.json
CHANGED
|
@@ -27,22 +27,23 @@
|
|
|
27
27
|
"@atlaskit/afm-i18n-platform-people-and-teams-teams-public": "2.39.0",
|
|
28
28
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
29
29
|
"@atlaskit/avatar": "^25.11.0",
|
|
30
|
-
"@atlaskit/button": "^23.
|
|
30
|
+
"@atlaskit/button": "^23.11.0",
|
|
31
31
|
"@atlaskit/css": "^0.19.0",
|
|
32
32
|
"@atlaskit/dropdown-menu": "^16.8.0",
|
|
33
33
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
34
|
-
"@atlaskit/heading": "^5.
|
|
34
|
+
"@atlaskit/heading": "^5.4.0",
|
|
35
35
|
"@atlaskit/icon": "^34.0.0",
|
|
36
36
|
"@atlaskit/image": "^3.0.0",
|
|
37
|
-
"@atlaskit/link": "^3.
|
|
37
|
+
"@atlaskit/link": "^3.4.0",
|
|
38
38
|
"@atlaskit/modal-dialog": "^14.14.0",
|
|
39
39
|
"@atlaskit/people-teams-ui-public": "^3.7.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
41
|
"@atlaskit/primitives": "^18.1.0",
|
|
42
42
|
"@atlaskit/skeleton": "^2.1.0",
|
|
43
43
|
"@atlaskit/teams-app-internal-analytics": "^1.27.0",
|
|
44
|
+
"@atlaskit/teams-app-internal-navigation": "^1.8.0",
|
|
44
45
|
"@atlaskit/teams-app-internal-product-permissions": "^1.3.0",
|
|
45
|
-
"@atlaskit/teams-client": "^4.
|
|
46
|
+
"@atlaskit/teams-client": "^4.31.0",
|
|
46
47
|
"@atlaskit/tokens": "^11.4.0",
|
|
47
48
|
"@atlaskit/tooltip": "^21.1.0",
|
|
48
49
|
"@babel/runtime": "^7.0.0",
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
}
|
|
107
108
|
},
|
|
108
109
|
"name": "@atlaskit/teams-public",
|
|
109
|
-
"version": "0.
|
|
110
|
+
"version": "0.74.1",
|
|
110
111
|
"description": "Public components related to teams",
|
|
111
112
|
"author": "Atlassian Pty Ltd",
|
|
112
113
|
"license": "Apache-2.0",
|
|
@@ -138,6 +139,9 @@
|
|
|
138
139
|
},
|
|
139
140
|
"workforce_optimization_team_modal_update": {
|
|
140
141
|
"type": "boolean"
|
|
142
|
+
},
|
|
143
|
+
"ptc-links-migrate-atlaskit-anchor-to-teams-anchor": {
|
|
144
|
+
"type": "boolean"
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.StatusCode = exports.SLOIgnoreError = exports.HttpError = exports.GraphQLError = exports.DefaultError = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
15
|
-
var _GraphQLError;
|
|
16
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
17
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
-
var StatusCode = exports.StatusCode = /*#__PURE__*/function (StatusCode) {
|
|
19
|
-
StatusCode[StatusCode["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
20
|
-
StatusCode[StatusCode["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
21
|
-
StatusCode[StatusCode["TIMEOUT"] = 408] = "TIMEOUT";
|
|
22
|
-
StatusCode[StatusCode["GONE"] = 410] = "GONE";
|
|
23
|
-
StatusCode[StatusCode["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
24
|
-
return StatusCode;
|
|
25
|
-
}({});
|
|
26
|
-
var CommonError = /*#__PURE__*/function (_Error) {
|
|
27
|
-
function CommonError(message) {
|
|
28
|
-
var _this;
|
|
29
|
-
(0, _classCallCheck2.default)(this, CommonError);
|
|
30
|
-
_this = _callSuper(this, CommonError, [message]);
|
|
31
|
-
_this.name = _this.constructor.name;
|
|
32
|
-
_this.message = message || 'UnknownError';
|
|
33
|
-
_this.stack = new Error(message).stack || '';
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
(0, _inherits2.default)(CommonError, _Error);
|
|
37
|
-
return (0, _createClass2.default)(CommonError);
|
|
38
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
39
|
-
var DefaultError = exports.DefaultError = /*#__PURE__*/function (_CommonError) {
|
|
40
|
-
function DefaultError(_ref) {
|
|
41
|
-
var _this2;
|
|
42
|
-
var message = _ref.message;
|
|
43
|
-
(0, _classCallCheck2.default)(this, DefaultError);
|
|
44
|
-
_this2 = _callSuper(this, DefaultError, [message || 'UnknownError']);
|
|
45
|
-
Object.setPrototypeOf(_this2, DefaultError.prototype);
|
|
46
|
-
return _this2;
|
|
47
|
-
}
|
|
48
|
-
(0, _inherits2.default)(DefaultError, _CommonError);
|
|
49
|
-
return (0, _createClass2.default)(DefaultError);
|
|
50
|
-
}(CommonError);
|
|
51
|
-
/**
|
|
52
|
-
* These errors will not fail UFO experiences
|
|
53
|
-
*/
|
|
54
|
-
var SLOIgnoreError = exports.SLOIgnoreError = /*#__PURE__*/function (_CommonError2) {
|
|
55
|
-
function SLOIgnoreError(_ref2) {
|
|
56
|
-
var _this3;
|
|
57
|
-
var message = _ref2.message;
|
|
58
|
-
(0, _classCallCheck2.default)(this, SLOIgnoreError);
|
|
59
|
-
_this3 = _callSuper(this, SLOIgnoreError, ["SentryIgnore: ".concat(message || 'UnknownError')]);
|
|
60
|
-
Object.setPrototypeOf(_this3, SLOIgnoreError.prototype);
|
|
61
|
-
return _this3;
|
|
62
|
-
}
|
|
63
|
-
(0, _inherits2.default)(SLOIgnoreError, _CommonError2);
|
|
64
|
-
return (0, _createClass2.default)(SLOIgnoreError);
|
|
65
|
-
}(CommonError);
|
|
66
|
-
// Http Errors
|
|
67
|
-
var HttpError = exports.HttpError = /*#__PURE__*/function (_CommonError3) {
|
|
68
|
-
function HttpError(_ref3) {
|
|
69
|
-
var _this4;
|
|
70
|
-
var message = _ref3.message,
|
|
71
|
-
status = _ref3.status,
|
|
72
|
-
traceId = _ref3.traceId,
|
|
73
|
-
path = _ref3.path;
|
|
74
|
-
(0, _classCallCheck2.default)(this, HttpError);
|
|
75
|
-
_this4 = _callSuper(this, HttpError, [message]);
|
|
76
|
-
Object.setPrototypeOf(_this4, HttpError.prototype);
|
|
77
|
-
_this4.status = status;
|
|
78
|
-
_this4.traceId = traceId;
|
|
79
|
-
_this4.path = path;
|
|
80
|
-
return _this4;
|
|
81
|
-
}
|
|
82
|
-
(0, _inherits2.default)(HttpError, _CommonError3);
|
|
83
|
-
return (0, _createClass2.default)(HttpError);
|
|
84
|
-
}(CommonError); // Graphql Errors
|
|
85
|
-
var GraphQLError = exports.GraphQLError = /*#__PURE__*/function (_CommonError4) {
|
|
86
|
-
// tslint:disable-line no-any
|
|
87
|
-
|
|
88
|
-
function GraphQLError(_ref4) {
|
|
89
|
-
var _this5;
|
|
90
|
-
var message = _ref4.message,
|
|
91
|
-
_ref4$category = _ref4.category,
|
|
92
|
-
category = _ref4$category === void 0 ? 'default' : _ref4$category,
|
|
93
|
-
fields = _ref4.fields;
|
|
94
|
-
(0, _classCallCheck2.default)(this, GraphQLError);
|
|
95
|
-
_this5 = _callSuper(this, GraphQLError, [message]);
|
|
96
|
-
Object.setPrototypeOf(_this5, GraphQLError.prototype);
|
|
97
|
-
_this5.category = category;
|
|
98
|
-
if (fields) {
|
|
99
|
-
_this5.fields = fields;
|
|
100
|
-
}
|
|
101
|
-
return _this5;
|
|
102
|
-
}
|
|
103
|
-
(0, _inherits2.default)(GraphQLError, _CommonError4);
|
|
104
|
-
return (0, _createClass2.default)(GraphQLError);
|
|
105
|
-
}(CommonError);
|
|
106
|
-
_GraphQLError = GraphQLError;
|
|
107
|
-
(0, _defineProperty2.default)(GraphQLError, "from", function (rawErrors) {
|
|
108
|
-
var firstError = rawErrors[0];
|
|
109
|
-
var errorData = {
|
|
110
|
-
category: firstError.category,
|
|
111
|
-
message: firstError.message
|
|
112
|
-
};
|
|
113
|
-
if (firstError.fields) {
|
|
114
|
-
errorData.fields = firstError.fields.reduce(function (obj, item) {
|
|
115
|
-
obj[item.field] = item.message;
|
|
116
|
-
return obj;
|
|
117
|
-
}, {});
|
|
118
|
-
}
|
|
119
|
-
return new _GraphQLError(errorData);
|
|
120
|
-
});
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.fetchWithExponentialBackoff = exports.EXPONENTIAL_BACKOFF_RETRY_POLICY = void 0;
|
|
8
|
-
exports.is5xx = is5xx;
|
|
9
|
-
exports.isFetchResponse = isFetchResponse;
|
|
10
|
-
exports.withExponentialBackoff = withExponentialBackoff;
|
|
11
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
var EXPONENTIAL_BACKOFF_RETRY_POLICY = exports.EXPONENTIAL_BACKOFF_RETRY_POLICY = {
|
|
14
|
-
INITIAL_DELAY: 200,
|
|
15
|
-
MAX_RETRIES: 5,
|
|
16
|
-
JITTER: true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Checks whether a status code is a 5xx HTTP code.
|
|
21
|
-
* @param {number} status HTTP status code
|
|
22
|
-
*/
|
|
23
|
-
function is5xx(status) {
|
|
24
|
-
return 500 <= status && status <= 599;
|
|
25
|
-
}
|
|
26
|
-
function isFetchResponse(data) {
|
|
27
|
-
if (!data || !data.hasOwnProperty('response')) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return data.response instanceof Response;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// tslint:disable-next-line no-any
|
|
34
|
-
|
|
35
|
-
// tslint:disable-next-line no-any
|
|
36
|
-
var defaultRetryIfCallback = function defaultRetryIfCallback(a) {
|
|
37
|
-
return !a;
|
|
38
|
-
};
|
|
39
|
-
var defaultOptions = {
|
|
40
|
-
initial: 200,
|
|
41
|
-
jitter: false,
|
|
42
|
-
max: 5,
|
|
43
|
-
retryIf: defaultRetryIfCallback
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Transparently wrap a function so that it is retried until it succeeds or reaches a max retry limit.
|
|
47
|
-
* The returned function has the same signature as the wrapped function.
|
|
48
|
-
*
|
|
49
|
-
* Modified from https://jsfiddle.net/pajtai/pLka0ow9/
|
|
50
|
-
*/
|
|
51
|
-
function withExponentialBackoff(toTry) {
|
|
52
|
-
var hofOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
|
|
53
|
-
var initial = hofOptions.initial,
|
|
54
|
-
jitter = hofOptions.jitter,
|
|
55
|
-
max = hofOptions.max,
|
|
56
|
-
retryIf = hofOptions.retryIf;
|
|
57
|
-
|
|
58
|
-
// Initialize max retry decrementing counter (range of max...0)
|
|
59
|
-
var attemptsRemaining = max;
|
|
60
|
-
|
|
61
|
-
// Initialize delay. This will exponentially increase each retry (delay = intial * 2^n)
|
|
62
|
-
var delay = initial;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* This function calls itself recursively until `retryIf` evaluates false or the retry limit is reached.
|
|
66
|
-
* The functioned-to-be-retried is called on each recursion.
|
|
67
|
-
*/
|
|
68
|
-
return /*#__PURE__*/function () {
|
|
69
|
-
var _tryWithExponentialBackoff = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
70
|
-
var result,
|
|
71
|
-
_args = arguments;
|
|
72
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
73
|
-
while (1) switch (_context.prev = _context.next) {
|
|
74
|
-
case 0:
|
|
75
|
-
_context.next = 2;
|
|
76
|
-
return toTry.apply(void 0, _args);
|
|
77
|
-
case 2:
|
|
78
|
-
result = _context.sent;
|
|
79
|
-
--attemptsRemaining;
|
|
80
|
-
|
|
81
|
-
// If tried function was unsuccessful and there are still retries remaining, retry!
|
|
82
|
-
if (!(retryIf && retryIf(result) && attemptsRemaining > 0)) {
|
|
83
|
-
_context.next = 9;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
_context.next = 7;
|
|
87
|
-
return new Promise(function (resolve) {
|
|
88
|
-
return setTimeout(resolve, jitter ? Math.random() * delay : delay);
|
|
89
|
-
});
|
|
90
|
-
case 7:
|
|
91
|
-
// Exponentially increase delay
|
|
92
|
-
delay *= 2;
|
|
93
|
-
|
|
94
|
-
// Initiate retry
|
|
95
|
-
return _context.abrupt("return", tryWithExponentialBackoff.apply(void 0, _args));
|
|
96
|
-
case 9:
|
|
97
|
-
return _context.abrupt("return", result);
|
|
98
|
-
case 10:
|
|
99
|
-
case "end":
|
|
100
|
-
return _context.stop();
|
|
101
|
-
}
|
|
102
|
-
}, _callee);
|
|
103
|
-
}));
|
|
104
|
-
function tryWithExponentialBackoff() {
|
|
105
|
-
return _tryWithExponentialBackoff.apply(this, arguments);
|
|
106
|
-
}
|
|
107
|
-
return tryWithExponentialBackoff;
|
|
108
|
-
}();
|
|
109
|
-
}
|
|
110
|
-
var fetchWithExponentialBackoff = exports.fetchWithExponentialBackoff = withExponentialBackoff(function (url, init) {
|
|
111
|
-
return fetch(url, init);
|
|
112
|
-
}, {
|
|
113
|
-
initial: EXPONENTIAL_BACKOFF_RETRY_POLICY.INITIAL_DELAY,
|
|
114
|
-
jitter: EXPONENTIAL_BACKOFF_RETRY_POLICY.JITTER,
|
|
115
|
-
max: EXPONENTIAL_BACKOFF_RETRY_POLICY.MAX_RETRIES,
|
|
116
|
-
retryIf: function retryIf(response) {
|
|
117
|
-
return is5xx(response.status);
|
|
118
|
-
}
|
|
119
|
-
});
|