@atlaskit/teams-public 0.65.3 → 0.65.4

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 (92) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/controllers/hooks/use-team-containers/index.js +5 -6
  3. package/dist/es2019/controllers/hooks/use-team-containers/index.js +6 -7
  4. package/dist/esm/controllers/hooks/use-team-containers/index.js +6 -7
  5. package/dist/types/controllers/hooks/use-team-containers/index.d.ts +1 -2
  6. package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +1 -2
  7. package/package.json +10 -12
  8. package/dist/cjs/services/agg-client/index.js +0 -254
  9. package/dist/cjs/services/agg-client/mocks/index.js +0 -177
  10. package/dist/cjs/services/agg-client/types.js +0 -1
  11. package/dist/cjs/services/agg-client/utils/mutations/unlink-container-mutation.js +0 -12
  12. package/dist/cjs/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js +0 -12
  13. package/dist/cjs/services/agg-client/utils/queries/team-connected-to-container-query.js +0 -12
  14. package/dist/cjs/services/agg-client/utils/queries/team-containers-query.js +0 -15
  15. package/dist/cjs/services/agg-client/utils/query-context-headers.js +0 -18
  16. package/dist/cjs/services/base-client/index.js +0 -92
  17. package/dist/cjs/services/constants.js +0 -9
  18. package/dist/cjs/services/graphql-client/index.js +0 -12
  19. package/dist/cjs/services/graphql-client/main.js +0 -95
  20. package/dist/cjs/services/graphql-client/types.js +0 -5
  21. package/dist/cjs/services/graphql-client/utils/index.js +0 -160
  22. package/dist/cjs/services/index.js +0 -18
  23. package/dist/cjs/services/main.js +0 -148
  24. package/dist/cjs/services/types.js +0 -5
  25. package/dist/es2019/services/agg-client/index.js +0 -153
  26. package/dist/es2019/services/agg-client/mocks/index.js +0 -171
  27. package/dist/es2019/services/agg-client/types.js +0 -0
  28. package/dist/es2019/services/agg-client/utils/mutations/unlink-container-mutation.js +0 -20
  29. package/dist/es2019/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js +0 -14
  30. package/dist/es2019/services/agg-client/utils/queries/team-connected-to-container-query.js +0 -55
  31. package/dist/es2019/services/agg-client/utils/queries/team-containers-query.js +0 -56
  32. package/dist/es2019/services/agg-client/utils/query-context-headers.js +0 -12
  33. package/dist/es2019/services/base-client/index.js +0 -64
  34. package/dist/es2019/services/constants.js +0 -3
  35. package/dist/es2019/services/graphql-client/index.js +0 -1
  36. package/dist/es2019/services/graphql-client/main.js +0 -47
  37. package/dist/es2019/services/graphql-client/types.js +0 -1
  38. package/dist/es2019/services/graphql-client/utils/index.js +0 -77
  39. package/dist/es2019/services/index.js +0 -1
  40. package/dist/es2019/services/main.js +0 -67
  41. package/dist/es2019/services/types.js +0 -1
  42. package/dist/esm/services/agg-client/index.js +0 -247
  43. package/dist/esm/services/agg-client/mocks/index.js +0 -171
  44. package/dist/esm/services/agg-client/types.js +0 -0
  45. package/dist/esm/services/agg-client/utils/mutations/unlink-container-mutation.js +0 -5
  46. package/dist/esm/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js +0 -5
  47. package/dist/esm/services/agg-client/utils/queries/team-connected-to-container-query.js +0 -5
  48. package/dist/esm/services/agg-client/utils/queries/team-containers-query.js +0 -8
  49. package/dist/esm/services/agg-client/utils/query-context-headers.js +0 -12
  50. package/dist/esm/services/base-client/index.js +0 -85
  51. package/dist/esm/services/constants.js +0 -3
  52. package/dist/esm/services/graphql-client/index.js +0 -1
  53. package/dist/esm/services/graphql-client/main.js +0 -88
  54. package/dist/esm/services/graphql-client/types.js +0 -1
  55. package/dist/esm/services/graphql-client/utils/index.js +0 -152
  56. package/dist/esm/services/index.js +0 -1
  57. package/dist/esm/services/main.js +0 -141
  58. package/dist/esm/services/types.js +0 -1
  59. package/dist/types/services/agg-client/index.d.ts +0 -14
  60. package/dist/types/services/agg-client/mocks/index.d.ts +0 -180
  61. package/dist/types/services/agg-client/types.d.ts +0 -4
  62. package/dist/types/services/agg-client/utils/mutations/unlink-container-mutation.d.ts +0 -18
  63. package/dist/types/services/agg-client/utils/queries/number-of-team-connected-to-container-query.d.ts +0 -11
  64. package/dist/types/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +0 -45
  65. package/dist/types/services/agg-client/utils/queries/team-containers-query.d.ts +0 -71
  66. package/dist/types/services/agg-client/utils/query-context-headers.d.ts +0 -5
  67. package/dist/types/services/base-client/index.d.ts +0 -37
  68. package/dist/types/services/constants.d.ts +0 -4
  69. package/dist/types/services/graphql-client/index.d.ts +0 -1
  70. package/dist/types/services/graphql-client/main.d.ts +0 -12
  71. package/dist/types/services/graphql-client/types.d.ts +0 -20
  72. package/dist/types/services/graphql-client/utils/index.d.ts +0 -3
  73. package/dist/types/services/index.d.ts +0 -1
  74. package/dist/types/services/main.d.ts +0 -46
  75. package/dist/types/services/types.d.ts +0 -37
  76. package/dist/types-ts4.5/services/agg-client/index.d.ts +0 -14
  77. package/dist/types-ts4.5/services/agg-client/mocks/index.d.ts +0 -180
  78. package/dist/types-ts4.5/services/agg-client/types.d.ts +0 -4
  79. package/dist/types-ts4.5/services/agg-client/utils/mutations/unlink-container-mutation.d.ts +0 -18
  80. package/dist/types-ts4.5/services/agg-client/utils/queries/number-of-team-connected-to-container-query.d.ts +0 -11
  81. package/dist/types-ts4.5/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +0 -45
  82. package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +0 -71
  83. package/dist/types-ts4.5/services/agg-client/utils/query-context-headers.d.ts +0 -5
  84. package/dist/types-ts4.5/services/base-client/index.d.ts +0 -37
  85. package/dist/types-ts4.5/services/constants.d.ts +0 -4
  86. package/dist/types-ts4.5/services/graphql-client/index.d.ts +0 -1
  87. package/dist/types-ts4.5/services/graphql-client/main.d.ts +0 -12
  88. package/dist/types-ts4.5/services/graphql-client/types.d.ts +0 -20
  89. package/dist/types-ts4.5/services/graphql-client/utils/index.d.ts +0 -3
  90. package/dist/types-ts4.5/services/index.d.ts +0 -1
  91. package/dist/types-ts4.5/services/main.d.ts +0 -46
  92. package/dist/types-ts4.5/services/types.d.ts +0 -37
@@ -1,14 +0,0 @@
1
- import { type ClientConfig } from '../base-client';
2
- import { BaseGraphQlClient } from '../graphql-client';
3
- import type { TeamContainers, TeamWithMemberships } from '../types';
4
- import { type UnlinkContainerMutationResponse } from './utils/mutations/unlink-container-mutation';
5
- export declare class AGGClient extends BaseGraphQlClient {
6
- constructor(baseUrl: string, config: ClientConfig);
7
- setBaseUrl(baseUrl: string): void;
8
- getTeamContainers(teamId: string): Promise<TeamContainers>;
9
- private processResponse;
10
- unlinkTeamContainer(teamId: string, containerId: string): Promise<UnlinkContainerMutationResponse>;
11
- queryNumberOfTeamConnectedToContainer(containerId: string): Promise<number>;
12
- queryTeamsConnectedToContainer(containerId: string): Promise<TeamWithMemberships[]>;
13
- }
14
- export declare const aggClient: AGGClient;
@@ -1,180 +0,0 @@
1
- export declare const MOCK_TEAM_CONTAINERS: {
2
- graphStore: {
3
- cypherQuery: {
4
- edges: ({
5
- node: {
6
- from: {
7
- id: string;
8
- };
9
- to: {
10
- id: string;
11
- data: {
12
- __typename: string;
13
- confluenceSpaceName: string;
14
- type: string;
15
- createdDate: string;
16
- links: {
17
- base: string;
18
- webUi: string;
19
- };
20
- icon: {
21
- path: string;
22
- };
23
- jiraProjectName?: undefined;
24
- webUrl?: undefined;
25
- created?: undefined;
26
- avatar?: undefined;
27
- };
28
- };
29
- };
30
- } | {
31
- node: {
32
- from: {
33
- id: string;
34
- };
35
- to: {
36
- id: string;
37
- data: {
38
- __typename: string;
39
- jiraProjectName: string;
40
- webUrl: string;
41
- created: string;
42
- avatar: {
43
- medium: string;
44
- };
45
- confluenceSpaceName?: undefined;
46
- type?: undefined;
47
- createdDate?: undefined;
48
- links?: undefined;
49
- icon?: undefined;
50
- };
51
- };
52
- };
53
- })[];
54
- };
55
- };
56
- };
57
- export declare const MOCK_TEAM_CONTAINERSV2: {
58
- graphStore: {
59
- cypherQueryV2: {
60
- edges: ({
61
- node: {
62
- columns: {
63
- key: string;
64
- value: {
65
- data: {
66
- __typename: string;
67
- id: string;
68
- confluenceSpaceName: string;
69
- type: string;
70
- createdDate: string;
71
- links: {
72
- base: string;
73
- webUi: string;
74
- };
75
- icon: {
76
- path: string;
77
- };
78
- };
79
- };
80
- }[];
81
- };
82
- } | {
83
- node: {
84
- columns: {
85
- key: string;
86
- value: {
87
- data: {
88
- __typename: string;
89
- id: string;
90
- jiraProjectName: string;
91
- webUrl: string;
92
- created: string;
93
- avatar: {
94
- medium: string;
95
- };
96
- projectType: string;
97
- projectTypeName: string;
98
- };
99
- };
100
- }[];
101
- };
102
- })[];
103
- };
104
- };
105
- };
106
- export declare const MOCK_NUMBER_OF_CONNECTED_TEAMS: {
107
- graphStore: {
108
- teamConnectedToContainerInverse: {
109
- edges: {
110
- id: string;
111
- }[];
112
- };
113
- };
114
- };
115
- export declare const MOCK_CONNECTED_TEAMS: {
116
- graphStore: {
117
- teamConnectedToContainerInverse: {
118
- edges: {
119
- node: {
120
- id: string;
121
- description: string;
122
- displayName: string;
123
- smallAvatarImageUrl: string;
124
- smallHeaderImageUrl: string;
125
- largeAvatarImageUrl: string;
126
- largeHeaderImageUrl: string;
127
- members: {
128
- nodes: {
129
- role: string;
130
- state: string;
131
- member: {
132
- name: string;
133
- picture: string;
134
- accountStatus: string;
135
- extendedProfile: {
136
- jobTitle: string;
137
- };
138
- id: string;
139
- };
140
- }[];
141
- pageInfo: {
142
- endCursor: null;
143
- hasNextPage: boolean;
144
- };
145
- };
146
- organizationId: string;
147
- membershipSettings: string;
148
- isVerified: boolean;
149
- state: string;
150
- creator: {
151
- id: string;
152
- };
153
- };
154
- }[];
155
- };
156
- };
157
- };
158
- export declare const MOCK_CONNECTED_TEAMS_RESULT: {
159
- id: string;
160
- displayName: string;
161
- description: string;
162
- state: string;
163
- membershipSettings: string;
164
- organizationId: string;
165
- creatorId: string;
166
- isVerified: boolean;
167
- members: {
168
- id: string;
169
- fullName: string;
170
- avatarUrl: string;
171
- status: string;
172
- }[];
173
- includesYou: boolean;
174
- memberCount: number;
175
- smallAvatarImageUrl: string;
176
- smallHeaderImageUrl: string;
177
- largeAvatarImageUrl: string;
178
- largeHeaderImageUrl: string;
179
- restriction: string;
180
- }[];
@@ -1,4 +0,0 @@
1
- export type AGGPageInfo = {
2
- endCursor: string | null;
3
- hasNextPage: boolean;
4
- };
@@ -1,18 +0,0 @@
1
- export declare const UnlinkContainerMutation: string;
2
- export interface UnlinkContainerMutationError extends Error {
3
- message: string;
4
- extensions?: {
5
- statusCode: string;
6
- errorType: string;
7
- };
8
- }
9
- export type UnlinkContainerMutationVariables = {
10
- teamId: string;
11
- containerId: string;
12
- };
13
- export type UnlinkContainerMutationResponse = {
14
- deleteTeamConnectedToContainer: {
15
- errors: Array<UnlinkContainerMutationError>;
16
- success: boolean;
17
- };
18
- };
@@ -1,11 +0,0 @@
1
- export declare const NumberOfTeamConnectedToContainerQuery: string;
2
- export type NumberOfTeamConnectedToContainerQueryVariables = {
3
- containerId: string;
4
- };
5
- export type NumberOfTeamConnectedToContainerQueryResponse = {
6
- teamConnectedToContainerInverse: {
7
- edges: {
8
- id: string;
9
- }[];
10
- };
11
- };
@@ -1,45 +0,0 @@
1
- import type { MembershipRole, MembershipState, TeamMembershipSettings, TeamState, UserARI } from '../../../../common/types';
2
- import type { AGGPageInfo } from '../../types';
3
- export declare const TeamConnectedToContainerQuery: string;
4
- export type TeamConnectedToContainerQueryVariables = {
5
- containerId: string;
6
- };
7
- export type TeamConnectedToContainerQueryResponse = {
8
- teamConnectedToContainerInverse: {
9
- edges: {
10
- node: {
11
- id: string;
12
- description: string;
13
- displayName: string;
14
- creator: {
15
- id: string;
16
- };
17
- smallAvatarImageUrl: string;
18
- smallHeaderImageUrl: string;
19
- largeAvatarImageUrl: string;
20
- largeHeaderImageUrl: string;
21
- members?: {
22
- nodes: {
23
- role: MembershipRole;
24
- state: MembershipState;
25
- member?: {
26
- name: string;
27
- picture: string;
28
- id: UserARI;
29
- accountStatus: 'active' | 'inactive' | 'closed';
30
- extendedProfile: {
31
- jobTitle: string | null;
32
- } | null;
33
- appType?: string | null;
34
- };
35
- }[];
36
- pageInfo: AGGPageInfo;
37
- };
38
- organizationId?: string;
39
- membershipSettings: TeamMembershipSettings;
40
- isVerified?: boolean;
41
- state: TeamState;
42
- };
43
- }[];
44
- };
45
- };
@@ -1,71 +0,0 @@
1
- export declare const TeamContainersQueryV2: string;
2
- export declare const getTeamContainersQuery: () => string;
3
- export type TeamContainersQueryVariables = {
4
- cypherQuery: string;
5
- };
6
- export type TeamContainersQueryResponse = {
7
- cypherQuery: {
8
- edges: Array<{
9
- node: {
10
- from: {
11
- id: string;
12
- };
13
- to: {
14
- id: string;
15
- data: JiraProject | ConfluenceSpace | LoomSpace;
16
- };
17
- };
18
- }>;
19
- };
20
- };
21
- export type TeamContainersQueryV2Variables = {
22
- cypherQuery: string;
23
- params: Record<string, any>;
24
- };
25
- export type TeamContainersQueryV2Response = {
26
- cypherQueryV2: {
27
- edges: Array<{
28
- node: {
29
- columns: Array<{
30
- key: string;
31
- value: {
32
- data?: JiraProject | ConfluenceSpace | LoomSpace;
33
- };
34
- }>;
35
- };
36
- }>;
37
- };
38
- };
39
- type JiraProject = {
40
- __typename: 'JiraProject';
41
- id: string;
42
- jiraProjectName: string;
43
- webUrl: string;
44
- created: string;
45
- avatar: {
46
- medium: string;
47
- };
48
- projectType: string;
49
- projectTypeName: string;
50
- };
51
- type ConfluenceSpace = {
52
- __typename: 'ConfluenceSpace';
53
- id: string;
54
- confluenceSpaceName?: string;
55
- type: string;
56
- createdDate: string;
57
- links: {
58
- base: string;
59
- webUi: string;
60
- };
61
- icon: {
62
- path: string;
63
- };
64
- };
65
- type LoomSpace = {
66
- __typename: 'LoomSpace';
67
- id: string;
68
- loomSpaceName: string;
69
- url: string;
70
- };
71
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Creates headers object with X-Query-Context header if cloudId is provided.
3
- * Use this for AGG client makeGraphQLRequest calls.
4
- */
5
- export declare function createQueryContextHeaders(cloudId?: string): Record<string, string> | undefined;
@@ -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 | null | undefined;
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,4 +0,0 @@
1
- export interface TeamsConfig {
2
- stargateRoot: string;
3
- }
4
- export declare const DEFAULT_CONFIG: TeamsConfig;
@@ -1 +0,0 @@
1
- export { BaseGraphQlClient } from './main';
@@ -1,12 +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.
9
- */
10
- private createQueryContextHeaders;
11
- makeGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
12
- }
@@ -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 +0,0 @@
1
- export { teamsClient, TeamsClient } from './main';
@@ -1,46 +0,0 @@
1
- import { type ClientContextProps, type TeamContainers, type TeamWithMemberships } from './types';
2
- type AwaitedReturn<T extends (...args: any) => any> = Awaited<ReturnType<T>>;
3
- export declare class TeamsClient {
4
- private readonly _aggClient;
5
- constructor(
6
- /**
7
- * @param {ClientContextProps} context - Context including CloudId & OrgId to be used for all requests
8
- */
9
- context?: ClientContextProps);
10
- /**
11
- * Sets the base URL to be used in the client requests
12
- * @param {string} baseUrl - The new base URL
13
- */
14
- setBaseUrl(baseUrl: string): void;
15
- /**
16
- * Sets context including CloudId & OrgId to be used for all requests
17
- */
18
- setContext(context: ClientContextProps): void;
19
- /**
20
- * Get the containers for a given team
21
- * @param {string} teamId
22
- * @returns {Promise<TeamContainers>}
23
- */
24
- getTeamContainers(teamId: string): Promise<TeamContainers>;
25
- /**
26
- * Get the number of teams connected to a container (Confluence space or Jira project)
27
- * @param {string} containerId
28
- * @returns {Promise}
29
- */
30
- getNumberOfConnectedTeams(containerId: string): Promise<number>;
31
- /**
32
- * Get teams connected to a container (Confluence space or Jira project)
33
- * @param {string} containerId
34
- * @returns {Promise}
35
- */
36
- getConnectedTeams(containerId: string): Promise<TeamWithMemberships[]>;
37
- /**
38
- * Unlink a container from a team
39
- * @param {string} teamId
40
- * @param {string} containerId
41
- * @returns {Promise<void>}
42
- */
43
- unlinkTeamContainer(teamId: string, containerId: string): Promise<AwaitedReturn<typeof this._aggClient.unlinkTeamContainer>>;
44
- }
45
- export declare const teamsClient: TeamsClient;
46
- export {};
@@ -1,37 +0,0 @@
1
- import type { TeamRestriction } from '@atlaskit/teams-client/types';
2
- import type { TeamContainer, TeamMembershipSettings, TeamState, UserStatus } from '../common/types';
3
- export type ClientContext = {
4
- cloudId?: string | null;
5
- orgId?: string;
6
- userId?: string;
7
- };
8
- export type ClientContextProps = {
9
- cloudId?: string | null;
10
- orgId?: string;
11
- userId?: string;
12
- };
13
- export type TeamContainers = Array<TeamContainer>;
14
- export type TeamMember = {
15
- id: string;
16
- fullName: string;
17
- avatarUrl?: string;
18
- status?: UserStatus;
19
- };
20
- export type TeamWithMemberships = {
21
- id: string;
22
- displayName: string;
23
- description: string;
24
- state: TeamState;
25
- membershipSettings: TeamMembershipSettings;
26
- organizationId?: string;
27
- creatorId?: string;
28
- isVerified?: boolean;
29
- members: TeamMember[];
30
- includesYou: boolean;
31
- memberCount: number;
32
- largeAvatarImageUrl: string;
33
- smallAvatarImageUrl: string;
34
- largeHeaderImageUrl: string;
35
- smallHeaderImageUrl: string;
36
- restriction: TeamRestriction;
37
- };