@atlaskit/teams-client 4.24.1 → 4.25.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/teams-client
2
2
 
3
+ ## 4.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`58a9f3b29f99d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/58a9f3b29f99d) -
8
+ Remove temporary implementation of type ARI, use the official one
9
+
10
+ ### Patch Changes
11
+
12
+ - [`da4bb4ac09df1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da4bb4ac09df1) -
13
+ Update some type related permissions
14
+
3
15
  ## 4.24.1
4
16
 
5
17
  ### Patch Changes
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.USER_ARI_PREFIX = exports.TEAM_TYPE_ARI_PREFIX = exports.TEAM_ARI_PREFIX = void 0;
6
+ exports.USER_ARI_PREFIX = exports.TEAM_ARI_PREFIX = void 0;
7
7
  var USER_ARI_PREFIX = exports.USER_ARI_PREFIX = 'ari:cloud:identity::user/';
8
- var TEAM_ARI_PREFIX = exports.TEAM_ARI_PREFIX = 'ari:cloud:identity::team/';
9
- var TEAM_TYPE_ARI_PREFIX = exports.TEAM_TYPE_ARI_PREFIX = 'ari:cloud:identity::team-type/';
8
+ var TEAM_ARI_PREFIX = exports.TEAM_ARI_PREFIX = 'ari:cloud:identity::team/';
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.toUserId = exports.toUserARI = exports.toTeamTypeId = exports.toTeamId = exports.toTeamARI = exports.isUserARI = exports.isTeamTypeAri = exports.isTeamARI = void 0;
6
+ exports.toUserId = exports.toUserARI = exports.toTeamId = exports.toTeamARI = exports.isUserARI = exports.isTeamARI = void 0;
7
7
  var _types = require("../types");
8
8
  var isUserARI = exports.isUserARI = function isUserARI(ari) {
9
9
  return ari.startsWith(_types.USER_ARI_PREFIX);
@@ -28,17 +28,4 @@ var toTeamId = exports.toTeamId = function toTeamId(ari) {
28
28
  };
29
29
  var toTeamARI = exports.toTeamARI = function toTeamARI(teamId) {
30
30
  return isTeamARI(teamId) ? teamId : "".concat(_types.TEAM_ARI_PREFIX).concat(teamId);
31
- };
32
-
33
- /**
34
- * TODO: Replace these team type ari utils with @atlassian/ari when it is published
35
- */
36
- var isTeamTypeAri = exports.isTeamTypeAri = function isTeamTypeAri(ari) {
37
- return ari.startsWith(_types.TEAM_TYPE_ARI_PREFIX);
38
- };
39
- var toTeamTypeId = exports.toTeamTypeId = function toTeamTypeId(teamTypeAriOrId) {
40
- if (isTeamTypeAri(teamTypeAriOrId)) {
41
- return teamTypeAriOrId.replace(_types.TEAM_TYPE_ARI_PREFIX, '');
42
- }
43
- return teamTypeAriOrId;
44
31
  };
@@ -111,7 +111,6 @@ var getActiveTeamPermissionMap = function getActiveTeamPermissionMap(settings, p
111
111
  ADD_AGENT_TO_TEAM: newTeamProfileEnabled && (isMember || isOrgAdmin),
112
112
  REMOVE_AGENT_FROM_TEAM: newTeamProfileEnabled && (isMember || isOrgAdmin),
113
113
  ARCHIVE_TEAM: isArchiveTeamEnabled && isOrgAdmin,
114
- EDIT_TEAM_TYPE: isOrgAdmin,
115
114
  CAN_EDIT_HIERARCHY: permission === 'FULL_WRITE' && isOrgAdmin
116
115
  });
117
116
  } else if (settings === 'ORG_ADMIN_MANAGED') {
@@ -122,7 +121,9 @@ var getActiveTeamPermissionMap = function getActiveTeamPermissionMap(settings, p
122
121
  REMOVE_AGENT_FROM_TEAM: newTeamProfileEnabled && (isMember || permission === 'FULL_WRITE'),
123
122
  ARCHIVE_TEAM: isArchiveTeamEnabled && permission === 'FULL_WRITE',
124
123
  CAN_EDIT_HIERARCHY: permission === 'FULL_WRITE',
125
- EDIT_TEAM_TYPE: permission === 'FULL_WRITE'
124
+ EDIT_TEAM_TYPE: permission === 'FULL_WRITE',
125
+ // ORG_ADMIN_MANAGED teams should not provide options to edit membership settings
126
+ EDIT_TEAM_MEMBERSHIP: false
126
127
  });
127
128
  }
128
129
  return allPermissions(false, false, false);
package/dist/cjs/index.js CHANGED
@@ -111,12 +111,6 @@ Object.defineProperty(exports, "toTeamId", {
111
111
  return _ari.toTeamId;
112
112
  }
113
113
  });
114
- Object.defineProperty(exports, "toTeamTypeId", {
115
- enumerable: true,
116
- get: function get() {
117
- return _ari.toTeamTypeId;
118
- }
119
- });
120
114
  Object.defineProperty(exports, "toUserARI", {
121
115
  enumerable: true,
122
116
  get: function get() {
@@ -15,7 +15,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
15
15
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
16
16
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
17
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
18
- var _ari = require("../../common/utils/ari");
19
18
  var _constants = require("../constants");
20
19
  var _restClient = require("../rest-client");
21
20
  var _excluded = ["linkUri"];
@@ -790,7 +789,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
790
789
  siteId: this.getCloudId(),
791
790
  organizationId: organizationId,
792
791
  members: (0, _toConsumableArray2.default)(new Set(members)),
793
- typeId: typeId ? (0, _ari.toTeamTypeId)(typeId) : undefined
792
+ typeId: typeId
794
793
  });
795
794
  case 10:
796
795
  legionTeam = _context25.sent;
@@ -1,3 +1,2 @@
1
1
  export const USER_ARI_PREFIX = 'ari:cloud:identity::user/';
2
- export const TEAM_ARI_PREFIX = 'ari:cloud:identity::team/';
3
- export const TEAM_TYPE_ARI_PREFIX = 'ari:cloud:identity::team-type/';
2
+ export const TEAM_ARI_PREFIX = 'ari:cloud:identity::team/';
@@ -1,4 +1,4 @@
1
- import { TEAM_ARI_PREFIX, TEAM_TYPE_ARI_PREFIX, USER_ARI_PREFIX } from '../types';
1
+ import { TEAM_ARI_PREFIX, USER_ARI_PREFIX } from '../types';
2
2
  export const isUserARI = ari => ari.startsWith(USER_ARI_PREFIX);
3
3
  export const toUserId = ari => {
4
4
  if (isUserARI(ari)) {
@@ -18,15 +18,4 @@ export const toTeamId = ari => {
18
18
  };
19
19
  export const toTeamARI = teamId => {
20
20
  return isTeamARI(teamId) ? teamId : `${TEAM_ARI_PREFIX}${teamId}`;
21
- };
22
-
23
- /**
24
- * TODO: Replace these team type ari utils with @atlassian/ari when it is published
25
- */
26
- export const isTeamTypeAri = ari => ari.startsWith(TEAM_TYPE_ARI_PREFIX);
27
- export const toTeamTypeId = teamTypeAriOrId => {
28
- if (isTeamTypeAri(teamTypeAriOrId)) {
29
- return teamTypeAriOrId.replace(TEAM_TYPE_ARI_PREFIX, '');
30
- }
31
- return teamTypeAriOrId;
32
21
  };
@@ -100,7 +100,6 @@ const getActiveTeamPermissionMap = (settings, permission, isMember, isOrgAdmin,
100
100
  ADD_AGENT_TO_TEAM: newTeamProfileEnabled && (isMember || isOrgAdmin),
101
101
  REMOVE_AGENT_FROM_TEAM: newTeamProfileEnabled && (isMember || isOrgAdmin),
102
102
  ARCHIVE_TEAM: isArchiveTeamEnabled && isOrgAdmin,
103
- EDIT_TEAM_TYPE: isOrgAdmin,
104
103
  CAN_EDIT_HIERARCHY: permission === 'FULL_WRITE' && isOrgAdmin
105
104
  };
106
105
  } else if (settings === 'ORG_ADMIN_MANAGED') {
@@ -112,7 +111,9 @@ const getActiveTeamPermissionMap = (settings, permission, isMember, isOrgAdmin,
112
111
  REMOVE_AGENT_FROM_TEAM: newTeamProfileEnabled && (isMember || permission === 'FULL_WRITE'),
113
112
  ARCHIVE_TEAM: isArchiveTeamEnabled && permission === 'FULL_WRITE',
114
113
  CAN_EDIT_HIERARCHY: permission === 'FULL_WRITE',
115
- EDIT_TEAM_TYPE: permission === 'FULL_WRITE'
114
+ EDIT_TEAM_TYPE: permission === 'FULL_WRITE',
115
+ // ORG_ADMIN_MANAGED teams should not provide options to edit membership settings
116
+ EDIT_TEAM_MEMBERSHIP: false
116
117
  };
117
118
  }
118
119
  return allPermissions(false, false, false);
@@ -15,5 +15,5 @@ export { userInfoProvider, UserInfoProvider } from './services/user-info-provide
15
15
 
16
16
  // /utils
17
17
  export { sortMembersByType, isInvited, isMember, isNonMember, isRequestingJoin } from './common/utils';
18
- export { toUserARI, toUserId, toTeamARI, toTeamId, toTeamTypeId } from './common/utils/ari';
18
+ export { toUserARI, toUserId, toTeamARI, toTeamId } from './common/utils/ari';
19
19
  export { useLazyQueryLight, useQueryLight, UseQueryLightError } from './services/use-query-light';
@@ -1,4 +1,3 @@
1
- import { toTeamTypeId } from '../../common/utils/ari';
2
1
  import { DEFAULT_CONFIG } from '../constants';
3
2
  import { RestClient } from '../rest-client';
4
3
 
@@ -286,7 +285,7 @@ export class LegionClient extends RestClient {
286
285
  siteId: this.getCloudId(),
287
286
  organizationId: organizationId,
288
287
  members: [...new Set(members)],
289
- typeId: typeId ? toTeamTypeId(typeId) : undefined
288
+ typeId: typeId
290
289
  });
291
290
  return this.mapTeamCreateResponseV4ToTeam(legionTeam);
292
291
  }
@@ -1,3 +1,2 @@
1
1
  export var USER_ARI_PREFIX = 'ari:cloud:identity::user/';
2
- export var TEAM_ARI_PREFIX = 'ari:cloud:identity::team/';
3
- export var TEAM_TYPE_ARI_PREFIX = 'ari:cloud:identity::team-type/';
2
+ export var TEAM_ARI_PREFIX = 'ari:cloud:identity::team/';
@@ -1,4 +1,4 @@
1
- import { TEAM_ARI_PREFIX, TEAM_TYPE_ARI_PREFIX, USER_ARI_PREFIX } from '../types';
1
+ import { TEAM_ARI_PREFIX, USER_ARI_PREFIX } from '../types';
2
2
  export var isUserARI = function isUserARI(ari) {
3
3
  return ari.startsWith(USER_ARI_PREFIX);
4
4
  };
@@ -22,17 +22,4 @@ export var toTeamId = function toTeamId(ari) {
22
22
  };
23
23
  export var toTeamARI = function toTeamARI(teamId) {
24
24
  return isTeamARI(teamId) ? teamId : "".concat(TEAM_ARI_PREFIX).concat(teamId);
25
- };
26
-
27
- /**
28
- * TODO: Replace these team type ari utils with @atlassian/ari when it is published
29
- */
30
- export var isTeamTypeAri = function isTeamTypeAri(ari) {
31
- return ari.startsWith(TEAM_TYPE_ARI_PREFIX);
32
- };
33
- export var toTeamTypeId = function toTeamTypeId(teamTypeAriOrId) {
34
- if (isTeamTypeAri(teamTypeAriOrId)) {
35
- return teamTypeAriOrId.replace(TEAM_TYPE_ARI_PREFIX, '');
36
- }
37
- return teamTypeAriOrId;
38
25
  };
@@ -104,7 +104,6 @@ var getActiveTeamPermissionMap = function getActiveTeamPermissionMap(settings, p
104
104
  ADD_AGENT_TO_TEAM: newTeamProfileEnabled && (isMember || isOrgAdmin),
105
105
  REMOVE_AGENT_FROM_TEAM: newTeamProfileEnabled && (isMember || isOrgAdmin),
106
106
  ARCHIVE_TEAM: isArchiveTeamEnabled && isOrgAdmin,
107
- EDIT_TEAM_TYPE: isOrgAdmin,
108
107
  CAN_EDIT_HIERARCHY: permission === 'FULL_WRITE' && isOrgAdmin
109
108
  });
110
109
  } else if (settings === 'ORG_ADMIN_MANAGED') {
@@ -115,7 +114,9 @@ var getActiveTeamPermissionMap = function getActiveTeamPermissionMap(settings, p
115
114
  REMOVE_AGENT_FROM_TEAM: newTeamProfileEnabled && (isMember || permission === 'FULL_WRITE'),
116
115
  ARCHIVE_TEAM: isArchiveTeamEnabled && permission === 'FULL_WRITE',
117
116
  CAN_EDIT_HIERARCHY: permission === 'FULL_WRITE',
118
- EDIT_TEAM_TYPE: permission === 'FULL_WRITE'
117
+ EDIT_TEAM_TYPE: permission === 'FULL_WRITE',
118
+ // ORG_ADMIN_MANAGED teams should not provide options to edit membership settings
119
+ EDIT_TEAM_MEMBERSHIP: false
119
120
  });
120
121
  }
121
122
  return allPermissions(false, false, false);
package/dist/esm/index.js CHANGED
@@ -15,5 +15,5 @@ export { userInfoProvider, UserInfoProvider } from './services/user-info-provide
15
15
 
16
16
  // /utils
17
17
  export { sortMembersByType, isInvited, isMember, isNonMember, isRequestingJoin } from './common/utils';
18
- export { toUserARI, toUserId, toTeamARI, toTeamId, toTeamTypeId } from './common/utils/ari';
18
+ export { toUserARI, toUserId, toTeamARI, toTeamId } from './common/utils/ari';
19
19
  export { useLazyQueryLight, useQueryLight, UseQueryLightError } from './services/use-query-light';
@@ -13,7 +13,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  import _regeneratorRuntime from "@babel/runtime/regenerator";
14
14
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
15
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
16
- import { toTeamTypeId } from '../../common/utils/ari';
17
16
  import { DEFAULT_CONFIG } from '../constants';
18
17
  import { RestClient } from '../rest-client';
19
18
 
@@ -784,7 +783,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
784
783
  siteId: this.getCloudId(),
785
784
  organizationId: organizationId,
786
785
  members: _toConsumableArray(new Set(members)),
787
- typeId: typeId ? toTeamTypeId(typeId) : undefined
786
+ typeId: typeId
788
787
  });
789
788
  case 10:
790
789
  legionTeam = _context25.sent;
@@ -2,5 +2,3 @@ export declare const USER_ARI_PREFIX: "ari:cloud:identity::user/";
2
2
  export type UserARI = `${typeof USER_ARI_PREFIX}${string}`;
3
3
  export declare const TEAM_ARI_PREFIX: "ari:cloud:identity::team/";
4
4
  export type TeamARI = `${typeof TEAM_ARI_PREFIX}${string}`;
5
- export declare const TEAM_TYPE_ARI_PREFIX: "ari:cloud:identity::team-type/";
6
- export type TeamTypeAri = `${typeof TEAM_TYPE_ARI_PREFIX}${string}`;
@@ -1,12 +1,7 @@
1
- import { type TeamARI, type TeamTypeAri, type UserARI } from '../types';
1
+ import { type TeamARI, type UserARI } from '../types';
2
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
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;
8
- /**
9
- * TODO: Replace these team type ari utils with @atlassian/ari when it is published
10
- */
11
- export declare const isTeamTypeAri: (ari: string) => ari is TeamTypeAri;
12
- export declare const toTeamTypeId: (teamTypeAriOrId: TeamTypeAri | string) => string;
@@ -10,6 +10,6 @@ export { logException, logInfoMessage } from './services/sentry/main';
10
10
  export type { SentryClient } from './services/sentry/types';
11
11
  export { userInfoProvider, UserInfoProvider } from './services/user-info-provider';
12
12
  export { sortMembersByType, isInvited, isMember, isNonMember, isRequestingJoin, } from './common/utils';
13
- export { toUserARI, toUserId, toTeamARI, toTeamId, toTeamTypeId } from './common/utils/ari';
13
+ export { toUserARI, toUserId, toTeamARI, toTeamId } from './common/utils/ari';
14
14
  export { useLazyQueryLight, useQueryLight, UseQueryLightError, type ActualGraphQLError, } from './services/use-query-light';
15
15
  export type { FetchMoreArgs, QueryOptions } from './services/use-query-light';
@@ -2,5 +2,3 @@ export declare const USER_ARI_PREFIX: "ari:cloud:identity::user/";
2
2
  export type UserARI = `${typeof USER_ARI_PREFIX}${string}`;
3
3
  export declare const TEAM_ARI_PREFIX: "ari:cloud:identity::team/";
4
4
  export type TeamARI = `${typeof TEAM_ARI_PREFIX}${string}`;
5
- export declare const TEAM_TYPE_ARI_PREFIX: "ari:cloud:identity::team-type/";
6
- export type TeamTypeAri = `${typeof TEAM_TYPE_ARI_PREFIX}${string}`;
@@ -1,12 +1,7 @@
1
- import { type TeamARI, type TeamTypeAri, type UserARI } from '../types';
1
+ import { type TeamARI, type UserARI } from '../types';
2
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
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;
8
- /**
9
- * TODO: Replace these team type ari utils with @atlassian/ari when it is published
10
- */
11
- export declare const isTeamTypeAri: (ari: string) => ari is TeamTypeAri;
12
- export declare const toTeamTypeId: (teamTypeAriOrId: TeamTypeAri | string) => string;
@@ -10,6 +10,6 @@ export { logException, logInfoMessage } from './services/sentry/main';
10
10
  export type { SentryClient } from './services/sentry/types';
11
11
  export { userInfoProvider, UserInfoProvider } from './services/user-info-provider';
12
12
  export { sortMembersByType, isInvited, isMember, isNonMember, isRequestingJoin, } from './common/utils';
13
- export { toUserARI, toUserId, toTeamARI, toTeamId, toTeamTypeId } from './common/utils/ari';
13
+ export { toUserARI, toUserId, toTeamARI, toTeamId } from './common/utils/ari';
14
14
  export { useLazyQueryLight, useQueryLight, UseQueryLightError, type ActualGraphQLError, } from './services/use-query-light';
15
15
  export type { FetchMoreArgs, QueryOptions } from './services/use-query-light';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/teams-client",
3
- "version": "4.24.1",
3
+ "version": "4.25.0",
4
4
  "description": "A client to retrieve team related data",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",