@atlaskit/teams-client 4.33.5 → 5.0.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.
Files changed (164) hide show
  1. package/CHANGELOG.md +35 -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/dist/cjs/common/utils/ufo/index.js +2 -2
  9. package/dist/cjs/services/collaborationgraph-client/index.js +10 -23
  10. package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
  11. package/dist/es2019/common/utils/ufo/index.js +2 -2
  12. package/dist/es2019/services/collaborationgraph-client/index.js +8 -17
  13. package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
  14. package/dist/esm/common/utils/ufo/index.js +2 -2
  15. package/dist/esm/services/collaborationgraph-client/index.js +10 -23
  16. package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
  17. package/dist/types/services/collaborationgraph-client/index.d.ts +2 -10
  18. package/endpoints/package.json +1 -8
  19. package/error/package.json +1 -8
  20. package/generate-data/package.json +1 -8
  21. package/has-permission/package.json +1 -8
  22. package/initialise-sentry/package.json +1 -8
  23. package/legion-client/package.json +1 -8
  24. package/links/package.json +1 -8
  25. package/main/package.json +1 -8
  26. package/media/package.json +1 -8
  27. package/membership/package.json +1 -8
  28. package/mocks/package.json +1 -8
  29. package/package.json +6 -14
  30. package/permissions/package.json +1 -8
  31. package/permissions/types/package.json +1 -8
  32. package/public/package.json +1 -8
  33. package/reporting-lines-client/utils/types/package.json +1 -8
  34. package/sentry/main/package.json +1 -8
  35. package/sentry/package.json +1 -8
  36. package/sentry/types/package.json +1 -8
  37. package/slack/package.json +1 -8
  38. package/sort-teams/package.json +1 -8
  39. package/team/package.json +1 -8
  40. package/team-container/package.json +1 -8
  41. package/tenure/package.json +1 -8
  42. package/types/package.json +1 -8
  43. package/types/team/package.json +1 -8
  44. package/ufo/package.json +1 -8
  45. package/unlink-container-mutation/package.json +1 -8
  46. package/use-query-light/main/package.json +1 -8
  47. package/use-query-light/package.json +1 -8
  48. package/use-query-light/types/package.json +1 -8
  49. package/use-teams-client-setup/package.json +1 -8
  50. package/use-teams-sentry-client-setup/package.json +1 -8
  51. package/user/package.json +1 -8
  52. package/user-info-provider/main/package.json +1 -8
  53. package/user-info-provider/package.json +1 -8
  54. package/utils/package.json +1 -8
  55. package/dist/types-ts4.5/common/types.d.ts +0 -4
  56. package/dist/types-ts4.5/common/utils/ari.d.ts +0 -7
  57. package/dist/types-ts4.5/common/utils/error/index.d.ts +0 -91
  58. package/dist/types-ts4.5/common/utils/http.d.ts +0 -31
  59. package/dist/types-ts4.5/common/utils/index.d.ts +0 -2
  60. package/dist/types-ts4.5/common/utils/permissions/constants.d.ts +0 -30
  61. package/dist/types-ts4.5/common/utils/permissions/has-permission.d.ts +0 -40
  62. package/dist/types-ts4.5/common/utils/permissions/index.d.ts +0 -3
  63. package/dist/types-ts4.5/common/utils/permissions/types.d.ts +0 -31
  64. package/dist/types-ts4.5/common/utils/sort-teams.d.ts +0 -2
  65. package/dist/types-ts4.5/common/utils/status-code-handlers-provider.d.ts +0 -17
  66. package/dist/types-ts4.5/common/utils/team.d.ts +0 -5
  67. package/dist/types-ts4.5/common/utils/ufo/constants.d.ts +0 -82
  68. package/dist/types-ts4.5/common/utils/ufo/index.d.ts +0 -6
  69. package/dist/types-ts4.5/common/utils/ufo/utils.d.ts +0 -11
  70. package/dist/types-ts4.5/index.d.ts +0 -15
  71. package/dist/types-ts4.5/mocks/endpoints.d.ts +0 -22
  72. package/dist/types-ts4.5/mocks/generate-data.d.ts +0 -16
  73. package/dist/types-ts4.5/mocks/index.d.ts +0 -2
  74. package/dist/types-ts4.5/mocks/invitations.d.ts +0 -11
  75. package/dist/types-ts4.5/mocks/responses.d.ts +0 -75
  76. package/dist/types-ts4.5/mocks/team-link.d.ts +0 -7
  77. package/dist/types-ts4.5/mocks/team.d.ts +0 -14
  78. package/dist/types-ts4.5/mocks/user.d.ts +0 -15
  79. package/dist/types-ts4.5/mocks/with-faker.d.ts +0 -12
  80. package/dist/types-ts4.5/services/agg-client/index.d.ts +0 -36
  81. package/dist/types-ts4.5/services/agg-client/mocks/index.d.ts +0 -49
  82. package/dist/types-ts4.5/services/agg-client/types.d.ts +0 -13
  83. package/dist/types-ts4.5/services/agg-client/utils/mutations/unlink-container-mutation.d.ts +0 -18
  84. package/dist/types-ts4.5/services/agg-client/utils/queries/number-of-team-connected-to-container-query.d.ts +0 -11
  85. package/dist/types-ts4.5/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +0 -47
  86. package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +0 -52
  87. package/dist/types-ts4.5/services/agg-client/utils/queries/team-has-agents-query.d.ts +0 -15
  88. package/dist/types-ts4.5/services/agg-client/utils/queries/team-membership-query.d.ts +0 -33
  89. package/dist/types-ts4.5/services/agg-client/utils/queries/user-query.d.ts +0 -31
  90. package/dist/types-ts4.5/services/agg-client/utils/user-type.d.ts +0 -7
  91. package/dist/types-ts4.5/services/base-client/index.d.ts +0 -37
  92. package/dist/types-ts4.5/services/collaborationgraph-client/index.d.ts +0 -70
  93. package/dist/types-ts4.5/services/constants.d.ts +0 -2
  94. package/dist/types-ts4.5/services/directory-client/index.d.ts +0 -53
  95. package/dist/types-ts4.5/services/graphql-client/index.d.ts +0 -1
  96. package/dist/types-ts4.5/services/graphql-client/main.d.ts +0 -14
  97. package/dist/types-ts4.5/services/graphql-client/types.d.ts +0 -20
  98. package/dist/types-ts4.5/services/graphql-client/utils/index.d.ts +0 -3
  99. package/dist/types-ts4.5/services/hooks/use-teams-client-setup.d.ts +0 -14
  100. package/dist/types-ts4.5/services/identity-client/index.d.ts +0 -34
  101. package/dist/types-ts4.5/services/identity-client/utils.d.ts +0 -85
  102. package/dist/types-ts4.5/services/index.d.ts +0 -1
  103. package/dist/types-ts4.5/services/invitations-client/index.d.ts +0 -11
  104. package/dist/types-ts4.5/services/invitations-client/types.d.ts +0 -67
  105. package/dist/types-ts4.5/services/invitations-client/utils/index.d.ts +0 -7
  106. package/dist/types-ts4.5/services/invitations-client/utils/types.d.ts +0 -7
  107. package/dist/types-ts4.5/services/legion-client/index.d.ts +0 -164
  108. package/dist/types-ts4.5/services/legion-client/types.d.ts +0 -128
  109. package/dist/types-ts4.5/services/main.d.ts +0 -452
  110. package/dist/types-ts4.5/services/mutability-client/index.d.ts +0 -8
  111. package/dist/types-ts4.5/services/mutability-client/types.d.ts +0 -5
  112. package/dist/types-ts4.5/services/object-resolver-client/index.d.ts +0 -10
  113. package/dist/types-ts4.5/services/object-resolver-client/types.d.ts +0 -69
  114. package/dist/types-ts4.5/services/object-resolver-client/utils.d.ts +0 -18
  115. package/dist/types-ts4.5/services/perms-client/index.d.ts +0 -16
  116. package/dist/types-ts4.5/services/public-api-client/generated/data-contracts.d.ts +0 -112
  117. package/dist/types-ts4.5/services/public-api-client/index.d.ts +0 -41
  118. package/dist/types-ts4.5/services/replines-client/index.d.ts +0 -11
  119. package/dist/types-ts4.5/services/reporting-lines-client/index.d.ts +0 -11
  120. package/dist/types-ts4.5/services/reporting-lines-client/utils/queries/ReportingLinesQueryWithAccountStatus.graphql.d.ts +0 -2
  121. package/dist/types-ts4.5/services/reporting-lines-client/utils/types.d.ts +0 -32
  122. package/dist/types-ts4.5/services/rest-client/index.d.ts +0 -40
  123. package/dist/types-ts4.5/services/rest-client/utils/cookie.d.ts +0 -5
  124. package/dist/types-ts4.5/services/rest-client/utils/parse-error-message.d.ts +0 -1
  125. package/dist/types-ts4.5/services/rest-client/utils/parse-response.d.ts +0 -1
  126. package/dist/types-ts4.5/services/rest-client/utils/strip-uuid.d.ts +0 -1
  127. package/dist/types-ts4.5/services/sentry/constants.d.ts +0 -5
  128. package/dist/types-ts4.5/services/sentry/index.d.ts +0 -3
  129. package/dist/types-ts4.5/services/sentry/main.d.ts +0 -32
  130. package/dist/types-ts4.5/services/sentry/types.d.ts +0 -36
  131. package/dist/types-ts4.5/services/sentry/utils/get-sentry-config.d.ts +0 -2
  132. package/dist/types-ts4.5/services/sentry/utils/initialise-sentry.d.ts +0 -2
  133. package/dist/types-ts4.5/services/sentry/utils/sentry-client.d.ts +0 -9
  134. package/dist/types-ts4.5/services/sentry/utils/use-teams-sentry-client-setup.d.ts +0 -3
  135. package/dist/types-ts4.5/services/team-central-client/index.d.ts +0 -26
  136. package/dist/types-ts4.5/services/team-central-client/mutations/add-team-watcher.graphql.d.ts +0 -9
  137. package/dist/types-ts4.5/services/team-central-client/mutations/create-tag-mutation.graphql.d.ts +0 -12
  138. package/dist/types-ts4.5/services/team-central-client/mutations/help-pointer-create-mutation.graphql.d.ts +0 -20
  139. package/dist/types-ts4.5/services/team-central-client/mutations/help-pointer-delete-mutation.graphql.d.ts +0 -7
  140. package/dist/types-ts4.5/services/team-central-client/mutations/help-pointer-update-mutation.graphql.d.ts +0 -21
  141. package/dist/types-ts4.5/services/team-central-client/mutations/kudos-delete-mutation.graphql.d.ts +0 -10
  142. package/dist/types-ts4.5/services/team-central-client/mutations/remove-team-watcher.graphql.d.ts +0 -9
  143. package/dist/types-ts4.5/services/team-central-client/queries/is-team-watcher.graphql.d.ts +0 -8
  144. package/dist/types-ts4.5/services/team-central-client/queries/tag-list-query.graphql.d.ts +0 -24
  145. package/dist/types-ts4.5/services/team-central-client/utils.d.ts +0 -2
  146. package/dist/types-ts4.5/services/teams-in-slack-client/index.d.ts +0 -27
  147. package/dist/types-ts4.5/services/types.d.ts +0 -10
  148. package/dist/types-ts4.5/services/use-query-light/index.d.ts +0 -3
  149. package/dist/types-ts4.5/services/use-query-light/main.d.ts +0 -7
  150. package/dist/types-ts4.5/services/use-query-light/types.d.ts +0 -57
  151. package/dist/types-ts4.5/services/user-info-provider/index.d.ts +0 -1
  152. package/dist/types-ts4.5/services/user-info-provider/main.d.ts +0 -14
  153. package/dist/types-ts4.5/services/user-preferences-client/index.d.ts +0 -9
  154. package/dist/types-ts4.5/types/association.d.ts +0 -8
  155. package/dist/types-ts4.5/types/config.d.ts +0 -7
  156. package/dist/types-ts4.5/types/index.d.ts +0 -16
  157. package/dist/types-ts4.5/types/links.d.ts +0 -31
  158. package/dist/types-ts4.5/types/media.d.ts +0 -6
  159. package/dist/types-ts4.5/types/membership.d.ts +0 -35
  160. package/dist/types-ts4.5/types/slack.d.ts +0 -7
  161. package/dist/types-ts4.5/types/team-container.d.ts +0 -29
  162. package/dist/types-ts4.5/types/team.d.ts +0 -188
  163. package/dist/types-ts4.5/types/tenure.d.ts +0 -5
  164. package/dist/types-ts4.5/types/user.d.ts +0 -55
@@ -1,37 +0,0 @@
1
- import { type ClientContext, type ClientContextProps } from '../types';
2
- type NestedContext = {
3
- [key: string]: string | number | boolean | NestedContext;
4
- };
5
- export type LogExceptionFN = (ex: unknown | Error, name: string, context?: NestedContext & {
6
- tags?: Record<string, string>;
7
- }) => void;
8
- export type ClientConfig = {
9
- logException: LogExceptionFN;
10
- };
11
- export declare class BaseClient {
12
- private config;
13
- private context;
14
- private cache;
15
- constructor(config: ClientConfig);
16
- setContext(context: ClientContextProps): void;
17
- getContext(): ClientContext;
18
- /**
19
- *
20
- * @param localValue is used for backwards compatibility
21
- * @returns
22
- */
23
- getOrgId(localValue?: string): string;
24
- /**
25
- *
26
- * @param localValue is used for backwards compatibility
27
- * @returns
28
- */
29
- getCloudId(localValue?: string): string;
30
- logException: (ex: unknown | Error, name: string, context?: NestedContext & {
31
- tags?: Record<string, string>;
32
- }) => void;
33
- private keyWithContext;
34
- cacheValue<T>(key: string, value: T, expiryMs?: number): void;
35
- getCachedValue<T>(key: string): T | undefined;
36
- }
37
- export {};
@@ -1,70 +0,0 @@
1
- import { RestClient } from '../rest-client';
2
- export type UserContainerArgs = {
3
- userId: string;
4
- principalId: string;
5
- siteId: string;
6
- sessionId: string;
7
- maxNumberOfResults: number;
8
- };
9
- export type RecommendedUsersArgs = {
10
- accountId: string;
11
- cloudId: string;
12
- maxNumberOfResults?: number;
13
- filter?: string | null;
14
- expand?: 'existing' | 'all' | string;
15
- requestingUserId?: string;
16
- sessionId?: string;
17
- modelRequestParams?: {
18
- experience?: string;
19
- caller?: string;
20
- featureServiceModel?: string;
21
- };
22
- };
23
- declare enum CONTAINER_TYPE {
24
- JIRA_PROJECT = "jiraProject",
25
- CONFLUENCE_SPACE = "confluenceSpace"
26
- }
27
- declare enum ENTITY_TYPE {
28
- CONTAINER = "CONTAINER",
29
- USER = "USER"
30
- }
31
- type CollaborationGraphContainerDetails = {
32
- id: string;
33
- key: string;
34
- name: string;
35
- url: string;
36
- iconUrl: string;
37
- };
38
- type CollaborationGraphEntities = {
39
- id: string;
40
- containerType: CONTAINER_TYPE;
41
- entityType: ENTITY_TYPE;
42
- containerDetails: CollaborationGraphContainerDetails;
43
- };
44
- type UserContainerResponse = {
45
- collaborationGraphEntities: CollaborationGraphEntities[];
46
- };
47
- type CollaborationGraphUser = {
48
- id: string;
49
- expand: {
50
- name: string;
51
- picture: string;
52
- nickname: string;
53
- account_status: string;
54
- extended_profile?: {
55
- job_title?: string;
56
- organization?: string;
57
- department?: string;
58
- location?: string;
59
- };
60
- };
61
- };
62
- export type RecommendedUsersResponse = {
63
- recommendedEntities: CollaborationGraphUser[];
64
- };
65
- export declare class CollaborationGraphClient extends RestClient {
66
- getUserContainers({ userId, principalId, siteId, sessionId, maxNumberOfResults, }: UserContainerArgs): Promise<UserContainerResponse>;
67
- getRecommendedUsers({ accountId, cloudId, maxNumberOfResults, filter, expand, requestingUserId, sessionId, modelRequestParams, }: RecommendedUsersArgs): Promise<RecommendedUsersResponse>;
68
- }
69
- declare const _default_1: CollaborationGraphClient;
70
- export default _default_1;
@@ -1,2 +0,0 @@
1
- import { type TeamsClientConfig } from '../types';
2
- export declare const DEFAULT_CONFIG: TeamsClientConfig;
@@ -1,53 +0,0 @@
1
- import { type TeamMembership } from '../../types';
2
- import { type ClientConfig } from '../base-client';
3
- import { BaseGraphQlClient } from '../graphql-client';
4
- export declare const BROWSE_USER_SETTINGS_KEY = "internal.browse-users-allowed";
5
- /**
6
- * @type CloudUser
7
- * @property {string} avatarUrl
8
- * @property {string} id
9
- * @property {string} fullName
10
- * @property {string} title
11
- */
12
- export interface CloudUser {
13
- avatarUrl: string;
14
- id: string;
15
- fullName: string;
16
- title?: string;
17
- }
18
- export declare class DirectoryClient extends BaseGraphQlClient {
19
- constructor(baseUrl: string, config: ClientConfig);
20
- setBaseUrl(baseUrl: string): void;
21
- queryFeatureFlags(
22
- /**
23
- * @private
24
- * @deprecated don't need to pass param, value is taken from `this.getCloudId()` instead
25
- */
26
- cloudId: string | undefined, flags: string[]): Promise<Record<string, boolean>>;
27
- private canRetryError;
28
- /**
29
- * Get user information of all members of a team
30
- * @param {string} teamId
31
- * @returns {Promise}
32
- * @private
33
- * @deprecated use AGG instead
34
- */
35
- queryTeamMemberships(teamId: string, membershipStatus?: string[]): Promise<TeamMembership[]>;
36
- /**
37
- * Get user information of all members of a team
38
- * @param {string} userId
39
- * @returns {Promise}
40
- */
41
- queryUser(userId: string,
42
- /**
43
- * @private
44
- * @deprecated don't need to pass param, value is taken from `this.getCloudId()` instead
45
- */
46
- cloudId?: string): Promise<{
47
- CloudUser: CloudUser;
48
- }>;
49
- }
50
- /**
51
- * @deprecated As part of decommisioning pf-directoy
52
- */
53
- export declare const directoryClient: DirectoryClient;
@@ -1 +0,0 @@
1
- export { BaseGraphQlClient } from './main';
@@ -1,14 +0,0 @@
1
- import { BaseClient, type ClientConfig } from '../base-client';
2
- import { type Body, type Options, type ResultResponse } from './types';
3
- export declare class BaseGraphQlClient extends BaseClient {
4
- private serviceUrl;
5
- constructor(serviceUrl: string, config: ClientConfig);
6
- setServiceUrl(serviceUrl: string): void;
7
- /**
8
- * Creates query context headers if cloudId is available and valid.
9
- * Validates the cloudId before constructing the ARI, preventing invalid
10
- * ARIs like `ari:cloud:platform::site/None` from being sent.
11
- */
12
- private createQueryContextHeaders;
13
- makeGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
14
- }
@@ -1,20 +0,0 @@
1
- import { type ErrorData } from '../../common/utils/error';
2
- export interface Options {
3
- operationName?: string;
4
- errorPolicy?: 'none' | 'all' | 'ignore';
5
- headers?: Record<string, string>;
6
- }
7
- export type InnerResponse<T> = {
8
- data: T;
9
- errors?: ErrorData[];
10
- };
11
- export type ResultResponse<Key extends string, Data> = {
12
- [name in Key]: Data;
13
- };
14
- export type Body<Variables> = {
15
- query: string;
16
- variables?: Variables;
17
- };
18
- export type GraphQLRequestDataResponse<Data> = Data | {
19
- response: Response;
20
- };
@@ -1,3 +0,0 @@
1
- import { type Body, type GraphQLRequestDataResponse, type Options, type ResultResponse } from '../types';
2
- export declare function makeGraphQLRequestWithoutRetries<Data, Variables>(serviceUrl: string, body: Body<Variables>, options?: Options): Promise<GraphQLRequestDataResponse<Data>>;
3
- export declare function handleGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(serviceUrl: string, body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
@@ -1,14 +0,0 @@
1
- /**
2
- * @deprecated use useTeamsClientSetupNext for named parameters
3
- */
4
- export declare const useTeamsClientSetup: (stargateRoot?: string, cloudId?: string | null, orgId?: string, principalUserId?: string) => void;
5
- type TeamsClientSetupProps = {
6
- stargateRoot?: string;
7
- cloudId?: string | null;
8
- orgId?: string;
9
- principalUserId?: string;
10
- };
11
- export declare const useTeamsClientSetupNext: ({ stargateRoot, cloudId, orgId, principalUserId, }: TeamsClientSetupProps) => {
12
- isClientReady: boolean;
13
- };
14
- export {};
@@ -1,34 +0,0 @@
1
- import { type EditableUserFields } from '../../types';
2
- import { RestClient } from '../rest-client';
3
- import { FieldType } from './utils';
4
- export declare class IdentityClient extends RestClient {
5
- constructor(config?: {});
6
- getUserManageConfig(userId: string): Promise<{
7
- mutabilityConstraints: {
8
- field: FieldType;
9
- reason: string | null;
10
- }[];
11
- }>;
12
- /**
13
- * @deprecated
14
- * User fetchUserAvatarInfo instead
15
- */
16
- getMyAvatarUploadedStatus(userId: string): Promise<{
17
- uploaded: boolean;
18
- url: string;
19
- }>;
20
- deleteAvatar(userId: string): Promise<unknown>;
21
- fetchUserAvatarInfo(userId: string): Promise<{
22
- uploaded: boolean;
23
- url: string;
24
- }>;
25
- updateUser({ id, ...user }: Partial<EditableUserFields> & {
26
- id: string;
27
- }): Promise<unknown>;
28
- updateUserAvatar({ id, fileURI }: {
29
- id: string;
30
- fileURI: string;
31
- }): Promise<string>;
32
- }
33
- declare const _default_1: IdentityClient;
34
- export default _default_1;
@@ -1,85 +0,0 @@
1
- interface IdentityProfileData {
2
- account_id: string;
3
- name: string;
4
- nickname: string;
5
- locale: string;
6
- picture: string;
7
- email: string;
8
- zoneinfo: string;
9
- extended_profile: {
10
- job_title: string;
11
- organization: string;
12
- department: string;
13
- location: string;
14
- phone_number: string;
15
- about_me: string;
16
- pronouns: string;
17
- };
18
- }
19
- interface IdentityProfileResponse {
20
- account: IdentityProfileData;
21
- }
22
- export interface UserDetails {
23
- id: string;
24
- fullName: string;
25
- nickname: string;
26
- timezone: string;
27
- locale: string;
28
- avatarUrl: string;
29
- email: string;
30
- title: string;
31
- companyName: string;
32
- department: string;
33
- location: string;
34
- phoneNumber: string;
35
- aboutMe: string;
36
- pronouns: string;
37
- localTime: ({ format }: {
38
- format: string;
39
- }) => string | null;
40
- }
41
- export type UserDetailKey = keyof UserDetails;
42
- export declare const fromManageAPIResponse: (res: IdentityProfileResponse) => UserDetails | null;
43
- export declare enum FieldType {
44
- FullName = "fullName",
45
- Nickname = "nickname",// aka `Public name`
46
- Title = "title",
47
- Department = "department",
48
- CompanyName = "companyName",
49
- Location = "location",
50
- Timezone = "timezone",
51
- Email = "email",
52
- PhoneNumber = "phoneNumber",
53
- Avatar = "picture",
54
- Language = "language",
55
- LocalTime = "localTime",
56
- RemoteWeekdayIndex = "remoteWeekdayIndex",
57
- RemoteWeekdayString = "remoteWeekdayString",
58
- RemoteTimeString = "remoteTimeString"
59
- }
60
- type FieldKey = 'fullName' | 'nickname' | 'timezone' | 'locale' | 'title' | 'phoneNumber' | 'companyName' | 'department' | 'location' | 'email';
61
- export interface SimpleConstraint {
62
- allowed: boolean;
63
- reason?: {
64
- key: string;
65
- };
66
- }
67
- export type MutabilityContraints = {
68
- [key: string]: SimpleConstraint | MutabilityContraints;
69
- };
70
- export declare const MUTABILITY_DETAILS_MAP: Record<FieldKey, string>;
71
- export declare const CUSTOM_FIELD_PLACE: {
72
- readonly email: "email.initiateChange";
73
- readonly picture: "avatar";
74
- };
75
- export type CustomFieldKey = keyof typeof CUSTOM_FIELD_PLACE;
76
- export type AllFieldKeys = FieldKey | CustomFieldKey;
77
- export declare const transformUserManageConfig: (data: MutabilityContraints) => {
78
- mutabilityConstraints: {
79
- field: FieldType;
80
- reason: string | null;
81
- }[];
82
- };
83
- export declare const toManageAPIInput: (input: Partial<UserDetails>) => any;
84
- export declare function dataURItoFile(dataURI: string, filename?: string): Blob | File;
85
- export {};
@@ -1 +0,0 @@
1
- export { teamsClient, TeamsClient } from './main';
@@ -1,11 +0,0 @@
1
- import { type ClientConfig } from '../base-client';
2
- import { RestClient } from '../rest-client';
3
- import { type AccessRequestBulkSimplified, type AccessResourcesResponse, type Capability, type Product, type RecommendationsResponse } from './types';
4
- export declare class InvitationsClient extends RestClient {
5
- constructor(serviceUrl: string, config: ClientConfig);
6
- private getProductRecommendationsInner;
7
- getProductRecommendations(supportedProducts?: Product[], capabilities?: Capability[]): Promise<RecommendationsResponse>;
8
- joinOrRequestDefaultAccessToProductsBulk(simplifiedRequest: AccessRequestBulkSimplified): Promise<AccessResourcesResponse>;
9
- }
10
- declare const _default_1: InvitationsClient;
11
- export default _default_1;
@@ -1,67 +0,0 @@
1
- export type ProductARI = string;
2
- type RoleARI = string;
3
- type StatusCode = string;
4
- export type AccessRequestBulkSimplified = Omit<AccessRequestBulk, 'resources'> & {
5
- productAris: ProductARI[];
6
- };
7
- /**
8
- *
9
- * The following types have been copied from id-invitations-service.
10
- * Last updated 2023-08-07.
11
- *
12
- */
13
- export type Product = 'confluence' | 'jira-core' | 'jira-servicedesk' | 'jira-software' | 'jira-incident-manager' | 'jira' | 'jira-product-discovery' | 'opsgenie' | 'statuspage' | 'avocado' | 'townsquare' | 'compass' | 'avp' | 'beacon' | 'mercury';
14
- export type Capability = 'REQUEST_ACCESS' | 'DIRECT_ACCESS';
15
- type UserAccessLevel = 'INTERNAL' | 'EXTERNAL' | 'INTERNAL_INACTIVE';
16
- export type RecommendationMode = 'DOMAIN' | 'OPEN';
17
- export type Recommendation = {
18
- resourceId: ProductARI;
19
- userAccessLevel: UserAccessLevel;
20
- mode?: RecommendationMode;
21
- roleAri: RoleARI;
22
- url: string;
23
- displayName?: string;
24
- avatarUrl?: string;
25
- };
26
- export type RecommendationsResponse = {
27
- capability: {
28
- [K in Capability]: Recommendation[];
29
- };
30
- };
31
- export type Role = 'org/admin' | 'product/member' | 'product/helpseeker' | 'product/external-collaborator-writer';
32
- export type Resource = {
33
- ari: ProductARI;
34
- continueUrl?: string;
35
- role: Role;
36
- };
37
- export type AccessMode = 'REQUEST_ACCESS' | 'DIRECT_ACCESS';
38
- export type AccessRequestBulk = {
39
- resources: Resource[];
40
- note?: string;
41
- accessMode?: AccessMode;
42
- source?: string;
43
- };
44
- export type AccessRequestCapability = 'ACCESS_GRANTED' | 'DIRECT_ACCESS' | 'REQUEST_ACCESS' | 'ACCESS_EXISTS' | 'PENDING_REQUEST_CREATED' | 'PENDING_REQUEST_EXISTS' | 'APPROVED_REQUEST_EXISTS' | 'DENIED_REQUEST_EXISTS' | 'FORBIDDEN' | 'VERIFICATION_REQUIRED' | 'ERROR';
45
- type AccessRequestCapabilityWithRole = {
46
- accessMode: AccessRequestCapability;
47
- role: Role;
48
- };
49
- type ErrorResponse = {
50
- message: string;
51
- responseStatus: StatusCode;
52
- };
53
- export type AccessResourceResponse = {
54
- ari: ProductARI;
55
- result: AccessRequestCapability;
56
- resultsV2: {
57
- [K in ProductARI]: AccessRequestCapabilityWithRole[];
58
- };
59
- errorReason?: ErrorResponse;
60
- };
61
- export type AccessResourcesResponse = AccessResourceResponse[];
62
- export {};
63
- /**
64
- *
65
- * END of copied types from id-invitations-service.
66
- *
67
- */
@@ -1,7 +0,0 @@
1
- import { type RecommendationsResponse } from '../types';
2
- /**
3
- * Removes duplicate recommendations with the same resource ARI.
4
- * When a collision occurs, select the recommendation with the most desirable capability and mode.
5
- * @returns a recommendation response with unique resource ARIs.
6
- */
7
- export declare const removeDuplicateRecommendations: (recommendations: RecommendationsResponse) => RecommendationsResponse;
@@ -1,7 +0,0 @@
1
- import { type Capability, type ProductARI, type Recommendation } from '../types';
2
- export type RecommendationWithCapability = Recommendation & {
3
- capability: Capability;
4
- };
5
- export type RecommendationsByProductAri = {
6
- [key: ProductARI]: RecommendationWithCapability;
7
- };
@@ -1,164 +0,0 @@
1
- import { type InvitedUser, type LinkOrder, type NewTeamLink, type ReadMediaTokenResponse, type Team, type TeamLink, type TeamMembership, type TeamMembershipSettings, type TeamWithImageUrls, type TeamWithMemberships } from '../../types';
2
- import { type AlignmentPermission, type AssignedTeamsResponse, type AssignTeamsToSitesResponse, type ExternalReference, type LinkedTeamsBulkResponse, type LinkedTeamsProfileDetails, type OrgScope, type SoftDeletedTeam, type TeamEnabledSitesResponse, type TeamSiteAssignmentOrgDetailsResponse, type TeamsPermissionFromApi, type TeamsToBeClonedToJsmSitesResponse, type UnassignedTeamsResponse } from '../../types/team';
3
- import { type ApiTeamContainerCreationPayload, type ApiTeamContainerResponse } from '../../types/team-container';
4
- import { type UserInSiteUserbase } from '../../types/user';
5
- import { RestClient } from '../rest-client';
6
- import { type LegionAssociateAgentResponse, type LegionLinkResponseV3, type LegionLinkResponseV4, type LegionPaginatedResponse, type LegionTeamAndGroupDifferenceResponse, type OrgAlignmentStatus, type TeamStatesInBulkResponse } from './types';
7
- export interface PaginationResult<T> {
8
- entities: T[];
9
- }
10
- export interface OriginQuery {
11
- /**
12
- * @private
13
- * @deprecated use getContext().cloudId instead
14
- */
15
- cloudId?: string;
16
- product?: string | null;
17
- }
18
- export interface SortField {
19
- field: string;
20
- order: 'asc' | 'desc';
21
- }
22
- /**
23
- * @type AllTeamsQuery
24
- * Query type for the getAllTeams API
25
- * @property {string} orgId - Organization ID
26
- * @property {string} cursor - Cursor to fetch the next page of results
27
- * @property {number} limit - Number of teams to fetch
28
- * @property {string} searchQuery - Search query to filter teams
29
- * @property {string[]} memberAccountIds - List of member account IDs to filter teams
30
- * @property {boolean} useDefaultSort - Whether to use the default sort order
31
- * @property {boolean} showEmptyTeams - Whether to return empty teams in the search
32
- * @property {string[]} teamTypeIdsFilter - List of team type IDs to filter teams
33
- * @property {boolean} enablePagination - Whether the API should paginate the response
34
- */
35
- export interface AllTeamsQuery {
36
- /**
37
- * @private
38
- * @deprecated use getContext().orgId instead
39
- */
40
- orgId: string;
41
- cursor?: string;
42
- limit?: number;
43
- searchQuery?: string;
44
- memberAccountIds?: string[];
45
- useDefaultSort?: boolean;
46
- showEmptyTeams?: boolean;
47
- sortBy?: SortField[];
48
- teamTypeIdsFilter?: string[];
49
- enablePagination?: boolean;
50
- }
51
- /**
52
- * @type AllTeamsResponse
53
- * Response type for the getAllTeams API
54
- * @property {TeamWithMemberships[]} teams - List of teams
55
- * @property {string} cursor - Cursor to fetch the next page of results
56
- * @property {Error} error - Error object if the API call fails
57
- */
58
- export interface AllTeamsResponse {
59
- teams: TeamWithMemberships[];
60
- cursor: string;
61
- error?: Error;
62
- }
63
- /**
64
- * @type AllTeamsPayload
65
- * Payload type for the getAllTeams API
66
- * @property {TeamWithMemberships[]} entities - List of teams
67
- * @property {string} cursor - Cursor to fetch the next page of results
68
- */
69
- export interface AllTeamsPayload {
70
- entities: TeamWithMemberships[];
71
- cursor: string;
72
- }
73
- export interface LegionClient {
74
- getTeamById(teamId: string): Promise<TeamWithImageUrls>;
75
- updateTeamById(teamId: string, data: Partial<Team>): Promise<TeamWithImageUrls>;
76
- getAllTeams(allTeamsQuery: AllTeamsQuery): Promise<AllTeamsResponse>;
77
- inviteUsersToTeam(teamId: string, users: InvitedUser[], originQuery: OriginQuery): Promise<TeamMembership[]>;
78
- getMyTeamMembership(teamId: string): Promise<TeamMembership>;
79
- getTeamLinksByTeamId(teamId: string): Promise<{
80
- entities: TeamLink[];
81
- }>;
82
- createTeamLink(teamId: string, link: NewTeamLink): Promise<TeamLink>;
83
- updateTeamLink(teamId: string, linkId: string, newLink: NewTeamLink): Promise<TeamLink>;
84
- deleteTeamLink(teamId: string, linkId: string): Promise<void>;
85
- reorderTeamLink(teamId: string, linkId: string, newPosition: number): Promise<LinkOrder>;
86
- acceptTeamInvitation(teamId: string): Promise<TeamMembership>;
87
- declineTeamInvitation(teamId: string): Promise<void>;
88
- selfJoinTeam(teamId: string, originQuery: OriginQuery): Promise<TeamMembership>;
89
- cancelJoinRequest(teamId: string): Promise<void>;
90
- acceptJoinRequest(teamId: string, memberId: string): Promise<TeamMembership>;
91
- declineJoinRequest(teamId: string, memberId: string): Promise<void>;
92
- deleteTeamMembership(teamId: string, memberId: string): Promise<TeamMembership>;
93
- revokeTeamInvite(teamId: string, memberId: string): Promise<TeamMembership>;
94
- deleteTeam(teamId: string): Promise<void>;
95
- archiveTeam(teamId: string): Promise<TeamWithImageUrls>;
96
- unArchiveTeam(teamId: string): Promise<TeamWithImageUrls>;
97
- isSingleFullMemberTeam(teamId: string): Promise<boolean>;
98
- createTeam(displayName: string, originQuery: OriginQuery, members?: string[], membershipSettings?: TeamMembershipSettings, typeId?: string): Promise<Team>;
99
- createExternalTeam(description: string, externalReference: ExternalReference, teamName?: string, siteId?: string): Promise<Team>;
100
- retrieveBrowseUserPermission(product: string): Promise<{
101
- canSearchUsers: boolean;
102
- }>;
103
- getLinkedTeamsBulk(groupIds: string[]): Promise<LinkedTeamsBulkResponse>;
104
- getTeamProfileDetails(teamId: string, siteId?: string): Promise<LinkedTeamsProfileDetails>;
105
- getOrgScope(): Promise<OrgScope>;
106
- getPermissions(): Promise<TeamsPermissionFromApi>;
107
- restoreTeamToSyncedGroup(teamId: string, externalReference: ExternalReference): Promise<void>;
108
- createTeamContainers(payload: ApiTeamContainerCreationPayload): Promise<ApiTeamContainerResponse>;
109
- getTeamEnabledSites(teamId: string): Promise<TeamEnabledSitesResponse>;
110
- assignTeamsToSites(migrations: {
111
- teamId: string;
112
- targetSite: string;
113
- }[]): Promise<AssignTeamsToSitesResponse>;
114
- getAssignedTeams(orgId: string, count: number, cursor?: string | null, displayNameContains?: string | null): Promise<AssignedTeamsResponse>;
115
- setTeamSiteAssignmentPermission(orgId: string, alignmentPermission: AlignmentPermission): Promise<void>;
116
- getUnassignedTeams(orgId: string, count: number, cursor?: string | null, query?: string | null): Promise<UnassignedTeamsResponse>;
117
- getTeamSiteAssignmentOrgDetails(): Promise<TeamSiteAssignmentOrgDetailsResponse>;
118
- checkOrgFullAlignmentStatus(orgId: string): Promise<OrgAlignmentStatus>;
119
- getTeamStatesInBulk(orgId: string, teamIds: string[]): Promise<TeamStatesInBulkResponse>;
120
- }
121
- /**
122
- * REST Client to make calls to Legion.
123
- *
124
- * Redirects to the instance login screen when a response returns a 401.
125
- * It should probably redirect to Aa, but this is what the existing clients
126
- * do so I'm going to follow suite.
127
- */
128
- export declare class LegionClient extends RestClient implements LegionClient {
129
- private serviceUrlRoot;
130
- constructor(serviceUrl: string);
131
- setRootUrl(url: string): void;
132
- getOrgEligibilityForManagedTeams(): Promise<{
133
- isEligible: boolean;
134
- }>;
135
- addAgentsToTeam(teamId: string, agents: string[]): Promise<LegionAssociateAgentResponse>;
136
- removeAgentTeamAssociation(teamId: string, agentId: string): Promise<null>;
137
- unlinkTeamFromGroup(teamId: string, membershipSettings: TeamMembershipSettings): Promise<void>;
138
- getTeamAndGroupDiff(teamId: string, externalReference: ExternalReference): Promise<LegionTeamAndGroupDifferenceResponse>;
139
- linkExistingTeamToGroup(teamId: string, externalReference: ExternalReference): Promise<void>;
140
- getWriteMediaToken(): Promise<ReadMediaTokenResponse>;
141
- getSoftDeletedTeamById(teamId: string): Promise<SoftDeletedTeam>;
142
- /**
143
- * Shoud only be used within Teams (P&T) packages
144
- */
145
- getUserInSiteUserBase(userId: string): Promise<UserInSiteUserbase>;
146
- getTeamsToBeClonedToJsmSites(teamsToSiteScope: {
147
- teamId: string;
148
- siteId: string;
149
- }[]): Promise<TeamsToBeClonedToJsmSitesResponse>;
150
- trimTeamARI(teamId?: string): string;
151
- private constructProductOriginParams;
152
- private mapTeamResponseV4ToTeam;
153
- private mapTeamCreateResponseV4ToTeam;
154
- private mapTeamSearchResponseV4ToTeamWithMembership;
155
- mapLegionTeamLinksResponseV3ToTeamLinkResponse(response: LegionPaginatedResponse<LegionLinkResponseV3>): {
156
- entities: TeamLink[];
157
- };
158
- mapLegionTeamLinksResponseV4ToTeamLinkResponse(response: LegionPaginatedResponse<LegionLinkResponseV4>): {
159
- entities: TeamLink[];
160
- };
161
- mapLegionTeamLinkResponseV3ToTeamLink(legionLinkResponseV3: LegionLinkResponseV3): TeamLink;
162
- mapLegionTeamLinkResponseV4ToTeamLink(legionLinkResponseV4: LegionLinkResponseV4): TeamLink;
163
- }
164
- export declare const defaultLegionClient: LegionClient;