@atlaskit/teams-client 4.33.5 → 5.0.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.
Files changed (154) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/agg-client/package.json +1 -8
  3. package/agg-client/types/package.json +1 -8
  4. package/ari/package.json +1 -8
  5. package/association/package.json +1 -8
  6. package/client/package.json +1 -8
  7. package/config/package.json +1 -8
  8. package/endpoints/package.json +1 -8
  9. package/error/package.json +1 -8
  10. package/generate-data/package.json +1 -8
  11. package/has-permission/package.json +1 -8
  12. package/initialise-sentry/package.json +1 -8
  13. package/legion-client/package.json +1 -8
  14. package/links/package.json +1 -8
  15. package/main/package.json +1 -8
  16. package/media/package.json +1 -8
  17. package/membership/package.json +1 -8
  18. package/mocks/package.json +1 -8
  19. package/package.json +5 -13
  20. package/permissions/package.json +1 -8
  21. package/permissions/types/package.json +1 -8
  22. package/public/package.json +1 -8
  23. package/reporting-lines-client/utils/types/package.json +1 -8
  24. package/sentry/main/package.json +1 -8
  25. package/sentry/package.json +1 -8
  26. package/sentry/types/package.json +1 -8
  27. package/slack/package.json +1 -8
  28. package/sort-teams/package.json +1 -8
  29. package/team/package.json +1 -8
  30. package/team-container/package.json +1 -8
  31. package/tenure/package.json +1 -8
  32. package/types/package.json +1 -8
  33. package/types/team/package.json +1 -8
  34. package/ufo/package.json +1 -8
  35. package/unlink-container-mutation/package.json +1 -8
  36. package/use-query-light/main/package.json +1 -8
  37. package/use-query-light/package.json +1 -8
  38. package/use-query-light/types/package.json +1 -8
  39. package/use-teams-client-setup/package.json +1 -8
  40. package/use-teams-sentry-client-setup/package.json +1 -8
  41. package/user/package.json +1 -8
  42. package/user-info-provider/main/package.json +1 -8
  43. package/user-info-provider/package.json +1 -8
  44. package/utils/package.json +1 -8
  45. package/dist/types-ts4.5/common/types.d.ts +0 -4
  46. package/dist/types-ts4.5/common/utils/ari.d.ts +0 -7
  47. package/dist/types-ts4.5/common/utils/error/index.d.ts +0 -91
  48. package/dist/types-ts4.5/common/utils/http.d.ts +0 -31
  49. package/dist/types-ts4.5/common/utils/index.d.ts +0 -2
  50. package/dist/types-ts4.5/common/utils/permissions/constants.d.ts +0 -30
  51. package/dist/types-ts4.5/common/utils/permissions/has-permission.d.ts +0 -40
  52. package/dist/types-ts4.5/common/utils/permissions/index.d.ts +0 -3
  53. package/dist/types-ts4.5/common/utils/permissions/types.d.ts +0 -31
  54. package/dist/types-ts4.5/common/utils/sort-teams.d.ts +0 -2
  55. package/dist/types-ts4.5/common/utils/status-code-handlers-provider.d.ts +0 -17
  56. package/dist/types-ts4.5/common/utils/team.d.ts +0 -5
  57. package/dist/types-ts4.5/common/utils/ufo/constants.d.ts +0 -82
  58. package/dist/types-ts4.5/common/utils/ufo/index.d.ts +0 -6
  59. package/dist/types-ts4.5/common/utils/ufo/utils.d.ts +0 -11
  60. package/dist/types-ts4.5/index.d.ts +0 -15
  61. package/dist/types-ts4.5/mocks/endpoints.d.ts +0 -22
  62. package/dist/types-ts4.5/mocks/generate-data.d.ts +0 -16
  63. package/dist/types-ts4.5/mocks/index.d.ts +0 -2
  64. package/dist/types-ts4.5/mocks/invitations.d.ts +0 -11
  65. package/dist/types-ts4.5/mocks/responses.d.ts +0 -75
  66. package/dist/types-ts4.5/mocks/team-link.d.ts +0 -7
  67. package/dist/types-ts4.5/mocks/team.d.ts +0 -14
  68. package/dist/types-ts4.5/mocks/user.d.ts +0 -15
  69. package/dist/types-ts4.5/mocks/with-faker.d.ts +0 -12
  70. package/dist/types-ts4.5/services/agg-client/index.d.ts +0 -36
  71. package/dist/types-ts4.5/services/agg-client/mocks/index.d.ts +0 -49
  72. package/dist/types-ts4.5/services/agg-client/types.d.ts +0 -13
  73. package/dist/types-ts4.5/services/agg-client/utils/mutations/unlink-container-mutation.d.ts +0 -18
  74. package/dist/types-ts4.5/services/agg-client/utils/queries/number-of-team-connected-to-container-query.d.ts +0 -11
  75. package/dist/types-ts4.5/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +0 -47
  76. package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +0 -52
  77. package/dist/types-ts4.5/services/agg-client/utils/queries/team-has-agents-query.d.ts +0 -15
  78. package/dist/types-ts4.5/services/agg-client/utils/queries/team-membership-query.d.ts +0 -33
  79. package/dist/types-ts4.5/services/agg-client/utils/queries/user-query.d.ts +0 -31
  80. package/dist/types-ts4.5/services/agg-client/utils/user-type.d.ts +0 -7
  81. package/dist/types-ts4.5/services/base-client/index.d.ts +0 -37
  82. package/dist/types-ts4.5/services/collaborationgraph-client/index.d.ts +0 -70
  83. package/dist/types-ts4.5/services/constants.d.ts +0 -2
  84. package/dist/types-ts4.5/services/directory-client/index.d.ts +0 -53
  85. package/dist/types-ts4.5/services/graphql-client/index.d.ts +0 -1
  86. package/dist/types-ts4.5/services/graphql-client/main.d.ts +0 -14
  87. package/dist/types-ts4.5/services/graphql-client/types.d.ts +0 -20
  88. package/dist/types-ts4.5/services/graphql-client/utils/index.d.ts +0 -3
  89. package/dist/types-ts4.5/services/hooks/use-teams-client-setup.d.ts +0 -14
  90. package/dist/types-ts4.5/services/identity-client/index.d.ts +0 -34
  91. package/dist/types-ts4.5/services/identity-client/utils.d.ts +0 -85
  92. package/dist/types-ts4.5/services/index.d.ts +0 -1
  93. package/dist/types-ts4.5/services/invitations-client/index.d.ts +0 -11
  94. package/dist/types-ts4.5/services/invitations-client/types.d.ts +0 -67
  95. package/dist/types-ts4.5/services/invitations-client/utils/index.d.ts +0 -7
  96. package/dist/types-ts4.5/services/invitations-client/utils/types.d.ts +0 -7
  97. package/dist/types-ts4.5/services/legion-client/index.d.ts +0 -164
  98. package/dist/types-ts4.5/services/legion-client/types.d.ts +0 -128
  99. package/dist/types-ts4.5/services/main.d.ts +0 -452
  100. package/dist/types-ts4.5/services/mutability-client/index.d.ts +0 -8
  101. package/dist/types-ts4.5/services/mutability-client/types.d.ts +0 -5
  102. package/dist/types-ts4.5/services/object-resolver-client/index.d.ts +0 -10
  103. package/dist/types-ts4.5/services/object-resolver-client/types.d.ts +0 -69
  104. package/dist/types-ts4.5/services/object-resolver-client/utils.d.ts +0 -18
  105. package/dist/types-ts4.5/services/perms-client/index.d.ts +0 -16
  106. package/dist/types-ts4.5/services/public-api-client/generated/data-contracts.d.ts +0 -112
  107. package/dist/types-ts4.5/services/public-api-client/index.d.ts +0 -41
  108. package/dist/types-ts4.5/services/replines-client/index.d.ts +0 -11
  109. package/dist/types-ts4.5/services/reporting-lines-client/index.d.ts +0 -11
  110. package/dist/types-ts4.5/services/reporting-lines-client/utils/queries/ReportingLinesQueryWithAccountStatus.graphql.d.ts +0 -2
  111. package/dist/types-ts4.5/services/reporting-lines-client/utils/types.d.ts +0 -32
  112. package/dist/types-ts4.5/services/rest-client/index.d.ts +0 -40
  113. package/dist/types-ts4.5/services/rest-client/utils/cookie.d.ts +0 -5
  114. package/dist/types-ts4.5/services/rest-client/utils/parse-error-message.d.ts +0 -1
  115. package/dist/types-ts4.5/services/rest-client/utils/parse-response.d.ts +0 -1
  116. package/dist/types-ts4.5/services/rest-client/utils/strip-uuid.d.ts +0 -1
  117. package/dist/types-ts4.5/services/sentry/constants.d.ts +0 -5
  118. package/dist/types-ts4.5/services/sentry/index.d.ts +0 -3
  119. package/dist/types-ts4.5/services/sentry/main.d.ts +0 -32
  120. package/dist/types-ts4.5/services/sentry/types.d.ts +0 -36
  121. package/dist/types-ts4.5/services/sentry/utils/get-sentry-config.d.ts +0 -2
  122. package/dist/types-ts4.5/services/sentry/utils/initialise-sentry.d.ts +0 -2
  123. package/dist/types-ts4.5/services/sentry/utils/sentry-client.d.ts +0 -9
  124. package/dist/types-ts4.5/services/sentry/utils/use-teams-sentry-client-setup.d.ts +0 -3
  125. package/dist/types-ts4.5/services/team-central-client/index.d.ts +0 -26
  126. package/dist/types-ts4.5/services/team-central-client/mutations/add-team-watcher.graphql.d.ts +0 -9
  127. package/dist/types-ts4.5/services/team-central-client/mutations/create-tag-mutation.graphql.d.ts +0 -12
  128. package/dist/types-ts4.5/services/team-central-client/mutations/help-pointer-create-mutation.graphql.d.ts +0 -20
  129. package/dist/types-ts4.5/services/team-central-client/mutations/help-pointer-delete-mutation.graphql.d.ts +0 -7
  130. package/dist/types-ts4.5/services/team-central-client/mutations/help-pointer-update-mutation.graphql.d.ts +0 -21
  131. package/dist/types-ts4.5/services/team-central-client/mutations/kudos-delete-mutation.graphql.d.ts +0 -10
  132. package/dist/types-ts4.5/services/team-central-client/mutations/remove-team-watcher.graphql.d.ts +0 -9
  133. package/dist/types-ts4.5/services/team-central-client/queries/is-team-watcher.graphql.d.ts +0 -8
  134. package/dist/types-ts4.5/services/team-central-client/queries/tag-list-query.graphql.d.ts +0 -24
  135. package/dist/types-ts4.5/services/team-central-client/utils.d.ts +0 -2
  136. package/dist/types-ts4.5/services/teams-in-slack-client/index.d.ts +0 -27
  137. package/dist/types-ts4.5/services/types.d.ts +0 -10
  138. package/dist/types-ts4.5/services/use-query-light/index.d.ts +0 -3
  139. package/dist/types-ts4.5/services/use-query-light/main.d.ts +0 -7
  140. package/dist/types-ts4.5/services/use-query-light/types.d.ts +0 -57
  141. package/dist/types-ts4.5/services/user-info-provider/index.d.ts +0 -1
  142. package/dist/types-ts4.5/services/user-info-provider/main.d.ts +0 -14
  143. package/dist/types-ts4.5/services/user-preferences-client/index.d.ts +0 -9
  144. package/dist/types-ts4.5/types/association.d.ts +0 -8
  145. package/dist/types-ts4.5/types/config.d.ts +0 -7
  146. package/dist/types-ts4.5/types/index.d.ts +0 -16
  147. package/dist/types-ts4.5/types/links.d.ts +0 -31
  148. package/dist/types-ts4.5/types/media.d.ts +0 -6
  149. package/dist/types-ts4.5/types/membership.d.ts +0 -35
  150. package/dist/types-ts4.5/types/slack.d.ts +0 -7
  151. package/dist/types-ts4.5/types/team-container.d.ts +0 -29
  152. package/dist/types-ts4.5/types/team.d.ts +0 -188
  153. package/dist/types-ts4.5/types/tenure.d.ts +0 -5
  154. package/dist/types-ts4.5/types/user.d.ts +0 -55
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/services/sentry/utils/use-teams-sentry-client-setup.js",
5
5
  "module:es2019": "../dist/es2019/services/sentry/utils/use-teams-sentry-client-setup.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/services/sentry/utils/use-teams-sentry-client-setup.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/services/sentry/utils/use-teams-sentry-client-setup.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/services/sentry/utils/use-teams-sentry-client-setup.d.ts"
15
8
  }
package/user/package.json CHANGED
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/types/user.js",
5
5
  "module:es2019": "../dist/es2019/types/user.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types/user.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/types/user.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/types/user.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../../dist/esm/services/user-info-provider/main.js",
5
5
  "module:es2019": "../../dist/es2019/services/user-info-provider/main.js",
6
6
  "sideEffects": false,
7
- "types": "../../dist/types/services/user-info-provider/main.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../../dist/types-ts4.5/services/user-info-provider/main.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../../dist/types/services/user-info-provider/main.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/services/user-info-provider/index.js",
5
5
  "module:es2019": "../dist/es2019/services/user-info-provider/index.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/services/user-info-provider/index.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/services/user-info-provider/index.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/services/user-info-provider/index.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/common/utils/index.js",
5
5
  "module:es2019": "../dist/es2019/common/utils/index.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/common/utils/index.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/common/utils/index.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/common/utils/index.d.ts"
15
8
  }
@@ -1,4 +0,0 @@
1
- export declare const USER_ARI_PREFIX: "ari:cloud:identity::user/";
2
- export type UserARI = `${typeof USER_ARI_PREFIX}${string}`;
3
- export declare const TEAM_ARI_PREFIX: "ari:cloud:identity::team/";
4
- export type TeamARI = `${typeof TEAM_ARI_PREFIX}${string}`;
@@ -1,7 +0,0 @@
1
- import { type TeamARI, type UserARI } from '../types';
2
- export declare const isUserARI: (ari: string) => ari is UserARI;
3
- export declare const toUserId: (ari: UserARI | string) => string;
4
- export declare const toUserARI: (userId: string) => UserARI;
5
- export declare const isTeamARI: (ari: string) => ari is TeamARI;
6
- export declare const toTeamId: (ari: TeamARI | string) => string;
7
- export declare const toTeamARI: (teamId: string) => TeamARI;
@@ -1,91 +0,0 @@
1
- export declare enum ErrorCategory {
2
- NotFound = "NotFound",
3
- NotPermitted = "NotPermitted",
4
- MalformedInput = "MalformedInput",
5
- Internal = "Internal"
6
- }
7
- export declare enum StatusCode {
8
- UNAUTHORIZED = 401,
9
- FORBIDDEN = 403,
10
- TIMEOUT = 408,
11
- GONE = 410,
12
- PAYLOAD_TOO_LARGE = 413
13
- }
14
- export declare function isAuthError(error?: Error | HttpError): boolean;
15
- export declare function isErrorStatusCode(statusCode: number, error?: Error | HttpError): boolean;
16
- export declare function doesErrorContainStatus(statusCode: number, message: string): boolean;
17
- export type DirectoryErrorCode = 'MISSING_ERROR_MESSAGE';
18
- export declare enum TeamErrorType {
19
- TEAM_NOT_ACTIVE = "Team must be active"
20
- }
21
- export type ErrorObjectType = {
22
- code?: string;
23
- message?: TeamErrorType;
24
- };
25
- export type SingleError = {
26
- status?: number;
27
- error?: string;
28
- };
29
- export type RestJsonErrorResponse = {
30
- errors: (TeamErrorType | ErrorObjectType)[];
31
- timestamp?: string;
32
- } & SingleError;
33
- declare class CommonError extends Error {
34
- message: string;
35
- name: string;
36
- stack: string;
37
- constructor(message?: string);
38
- }
39
- export declare class DefaultError extends CommonError {
40
- constructor({ message }: {
41
- message?: string;
42
- });
43
- }
44
- /**
45
- * These errors will not fail UFO experiences
46
- */
47
- export declare class SLOIgnoreError extends CommonError {
48
- constructor({ message }: {
49
- message?: string;
50
- });
51
- }
52
- interface HttpErrorArguments {
53
- message: string;
54
- status: number;
55
- traceId?: string;
56
- path?: string;
57
- }
58
- export declare class HttpError extends CommonError {
59
- status: number;
60
- traceId?: string;
61
- path?: string;
62
- constructor({ message, status, traceId, path }: HttpErrorArguments);
63
- }
64
- /**
65
- * These errors will not fail UFO experiences
66
- */
67
- export declare class SLOIgnoreHttpError extends HttpError {
68
- constructor(props: HttpErrorArguments);
69
- }
70
- interface ResultErrorData {
71
- category: string;
72
- message: string;
73
- fields?: object;
74
- }
75
- interface FieldError {
76
- message: string;
77
- field: string;
78
- }
79
- export interface ErrorData {
80
- category: string;
81
- message: string;
82
- fields?: FieldError[];
83
- }
84
- export declare class GraphQLError extends CommonError {
85
- fields?: any;
86
- category?: string;
87
- constructor({ message, category, fields }: Partial<ResultErrorData>);
88
- static from: (rawErrors: ErrorData[]) => GraphQLError;
89
- }
90
- export declare function isNetworkError(error: Error): boolean;
91
- 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,2 +0,0 @@
1
- export { sortMembersByType } from './sort-teams';
2
- export { isInvited, isMember, isNonMember, isRequestingJoin } from './team';
@@ -1,30 +0,0 @@
1
- import { type ExternalReferenceSource, type TeamMembershipSettings, type TeamPermission, type TeamState } from '../../../types/team';
2
- import { type TeamAction } from './types';
3
- export type PermissionMap = Required<Record<TeamAction, boolean>>;
4
- export declare const allPermissions: (defaultPermission: boolean, isMember: boolean, isOrgAdmin: boolean) => PermissionMap;
5
- export declare const vanityActions: TeamAction[];
6
- /**
7
- * This is really just required so we don't show things like "Request to join team" if the team is open
8
- */
9
- export declare const openPermissions: (permission: TeamPermission | undefined) => {
10
- JOIN_TEAM: boolean;
11
- REQUEST_TO_JOIN: boolean;
12
- CANCEL_JOIN_REQUEST: boolean;
13
- APPROVE_JOIN_REQUEST: boolean;
14
- REJECT_JOIN_REQUEST: boolean;
15
- };
16
- /**
17
- * This is really just required so we don't show things like "Join team" if the team is member invite and it should say "Request to join team"
18
- */
19
- export declare const inviteOnlyPermissions: (permission: TeamPermission | undefined) => {
20
- REQUEST_TO_JOIN: boolean;
21
- CANCEL_JOIN_REQUEST: boolean;
22
- };
23
- export declare const SCIMSyncTeamPermissions: (isMember: boolean, isOrgAdmin: boolean, source?: ExternalReferenceSource) => {
24
- EDIT_DESCRIPTION: boolean;
25
- EDIT_TEAM_SETTINGS: boolean;
26
- EDIT_TEAM_LINK: boolean;
27
- EDIT_TEAM_NAME: boolean;
28
- CAN_EDIT_HIERARCHY: boolean;
29
- };
30
- export declare const getPermissionMap: (settings: TeamMembershipSettings, permission: TeamPermission | undefined, isMember: boolean, isOrgAdmin: boolean, source?: ExternalReferenceSource, state?: TeamState) => PermissionMap;
@@ -1,40 +0,0 @@
1
- import { type TeamMembership } from '../../../types/membership';
2
- import { type ExternalReferenceSource, type TeamMembershipSettings, type TeamPermission, type TeamState } from '../../../types/team';
3
- import { type TeamAction, type TeamPermissions } from './types';
4
- /**
5
- * @deprecated use import { userCan } from '@atlassian/teams-app-internal-user-permissions';
6
- */
7
- export declare function hasPermission(action: TeamAction, settings: TeamMembershipSettings, permission: TeamPermission | undefined, isPeopleBrowseEnabled: boolean, currentUserMembership: TeamMembership | undefined, teamVisibilityPermissions?: TeamPermissions, source?: ExternalReferenceSource, state?: TeamState): boolean;
8
- type PermissionOptions = {
9
- /**
10
- * The teams membership settings, "OPEN" | "MEMBER_INVITE" | "EXTERNAL"
11
- */
12
- membershipSettings: TeamMembershipSettings;
13
- /**
14
- * The users permission for the team, "FULL_WRITE" | "FULL_READ" | "NONE"
15
- */
16
- teamPermission: TeamPermission | undefined;
17
- /**
18
- * Is the user a member of the team
19
- */
20
- isMemberOfTeam: boolean;
21
- /**
22
- * Is the user an org admin
23
- */
24
- isOrgAdmin: boolean;
25
- /**
26
- * External source(if any) "ATLASSIAN_GROUP" | "HRIS"
27
- */
28
- source?: ExternalReferenceSource;
29
- state?: TeamState;
30
- };
31
- /**
32
- * Determines if a user has permission perform a given action on a team
33
- * @deprecated use import { userCan } from '@atlassian/teams-app-internal-user-permissions';
34
- */
35
- export declare function userCan(action: TeamAction, options: PermissionOptions): boolean;
36
- /**
37
- * @deprecated Use `userCan` instead, it gives better visibility into the option mappings
38
- */
39
- export declare function hasPermissionForAction(action: TeamAction, settings: TeamMembershipSettings, permission: TeamPermission | undefined, isMemberOfTeam: boolean, isOrgAdmin?: boolean): boolean;
40
- export {};
@@ -1,3 +0,0 @@
1
- export { hasPermission, hasPermissionForAction, userCan } from './has-permission';
2
- export { AllTeamActions } from './types';
3
- export type { TeamAction } from './types';
@@ -1,31 +0,0 @@
1
- export declare const AllTeamActions: readonly [
2
- "ADD_MEMBER_TO_TEAM",
3
- "JOIN_TEAM",
4
- "REQUEST_TO_JOIN",
5
- "CANCEL_JOIN_REQUEST",
6
- "APPROVE_JOIN_REQUEST",
7
- "REJECT_JOIN_REQUEST",
8
- "REMOVE_MEMBER_FROM_TEAM",
9
- "CANCEL_INVITE",
10
- "LEAVE_TEAM",
11
- "REMOVE_AGENT_FROM_TEAM",
12
- "ADD_AGENT_TO_TEAM",
13
- "CAN_EDIT_HIERARCHY",
14
- "CAN_CHANGE_MEMBERSHIP_SETTINGS",
15
- "EDIT_TEAM_NAME",
16
- "EDIT_DESCRIPTION",
17
- "EDIT_PROFILE_HEADER",
18
- "EDIT_TEAM_LINK",
19
- "EDIT_TEAM_SETTINGS",
20
- "EDIT_TEAM_MEMBERSHIP",
21
- "EDIT_TEAM_TYPE",
22
- "DELETE_TEAM",
23
- "ARCHIVE_TEAM",
24
- "UNARCHIVE_TEAM"
25
- ];
26
- export type TeamAction = (typeof AllTeamActions)[number];
27
- export type TeamPermissions = {
28
- canCreateTeams: boolean;
29
- canViewTeams: boolean;
30
- canAdminTeams?: boolean;
31
- };
@@ -1,2 +0,0 @@
1
- import { type TeamMembership } from '../../types';
2
- export declare const sortMembersByType: (members: TeamMembership[], currentAccountId?: string) => TeamMembership[];
@@ -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,5 +0,0 @@
1
- import { type TeamMembership } from '../../types';
2
- export declare function isInvited(member?: TeamMembership): member is TeamMembership & boolean;
3
- export declare const isNonMember: (member?: TeamMembership) => boolean;
4
- export declare const isRequestingJoin: (member?: TeamMembership) => boolean;
5
- export declare const isMember: (member?: TeamMembership) => boolean;
@@ -1,82 +0,0 @@
1
- import { TeamsUFOExperience } from './index';
2
- declare const TeamsClientExperienceKeyList: readonly [
3
- "getAllTeams",
4
- "getTeamById",
5
- "updateTeamById",
6
- "querySettings",
7
- "queryFeatureFlags",
8
- "queryTeamMemberships",
9
- "queryUser",
10
- "inviteUsersToTeam",
11
- "getMyTeamMembership",
12
- "getTeamLinksByTeamId",
13
- "createTeamLink",
14
- "updateTeamLink",
15
- "deleteTeamLink",
16
- "reorderTeamLink",
17
- "acceptTeamInvitation",
18
- "declineTeamInvitation",
19
- "selfJoinTeam",
20
- "cancelJoinRequest",
21
- "acceptJoinRequest",
22
- "declineJoinRequest",
23
- "deleteTeamMembership",
24
- "revokeTeamInvite",
25
- "deleteTeam",
26
- "archiveTeam",
27
- "unarchiveTeam",
28
- "unlinkTeamFromGroup",
29
- "isSingleFullMemberTeam",
30
- "createTeam",
31
- "createTeamContainers",
32
- "createExternalTeam",
33
- "getProfileWithMutability",
34
- "getIsSiteAdmin",
35
- "addUsersToTeam",
36
- "removeTeamMemberships",
37
- "getRecommendedProducts",
38
- "joinOrRequestDefaultAccessToProductsBulk",
39
- "getReadMediaToken",
40
- "getWriteUserMediaToken",
41
- "updateUserHeaderImage",
42
- "getWriteTeamMediaToken",
43
- "getSoftDeletedTeamById",
44
- "restoreTeam",
45
- "getUserInSiteUserBase",
46
- "getLinkedTeamsBulk",
47
- "getTeamProfileDetails",
48
- "getUserContainers",
49
- "getRecommendedUsers",
50
- "getPermissions",
51
- "getUserManageConfig",
52
- "getMyAvatarUploadedStatus",
53
- "deleteUserAvatar",
54
- "getTeamLinkIcons",
55
- "getTeamInSlack",
56
- "getOrgScope",
57
- "restoreTeamToSyncedGroup",
58
- "getTeamAndGroupDiff",
59
- "linkExistingTeamToGroup",
60
- "fetchUserAvatarInfo",
61
- "getOrgEligibilityForManagedTeams",
62
- "updateUser",
63
- "updateUserAvatar",
64
- "disconnectTeamInSlack",
65
- "updateTeamInSlack",
66
- "getUserTenure",
67
- "getAriFromUrl",
68
- "getWebLinkTitle",
69
- "addAgentToTeam",
70
- "getTeamEnabledSites",
71
- "assignTeamsToSites",
72
- "removeAgentTeamAssociation",
73
- "getAssignedTeams",
74
- "setTeamSiteAssignmentPermission",
75
- "getUnassignedTeams",
76
- "getTeamSiteAssignmentOrgDetails",
77
- "getTeamsToBeClonedToJsmSites",
78
- "getReportingLines"
79
- ];
80
- export type TeamsClientExperienceKeys = (typeof TeamsClientExperienceKeyList)[number];
81
- export declare const TEAMS_CLIENT_EXPERIENCES: Map<'getAllTeams' | 'getTeamById' | 'updateTeamById' | 'querySettings' | 'queryFeatureFlags' | 'queryTeamMemberships' | 'queryUser' | 'inviteUsersToTeam' | 'getMyTeamMembership' | 'getTeamLinksByTeamId' | 'createTeamLink' | 'updateTeamLink' | 'deleteTeamLink' | 'reorderTeamLink' | 'acceptTeamInvitation' | 'declineTeamInvitation' | 'selfJoinTeam' | 'cancelJoinRequest' | 'acceptJoinRequest' | 'declineJoinRequest' | 'deleteTeamMembership' | 'revokeTeamInvite' | 'deleteTeam' | 'archiveTeam' | 'unarchiveTeam' | 'unlinkTeamFromGroup' | 'isSingleFullMemberTeam' | 'createTeam' | 'createTeamContainers' | 'createExternalTeam' | 'getProfileWithMutability' | 'getIsSiteAdmin' | 'addUsersToTeam' | 'removeTeamMemberships' | 'getRecommendedProducts' | 'joinOrRequestDefaultAccessToProductsBulk' | 'getReadMediaToken' | 'getWriteUserMediaToken' | 'updateUserHeaderImage' | 'getWriteTeamMediaToken' | 'getSoftDeletedTeamById' | 'restoreTeam' | 'getUserInSiteUserBase' | 'getLinkedTeamsBulk' | 'getTeamProfileDetails' | 'getUserContainers' | 'getRecommendedUsers' | 'getPermissions' | 'getUserManageConfig' | 'getMyAvatarUploadedStatus' | 'deleteUserAvatar' | 'getTeamLinkIcons' | 'getTeamInSlack' | 'getOrgScope' | 'restoreTeamToSyncedGroup' | 'getTeamAndGroupDiff' | 'linkExistingTeamToGroup' | 'fetchUserAvatarInfo' | 'getOrgEligibilityForManagedTeams' | 'updateUser' | 'updateUserAvatar' | 'disconnectTeamInSlack' | 'updateTeamInSlack' | 'getUserTenure' | 'getAriFromUrl' | 'getWebLinkTitle' | 'addAgentToTeam' | 'getTeamEnabledSites' | 'assignTeamsToSites' | 'removeAgentTeamAssociation' | 'getAssignedTeams' | 'setTeamSiteAssignmentPermission' | 'getUnassignedTeams' | 'getTeamSiteAssignmentOrgDetails' | 'getTeamsToBeClonedToJsmSites' | 'getReportingLines', TeamsUFOExperience>;
82
- export {};
@@ -1,6 +0,0 @@
1
- import { UFOExperience } from '@atlaskit/ufo';
2
- import { type HttpError } from '../error';
3
- export declare class TeamsUFOExperience extends UFOExperience {
4
- abortWithError(error: Error | HttpError, reason: string): Promise<boolean | null>;
5
- failWithError(error: Error | HttpError | unknown): Promise<boolean | null>;
6
- }
@@ -1,11 +0,0 @@
1
- import { HttpError } from '../error';
2
- export declare const createErrorMetadata: (error: Error | HttpError) => {
3
- error: {
4
- name: string;
5
- message: string;
6
- stack: string | undefined;
7
- traceId: string | undefined;
8
- status: number | undefined;
9
- };
10
- };
11
- export declare const isIgnoredError: (error: Error) => boolean;
@@ -1,15 +0,0 @@
1
- export { HttpError } from './common/utils/error';
2
- export type { AllTeamsQuery, OriginQuery } from './services/legion-client';
3
- export { isTeamMembershipWithUser } from './types/membership';
4
- export { teamsClient, TeamsClient } from './services';
5
- export { useTeamsClientSetup, useTeamsClientSetupNext, } from './services/hooks/use-teams-client-setup';
6
- export { AllTeamActions, hasPermission } from './common/utils/permissions';
7
- export type { TeamAction } from './common/utils/permissions';
8
- export { initialiseSentry } from './services/sentry/utils/initialise-sentry';
9
- export { logException, logInfoMessage } from './services/sentry/main';
10
- export type { SentryClient } from './services/sentry/types';
11
- export { userInfoProvider, UserInfoProvider } from './services/user-info-provider';
12
- export { sortMembersByType, isInvited, isMember, isNonMember, isRequestingJoin, } from './common/utils';
13
- export { toUserARI, toUserId, toTeamARI, toTeamId } from './common/utils/ari';
14
- export { useLazyQueryLight, useQueryLight, UseQueryLightError, type ActualGraphQLError, } from './services/use-query-light';
15
- export type { FetchMoreArgs, QueryOptions } from './services/use-query-light';
@@ -1,22 +0,0 @@
1
- import type FakerType from 'faker';
2
- import type fetchMockType from 'fetch-mock/cjs/client';
3
- type MockConfig = {
4
- fetchMock: typeof fetchMockType;
5
- delay?: number;
6
- faker?: typeof FakerType;
7
- restoreFetchMock?: boolean;
8
- endpointConfig?: {
9
- teamMembership?: MockTeamMembershipConfig;
10
- teamType?: 'open' | 'inviteOnly' | 'external';
11
- memberStatus?: 'requestingToJoin' | 'notMember' | 'fullMember';
12
- };
13
- };
14
- type MockTeamMembershipConfig = {
15
- count?: number;
16
- };
17
- export declare const mockTeamsClientEndpoints: (config: MockConfig) => void;
18
- export declare const mockTeamsClientRequestingToJoinEndpoints: (config: MockConfig) => void;
19
- export declare const mockTeamsClientNotMemberEndpoints: (config: MockConfig) => void;
20
- export declare const mockTeamsClientAdminEndpoints: (config: MockConfig) => void;
21
- export declare const mockTeamsClientInviteOnlyMemberEndpoints: (config: MockConfig) => void;
22
- export {};
@@ -1,16 +0,0 @@
1
- import type FakerType from 'faker';
2
- import { type TeamMembershipQueryResponse } from '../services/agg-client/utils/queries/team-membership-query';
3
- import { type Team, type TeamMembership } from '../types';
4
- type MockConfig = {
5
- faker: typeof FakerType;
6
- };
7
- export declare const randomTeamMembership: ({ faker }: MockConfig, customProps?: {}) => TeamMembership;
8
- export declare const randomTeamMemberships: (config: MockConfig, n?: number, customProps?: {}) => TeamMembership[];
9
- export declare const fixedTeamMemberships: (n?: number) => TeamMembership[];
10
- export declare function randomReturnedNewTeamData({ faker }: MockConfig, customProps?: Partial<Team>): Team;
11
- export declare const mockTeamMembershipResponseWithNEdges: ({ faker }: MockConfig, n: number) => {
12
- data: {
13
- team: TeamMembershipQueryResponse;
14
- };
15
- };
16
- export {};
@@ -1,2 +0,0 @@
1
- export { mockTeamsClientEndpoints, mockTeamsClientRequestingToJoinEndpoints, mockTeamsClientAdminEndpoints, mockTeamsClientNotMemberEndpoints, mockTeamsClientInviteOnlyMemberEndpoints, } from './endpoints';
2
- export { randomReturnedNewTeamData, randomTeamMembership, randomTeamMemberships, fixedTeamMemberships, } from './generate-data';
@@ -1,11 +0,0 @@
1
- export declare const getJoinOrRequestDefaultAccessToProductsBulkSuccessResponse: (aris: string[]) => {
2
- ari: string;
3
- result: string;
4
- resultsV2: {
5
- [x: string]: {
6
- accessMode: string;
7
- role: string;
8
- }[];
9
- };
10
- errorReason: null;
11
- }[];
@@ -1,75 +0,0 @@
1
- import { type TeamMembershipQueryResponse } from '../services/agg-client/utils/queries/team-membership-query';
2
- import { type RecommendationsResponse } from '../services/invitations-client/types';
3
- import { type LegionTeamGetResponseV4 } from '../services/legion-client/types';
4
- import { type TeamMembership } from '../types';
5
- export declare const MOCK_ME_RESPONSE: {
6
- email: string;
7
- nickname: string;
8
- characteristics: {
9
- not_mentionable: null;
10
- };
11
- extended_profile: {
12
- job_title: string;
13
- organization: string;
14
- department: string;
15
- location: string;
16
- };
17
- account_id: string;
18
- name: string;
19
- zoneinfo: string;
20
- locale: string;
21
- privacy_settings: {
22
- name: string;
23
- nickname: string;
24
- picture: string;
25
- job_title: string;
26
- department: string;
27
- organization: string;
28
- location: string;
29
- zoneinfo: string;
30
- email: string;
31
- phone_number: string;
32
- team_type: string;
33
- };
34
- picture: any;
35
- account_type: string;
36
- account_status: string;
37
- };
38
- export declare const MOCK_PROFILE_MUTABILITY_RESPONSE: {
39
- account_id: string;
40
- account_type: string;
41
- account_status: string;
42
- characteristics: {
43
- not_mentionable: null;
44
- };
45
- email: string;
46
- extended_profile: {
47
- job_title: string;
48
- organization: string;
49
- department: string;
50
- location: string;
51
- };
52
- locale: string;
53
- last_updated: string;
54
- name: string;
55
- nickname: string;
56
- not_editable: {
57
- field: string;
58
- reason: string;
59
- }[];
60
- picture: any;
61
- };
62
- export declare const MOCK_MEMBERS_ME_MEMBER_RESPONSE: TeamMembership;
63
- export declare const MOCK_MEMBERS_ME_ADMIN_RESPONSE: TeamMembership;
64
- export declare const MOCK_MEMBERS_ME_REQUESTING_RESPONSE: TeamMembership;
65
- export declare const MOCK_TEAM_MEMBERSHIP_RESPONSE: {
66
- data: {
67
- team: TeamMembershipQueryResponse;
68
- };
69
- };
70
- export declare const MOCK_INVITE_ONLY_TEAM_RESPONSE: LegionTeamGetResponseV4;
71
- export declare const MOCK_EXTERNAL_TEAM_RESPONSE: LegionTeamGetResponseV4;
72
- export declare const MOCK_INVITE_ONLY_TEAM_WRITE_PERMISSION_RESPONSE: LegionTeamGetResponseV4;
73
- export declare const MOCK_OPEN_TEAM_RESPONSE: LegionTeamGetResponseV4;
74
- export declare const MOCK_OPEN_TEAM_WRITE_PERMISSION_RESPONSE: LegionTeamGetResponseV4;
75
- export declare const MOCK_PRODUCT_RECOMMENDATIONS_RESPONSE: RecommendationsResponse;
@@ -1,7 +0,0 @@
1
- import type FakerType from 'faker';
2
- import { type TeamLink } from '../types';
3
- type MockConfig = {
4
- faker: typeof FakerType;
5
- };
6
- export declare const randomTeamLinks: ({ faker }: MockConfig) => (n?: number, customProps?: {}) => TeamLink[];
7
- export {};
@@ -1,14 +0,0 @@
1
- import type FakerType from 'faker';
2
- import { type TeamMembership, type TeamWithMemberships } from '../types/membership';
3
- import { type Team, type TeamAvatarImage, type TeamWithImageUrls } from '../types/team';
4
- type MockConfig = {
5
- faker: typeof FakerType;
6
- };
7
- export declare const randomTeamMembership: ({ faker }: MockConfig) => (customProps?: {}) => TeamMembership;
8
- export declare const randomTeamMemberships: (config: MockConfig) => (n?: number, customProps?: {}) => TeamMembership[];
9
- export declare const randomHeaderImage: ({ faker }: MockConfig) => () => string;
10
- export declare const randomTeamImages: ({ faker }: MockConfig) => (customImage?: string) => TeamAvatarImage;
11
- export declare const randomBasicTeam: ({ faker }: MockConfig) => (customProps?: {}) => Team;
12
- export declare const randomFullTeam: ({ faker }: MockConfig) => (customProps?: {}) => TeamWithImageUrls;
13
- export declare const randomTeamWithMemberships: ({ faker }: MockConfig) => (team: TeamWithImageUrls, customProps?: {}) => TeamWithMemberships;
14
- export {};
@@ -1,15 +0,0 @@
1
- import type FakerType from 'faker';
2
- import { type TeamsClientUser as User } from '../types/user';
3
- type MockConfig = {
4
- faker: typeof FakerType;
5
- };
6
- export declare const createUser: (id: string, customProps?: {}) => User;
7
- export declare const randomUser: ({ faker }: MockConfig, customProps?: {}) => User;
8
- export declare const randomUsers: (n: number | undefined, config: MockConfig) => User[];
9
- export declare const fixedUsers: (n?: number) => User[];
10
- export declare const JohnWick: User;
11
- export declare const DenzelWashington: User;
12
- export declare const ClosedUser: User;
13
- export declare const InactiveUser: User;
14
- export declare const AgentUser: User;
15
- export {};