@atlaskit/teams-client 4.31.0 → 4.32.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,18 @@
1
1
  # @atlaskit/teams-client
2
2
 
3
+ ## 4.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2f909e7624d7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f909e7624d7f) -
8
+ Align getAllTeams request with pagination parameter
9
+
10
+ ## 4.31.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 4.31.0
4
17
 
5
18
  ### Minor Changes
@@ -52,7 +52,7 @@ var TeamsUFOExperience = exports.TeamsUFOExperience = /*#__PURE__*/function (_UF
52
52
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
53
53
  metadata: {
54
54
  error: (0, _utils.createErrorMetadata)(error),
55
- packageVersion: "4.30.3",
55
+ packageVersion: "0.0.0-development",
56
56
  packageName: "@atlaskit/teams-client"
57
57
  }
58
58
  }]);
@@ -60,7 +60,7 @@ var TeamsUFOExperience = exports.TeamsUFOExperience = /*#__PURE__*/function (_UF
60
60
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
61
61
  metadata: {
62
62
  error: 'unknown error',
63
- packageVersion: "4.30.3",
63
+ packageVersion: "0.0.0-development",
64
64
  packageName: "@atlaskit/teams-client"
65
65
  }
66
66
  }]);
@@ -33,6 +33,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
33
33
  * @property {boolean} useDefaultSort - Whether to use the default sort order
34
34
  * @property {boolean} showEmptyTeams - Whether to return empty teams in the search
35
35
  * @property {string[]} teamTypeIdsFilter - List of team type IDs to filter teams
36
+ * @property {boolean} enablePagination - Whether the API should paginate the response
36
37
  */
37
38
 
38
39
  /**
@@ -110,20 +111,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
110
111
  value: function () {
111
112
  var _getAllTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(allTeamsQuery) {
112
113
  var _this2 = this;
113
- var _orgId, _siteId, _yield$this$postResou, entities, _cursor, teams;
114
+ var _allTeamsQuery$enable, _orgId, _siteId, enablePagination, _yield$this$postResou, entities, _cursor, teams;
114
115
  return _regenerator.default.wrap(function _callee2$(_context2) {
115
116
  while (1) switch (_context2.prev = _context2.next) {
116
117
  case 0:
117
118
  _context2.prev = 0;
118
119
  _orgId = this.getOrgId(allTeamsQuery.orgId);
119
120
  _siteId = this.getCloudId();
120
- _context2.next = 5;
121
- return this.postResource("".concat(v4UrlPath, "/search"), {
121
+ enablePagination = (_allTeamsQuery$enable = allTeamsQuery.enablePagination) !== null && _allTeamsQuery$enable !== void 0 ? _allTeamsQuery$enable : true;
122
+ _context2.next = 6;
123
+ return this.postResource("".concat(v4UrlPath, "/search"), _objectSpread({
122
124
  organizationId: _orgId,
123
125
  siteId: _siteId,
124
126
  limit: allTeamsQuery.limit,
125
127
  query: allTeamsQuery.searchQuery,
126
- cursor: allTeamsQuery.cursor || '',
127
128
  sortBy: allTeamsQuery.useDefaultSort ? null : allTeamsQuery.sortBy && allTeamsQuery.sortBy.length > 0 ? allTeamsQuery.sortBy : [{
128
129
  field: 'displayName',
129
130
  order: 'asc'
@@ -132,9 +133,12 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
132
133
  memberAccountIds: allTeamsQuery.memberAccountIds
133
134
  },
134
135
  showEmptyTeams: allTeamsQuery.showEmptyTeams,
135
- teamTypeIdsFilter: allTeamsQuery.teamTypeIdsFilter
136
- });
137
- case 5:
136
+ teamTypeIdsFilter: allTeamsQuery.teamTypeIdsFilter,
137
+ enablePagination: enablePagination
138
+ }, enablePagination && allTeamsQuery.cursor ? {
139
+ cursor: allTeamsQuery.cursor
140
+ } : {}));
141
+ case 6:
138
142
  _yield$this$postResou = _context2.sent;
139
143
  entities = _yield$this$postResou.entities;
140
144
  _cursor = _yield$this$postResou.cursor;
@@ -145,8 +149,8 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
145
149
  cursor: _cursor,
146
150
  teams: teams
147
151
  });
148
- case 12:
149
- _context2.prev = 12;
152
+ case 13:
153
+ _context2.prev = 13;
150
154
  _context2.t0 = _context2["catch"](0);
151
155
  this.logException(_context2.t0, 'getAllTeams');
152
156
  return _context2.abrupt("return", {
@@ -154,11 +158,11 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
154
158
  teams: [],
155
159
  error: _context2.t0 instanceof Error ? _context2.t0 : undefined
156
160
  });
157
- case 16:
161
+ case 17:
158
162
  case "end":
159
163
  return _context2.stop();
160
164
  }
161
- }, _callee2, this, [[0, 12]]);
165
+ }, _callee2, this, [[0, 13]]);
162
166
  }));
163
167
  function getAllTeams(_x3) {
164
168
  return _getAllTeams.apply(this, arguments);
@@ -36,7 +36,7 @@ function getSentryConfig(options) {
36
36
  return _objectSpread(_objectSpread(_objectSpread({}, otherOptions), DEFAULT_SENTRY_CONFIG), {}, {
37
37
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
38
38
  // when building to deploy to production
39
- release: "".concat("@atlaskit/teams-client", "@").concat("4.30.3") ||
39
+ release: "".concat("@atlaskit/teams-client", "@").concat("0.0.0-development") ||
40
40
  // @ts-ignore Jira - window.BUILD_KEY
41
41
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
42
42
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -27,7 +27,7 @@ export class TeamsUFOExperience extends UFOExperience {
27
27
  return super.failure({
28
28
  metadata: {
29
29
  error: createErrorMetadata(error),
30
- packageVersion: "4.30.3",
30
+ packageVersion: "0.0.0-development",
31
31
  packageName: "@atlaskit/teams-client"
32
32
  }
33
33
  });
@@ -35,7 +35,7 @@ export class TeamsUFOExperience extends UFOExperience {
35
35
  return super.failure({
36
36
  metadata: {
37
37
  error: 'unknown error',
38
- packageVersion: "4.30.3",
38
+ packageVersion: "0.0.0-development",
39
39
  packageName: "@atlaskit/teams-client"
40
40
  }
41
41
  });
@@ -12,6 +12,7 @@ import { RestClient } from '../rest-client';
12
12
  * @property {boolean} useDefaultSort - Whether to use the default sort order
13
13
  * @property {boolean} showEmptyTeams - Whether to return empty teams in the search
14
14
  * @property {string[]} teamTypeIdsFilter - List of team type IDs to filter teams
15
+ * @property {boolean} enablePagination - Whether the API should paginate the response
15
16
  */
16
17
 
17
18
  /**
@@ -60,8 +61,10 @@ export class LegionClient extends RestClient {
60
61
  }
61
62
  async getAllTeams(allTeamsQuery) {
62
63
  try {
64
+ var _allTeamsQuery$enable;
63
65
  const orgId = this.getOrgId(allTeamsQuery.orgId);
64
66
  const siteId = this.getCloudId();
67
+ const enablePagination = (_allTeamsQuery$enable = allTeamsQuery.enablePagination) !== null && _allTeamsQuery$enable !== void 0 ? _allTeamsQuery$enable : true;
65
68
  const {
66
69
  entities,
67
70
  cursor
@@ -70,7 +73,6 @@ export class LegionClient extends RestClient {
70
73
  siteId: siteId,
71
74
  limit: allTeamsQuery.limit,
72
75
  query: allTeamsQuery.searchQuery,
73
- cursor: allTeamsQuery.cursor || '',
74
76
  sortBy: allTeamsQuery.useDefaultSort ? null : allTeamsQuery.sortBy && allTeamsQuery.sortBy.length > 0 ? allTeamsQuery.sortBy : [{
75
77
  field: 'displayName',
76
78
  order: 'asc'
@@ -79,7 +81,11 @@ export class LegionClient extends RestClient {
79
81
  memberAccountIds: allTeamsQuery.memberAccountIds
80
82
  },
81
83
  showEmptyTeams: allTeamsQuery.showEmptyTeams,
82
- teamTypeIdsFilter: allTeamsQuery.teamTypeIdsFilter
84
+ teamTypeIdsFilter: allTeamsQuery.teamTypeIdsFilter,
85
+ enablePagination,
86
+ ...(enablePagination && allTeamsQuery.cursor ? {
87
+ cursor: allTeamsQuery.cursor
88
+ } : {})
83
89
  });
84
90
  const teams = entities.map(t => this.mapTeamSearchResponseV4ToTeamWithMembership(t));
85
91
  return {
@@ -28,7 +28,7 @@ export function getSentryConfig(options) {
28
28
  ...DEFAULT_SENTRY_CONFIG,
29
29
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
30
30
  // when building to deploy to production
31
- release: `${"@atlaskit/teams-client"}@${"4.30.3"}` ||
31
+ release: `${"@atlaskit/teams-client"}@${"0.0.0-development"}` ||
32
32
  // @ts-ignore Jira - window.BUILD_KEY
33
33
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
34
34
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -45,7 +45,7 @@ export var TeamsUFOExperience = /*#__PURE__*/function (_UFOExperience) {
45
45
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
46
46
  metadata: {
47
47
  error: createErrorMetadata(error),
48
- packageVersion: "4.30.3",
48
+ packageVersion: "0.0.0-development",
49
49
  packageName: "@atlaskit/teams-client"
50
50
  }
51
51
  }]);
@@ -53,7 +53,7 @@ export var TeamsUFOExperience = /*#__PURE__*/function (_UFOExperience) {
53
53
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
54
54
  metadata: {
55
55
  error: 'unknown error',
56
- packageVersion: "4.30.3",
56
+ packageVersion: "0.0.0-development",
57
57
  packageName: "@atlaskit/teams-client"
58
58
  }
59
59
  }]);
@@ -27,6 +27,7 @@ import { RestClient } from '../rest-client';
27
27
  * @property {boolean} useDefaultSort - Whether to use the default sort order
28
28
  * @property {boolean} showEmptyTeams - Whether to return empty teams in the search
29
29
  * @property {string[]} teamTypeIdsFilter - List of team type IDs to filter teams
30
+ * @property {boolean} enablePagination - Whether the API should paginate the response
30
31
  */
31
32
 
32
33
  /**
@@ -104,20 +105,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
104
105
  value: function () {
105
106
  var _getAllTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(allTeamsQuery) {
106
107
  var _this2 = this;
107
- var _orgId, _siteId, _yield$this$postResou, entities, _cursor, teams;
108
+ var _allTeamsQuery$enable, _orgId, _siteId, enablePagination, _yield$this$postResou, entities, _cursor, teams;
108
109
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
109
110
  while (1) switch (_context2.prev = _context2.next) {
110
111
  case 0:
111
112
  _context2.prev = 0;
112
113
  _orgId = this.getOrgId(allTeamsQuery.orgId);
113
114
  _siteId = this.getCloudId();
114
- _context2.next = 5;
115
- return this.postResource("".concat(v4UrlPath, "/search"), {
115
+ enablePagination = (_allTeamsQuery$enable = allTeamsQuery.enablePagination) !== null && _allTeamsQuery$enable !== void 0 ? _allTeamsQuery$enable : true;
116
+ _context2.next = 6;
117
+ return this.postResource("".concat(v4UrlPath, "/search"), _objectSpread({
116
118
  organizationId: _orgId,
117
119
  siteId: _siteId,
118
120
  limit: allTeamsQuery.limit,
119
121
  query: allTeamsQuery.searchQuery,
120
- cursor: allTeamsQuery.cursor || '',
121
122
  sortBy: allTeamsQuery.useDefaultSort ? null : allTeamsQuery.sortBy && allTeamsQuery.sortBy.length > 0 ? allTeamsQuery.sortBy : [{
122
123
  field: 'displayName',
123
124
  order: 'asc'
@@ -126,9 +127,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
126
127
  memberAccountIds: allTeamsQuery.memberAccountIds
127
128
  },
128
129
  showEmptyTeams: allTeamsQuery.showEmptyTeams,
129
- teamTypeIdsFilter: allTeamsQuery.teamTypeIdsFilter
130
- });
131
- case 5:
130
+ teamTypeIdsFilter: allTeamsQuery.teamTypeIdsFilter,
131
+ enablePagination: enablePagination
132
+ }, enablePagination && allTeamsQuery.cursor ? {
133
+ cursor: allTeamsQuery.cursor
134
+ } : {}));
135
+ case 6:
132
136
  _yield$this$postResou = _context2.sent;
133
137
  entities = _yield$this$postResou.entities;
134
138
  _cursor = _yield$this$postResou.cursor;
@@ -139,8 +143,8 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
139
143
  cursor: _cursor,
140
144
  teams: teams
141
145
  });
142
- case 12:
143
- _context2.prev = 12;
146
+ case 13:
147
+ _context2.prev = 13;
144
148
  _context2.t0 = _context2["catch"](0);
145
149
  this.logException(_context2.t0, 'getAllTeams');
146
150
  return _context2.abrupt("return", {
@@ -148,11 +152,11 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
148
152
  teams: [],
149
153
  error: _context2.t0 instanceof Error ? _context2.t0 : undefined
150
154
  });
151
- case 16:
155
+ case 17:
152
156
  case "end":
153
157
  return _context2.stop();
154
158
  }
155
- }, _callee2, this, [[0, 12]]);
159
+ }, _callee2, this, [[0, 13]]);
156
160
  }));
157
161
  function getAllTeams(_x3) {
158
162
  return _getAllTeams.apply(this, arguments);
@@ -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.30.3") ||
32
+ release: "".concat("@atlaskit/teams-client", "@").concat("0.0.0-development") ||
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) || '---',
@@ -30,6 +30,7 @@ export interface SortField {
30
30
  * @property {boolean} useDefaultSort - Whether to use the default sort order
31
31
  * @property {boolean} showEmptyTeams - Whether to return empty teams in the search
32
32
  * @property {string[]} teamTypeIdsFilter - List of team type IDs to filter teams
33
+ * @property {boolean} enablePagination - Whether the API should paginate the response
33
34
  */
34
35
  export interface AllTeamsQuery {
35
36
  /**
@@ -45,6 +46,7 @@ export interface AllTeamsQuery {
45
46
  showEmptyTeams?: boolean;
46
47
  sortBy?: SortField[];
47
48
  teamTypeIdsFilter?: string[];
49
+ enablePagination?: boolean;
48
50
  }
49
51
  /**
50
52
  * @type AllTeamsResponse
@@ -94,6 +94,7 @@ export interface LegionTeamSearchResponseV4 {
94
94
  memberCount: number;
95
95
  includesYou: boolean;
96
96
  isVerified?: boolean;
97
+ enablePagination?: boolean;
97
98
  }
98
99
  export interface LegionPaginatedResponse<T> {
99
100
  entities: T[];
@@ -30,6 +30,7 @@ export interface SortField {
30
30
  * @property {boolean} useDefaultSort - Whether to use the default sort order
31
31
  * @property {boolean} showEmptyTeams - Whether to return empty teams in the search
32
32
  * @property {string[]} teamTypeIdsFilter - List of team type IDs to filter teams
33
+ * @property {boolean} enablePagination - Whether the API should paginate the response
33
34
  */
34
35
  export interface AllTeamsQuery {
35
36
  /**
@@ -45,6 +46,7 @@ export interface AllTeamsQuery {
45
46
  showEmptyTeams?: boolean;
46
47
  sortBy?: SortField[];
47
48
  teamTypeIdsFilter?: string[];
49
+ enablePagination?: boolean;
48
50
  }
49
51
  /**
50
52
  * @type AllTeamsResponse
@@ -94,6 +94,7 @@ export interface LegionTeamSearchResponseV4 {
94
94
  memberCount: number;
95
95
  includesYou: boolean;
96
96
  isVerified?: boolean;
97
+ enablePagination?: boolean;
97
98
  }
98
99
  export interface LegionPaginatedResponse<T> {
99
100
  entities: T[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/teams-client",
3
- "version": "4.31.0",
3
+ "version": "4.32.0",
4
4
  "description": "A client to retrieve team related data",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "test:coverage": "(cd ../../.. && yarn test 'packages/people-and-teams/teams-client/src' --coverage --coverageProvider=v8 --collectCoverageFrom='[\"packages/people-and-teams/teams-client/src/**\", \"!packages/people-and-teams/teams-client/src/**/**/types.ts\", \"!packages/people-and-teams/teams-client/src/ui/**/styled.tsx\"]')"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/atlassian-context": "^0.7.0",
34
+ "@atlaskit/atlassian-context": "^0.8.0",
35
35
  "@atlaskit/platform-feature-flags": "^1.1.0",
36
36
  "@atlaskit/ufo": "^0.4.0",
37
37
  "@babel/runtime": "^7.0.0",