@atlaskit/teams-client 4.9.1 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/common/utils/ufo/constants.js +1 -1
- package/dist/cjs/common/utils/ufo/index.js +2 -2
- package/dist/cjs/services/legion-client/index.js +107 -5
- package/dist/cjs/services/main.js +464 -320
- package/dist/cjs/services/sentry/main.js +2 -0
- package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/es2019/common/utils/ufo/constants.js +1 -1
- package/dist/es2019/common/utils/ufo/index.js +2 -2
- package/dist/es2019/services/legion-client/index.js +26 -0
- package/dist/es2019/services/main.js +36 -0
- package/dist/es2019/services/rest-client/index.js +2 -0
- package/dist/es2019/services/sentry/main.js +2 -0
- package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/esm/common/utils/ufo/constants.js +1 -1
- package/dist/esm/common/utils/ufo/index.js +2 -2
- package/dist/esm/services/legion-client/index.js +107 -5
- package/dist/esm/services/main.js +464 -320
- package/dist/esm/services/sentry/main.js +2 -0
- package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/types/common/utils/ari.d.ts +2 -2
- package/dist/types/common/utils/ufo/constants.d.ts +2 -2
- package/dist/types/services/legion-client/index.d.ts +9 -1
- package/dist/types/services/main.d.ts +24 -0
- package/dist/types/services/sentry/main.d.ts +4 -8
- package/dist/types/services/use-query-light/main.d.ts +1 -1
- package/dist/types/types/team.d.ts +39 -0
- package/dist/types/types/user.d.ts +1 -1
- package/dist/types-ts4.5/common/utils/ari.d.ts +2 -2
- package/dist/types-ts4.5/common/utils/ufo/constants.d.ts +6 -2
- package/dist/types-ts4.5/services/legion-client/index.d.ts +9 -1
- package/dist/types-ts4.5/services/main.d.ts +24 -0
- package/dist/types-ts4.5/services/sentry/main.d.ts +4 -8
- package/dist/types-ts4.5/services/use-query-light/main.d.ts +1 -1
- package/dist/types-ts4.5/types/team.d.ts +39 -0
- package/dist/types-ts4.5/types/user.d.ts +1 -1
- package/package.json +2 -2
|
@@ -94,6 +94,7 @@ function _logMessage() {
|
|
|
94
94
|
var _context$packageName2, _context$packageVersi2;
|
|
95
95
|
decorateScope(scope, context);
|
|
96
96
|
// The Severity enum is being replaced by SeverityLevel type in v7 anyway
|
|
97
|
+
// @ts-ignore - TypeScript 5.9.2 upgrade
|
|
97
98
|
scope.setLevel(severity);
|
|
98
99
|
scope.setTag('packageName', (_context$packageName2 = context.packageName) !== null && _context$packageName2 !== void 0 ? _context$packageName2 : 'unknown');
|
|
99
100
|
scope.setTag('packageVersion', (_context$packageVersi2 = context.packageVersion) !== null && _context$packageVersi2 !== void 0 ? _context$packageVersi2 : 'unknown');
|
|
@@ -172,6 +173,7 @@ function _addBreadcrumb() {
|
|
|
172
173
|
case 2:
|
|
173
174
|
sentryClient = _context3.sent;
|
|
174
175
|
sentryClient.withScope(function (scope) {
|
|
176
|
+
// @ts-ignore - TypeScript 5.9.2 upgrade
|
|
175
177
|
scope.addBreadcrumb(typeof crumb === 'string' ? {
|
|
176
178
|
message: crumb
|
|
177
179
|
} : crumb);
|
|
@@ -29,7 +29,7 @@ export function getSentryConfig(options) {
|
|
|
29
29
|
return _objectSpread(_objectSpread(_objectSpread({}, otherOptions), DEFAULT_SENTRY_CONFIG), {}, {
|
|
30
30
|
// Standalone __VERSION__ is set from `bin/set-release-version.sh`
|
|
31
31
|
// when building to deploy to production
|
|
32
|
-
release: "".concat("@atlaskit/teams-client", "@").concat("4.
|
|
32
|
+
release: "".concat("@atlaskit/teams-client", "@").concat("4.10.0") ||
|
|
33
33
|
// @ts-ignore Jira - window.BUILD_KEY
|
|
34
34
|
window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
|
|
35
35
|
(_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type TeamARI, type UserARI } from '../types';
|
|
2
|
-
export declare const isUserARI: (ari: string) => ari is
|
|
2
|
+
export declare const isUserARI: (ari: string) => ari is UserARI;
|
|
3
3
|
export declare const toUserId: (ari: UserARI | string) => string;
|
|
4
4
|
export declare const toUserARI: (userId: string) => UserARI;
|
|
5
|
-
export declare const isTeamARI: (ari: string) => ari is
|
|
5
|
+
export declare const isTeamARI: (ari: string) => ari is TeamARI;
|
|
6
6
|
export declare const toTeamId: (ari: TeamARI | string) => string;
|
|
7
7
|
export declare const toTeamARI: (teamId: string) => TeamARI;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TeamsUFOExperience } from './index';
|
|
2
|
-
declare const TeamsClientExperienceKeyList: readonly ["getAllTeams", "getTeamById", "updateTeamById", "querySettings", "queryFeatureFlags", "queryTeamMemberships", "queryUser", "inviteUsersToTeam", "getMyTeamMembership", "getTeamLinksByTeamId", "createTeamLink", "updateTeamLink", "deleteTeamLink", "reorderTeamLink", "acceptTeamInvitation", "declineTeamInvitation", "selfJoinTeam", "cancelJoinRequest", "acceptJoinRequest", "declineJoinRequest", "deleteTeamMembership", "revokeTeamInvite", "deleteTeam", "isSingleFullMemberTeam", "createTeam", "createTeamContainers", "createExternalTeam", "getProfileWithMutability", "getIsSiteAdmin", "addUsersToTeam", "removeTeamMemberships", "getRecommendedProducts", "joinOrRequestDefaultAccessToProductsBulk", "getReadMediaToken", "getWriteUserMediaToken", "updateUserHeaderImage", "getWriteTeamMediaToken", "getSoftDeletedTeamById", "restoreTeam", "getUserInSiteUserBase", "getLinkedTeamsBulk", "getTeamProfileDetails", "getUserContainers", "getPermissions", "getUserManageConfig", "getMyAvatarUploadedStatus", "deleteUserAvatar", "getTeamLinkIcons", "getTeamInSlack", "getOrgScope", "restoreTeamToSyncedGroup", "getTeamAndGroupDiff", "linkExistingTeamToGroup", "fetchUserAvatarInfo", "getOrgEligibilityForManagedTeams", "updateUser", "updateUserAvatar", "disconnectTeamInSlack", "updateTeamInSlack", "getUserTenure", "getAriFromUrl", "getWebLinkTitle", "addAgentToTeam", "removeAgentTeamAssociation"];
|
|
2
|
+
declare const TeamsClientExperienceKeyList: readonly ["getAllTeams", "getTeamById", "updateTeamById", "querySettings", "queryFeatureFlags", "queryTeamMemberships", "queryUser", "inviteUsersToTeam", "getMyTeamMembership", "getTeamLinksByTeamId", "createTeamLink", "updateTeamLink", "deleteTeamLink", "reorderTeamLink", "acceptTeamInvitation", "declineTeamInvitation", "selfJoinTeam", "cancelJoinRequest", "acceptJoinRequest", "declineJoinRequest", "deleteTeamMembership", "revokeTeamInvite", "deleteTeam", "isSingleFullMemberTeam", "createTeam", "createTeamContainers", "createExternalTeam", "getProfileWithMutability", "getIsSiteAdmin", "addUsersToTeam", "removeTeamMemberships", "getRecommendedProducts", "joinOrRequestDefaultAccessToProductsBulk", "getReadMediaToken", "getWriteUserMediaToken", "updateUserHeaderImage", "getWriteTeamMediaToken", "getSoftDeletedTeamById", "restoreTeam", "getUserInSiteUserBase", "getLinkedTeamsBulk", "getTeamProfileDetails", "getUserContainers", "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"];
|
|
3
3
|
export type TeamsClientExperienceKeys = (typeof TeamsClientExperienceKeyList)[number];
|
|
4
|
-
export declare const TEAMS_CLIENT_EXPERIENCES: Map<"getAllTeams" | "getOrgEligibilityForManagedTeams" | "addAgentToTeam" | "removeAgentTeamAssociation" | "createTeam" | "getPermissions" | "getLinkedTeamsBulk" | "getTeamProfileDetails" | "getOrgScope" | "getTeamById" | "updateTeamById" | "querySettings" | "queryFeatureFlags" | "queryTeamMemberships" | "queryUser" | "inviteUsersToTeam" | "getMyTeamMembership" | "getTeamLinksByTeamId" | "createTeamLink" | "updateTeamLink" | "deleteTeamLink" | "reorderTeamLink" | "acceptTeamInvitation" | "declineTeamInvitation" | "selfJoinTeam" | "cancelJoinRequest" | "acceptJoinRequest" | "declineJoinRequest" | "deleteTeamMembership" | "revokeTeamInvite" | "deleteTeam" | "isSingleFullMemberTeam" | "createTeamContainers" | "createExternalTeam" | "getProfileWithMutability" | "getIsSiteAdmin" | "addUsersToTeam" | "removeTeamMemberships" | "getRecommendedProducts" | "joinOrRequestDefaultAccessToProductsBulk" | "getReadMediaToken" | "getWriteUserMediaToken" | "updateUserHeaderImage" | "getWriteTeamMediaToken" | "getSoftDeletedTeamById" | "restoreTeam" | "getUserInSiteUserBase" | "getUserContainers" | "getUserManageConfig" | "getMyAvatarUploadedStatus" | "deleteUserAvatar" | "getTeamLinkIcons" | "getTeamInSlack" | "restoreTeamToSyncedGroup" | "getTeamAndGroupDiff" | "linkExistingTeamToGroup" | "fetchUserAvatarInfo" | "updateUser" | "updateUserAvatar" | "disconnectTeamInSlack" | "updateTeamInSlack" | "getUserTenure" | "getAriFromUrl" | "getWebLinkTitle", TeamsUFOExperience>;
|
|
4
|
+
export declare const TEAMS_CLIENT_EXPERIENCES: Map<"getAllTeams" | "getOrgEligibilityForManagedTeams" | "addAgentToTeam" | "removeAgentTeamAssociation" | "createTeam" | "getPermissions" | "getLinkedTeamsBulk" | "getTeamProfileDetails" | "getOrgScope" | "getTeamById" | "updateTeamById" | "querySettings" | "queryFeatureFlags" | "queryTeamMemberships" | "queryUser" | "inviteUsersToTeam" | "getMyTeamMembership" | "getTeamLinksByTeamId" | "createTeamLink" | "updateTeamLink" | "deleteTeamLink" | "reorderTeamLink" | "acceptTeamInvitation" | "declineTeamInvitation" | "selfJoinTeam" | "cancelJoinRequest" | "acceptJoinRequest" | "declineJoinRequest" | "deleteTeamMembership" | "revokeTeamInvite" | "deleteTeam" | "isSingleFullMemberTeam" | "createTeamContainers" | "createExternalTeam" | "getProfileWithMutability" | "getIsSiteAdmin" | "addUsersToTeam" | "removeTeamMemberships" | "getRecommendedProducts" | "joinOrRequestDefaultAccessToProductsBulk" | "getReadMediaToken" | "getWriteUserMediaToken" | "updateUserHeaderImage" | "getWriteTeamMediaToken" | "getSoftDeletedTeamById" | "restoreTeam" | "getUserInSiteUserBase" | "getUserContainers" | "getUserManageConfig" | "getMyAvatarUploadedStatus" | "deleteUserAvatar" | "getTeamLinkIcons" | "getTeamInSlack" | "restoreTeamToSyncedGroup" | "getTeamAndGroupDiff" | "linkExistingTeamToGroup" | "fetchUserAvatarInfo" | "updateUser" | "updateUserAvatar" | "disconnectTeamInSlack" | "updateTeamInSlack" | "getUserTenure" | "getAriFromUrl" | "getWebLinkTitle" | "getTeamEnabledSites" | "assignTeamsToSites" | "getAssignedTeams" | "setTeamSiteAssignmentPermission", TeamsUFOExperience>;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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 ExternalReference, type LinkedTeamsBulkResponse, type LinkedTeamsProfileDetails, type OrgScope, type SoftDeletedTeam, type TeamsPermissionFromApi } from '../../types/team';
|
|
2
|
+
import { type AssignedTeamsResponse, type AssignTeamsToSitesResponse, type ExternalReference, type LinkedTeamsBulkResponse, type LinkedTeamsProfileDetails, type OrgScope, type SoftDeletedTeam, type TeamEnabledSitesResponse, type TeamsPermissionFromApi } from '../../types/team';
|
|
3
3
|
import { type ApiTeamContainerCreationPayload, type ApiTeamContainerResponse } from '../../types/team-container';
|
|
4
4
|
import { type UserInSiteUserbase } from '../../types/user';
|
|
5
5
|
import { RestClient } from '../rest-client';
|
|
@@ -19,6 +19,7 @@ export interface SortField {
|
|
|
19
19
|
field: string;
|
|
20
20
|
order: 'asc' | 'desc';
|
|
21
21
|
}
|
|
22
|
+
export type AlignmentPermission = 'ALL_USERS' | 'ORG_ADMIN';
|
|
22
23
|
/**
|
|
23
24
|
* @type AllTeamsQuery
|
|
24
25
|
* Query type for the getAllTeams API
|
|
@@ -100,6 +101,13 @@ export interface LegionClient {
|
|
|
100
101
|
getPermissions(): Promise<TeamsPermissionFromApi>;
|
|
101
102
|
restoreTeamToSyncedGroup(teamId: string, externalReference: ExternalReference): Promise<void>;
|
|
102
103
|
createTeamContainers(payload: ApiTeamContainerCreationPayload): Promise<ApiTeamContainerResponse>;
|
|
104
|
+
getTeamEnabledSites(teamId: string): Promise<TeamEnabledSitesResponse>;
|
|
105
|
+
assignTeamsToSites(migrations: {
|
|
106
|
+
teamId: string;
|
|
107
|
+
targetSite: string;
|
|
108
|
+
}[]): Promise<AssignTeamsToSitesResponse>;
|
|
109
|
+
getAssignedTeams(orgId: string, count: number, cursor?: string, displayNameContains?: string): Promise<AssignedTeamsResponse>;
|
|
110
|
+
setTeamSiteAssignmentPermission(orgId: string, alignmentPermission: AlignmentPermission): Promise<void>;
|
|
103
111
|
}
|
|
104
112
|
/**
|
|
105
113
|
* REST Client to make calls to Legion.
|
|
@@ -259,6 +259,30 @@ export declare class TeamsClient {
|
|
|
259
259
|
* Get user profile with mutability constraints
|
|
260
260
|
*/
|
|
261
261
|
getProfileWithMutability(...args: Parameters<typeof mutabilityClient.getProfileWithMutability>): Promise<AwaitedReturn<typeof mutabilityClient.getProfileWithMutability>>;
|
|
262
|
+
/**
|
|
263
|
+
* Get enabled sites for a team
|
|
264
|
+
*/
|
|
265
|
+
getTeamEnabledSites(...args: Parameters<typeof defaultLegionClient.getTeamEnabledSites>): Promise<AwaitedReturn<typeof defaultLegionClient.getTeamEnabledSites>>;
|
|
266
|
+
/**
|
|
267
|
+
* Assign teams to sites
|
|
268
|
+
* @param migrations
|
|
269
|
+
* @returns {Promise<AssignTeamsToSitesResponse>}
|
|
270
|
+
*/
|
|
271
|
+
assignTeamsToSites(...args: Parameters<typeof defaultLegionClient.assignTeamsToSites>): Promise<AwaitedReturn<typeof defaultLegionClient.assignTeamsToSites>>;
|
|
272
|
+
/**
|
|
273
|
+
* Get assigned teams
|
|
274
|
+
* @param orgId
|
|
275
|
+
* @param cursor
|
|
276
|
+
* @param displayNameContains
|
|
277
|
+
* @param count - number of teams to return
|
|
278
|
+
*/
|
|
279
|
+
getAssignedTeams(...args: Parameters<typeof defaultLegionClient.getAssignedTeams>): Promise<AwaitedReturn<typeof defaultLegionClient.getAssignedTeams>>;
|
|
280
|
+
/**
|
|
281
|
+
* Set team site assignment permission
|
|
282
|
+
* @param orgId
|
|
283
|
+
* @param alignmentPermission - 'ALL_USERS' | 'ORG_ADMIN'
|
|
284
|
+
*/
|
|
285
|
+
setTeamSiteAssignmentPermission(...args: Parameters<typeof defaultLegionClient.setTeamSiteAssignmentPermission>): Promise<AwaitedReturn<typeof defaultLegionClient.setTeamSiteAssignmentPermission>>;
|
|
262
286
|
/**
|
|
263
287
|
* Is the current user a site admin
|
|
264
288
|
*/
|
|
@@ -15,22 +15,18 @@ export declare const createErrorHandler: CreateErrorHandler;
|
|
|
15
15
|
export declare const logExceptionWithPackageContext: (packageContext: {
|
|
16
16
|
packageName: string;
|
|
17
17
|
packageVersion: string;
|
|
18
|
-
}) => (
|
|
18
|
+
}) => (...args: Parameters<typeof logException>) => void;
|
|
19
19
|
export declare const logErrorMessageWithPackageContext: (packageContext: {
|
|
20
20
|
packageName: string;
|
|
21
21
|
packageVersion: string;
|
|
22
|
-
}) => (
|
|
22
|
+
}) => (...args: Parameters<typeof logErrorMessage>) => void;
|
|
23
23
|
export declare const logInfoMessageWithPackageContext: (packageContext: {
|
|
24
24
|
packageName: string;
|
|
25
25
|
packageVersion: string;
|
|
26
|
-
}) => (
|
|
26
|
+
}) => (...args: Parameters<typeof logInfoMessage>) => void;
|
|
27
27
|
export declare const createErrorHandlerWithPackageContext: (packageContext: {
|
|
28
28
|
packageName: string;
|
|
29
29
|
packageVersion: string;
|
|
30
|
-
}) => (
|
|
31
|
-
packageName: string;
|
|
32
|
-
packageVersion: string;
|
|
33
|
-
teamName: string;
|
|
34
|
-
}, commonTags?: Record<string, string> | undefined) => import("./types").ErrorHandler;
|
|
30
|
+
}) => (...args: Parameters<typeof createErrorHandler>) => import("./types").ErrorHandler;
|
|
35
31
|
export declare function addBreadcrumb(crumb: string | Breadcrumb): Promise<void>;
|
|
36
32
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type DocumentNode } from 'graphql';
|
|
2
2
|
import { type QueryOptions, type QueryResponse } from './types';
|
|
3
3
|
export declare const useQueryLight: <TParams, TResult>(query: DocumentNode, options: QueryOptions<TParams>) => QueryResponse<TParams, TResult>;
|
|
4
|
-
export declare const useLazyQueryLight: <TParams, TResult>(query: DocumentNode, options: Omit<QueryOptions<TParams>,
|
|
4
|
+
export declare const useLazyQueryLight: <TParams, TResult>(query: DocumentNode, options: Omit<QueryOptions<TParams>, "skip">) => [() => void, QueryResponse<TParams, TResult>];
|
|
@@ -120,3 +120,42 @@ export interface OrgScope {
|
|
|
120
120
|
scopeMode: ScopeMode;
|
|
121
121
|
scopes: Scope[];
|
|
122
122
|
}
|
|
123
|
+
export interface TeamEnabledSitesResponse {
|
|
124
|
+
suggestedSite: {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
};
|
|
128
|
+
sites: {
|
|
129
|
+
id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
}[];
|
|
132
|
+
}
|
|
133
|
+
export interface AssignTeamsToSitesResponse {
|
|
134
|
+
migratedTeams: string[];
|
|
135
|
+
failedTeams: {
|
|
136
|
+
teamId: string;
|
|
137
|
+
failureCode: string;
|
|
138
|
+
failureReason: string;
|
|
139
|
+
}[];
|
|
140
|
+
}
|
|
141
|
+
export interface AssignedTeam {
|
|
142
|
+
id: string;
|
|
143
|
+
displayName: string;
|
|
144
|
+
avatarImageUrl: string;
|
|
145
|
+
members: {
|
|
146
|
+
firstPageCount: number;
|
|
147
|
+
memberCursor: string;
|
|
148
|
+
};
|
|
149
|
+
scope: {
|
|
150
|
+
id: string;
|
|
151
|
+
name: string;
|
|
152
|
+
};
|
|
153
|
+
scopeAlignmentMetadata: {
|
|
154
|
+
accountId: string;
|
|
155
|
+
timestamp: string;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface AssignedTeamsResponse {
|
|
159
|
+
teams: AssignedTeam[];
|
|
160
|
+
cursor: string;
|
|
161
|
+
}
|
|
@@ -37,5 +37,5 @@ export interface UserInSiteUserbase {
|
|
|
37
37
|
}
|
|
38
38
|
declare const EditableUserFieldList: readonly ["title", "department", "companyName", "location", "phoneNumber", "fullName", "nickname", "locale", "email"];
|
|
39
39
|
export type EditableUserFields = Pick<TeamsClientUser, (typeof EditableUserFieldList)[number]>;
|
|
40
|
-
export declare const isEditableUserField: (key: string) => key is
|
|
40
|
+
export declare const isEditableUserField: (key: string) => key is keyof EditableUserFields;
|
|
41
41
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type TeamARI, type UserARI } from '../types';
|
|
2
|
-
export declare const isUserARI: (ari: string) => ari is
|
|
2
|
+
export declare const isUserARI: (ari: string) => ari is UserARI;
|
|
3
3
|
export declare const toUserId: (ari: UserARI | string) => string;
|
|
4
4
|
export declare const toUserARI: (userId: string) => UserARI;
|
|
5
|
-
export declare const isTeamARI: (ari: string) => ari is
|
|
5
|
+
export declare const isTeamARI: (ari: string) => ari is TeamARI;
|
|
6
6
|
export declare const toTeamId: (ari: TeamARI | string) => string;
|
|
7
7
|
export declare const toTeamARI: (teamId: string) => TeamARI;
|
|
@@ -63,8 +63,12 @@ declare const TeamsClientExperienceKeyList: readonly [
|
|
|
63
63
|
"getAriFromUrl",
|
|
64
64
|
"getWebLinkTitle",
|
|
65
65
|
"addAgentToTeam",
|
|
66
|
-
"
|
|
66
|
+
"getTeamEnabledSites",
|
|
67
|
+
"assignTeamsToSites",
|
|
68
|
+
"removeAgentTeamAssociation",
|
|
69
|
+
"getAssignedTeams",
|
|
70
|
+
"setTeamSiteAssignmentPermission"
|
|
67
71
|
];
|
|
68
72
|
export type TeamsClientExperienceKeys = (typeof TeamsClientExperienceKeyList)[number];
|
|
69
|
-
export declare const TEAMS_CLIENT_EXPERIENCES: Map<"getAllTeams" | "getOrgEligibilityForManagedTeams" | "addAgentToTeam" | "removeAgentTeamAssociation" | "createTeam" | "getPermissions" | "getLinkedTeamsBulk" | "getTeamProfileDetails" | "getOrgScope" | "getTeamById" | "updateTeamById" | "querySettings" | "queryFeatureFlags" | "queryTeamMemberships" | "queryUser" | "inviteUsersToTeam" | "getMyTeamMembership" | "getTeamLinksByTeamId" | "createTeamLink" | "updateTeamLink" | "deleteTeamLink" | "reorderTeamLink" | "acceptTeamInvitation" | "declineTeamInvitation" | "selfJoinTeam" | "cancelJoinRequest" | "acceptJoinRequest" | "declineJoinRequest" | "deleteTeamMembership" | "revokeTeamInvite" | "deleteTeam" | "isSingleFullMemberTeam" | "createTeamContainers" | "createExternalTeam" | "getProfileWithMutability" | "getIsSiteAdmin" | "addUsersToTeam" | "removeTeamMemberships" | "getRecommendedProducts" | "joinOrRequestDefaultAccessToProductsBulk" | "getReadMediaToken" | "getWriteUserMediaToken" | "updateUserHeaderImage" | "getWriteTeamMediaToken" | "getSoftDeletedTeamById" | "restoreTeam" | "getUserInSiteUserBase" | "getUserContainers" | "getUserManageConfig" | "getMyAvatarUploadedStatus" | "deleteUserAvatar" | "getTeamLinkIcons" | "getTeamInSlack" | "restoreTeamToSyncedGroup" | "getTeamAndGroupDiff" | "linkExistingTeamToGroup" | "fetchUserAvatarInfo" | "updateUser" | "updateUserAvatar" | "disconnectTeamInSlack" | "updateTeamInSlack" | "getUserTenure" | "getAriFromUrl" | "getWebLinkTitle", TeamsUFOExperience>;
|
|
73
|
+
export declare const TEAMS_CLIENT_EXPERIENCES: Map<"getAllTeams" | "getOrgEligibilityForManagedTeams" | "addAgentToTeam" | "removeAgentTeamAssociation" | "createTeam" | "getPermissions" | "getLinkedTeamsBulk" | "getTeamProfileDetails" | "getOrgScope" | "getTeamById" | "updateTeamById" | "querySettings" | "queryFeatureFlags" | "queryTeamMemberships" | "queryUser" | "inviteUsersToTeam" | "getMyTeamMembership" | "getTeamLinksByTeamId" | "createTeamLink" | "updateTeamLink" | "deleteTeamLink" | "reorderTeamLink" | "acceptTeamInvitation" | "declineTeamInvitation" | "selfJoinTeam" | "cancelJoinRequest" | "acceptJoinRequest" | "declineJoinRequest" | "deleteTeamMembership" | "revokeTeamInvite" | "deleteTeam" | "isSingleFullMemberTeam" | "createTeamContainers" | "createExternalTeam" | "getProfileWithMutability" | "getIsSiteAdmin" | "addUsersToTeam" | "removeTeamMemberships" | "getRecommendedProducts" | "joinOrRequestDefaultAccessToProductsBulk" | "getReadMediaToken" | "getWriteUserMediaToken" | "updateUserHeaderImage" | "getWriteTeamMediaToken" | "getSoftDeletedTeamById" | "restoreTeam" | "getUserInSiteUserBase" | "getUserContainers" | "getUserManageConfig" | "getMyAvatarUploadedStatus" | "deleteUserAvatar" | "getTeamLinkIcons" | "getTeamInSlack" | "restoreTeamToSyncedGroup" | "getTeamAndGroupDiff" | "linkExistingTeamToGroup" | "fetchUserAvatarInfo" | "updateUser" | "updateUserAvatar" | "disconnectTeamInSlack" | "updateTeamInSlack" | "getUserTenure" | "getAriFromUrl" | "getWebLinkTitle" | "getTeamEnabledSites" | "assignTeamsToSites" | "getAssignedTeams" | "setTeamSiteAssignmentPermission", TeamsUFOExperience>;
|
|
70
74
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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 ExternalReference, type LinkedTeamsBulkResponse, type LinkedTeamsProfileDetails, type OrgScope, type SoftDeletedTeam, type TeamsPermissionFromApi } from '../../types/team';
|
|
2
|
+
import { type AssignedTeamsResponse, type AssignTeamsToSitesResponse, type ExternalReference, type LinkedTeamsBulkResponse, type LinkedTeamsProfileDetails, type OrgScope, type SoftDeletedTeam, type TeamEnabledSitesResponse, type TeamsPermissionFromApi } from '../../types/team';
|
|
3
3
|
import { type ApiTeamContainerCreationPayload, type ApiTeamContainerResponse } from '../../types/team-container';
|
|
4
4
|
import { type UserInSiteUserbase } from '../../types/user';
|
|
5
5
|
import { RestClient } from '../rest-client';
|
|
@@ -19,6 +19,7 @@ export interface SortField {
|
|
|
19
19
|
field: string;
|
|
20
20
|
order: 'asc' | 'desc';
|
|
21
21
|
}
|
|
22
|
+
export type AlignmentPermission = 'ALL_USERS' | 'ORG_ADMIN';
|
|
22
23
|
/**
|
|
23
24
|
* @type AllTeamsQuery
|
|
24
25
|
* Query type for the getAllTeams API
|
|
@@ -100,6 +101,13 @@ export interface LegionClient {
|
|
|
100
101
|
getPermissions(): Promise<TeamsPermissionFromApi>;
|
|
101
102
|
restoreTeamToSyncedGroup(teamId: string, externalReference: ExternalReference): Promise<void>;
|
|
102
103
|
createTeamContainers(payload: ApiTeamContainerCreationPayload): Promise<ApiTeamContainerResponse>;
|
|
104
|
+
getTeamEnabledSites(teamId: string): Promise<TeamEnabledSitesResponse>;
|
|
105
|
+
assignTeamsToSites(migrations: {
|
|
106
|
+
teamId: string;
|
|
107
|
+
targetSite: string;
|
|
108
|
+
}[]): Promise<AssignTeamsToSitesResponse>;
|
|
109
|
+
getAssignedTeams(orgId: string, count: number, cursor?: string, displayNameContains?: string): Promise<AssignedTeamsResponse>;
|
|
110
|
+
setTeamSiteAssignmentPermission(orgId: string, alignmentPermission: AlignmentPermission): Promise<void>;
|
|
103
111
|
}
|
|
104
112
|
/**
|
|
105
113
|
* REST Client to make calls to Legion.
|
|
@@ -259,6 +259,30 @@ export declare class TeamsClient {
|
|
|
259
259
|
* Get user profile with mutability constraints
|
|
260
260
|
*/
|
|
261
261
|
getProfileWithMutability(...args: Parameters<typeof mutabilityClient.getProfileWithMutability>): Promise<AwaitedReturn<typeof mutabilityClient.getProfileWithMutability>>;
|
|
262
|
+
/**
|
|
263
|
+
* Get enabled sites for a team
|
|
264
|
+
*/
|
|
265
|
+
getTeamEnabledSites(...args: Parameters<typeof defaultLegionClient.getTeamEnabledSites>): Promise<AwaitedReturn<typeof defaultLegionClient.getTeamEnabledSites>>;
|
|
266
|
+
/**
|
|
267
|
+
* Assign teams to sites
|
|
268
|
+
* @param migrations
|
|
269
|
+
* @returns {Promise<AssignTeamsToSitesResponse>}
|
|
270
|
+
*/
|
|
271
|
+
assignTeamsToSites(...args: Parameters<typeof defaultLegionClient.assignTeamsToSites>): Promise<AwaitedReturn<typeof defaultLegionClient.assignTeamsToSites>>;
|
|
272
|
+
/**
|
|
273
|
+
* Get assigned teams
|
|
274
|
+
* @param orgId
|
|
275
|
+
* @param cursor
|
|
276
|
+
* @param displayNameContains
|
|
277
|
+
* @param count - number of teams to return
|
|
278
|
+
*/
|
|
279
|
+
getAssignedTeams(...args: Parameters<typeof defaultLegionClient.getAssignedTeams>): Promise<AwaitedReturn<typeof defaultLegionClient.getAssignedTeams>>;
|
|
280
|
+
/**
|
|
281
|
+
* Set team site assignment permission
|
|
282
|
+
* @param orgId
|
|
283
|
+
* @param alignmentPermission - 'ALL_USERS' | 'ORG_ADMIN'
|
|
284
|
+
*/
|
|
285
|
+
setTeamSiteAssignmentPermission(...args: Parameters<typeof defaultLegionClient.setTeamSiteAssignmentPermission>): Promise<AwaitedReturn<typeof defaultLegionClient.setTeamSiteAssignmentPermission>>;
|
|
262
286
|
/**
|
|
263
287
|
* Is the current user a site admin
|
|
264
288
|
*/
|
|
@@ -15,22 +15,18 @@ export declare const createErrorHandler: CreateErrorHandler;
|
|
|
15
15
|
export declare const logExceptionWithPackageContext: (packageContext: {
|
|
16
16
|
packageName: string;
|
|
17
17
|
packageVersion: string;
|
|
18
|
-
}) => (
|
|
18
|
+
}) => (...args: Parameters<typeof logException>) => void;
|
|
19
19
|
export declare const logErrorMessageWithPackageContext: (packageContext: {
|
|
20
20
|
packageName: string;
|
|
21
21
|
packageVersion: string;
|
|
22
|
-
}) => (
|
|
22
|
+
}) => (...args: Parameters<typeof logErrorMessage>) => void;
|
|
23
23
|
export declare const logInfoMessageWithPackageContext: (packageContext: {
|
|
24
24
|
packageName: string;
|
|
25
25
|
packageVersion: string;
|
|
26
|
-
}) => (
|
|
26
|
+
}) => (...args: Parameters<typeof logInfoMessage>) => void;
|
|
27
27
|
export declare const createErrorHandlerWithPackageContext: (packageContext: {
|
|
28
28
|
packageName: string;
|
|
29
29
|
packageVersion: string;
|
|
30
|
-
}) => (
|
|
31
|
-
packageName: string;
|
|
32
|
-
packageVersion: string;
|
|
33
|
-
teamName: string;
|
|
34
|
-
}, commonTags?: Record<string, string> | undefined) => import("./types").ErrorHandler;
|
|
30
|
+
}) => (...args: Parameters<typeof createErrorHandler>) => import("./types").ErrorHandler;
|
|
35
31
|
export declare function addBreadcrumb(crumb: string | Breadcrumb): Promise<void>;
|
|
36
32
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DocumentNode } from 'graphql';
|
|
2
2
|
import { type QueryOptions, type QueryResponse } from './types';
|
|
3
3
|
export declare const useQueryLight: <TParams, TResult>(query: DocumentNode, options: QueryOptions<TParams>) => QueryResponse<TParams, TResult>;
|
|
4
|
-
export declare const useLazyQueryLight: <TParams, TResult>(query: DocumentNode, options: Omit<QueryOptions<TParams>,
|
|
4
|
+
export declare const useLazyQueryLight: <TParams, TResult>(query: DocumentNode, options: Omit<QueryOptions<TParams>, "skip">) => [
|
|
5
5
|
() => void,
|
|
6
6
|
QueryResponse<TParams, TResult>
|
|
7
7
|
];
|
|
@@ -120,3 +120,42 @@ export interface OrgScope {
|
|
|
120
120
|
scopeMode: ScopeMode;
|
|
121
121
|
scopes: Scope[];
|
|
122
122
|
}
|
|
123
|
+
export interface TeamEnabledSitesResponse {
|
|
124
|
+
suggestedSite: {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
};
|
|
128
|
+
sites: {
|
|
129
|
+
id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
}[];
|
|
132
|
+
}
|
|
133
|
+
export interface AssignTeamsToSitesResponse {
|
|
134
|
+
migratedTeams: string[];
|
|
135
|
+
failedTeams: {
|
|
136
|
+
teamId: string;
|
|
137
|
+
failureCode: string;
|
|
138
|
+
failureReason: string;
|
|
139
|
+
}[];
|
|
140
|
+
}
|
|
141
|
+
export interface AssignedTeam {
|
|
142
|
+
id: string;
|
|
143
|
+
displayName: string;
|
|
144
|
+
avatarImageUrl: string;
|
|
145
|
+
members: {
|
|
146
|
+
firstPageCount: number;
|
|
147
|
+
memberCursor: string;
|
|
148
|
+
};
|
|
149
|
+
scope: {
|
|
150
|
+
id: string;
|
|
151
|
+
name: string;
|
|
152
|
+
};
|
|
153
|
+
scopeAlignmentMetadata: {
|
|
154
|
+
accountId: string;
|
|
155
|
+
timestamp: string;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface AssignedTeamsResponse {
|
|
159
|
+
teams: AssignedTeam[];
|
|
160
|
+
cursor: string;
|
|
161
|
+
}
|
|
@@ -47,5 +47,5 @@ declare const EditableUserFieldList: readonly [
|
|
|
47
47
|
"email"
|
|
48
48
|
];
|
|
49
49
|
export type EditableUserFields = Pick<TeamsClientUser, (typeof EditableUserFieldList)[number]>;
|
|
50
|
-
export declare const isEditableUserField: (key: string) => key is
|
|
50
|
+
export declare const isEditableUserField: (key: string) => key is keyof EditableUserFields;
|
|
51
51
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/teams-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "A client to retrieve team related data",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"@atlassian/ptc-test-utils": "^0.9.0",
|
|
65
65
|
"@testing-library/react": "^13.4.0",
|
|
66
66
|
"@testing-library/react-hooks": "^8.0.1",
|
|
67
|
+
"@types/faker": "^4.1.8",
|
|
67
68
|
"react-dom": "^18.2.0",
|
|
68
69
|
"swagger-typescript-api": "^13.0.3",
|
|
69
70
|
"ts-morph": "^17.0.0",
|
|
70
71
|
"ts-node": "^10.9.1",
|
|
71
|
-
"typescript": "~5.4.2",
|
|
72
72
|
"wait-for-expect": "^1.2.0"
|
|
73
73
|
},
|
|
74
74
|
"techstack": {
|