@atlaskit/teams-public 0.72.2 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/next/ui/team-containers/add-container-card/index.js +2 -3
- package/dist/cjs/next/ui/team-containers/team-link-card/index.js +1 -2
- package/dist/es2019/next/ui/team-containers/add-container-card/index.js +2 -3
- package/dist/es2019/next/ui/team-containers/team-link-card/index.js +1 -2
- package/dist/esm/next/ui/team-containers/add-container-card/index.js +2 -3
- package/dist/esm/next/ui/team-containers/team-link-card/index.js +1 -2
- package/dist/types/common/utils/get-is-experiment-enabled.d.ts +9 -9
- package/dist/types/controllers/hooks/use-create-containers/index.d.ts +2 -2
- package/dist/types/controllers/hooks/use-team-containers/index.d.ts +6 -6
- package/dist/types/controllers/hooks/use-team-containers/multi-team.d.ts +6 -6
- package/dist/types/controllers/product-permission/main.d.ts +2 -1
- package/dist/types-ts4.5/common/utils/get-is-experiment-enabled.d.ts +9 -9
- package/dist/types-ts4.5/controllers/hooks/use-create-containers/index.d.ts +2 -2
- package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +6 -6
- package/dist/types-ts4.5/controllers/hooks/use-team-containers/multi-team.d.ts +6 -6
- package/dist/types-ts4.5/controllers/product-permission/main.d.ts +2 -1
- package/package.json +2 -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
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { USER_ARI_PREFIX } from '../types';
|
|
2
|
-
export var isUserARI = function isUserARI(ari) {
|
|
3
|
-
return ari.startsWith(USER_ARI_PREFIX);
|
|
4
|
-
};
|
|
5
|
-
export var toUserId = function toUserId(ari) {
|
|
6
|
-
if (isUserARI(ari)) {
|
|
7
|
-
return ari.replace(USER_ARI_PREFIX, '');
|
|
8
|
-
}
|
|
9
|
-
throw new Error('Invalid UserARI');
|
|
10
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { defineMessages, FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
5
|
-
import { Flex } from '@atlaskit/primitives/compiled';
|
|
6
|
-
export var getCreateContainerContactSupportFlag = function getCreateContainerContactSupportFlag() {
|
|
7
|
-
return {
|
|
8
|
-
id: 'teams-public.team-container.create-container.error.contact-support',
|
|
9
|
-
type: 'error',
|
|
10
|
-
title: /*#__PURE__*/React.createElement(FormattedMessage, messages.noConnectionTitle),
|
|
11
|
-
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.noConnectionDescription),
|
|
12
|
-
actions: [{
|
|
13
|
-
content: /*#__PURE__*/React.createElement(Flex, {
|
|
14
|
-
alignItems: "center",
|
|
15
|
-
columnGap: "space.100"
|
|
16
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.noConnectionAction), /*#__PURE__*/React.createElement(LinkExternalIcon, {
|
|
17
|
-
label: ""
|
|
18
|
-
})),
|
|
19
|
-
href: 'https://support.atlassian.com/contact/#/&support_type=customer'
|
|
20
|
-
}]
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export var getCreateContainerTryAgainFlag = function getCreateContainerTryAgainFlag(_ref) {
|
|
24
|
-
var tryAgainAction = _ref.tryAgainAction,
|
|
25
|
-
containerType = _ref.containerType;
|
|
26
|
-
return {
|
|
27
|
-
id: 'teams-public.team-container.create-container.error.try-again',
|
|
28
|
-
type: 'error',
|
|
29
|
-
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.timeoutTitle, {
|
|
30
|
-
values: {
|
|
31
|
-
containerType: containerType
|
|
32
|
-
}
|
|
33
|
-
})),
|
|
34
|
-
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.timeoutDescription),
|
|
35
|
-
actions: [{
|
|
36
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.timeoutAction),
|
|
37
|
-
onClick: function onClick() {
|
|
38
|
-
tryAgainAction === null || tryAgainAction === void 0 || tryAgainAction();
|
|
39
|
-
}
|
|
40
|
-
}]
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
var messages = defineMessages({
|
|
44
|
-
timeoutTitle: {
|
|
45
|
-
id: 'teams-public.team-containers.timeout-title',
|
|
46
|
-
defaultMessage: 'We’re couldn’t connect your {containerType}',
|
|
47
|
-
description: 'Title for the timeout flag'
|
|
48
|
-
},
|
|
49
|
-
timeoutDescription: {
|
|
50
|
-
id: 'teams-public.team-containers.timeout-description',
|
|
51
|
-
defaultMessage: 'Something went wrong. Verify your connection and retry.',
|
|
52
|
-
description: 'Description for the timeout flag'
|
|
53
|
-
},
|
|
54
|
-
timeoutAction: {
|
|
55
|
-
id: 'teams-public.team-containers.timeout-action',
|
|
56
|
-
defaultMessage: 'Try again',
|
|
57
|
-
description: 'Action text for the timeout flag'
|
|
58
|
-
},
|
|
59
|
-
noConnectionTitle: {
|
|
60
|
-
id: 'teams-public.team-containers.timeout-no-connection-title',
|
|
61
|
-
defaultMessage: 'Connection failed',
|
|
62
|
-
description: 'Title for the no connection flag'
|
|
63
|
-
},
|
|
64
|
-
noConnectionDescription: {
|
|
65
|
-
id: 'teams-public.team-containers.timeout-no-connection-description',
|
|
66
|
-
defaultMessage: 'Try manually creating the space yourself.',
|
|
67
|
-
description: 'Description for the no connection flag'
|
|
68
|
-
},
|
|
69
|
-
noConnectionAction: {
|
|
70
|
-
id: 'teams-public.team-containers.timeout-no-connection-action',
|
|
71
|
-
defaultMessage: 'Contact support',
|
|
72
|
-
description: 'Action text for the no connection flag'
|
|
73
|
-
}
|
|
74
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export declare enum StatusCode {
|
|
2
|
-
UNAUTHORIZED = 401,
|
|
3
|
-
FORBIDDEN = 403,
|
|
4
|
-
TIMEOUT = 408,
|
|
5
|
-
GONE = 410,
|
|
6
|
-
PAYLOAD_TOO_LARGE = 413
|
|
7
|
-
}
|
|
8
|
-
declare class CommonError extends Error {
|
|
9
|
-
message: string;
|
|
10
|
-
name: string;
|
|
11
|
-
stack: string;
|
|
12
|
-
constructor(message?: string);
|
|
13
|
-
}
|
|
14
|
-
export declare class DefaultError extends CommonError {
|
|
15
|
-
constructor({ message }: {
|
|
16
|
-
message?: string;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* These errors will not fail UFO experiences
|
|
21
|
-
*/
|
|
22
|
-
export declare class SLOIgnoreError extends CommonError {
|
|
23
|
-
constructor({ message }: {
|
|
24
|
-
message?: string;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
interface HttpErrorArguments {
|
|
28
|
-
message: string;
|
|
29
|
-
status: number;
|
|
30
|
-
traceId?: string;
|
|
31
|
-
path?: string;
|
|
32
|
-
}
|
|
33
|
-
export declare class HttpError extends CommonError {
|
|
34
|
-
status: number;
|
|
35
|
-
traceId?: string;
|
|
36
|
-
path?: string;
|
|
37
|
-
constructor({ message, status, traceId, path }: HttpErrorArguments);
|
|
38
|
-
}
|
|
39
|
-
interface ResultErrorData {
|
|
40
|
-
category: string;
|
|
41
|
-
message: string;
|
|
42
|
-
fields?: object;
|
|
43
|
-
}
|
|
44
|
-
interface FieldError {
|
|
45
|
-
message: string;
|
|
46
|
-
field: string;
|
|
47
|
-
}
|
|
48
|
-
export interface ErrorData {
|
|
49
|
-
category: string;
|
|
50
|
-
message: string;
|
|
51
|
-
fields?: FieldError[];
|
|
52
|
-
}
|
|
53
|
-
export declare class GraphQLError extends CommonError {
|
|
54
|
-
fields?: any;
|
|
55
|
-
category?: string;
|
|
56
|
-
constructor({ message, category, fields }: Partial<ResultErrorData>);
|
|
57
|
-
static from: (rawErrors: ErrorData[]) => GraphQLError;
|
|
58
|
-
}
|
|
59
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const EXPONENTIAL_BACKOFF_RETRY_POLICY: {
|
|
2
|
-
INITIAL_DELAY: number;
|
|
3
|
-
MAX_RETRIES: number;
|
|
4
|
-
JITTER: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Checks whether a status code is a 5xx HTTP code.
|
|
8
|
-
* @param {number} status HTTP status code
|
|
9
|
-
*/
|
|
10
|
-
export declare function is5xx(status: number): boolean;
|
|
11
|
-
export declare function isFetchResponse(data: unknown): data is {
|
|
12
|
-
response: Response;
|
|
13
|
-
};
|
|
14
|
-
type ToTryFunctionArgs = any[];
|
|
15
|
-
type ToTryFunction<T> = (...args: ToTryFunctionArgs) => Promise<T>;
|
|
16
|
-
type RetryIfCallback<T> = (a: T) => boolean;
|
|
17
|
-
interface WithExponentialBackoffOptions<T> {
|
|
18
|
-
initial: number;
|
|
19
|
-
jitter?: boolean;
|
|
20
|
-
max: number;
|
|
21
|
-
retryIf?: RetryIfCallback<T>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Transparently wrap a function so that it is retried until it succeeds or reaches a max retry limit.
|
|
25
|
-
* The returned function has the same signature as the wrapped function.
|
|
26
|
-
*
|
|
27
|
-
* Modified from https://jsfiddle.net/pajtai/pLka0ow9/
|
|
28
|
-
*/
|
|
29
|
-
export declare function withExponentialBackoff<ResponseType>(toTry: ToTryFunction<ResponseType>, hofOptions?: WithExponentialBackoffOptions<ResponseType>): (...args: ToTryFunctionArgs) => Promise<ResponseType>;
|
|
30
|
-
export declare const fetchWithExponentialBackoff: (...args: ToTryFunctionArgs) => Promise<Response>;
|
|
31
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Our REST clients are initialised when their module loads which makes it tricky for them to consume the `statusCodeHandlers` prop passed to App from the host application.
|
|
3
|
-
* This is a temporary measure to enable the clients to consume `statusCodeHandlers`.
|
|
4
|
-
* The long term solution is to replace our REST clients with Apollo client custom resolvers
|
|
5
|
-
* This will unify all remote data handling under the apollo-client module which is able to easily receive `statusCodeHandlers` as it is initialised within the React portion of our app.
|
|
6
|
-
*/
|
|
7
|
-
type StatusCodeHandler = (response: Response) => void;
|
|
8
|
-
export interface StatusCodeHandlerMap {
|
|
9
|
-
[statusCode: number]: StatusCodeHandler;
|
|
10
|
-
}
|
|
11
|
-
export declare const statusCodeHandlersProvider: {
|
|
12
|
-
handlers: StatusCodeHandlerMap;
|
|
13
|
-
get(): StatusCodeHandlerMap;
|
|
14
|
-
setHandlers(handlers: StatusCodeHandlerMap): void;
|
|
15
|
-
};
|
|
16
|
-
export declare function handleResponse(response: Response): void;
|
|
17
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FlagType } from './types';
|
|
3
|
-
export declare const getCreateContainerContactSupportFlag: () => {
|
|
4
|
-
id: string;
|
|
5
|
-
type: FlagType;
|
|
6
|
-
title: React.JSX.Element;
|
|
7
|
-
description: React.JSX.Element;
|
|
8
|
-
actions: {
|
|
9
|
-
content: React.JSX.Element;
|
|
10
|
-
href: string;
|
|
11
|
-
}[];
|
|
12
|
-
};
|
|
13
|
-
export declare const getCreateContainerTryAgainFlag: ({ tryAgainAction, containerType, }: {
|
|
14
|
-
tryAgainAction?: () => void;
|
|
15
|
-
containerType: string;
|
|
16
|
-
}) => {
|
|
17
|
-
id: string;
|
|
18
|
-
type: FlagType;
|
|
19
|
-
title: React.JSX.Element;
|
|
20
|
-
description: React.JSX.Element;
|
|
21
|
-
actions: {
|
|
22
|
-
content: React.JSX.Element;
|
|
23
|
-
onClick: () => void;
|
|
24
|
-
}[];
|
|
25
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export declare enum StatusCode {
|
|
2
|
-
UNAUTHORIZED = 401,
|
|
3
|
-
FORBIDDEN = 403,
|
|
4
|
-
TIMEOUT = 408,
|
|
5
|
-
GONE = 410,
|
|
6
|
-
PAYLOAD_TOO_LARGE = 413
|
|
7
|
-
}
|
|
8
|
-
declare class CommonError extends Error {
|
|
9
|
-
message: string;
|
|
10
|
-
name: string;
|
|
11
|
-
stack: string;
|
|
12
|
-
constructor(message?: string);
|
|
13
|
-
}
|
|
14
|
-
export declare class DefaultError extends CommonError {
|
|
15
|
-
constructor({ message }: {
|
|
16
|
-
message?: string;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* These errors will not fail UFO experiences
|
|
21
|
-
*/
|
|
22
|
-
export declare class SLOIgnoreError extends CommonError {
|
|
23
|
-
constructor({ message }: {
|
|
24
|
-
message?: string;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
interface HttpErrorArguments {
|
|
28
|
-
message: string;
|
|
29
|
-
status: number;
|
|
30
|
-
traceId?: string;
|
|
31
|
-
path?: string;
|
|
32
|
-
}
|
|
33
|
-
export declare class HttpError extends CommonError {
|
|
34
|
-
status: number;
|
|
35
|
-
traceId?: string;
|
|
36
|
-
path?: string;
|
|
37
|
-
constructor({ message, status, traceId, path }: HttpErrorArguments);
|
|
38
|
-
}
|
|
39
|
-
interface ResultErrorData {
|
|
40
|
-
category: string;
|
|
41
|
-
message: string;
|
|
42
|
-
fields?: object;
|
|
43
|
-
}
|
|
44
|
-
interface FieldError {
|
|
45
|
-
message: string;
|
|
46
|
-
field: string;
|
|
47
|
-
}
|
|
48
|
-
export interface ErrorData {
|
|
49
|
-
category: string;
|
|
50
|
-
message: string;
|
|
51
|
-
fields?: FieldError[];
|
|
52
|
-
}
|
|
53
|
-
export declare class GraphQLError extends CommonError {
|
|
54
|
-
fields?: any;
|
|
55
|
-
category?: string;
|
|
56
|
-
constructor({ message, category, fields }: Partial<ResultErrorData>);
|
|
57
|
-
static from: (rawErrors: ErrorData[]) => GraphQLError;
|
|
58
|
-
}
|
|
59
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const EXPONENTIAL_BACKOFF_RETRY_POLICY: {
|
|
2
|
-
INITIAL_DELAY: number;
|
|
3
|
-
MAX_RETRIES: number;
|
|
4
|
-
JITTER: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Checks whether a status code is a 5xx HTTP code.
|
|
8
|
-
* @param {number} status HTTP status code
|
|
9
|
-
*/
|
|
10
|
-
export declare function is5xx(status: number): boolean;
|
|
11
|
-
export declare function isFetchResponse(data: unknown): data is {
|
|
12
|
-
response: Response;
|
|
13
|
-
};
|
|
14
|
-
type ToTryFunctionArgs = any[];
|
|
15
|
-
type ToTryFunction<T> = (...args: ToTryFunctionArgs) => Promise<T>;
|
|
16
|
-
type RetryIfCallback<T> = (a: T) => boolean;
|
|
17
|
-
interface WithExponentialBackoffOptions<T> {
|
|
18
|
-
initial: number;
|
|
19
|
-
jitter?: boolean;
|
|
20
|
-
max: number;
|
|
21
|
-
retryIf?: RetryIfCallback<T>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Transparently wrap a function so that it is retried until it succeeds or reaches a max retry limit.
|
|
25
|
-
* The returned function has the same signature as the wrapped function.
|
|
26
|
-
*
|
|
27
|
-
* Modified from https://jsfiddle.net/pajtai/pLka0ow9/
|
|
28
|
-
*/
|
|
29
|
-
export declare function withExponentialBackoff<ResponseType>(toTry: ToTryFunction<ResponseType>, hofOptions?: WithExponentialBackoffOptions<ResponseType>): (...args: ToTryFunctionArgs) => Promise<ResponseType>;
|
|
30
|
-
export declare const fetchWithExponentialBackoff: (...args: ToTryFunctionArgs) => Promise<Response>;
|
|
31
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Our REST clients are initialised when their module loads which makes it tricky for them to consume the `statusCodeHandlers` prop passed to App from the host application.
|
|
3
|
-
* This is a temporary measure to enable the clients to consume `statusCodeHandlers`.
|
|
4
|
-
* The long term solution is to replace our REST clients with Apollo client custom resolvers
|
|
5
|
-
* This will unify all remote data handling under the apollo-client module which is able to easily receive `statusCodeHandlers` as it is initialised within the React portion of our app.
|
|
6
|
-
*/
|
|
7
|
-
type StatusCodeHandler = (response: Response) => void;
|
|
8
|
-
export interface StatusCodeHandlerMap {
|
|
9
|
-
[statusCode: number]: StatusCodeHandler;
|
|
10
|
-
}
|
|
11
|
-
export declare const statusCodeHandlersProvider: {
|
|
12
|
-
handlers: StatusCodeHandlerMap;
|
|
13
|
-
get(): StatusCodeHandlerMap;
|
|
14
|
-
setHandlers(handlers: StatusCodeHandlerMap): void;
|
|
15
|
-
};
|
|
16
|
-
export declare function handleResponse(response: Response): void;
|
|
17
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FlagType } from './types';
|
|
3
|
-
export declare const getCreateContainerContactSupportFlag: () => {
|
|
4
|
-
id: string;
|
|
5
|
-
type: FlagType;
|
|
6
|
-
title: React.JSX.Element;
|
|
7
|
-
description: React.JSX.Element;
|
|
8
|
-
actions: {
|
|
9
|
-
content: React.JSX.Element;
|
|
10
|
-
href: string;
|
|
11
|
-
}[];
|
|
12
|
-
};
|
|
13
|
-
export declare const getCreateContainerTryAgainFlag: ({ tryAgainAction, containerType, }: {
|
|
14
|
-
tryAgainAction?: () => void;
|
|
15
|
-
containerType: string;
|
|
16
|
-
}) => {
|
|
17
|
-
id: string;
|
|
18
|
-
type: FlagType;
|
|
19
|
-
title: React.JSX.Element;
|
|
20
|
-
description: React.JSX.Element;
|
|
21
|
-
actions: {
|
|
22
|
-
content: React.JSX.Element;
|
|
23
|
-
onClick: () => void;
|
|
24
|
-
}[];
|
|
25
|
-
};
|