@atlaskit/teams-client 4.7.0 → 4.8.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.
- 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/agg-client/index.js +1 -1
- package/dist/cjs/services/legion-client/index.js +200 -163
- package/dist/cjs/services/main.js +492 -458
- 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/agg-client/index.js +1 -1
- package/dist/es2019/services/legion-client/index.js +17 -1
- package/dist/es2019/services/main.js +7 -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/agg-client/index.js +1 -1
- package/dist/esm/services/legion-client/index.js +200 -163
- package/dist/esm/services/main.js +492 -458
- package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/types/common/utils/ufo/constants.d.ts +2 -2
- package/dist/types/services/legion-client/index.d.ts +7 -1
- package/dist/types/services/legion-client/types.d.ts +8 -0
- package/dist/types/services/main.d.ts +4 -0
- package/dist/types/types/association.d.ts +1 -1
- package/dist/types-ts4.5/common/utils/ufo/constants.d.ts +3 -2
- package/dist/types-ts4.5/services/legion-client/index.d.ts +7 -1
- package/dist/types-ts4.5/services/legion-client/types.d.ts +8 -0
- package/dist/types-ts4.5/services/main.d.ts +4 -0
- package/dist/types-ts4.5/types/association.d.ts +1 -1
- package/package.json +1 -1
|
@@ -123,7 +123,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
123
123
|
limit: allTeamsQuery.limit,
|
|
124
124
|
query: allTeamsQuery.searchQuery,
|
|
125
125
|
cursor: allTeamsQuery.cursor || '',
|
|
126
|
-
sortBy: allTeamsQuery.useDefaultSort ? null : [{
|
|
126
|
+
sortBy: allTeamsQuery.useDefaultSort ? null : allTeamsQuery.sortBy && allTeamsQuery.sortBy.length > 0 ? allTeamsQuery.sortBy : [{
|
|
127
127
|
field: 'displayName',
|
|
128
128
|
order: 'asc'
|
|
129
129
|
}],
|
|
@@ -478,58 +478,95 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
478
478
|
return selfJoinTeam;
|
|
479
479
|
}()
|
|
480
480
|
}, {
|
|
481
|
-
key: "
|
|
481
|
+
key: "addAgentsToTeam",
|
|
482
482
|
value: function () {
|
|
483
|
-
var
|
|
483
|
+
var _addAgentsToTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(teamId, agents) {
|
|
484
|
+
var missingAgentsError, url;
|
|
484
485
|
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
485
486
|
while (1) switch (_context13.prev = _context13.next) {
|
|
486
487
|
case 0:
|
|
487
|
-
|
|
488
|
-
|
|
488
|
+
if (!(!agents || agents.length === 0)) {
|
|
489
|
+
_context13.next = 4;
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
missingAgentsError = new Error('Missing agents to add');
|
|
493
|
+
this.logException(missingAgentsError, 'addAgentToTeam');
|
|
494
|
+
throw missingAgentsError;
|
|
495
|
+
case 4:
|
|
496
|
+
_context13.prev = 4;
|
|
497
|
+
url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/agents");
|
|
498
|
+
return _context13.abrupt("return", this.postResource(url, {
|
|
499
|
+
agents: agents
|
|
500
|
+
}));
|
|
501
|
+
case 9:
|
|
502
|
+
_context13.prev = 9;
|
|
503
|
+
_context13.t0 = _context13["catch"](4);
|
|
504
|
+
this.logException(_context13.t0, 'addAgentToTeam');
|
|
505
|
+
throw _context13.t0;
|
|
506
|
+
case 13:
|
|
489
507
|
case "end":
|
|
490
508
|
return _context13.stop();
|
|
491
509
|
}
|
|
492
|
-
}, _callee13, this);
|
|
510
|
+
}, _callee13, this, [[4, 9]]);
|
|
493
511
|
}));
|
|
494
|
-
function
|
|
495
|
-
return
|
|
512
|
+
function addAgentsToTeam(_x22, _x23) {
|
|
513
|
+
return _addAgentsToTeam.apply(this, arguments);
|
|
496
514
|
}
|
|
497
|
-
return
|
|
515
|
+
return addAgentsToTeam;
|
|
498
516
|
}()
|
|
499
517
|
}, {
|
|
500
|
-
key: "
|
|
518
|
+
key: "cancelJoinRequest",
|
|
501
519
|
value: function () {
|
|
502
|
-
var
|
|
520
|
+
var _cancelJoinRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(teamId) {
|
|
503
521
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
504
522
|
while (1) switch (_context14.prev = _context14.next) {
|
|
505
523
|
case 0:
|
|
506
|
-
return _context14.abrupt("return", this.
|
|
524
|
+
return _context14.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/request")));
|
|
507
525
|
case 1:
|
|
508
526
|
case "end":
|
|
509
527
|
return _context14.stop();
|
|
510
528
|
}
|
|
511
529
|
}, _callee14, this);
|
|
512
530
|
}));
|
|
513
|
-
function
|
|
514
|
-
return
|
|
531
|
+
function cancelJoinRequest(_x24) {
|
|
532
|
+
return _cancelJoinRequest.apply(this, arguments);
|
|
515
533
|
}
|
|
516
|
-
return
|
|
534
|
+
return cancelJoinRequest;
|
|
517
535
|
}()
|
|
518
536
|
}, {
|
|
519
|
-
key: "
|
|
537
|
+
key: "acceptJoinRequest",
|
|
520
538
|
value: function () {
|
|
521
|
-
var
|
|
539
|
+
var _acceptJoinRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(teamId, memberId) {
|
|
522
540
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
523
541
|
while (1) switch (_context15.prev = _context15.next) {
|
|
524
542
|
case 0:
|
|
525
|
-
return _context15.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/
|
|
543
|
+
return _context15.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/accept")));
|
|
526
544
|
case 1:
|
|
527
545
|
case "end":
|
|
528
546
|
return _context15.stop();
|
|
529
547
|
}
|
|
530
548
|
}, _callee15, this);
|
|
531
549
|
}));
|
|
532
|
-
function
|
|
550
|
+
function acceptJoinRequest(_x25, _x26) {
|
|
551
|
+
return _acceptJoinRequest.apply(this, arguments);
|
|
552
|
+
}
|
|
553
|
+
return acceptJoinRequest;
|
|
554
|
+
}()
|
|
555
|
+
}, {
|
|
556
|
+
key: "declineJoinRequest",
|
|
557
|
+
value: function () {
|
|
558
|
+
var _declineJoinRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(teamId, memberId) {
|
|
559
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
560
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
561
|
+
case 0:
|
|
562
|
+
return _context16.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/decline")));
|
|
563
|
+
case 1:
|
|
564
|
+
case "end":
|
|
565
|
+
return _context16.stop();
|
|
566
|
+
}
|
|
567
|
+
}, _callee16, this);
|
|
568
|
+
}));
|
|
569
|
+
function declineJoinRequest(_x27, _x28) {
|
|
533
570
|
return _declineJoinRequest.apply(this, arguments);
|
|
534
571
|
}
|
|
535
572
|
return declineJoinRequest;
|
|
@@ -541,18 +578,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
541
578
|
}, {
|
|
542
579
|
key: "deleteTeamMembership",
|
|
543
580
|
value: (function () {
|
|
544
|
-
var _deleteTeamMembership = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
545
|
-
return _regenerator.default.wrap(function
|
|
546
|
-
while (1) switch (
|
|
581
|
+
var _deleteTeamMembership = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(teamId, memberId) {
|
|
582
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
583
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
547
584
|
case 0:
|
|
548
|
-
return
|
|
585
|
+
return _context17.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/").concat(this.trimTeamARI(teamId), "/members/").concat(memberId)));
|
|
549
586
|
case 1:
|
|
550
587
|
case "end":
|
|
551
|
-
return
|
|
588
|
+
return _context17.stop();
|
|
552
589
|
}
|
|
553
|
-
},
|
|
590
|
+
}, _callee17, this);
|
|
554
591
|
}));
|
|
555
|
-
function deleteTeamMembership(
|
|
592
|
+
function deleteTeamMembership(_x29, _x30) {
|
|
556
593
|
return _deleteTeamMembership.apply(this, arguments);
|
|
557
594
|
}
|
|
558
595
|
return deleteTeamMembership;
|
|
@@ -565,18 +602,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
565
602
|
}, {
|
|
566
603
|
key: "revokeTeamInvite",
|
|
567
604
|
value: (function () {
|
|
568
|
-
var _revokeTeamInvite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
569
|
-
return _regenerator.default.wrap(function
|
|
570
|
-
while (1) switch (
|
|
605
|
+
var _revokeTeamInvite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(teamId, memberId) {
|
|
606
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
607
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
571
608
|
case 0:
|
|
572
|
-
return
|
|
609
|
+
return _context18.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/revoke")));
|
|
573
610
|
case 1:
|
|
574
611
|
case "end":
|
|
575
|
-
return
|
|
612
|
+
return _context18.stop();
|
|
576
613
|
}
|
|
577
|
-
},
|
|
614
|
+
}, _callee18, this);
|
|
578
615
|
}));
|
|
579
|
-
function revokeTeamInvite(
|
|
616
|
+
function revokeTeamInvite(_x31, _x32) {
|
|
580
617
|
return _revokeTeamInvite.apply(this, arguments);
|
|
581
618
|
}
|
|
582
619
|
return revokeTeamInvite;
|
|
@@ -584,18 +621,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
584
621
|
}, {
|
|
585
622
|
key: "deleteTeam",
|
|
586
623
|
value: function () {
|
|
587
|
-
var _deleteTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
588
|
-
return _regenerator.default.wrap(function
|
|
589
|
-
while (1) switch (
|
|
624
|
+
var _deleteTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(teamId) {
|
|
625
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
626
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
590
627
|
case 0:
|
|
591
|
-
return
|
|
628
|
+
return _context19.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId))));
|
|
592
629
|
case 1:
|
|
593
630
|
case "end":
|
|
594
|
-
return
|
|
631
|
+
return _context19.stop();
|
|
595
632
|
}
|
|
596
|
-
},
|
|
633
|
+
}, _callee19, this);
|
|
597
634
|
}));
|
|
598
|
-
function deleteTeam(
|
|
635
|
+
function deleteTeam(_x33) {
|
|
599
636
|
return _deleteTeam.apply(this, arguments);
|
|
600
637
|
}
|
|
601
638
|
return deleteTeam;
|
|
@@ -607,23 +644,23 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
607
644
|
}, {
|
|
608
645
|
key: "isSingleFullMemberTeam",
|
|
609
646
|
value: (function () {
|
|
610
|
-
var _isSingleFullMemberTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
647
|
+
var _isSingleFullMemberTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(teamId) {
|
|
611
648
|
var members;
|
|
612
|
-
return _regenerator.default.wrap(function
|
|
613
|
-
while (1) switch (
|
|
649
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
650
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
614
651
|
case 0:
|
|
615
|
-
|
|
652
|
+
_context20.next = 2;
|
|
616
653
|
return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/members?size=2&membershipState=FULL_MEMBER&siteId=").concat(this.getCloudId()));
|
|
617
654
|
case 2:
|
|
618
|
-
members =
|
|
619
|
-
return
|
|
655
|
+
members = _context20.sent;
|
|
656
|
+
return _context20.abrupt("return", members.entities.length === 1);
|
|
620
657
|
case 4:
|
|
621
658
|
case "end":
|
|
622
|
-
return
|
|
659
|
+
return _context20.stop();
|
|
623
660
|
}
|
|
624
|
-
},
|
|
661
|
+
}, _callee20, this);
|
|
625
662
|
}));
|
|
626
|
-
function isSingleFullMemberTeam(
|
|
663
|
+
function isSingleFullMemberTeam(_x34) {
|
|
627
664
|
return _isSingleFullMemberTeam.apply(this, arguments);
|
|
628
665
|
}
|
|
629
666
|
return isSingleFullMemberTeam;
|
|
@@ -631,20 +668,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
631
668
|
}, {
|
|
632
669
|
key: "createTeam",
|
|
633
670
|
value: function () {
|
|
634
|
-
var _createTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
671
|
+
var _createTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(displayName, originQuery, members) {
|
|
635
672
|
var membershipSettings,
|
|
636
673
|
organizationId,
|
|
637
674
|
err,
|
|
638
675
|
url,
|
|
639
676
|
legionTeam,
|
|
640
|
-
|
|
641
|
-
return _regenerator.default.wrap(function
|
|
642
|
-
while (1) switch (
|
|
677
|
+
_args21 = arguments;
|
|
678
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
679
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
643
680
|
case 0:
|
|
644
|
-
membershipSettings =
|
|
681
|
+
membershipSettings = _args21.length > 3 && _args21[3] !== undefined ? _args21[3] : 'OPEN';
|
|
645
682
|
organizationId = this.getContext().orgId;
|
|
646
683
|
if (organizationId) {
|
|
647
|
-
|
|
684
|
+
_context21.next = 6;
|
|
648
685
|
break;
|
|
649
686
|
}
|
|
650
687
|
err = new Error('Organization ID is required');
|
|
@@ -652,7 +689,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
652
689
|
throw err;
|
|
653
690
|
case 6:
|
|
654
691
|
url = "".concat(v4UrlPath, "?").concat(this.constructProductOriginParams(originQuery));
|
|
655
|
-
|
|
692
|
+
_context21.next = 9;
|
|
656
693
|
return this.postResource(url, {
|
|
657
694
|
displayName: displayName,
|
|
658
695
|
description: '',
|
|
@@ -662,15 +699,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
662
699
|
members: (0, _toConsumableArray2.default)(new Set(members))
|
|
663
700
|
});
|
|
664
701
|
case 9:
|
|
665
|
-
legionTeam =
|
|
666
|
-
return
|
|
702
|
+
legionTeam = _context21.sent;
|
|
703
|
+
return _context21.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
|
|
667
704
|
case 11:
|
|
668
705
|
case "end":
|
|
669
|
-
return
|
|
706
|
+
return _context21.stop();
|
|
670
707
|
}
|
|
671
|
-
},
|
|
708
|
+
}, _callee21, this);
|
|
672
709
|
}));
|
|
673
|
-
function createTeam(
|
|
710
|
+
function createTeam(_x35, _x36, _x37) {
|
|
674
711
|
return _createTeam.apply(this, arguments);
|
|
675
712
|
}
|
|
676
713
|
return createTeam;
|
|
@@ -678,15 +715,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
678
715
|
}, {
|
|
679
716
|
key: "createExternalTeam",
|
|
680
717
|
value: function () {
|
|
681
|
-
var _createExternalTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
718
|
+
var _createExternalTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(description, externalReference, teamName, siteId) {
|
|
682
719
|
var organizationId, cloudId, err, url, legionExternalTeam;
|
|
683
|
-
return _regenerator.default.wrap(function
|
|
684
|
-
while (1) switch (
|
|
720
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
721
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
685
722
|
case 0:
|
|
686
723
|
organizationId = this.getContext().orgId;
|
|
687
724
|
cloudId = this.getContext().cloudId;
|
|
688
725
|
if (organizationId) {
|
|
689
|
-
|
|
726
|
+
_context22.next = 6;
|
|
690
727
|
break;
|
|
691
728
|
}
|
|
692
729
|
err = new Error('Organization ID is required');
|
|
@@ -694,7 +731,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
694
731
|
throw err;
|
|
695
732
|
case 6:
|
|
696
733
|
url = "".concat(v4UrlPath, "/external?origin.cloudId=").concat(encodeURIComponent(this.getCloudId(siteId || cloudId)));
|
|
697
|
-
|
|
734
|
+
_context22.next = 9;
|
|
698
735
|
return this.postResource(url, {
|
|
699
736
|
description: description,
|
|
700
737
|
externalReference: externalReference,
|
|
@@ -703,15 +740,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
703
740
|
displayName: teamName
|
|
704
741
|
});
|
|
705
742
|
case 9:
|
|
706
|
-
legionExternalTeam =
|
|
707
|
-
return
|
|
743
|
+
legionExternalTeam = _context22.sent;
|
|
744
|
+
return _context22.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
|
|
708
745
|
case 11:
|
|
709
746
|
case "end":
|
|
710
|
-
return
|
|
747
|
+
return _context22.stop();
|
|
711
748
|
}
|
|
712
|
-
},
|
|
749
|
+
}, _callee22, this);
|
|
713
750
|
}));
|
|
714
|
-
function createExternalTeam(
|
|
751
|
+
function createExternalTeam(_x38, _x39, _x40, _x41) {
|
|
715
752
|
return _createExternalTeam.apply(this, arguments);
|
|
716
753
|
}
|
|
717
754
|
return createExternalTeam;
|
|
@@ -719,23 +756,23 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
719
756
|
}, {
|
|
720
757
|
key: "getTeamAndGroupDiff",
|
|
721
758
|
value: function () {
|
|
722
|
-
var _getTeamAndGroupDiff = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
759
|
+
var _getTeamAndGroupDiff = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(teamId, externalReference) {
|
|
723
760
|
var siteId;
|
|
724
|
-
return _regenerator.default.wrap(function
|
|
725
|
-
while (1) switch (
|
|
761
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
762
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
726
763
|
case 0:
|
|
727
764
|
siteId = this.getCloudId();
|
|
728
|
-
return
|
|
765
|
+
return _context23.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/diff"), {
|
|
729
766
|
siteId: siteId,
|
|
730
767
|
externalReference: externalReference
|
|
731
768
|
}));
|
|
732
769
|
case 2:
|
|
733
770
|
case "end":
|
|
734
|
-
return
|
|
771
|
+
return _context23.stop();
|
|
735
772
|
}
|
|
736
|
-
},
|
|
773
|
+
}, _callee23, this);
|
|
737
774
|
}));
|
|
738
|
-
function getTeamAndGroupDiff(
|
|
775
|
+
function getTeamAndGroupDiff(_x42, _x43) {
|
|
739
776
|
return _getTeamAndGroupDiff.apply(this, arguments);
|
|
740
777
|
}
|
|
741
778
|
return getTeamAndGroupDiff;
|
|
@@ -743,23 +780,23 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
743
780
|
}, {
|
|
744
781
|
key: "linkExistingTeamToGroup",
|
|
745
782
|
value: function () {
|
|
746
|
-
var _linkExistingTeamToGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
783
|
+
var _linkExistingTeamToGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(teamId, externalReference) {
|
|
747
784
|
var siteId;
|
|
748
|
-
return _regenerator.default.wrap(function
|
|
749
|
-
while (1) switch (
|
|
785
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
786
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
750
787
|
case 0:
|
|
751
788
|
siteId = this.getCloudId();
|
|
752
|
-
return
|
|
789
|
+
return _context24.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/link"), {
|
|
753
790
|
externalReference: externalReference,
|
|
754
791
|
siteId: siteId
|
|
755
792
|
}));
|
|
756
793
|
case 2:
|
|
757
794
|
case "end":
|
|
758
|
-
return
|
|
795
|
+
return _context24.stop();
|
|
759
796
|
}
|
|
760
|
-
},
|
|
797
|
+
}, _callee24, this);
|
|
761
798
|
}));
|
|
762
|
-
function linkExistingTeamToGroup(
|
|
799
|
+
function linkExistingTeamToGroup(_x44, _x45) {
|
|
763
800
|
return _linkExistingTeamToGroup.apply(this, arguments);
|
|
764
801
|
}
|
|
765
802
|
return linkExistingTeamToGroup;
|
|
@@ -767,11 +804,11 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
767
804
|
}, {
|
|
768
805
|
key: "getWriteMediaToken",
|
|
769
806
|
value: function () {
|
|
770
|
-
var _getWriteMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
771
|
-
return _regenerator.default.wrap(function
|
|
772
|
-
while (1) switch (
|
|
807
|
+
var _getWriteMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
808
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
809
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
773
810
|
case 0:
|
|
774
|
-
return
|
|
811
|
+
return _context25.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
|
|
775
812
|
var _response$baseUrl;
|
|
776
813
|
return _objectSpread(_objectSpread({}, response), {}, {
|
|
777
814
|
baseUrl: (_response$baseUrl = response.baseUrl) !== null && _response$baseUrl !== void 0 && _response$baseUrl.endsWith('/') ? response.baseUrl.slice(0, -1) : response.baseUrl
|
|
@@ -779,9 +816,9 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
779
816
|
}));
|
|
780
817
|
case 1:
|
|
781
818
|
case "end":
|
|
782
|
-
return
|
|
819
|
+
return _context25.stop();
|
|
783
820
|
}
|
|
784
|
-
},
|
|
821
|
+
}, _callee25, this);
|
|
785
822
|
}));
|
|
786
823
|
function getWriteMediaToken() {
|
|
787
824
|
return _getWriteMediaToken.apply(this, arguments);
|
|
@@ -791,25 +828,25 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
791
828
|
}, {
|
|
792
829
|
key: "getSoftDeletedTeamById",
|
|
793
830
|
value: function () {
|
|
794
|
-
var _getSoftDeletedTeamById = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
831
|
+
var _getSoftDeletedTeamById = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(teamId) {
|
|
795
832
|
var orgId, siteId;
|
|
796
|
-
return _regenerator.default.wrap(function
|
|
797
|
-
while (1) switch (
|
|
833
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
834
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
798
835
|
case 0:
|
|
799
836
|
orgId = this.getOrgId();
|
|
800
837
|
siteId = this.getCloudId();
|
|
801
|
-
return
|
|
838
|
+
return _context26.abrupt("return", this.getResource("".concat(v4UrlPath, "/org/").concat(orgId, "/soft-deleted/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId)).then(function (response) {
|
|
802
839
|
return _objectSpread(_objectSpread({}, response.teamResponse), {}, {
|
|
803
840
|
id: teamId
|
|
804
841
|
});
|
|
805
842
|
}));
|
|
806
843
|
case 3:
|
|
807
844
|
case "end":
|
|
808
|
-
return
|
|
845
|
+
return _context26.stop();
|
|
809
846
|
}
|
|
810
|
-
},
|
|
847
|
+
}, _callee26, this);
|
|
811
848
|
}));
|
|
812
|
-
function getSoftDeletedTeamById(
|
|
849
|
+
function getSoftDeletedTeamById(_x46) {
|
|
813
850
|
return _getSoftDeletedTeamById.apply(this, arguments);
|
|
814
851
|
}
|
|
815
852
|
return getSoftDeletedTeamById;
|
|
@@ -820,13 +857,13 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
820
857
|
}, {
|
|
821
858
|
key: "getUserInSiteUserBase",
|
|
822
859
|
value: (function () {
|
|
823
|
-
var _getUserInSiteUserBase = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
860
|
+
var _getUserInSiteUserBase = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(userId) {
|
|
824
861
|
var siteId;
|
|
825
|
-
return _regenerator.default.wrap(function
|
|
826
|
-
while (1) switch (
|
|
862
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
863
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
827
864
|
case 0:
|
|
828
865
|
siteId = this.getCloudId();
|
|
829
|
-
return
|
|
866
|
+
return _context27.abrupt("return", this.getResource("/teams/site/".concat(siteId, "/users/").concat(userId, "/exists"), {
|
|
830
867
|
headers: {
|
|
831
868
|
Accept: 'application/json',
|
|
832
869
|
'X-header-client-id': 'ptc-fe'
|
|
@@ -834,11 +871,11 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
834
871
|
}));
|
|
835
872
|
case 2:
|
|
836
873
|
case "end":
|
|
837
|
-
return
|
|
874
|
+
return _context27.stop();
|
|
838
875
|
}
|
|
839
|
-
},
|
|
876
|
+
}, _callee27, this);
|
|
840
877
|
}));
|
|
841
|
-
function getUserInSiteUserBase(
|
|
878
|
+
function getUserInSiteUserBase(_x47) {
|
|
842
879
|
return _getUserInSiteUserBase.apply(this, arguments);
|
|
843
880
|
}
|
|
844
881
|
return getUserInSiteUserBase;
|
|
@@ -846,22 +883,22 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
846
883
|
}, {
|
|
847
884
|
key: "retrieveBrowseUserPermission",
|
|
848
885
|
value: function () {
|
|
849
|
-
var _retrieveBrowseUserPermission = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
850
|
-
return _regenerator.default.wrap(function
|
|
851
|
-
while (1) switch (
|
|
886
|
+
var _retrieveBrowseUserPermission = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(product) {
|
|
887
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
888
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
852
889
|
case 0:
|
|
853
|
-
return
|
|
890
|
+
return _context28.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
|
|
854
891
|
// 2 minute expiration, resolves duplicate calls in initial load
|
|
855
892
|
{
|
|
856
893
|
expiration: 1000 * 60 * 2
|
|
857
894
|
}));
|
|
858
895
|
case 1:
|
|
859
896
|
case "end":
|
|
860
|
-
return
|
|
897
|
+
return _context28.stop();
|
|
861
898
|
}
|
|
862
|
-
},
|
|
899
|
+
}, _callee28, this);
|
|
863
900
|
}));
|
|
864
|
-
function retrieveBrowseUserPermission(
|
|
901
|
+
function retrieveBrowseUserPermission(_x48) {
|
|
865
902
|
return _retrieveBrowseUserPermission.apply(this, arguments);
|
|
866
903
|
}
|
|
867
904
|
return retrieveBrowseUserPermission;
|
|
@@ -869,27 +906,27 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
869
906
|
}, {
|
|
870
907
|
key: "getPermissions",
|
|
871
908
|
value: function () {
|
|
872
|
-
var _getPermissions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
909
|
+
var _getPermissions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
873
910
|
var orgId, siteId, err;
|
|
874
|
-
return _regenerator.default.wrap(function
|
|
875
|
-
while (1) switch (
|
|
911
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
912
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
876
913
|
case 0:
|
|
877
914
|
orgId = this.getContext().orgId;
|
|
878
915
|
siteId = this.getCloudId();
|
|
879
916
|
if (orgId) {
|
|
880
|
-
|
|
917
|
+
_context29.next = 6;
|
|
881
918
|
break;
|
|
882
919
|
}
|
|
883
920
|
err = new Error('Organization ID is required');
|
|
884
921
|
this.logException(err, 'getPermissions');
|
|
885
922
|
throw err;
|
|
886
923
|
case 6:
|
|
887
|
-
return
|
|
924
|
+
return _context29.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
|
|
888
925
|
case 7:
|
|
889
926
|
case "end":
|
|
890
|
-
return
|
|
927
|
+
return _context29.stop();
|
|
891
928
|
}
|
|
892
|
-
},
|
|
929
|
+
}, _callee29, this);
|
|
893
930
|
}));
|
|
894
931
|
function getPermissions() {
|
|
895
932
|
return _getPermissions.apply(this, arguments);
|
|
@@ -899,36 +936,36 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
899
936
|
}, {
|
|
900
937
|
key: "getLinkedTeamsBulk",
|
|
901
938
|
value: function () {
|
|
902
|
-
var _getLinkedTeamsBulk = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
939
|
+
var _getLinkedTeamsBulk = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(groupIds) {
|
|
903
940
|
var organizationId, err, legionExternalTeam;
|
|
904
|
-
return _regenerator.default.wrap(function
|
|
905
|
-
while (1) switch (
|
|
941
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
942
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
906
943
|
case 0:
|
|
907
944
|
organizationId = this.getContext().orgId;
|
|
908
945
|
if (organizationId) {
|
|
909
|
-
|
|
946
|
+
_context30.next = 5;
|
|
910
947
|
break;
|
|
911
948
|
}
|
|
912
949
|
err = new Error('Organization ID is required');
|
|
913
950
|
this.logException(err, 'getLinkedTeamsBulk');
|
|
914
951
|
throw err;
|
|
915
952
|
case 5:
|
|
916
|
-
|
|
953
|
+
_context30.next = 7;
|
|
917
954
|
return this.postResource("".concat(v4UrlPath, "/external/bulk"), {
|
|
918
955
|
organizationId: organizationId,
|
|
919
956
|
source: 'ATLASSIAN_GROUP',
|
|
920
957
|
externalIds: groupIds
|
|
921
958
|
});
|
|
922
959
|
case 7:
|
|
923
|
-
legionExternalTeam =
|
|
924
|
-
return
|
|
960
|
+
legionExternalTeam = _context30.sent;
|
|
961
|
+
return _context30.abrupt("return", legionExternalTeam);
|
|
925
962
|
case 9:
|
|
926
963
|
case "end":
|
|
927
|
-
return
|
|
964
|
+
return _context30.stop();
|
|
928
965
|
}
|
|
929
|
-
},
|
|
966
|
+
}, _callee30, this);
|
|
930
967
|
}));
|
|
931
|
-
function getLinkedTeamsBulk(
|
|
968
|
+
function getLinkedTeamsBulk(_x49) {
|
|
932
969
|
return _getLinkedTeamsBulk.apply(this, arguments);
|
|
933
970
|
}
|
|
934
971
|
return getLinkedTeamsBulk;
|
|
@@ -936,32 +973,32 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
936
973
|
}, {
|
|
937
974
|
key: "getTeamProfileDetails",
|
|
938
975
|
value: function () {
|
|
939
|
-
var _getTeamProfileDetails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
976
|
+
var _getTeamProfileDetails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(teamId) {
|
|
940
977
|
var siteId, err, linkedTeamsProfileDetails;
|
|
941
|
-
return _regenerator.default.wrap(function
|
|
942
|
-
while (1) switch (
|
|
978
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
979
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
943
980
|
case 0:
|
|
944
981
|
siteId = this.getCloudId();
|
|
945
982
|
if (siteId) {
|
|
946
|
-
|
|
983
|
+
_context31.next = 5;
|
|
947
984
|
break;
|
|
948
985
|
}
|
|
949
986
|
err = new Error('Site ID is required');
|
|
950
987
|
this.logException(err, 'getTeamProfileDetails');
|
|
951
988
|
throw err;
|
|
952
989
|
case 5:
|
|
953
|
-
|
|
990
|
+
_context31.next = 7;
|
|
954
991
|
return this.getResource("".concat(v4UrlPath, "/").concat(teamId, "/profile?siteId=").concat(this.getCloudId()));
|
|
955
992
|
case 7:
|
|
956
|
-
linkedTeamsProfileDetails =
|
|
957
|
-
return
|
|
993
|
+
linkedTeamsProfileDetails = _context31.sent;
|
|
994
|
+
return _context31.abrupt("return", linkedTeamsProfileDetails);
|
|
958
995
|
case 9:
|
|
959
996
|
case "end":
|
|
960
|
-
return
|
|
997
|
+
return _context31.stop();
|
|
961
998
|
}
|
|
962
|
-
},
|
|
999
|
+
}, _callee31, this);
|
|
963
1000
|
}));
|
|
964
|
-
function getTeamProfileDetails(
|
|
1001
|
+
function getTeamProfileDetails(_x50) {
|
|
965
1002
|
return _getTeamProfileDetails.apply(this, arguments);
|
|
966
1003
|
}
|
|
967
1004
|
return getTeamProfileDetails;
|
|
@@ -969,30 +1006,30 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
969
1006
|
}, {
|
|
970
1007
|
key: "getOrgScope",
|
|
971
1008
|
value: function () {
|
|
972
|
-
var _getOrgScope = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1009
|
+
var _getOrgScope = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
973
1010
|
var orgId, err, orgScope;
|
|
974
|
-
return _regenerator.default.wrap(function
|
|
975
|
-
while (1) switch (
|
|
1011
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1012
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
976
1013
|
case 0:
|
|
977
1014
|
orgId = this.getContext().orgId;
|
|
978
1015
|
if (orgId) {
|
|
979
|
-
|
|
1016
|
+
_context32.next = 5;
|
|
980
1017
|
break;
|
|
981
1018
|
}
|
|
982
1019
|
err = new Error('Organization ID is required');
|
|
983
1020
|
this.logException(err, 'getOrgScope');
|
|
984
1021
|
throw err;
|
|
985
1022
|
case 5:
|
|
986
|
-
|
|
1023
|
+
_context32.next = 7;
|
|
987
1024
|
return this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/scope"));
|
|
988
1025
|
case 7:
|
|
989
|
-
orgScope =
|
|
990
|
-
return
|
|
1026
|
+
orgScope = _context32.sent;
|
|
1027
|
+
return _context32.abrupt("return", orgScope);
|
|
991
1028
|
case 9:
|
|
992
1029
|
case "end":
|
|
993
|
-
return
|
|
1030
|
+
return _context32.stop();
|
|
994
1031
|
}
|
|
995
|
-
},
|
|
1032
|
+
}, _callee32, this);
|
|
996
1033
|
}));
|
|
997
1034
|
function getOrgScope() {
|
|
998
1035
|
return _getOrgScope.apply(this, arguments);
|
|
@@ -1002,26 +1039,26 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1002
1039
|
}, {
|
|
1003
1040
|
key: "restoreTeamToSyncedGroup",
|
|
1004
1041
|
value: function () {
|
|
1005
|
-
var _restoreTeamToSyncedGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1042
|
+
var _restoreTeamToSyncedGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(teamId, externalReference) {
|
|
1006
1043
|
var siteId;
|
|
1007
|
-
return _regenerator.default.wrap(function
|
|
1008
|
-
while (1) switch (
|
|
1044
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1045
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1009
1046
|
case 0:
|
|
1010
1047
|
siteId = this.getCloudId();
|
|
1011
|
-
|
|
1048
|
+
_context33.next = 3;
|
|
1012
1049
|
return this.postResource("".concat(v4UrlPath, "/").concat(teamId, "/external/restore"), {
|
|
1013
1050
|
externalReference: externalReference,
|
|
1014
1051
|
siteId: siteId
|
|
1015
1052
|
});
|
|
1016
1053
|
case 3:
|
|
1017
|
-
return
|
|
1054
|
+
return _context33.abrupt("return", _context33.sent);
|
|
1018
1055
|
case 4:
|
|
1019
1056
|
case "end":
|
|
1020
|
-
return
|
|
1057
|
+
return _context33.stop();
|
|
1021
1058
|
}
|
|
1022
|
-
},
|
|
1059
|
+
}, _callee33, this);
|
|
1023
1060
|
}));
|
|
1024
|
-
function restoreTeamToSyncedGroup(
|
|
1061
|
+
function restoreTeamToSyncedGroup(_x51, _x52) {
|
|
1025
1062
|
return _restoreTeamToSyncedGroup.apply(this, arguments);
|
|
1026
1063
|
}
|
|
1027
1064
|
return restoreTeamToSyncedGroup;
|
|
@@ -1029,18 +1066,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1029
1066
|
}, {
|
|
1030
1067
|
key: "createTeamContainers",
|
|
1031
1068
|
value: function () {
|
|
1032
|
-
var _createTeamContainers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1033
|
-
return _regenerator.default.wrap(function
|
|
1034
|
-
while (1) switch (
|
|
1069
|
+
var _createTeamContainers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(payload) {
|
|
1070
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1071
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1035
1072
|
case 0:
|
|
1036
|
-
return
|
|
1073
|
+
return _context34.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
|
|
1037
1074
|
case 1:
|
|
1038
1075
|
case "end":
|
|
1039
|
-
return
|
|
1076
|
+
return _context34.stop();
|
|
1040
1077
|
}
|
|
1041
|
-
},
|
|
1078
|
+
}, _callee34, this);
|
|
1042
1079
|
}));
|
|
1043
|
-
function createTeamContainers(
|
|
1080
|
+
function createTeamContainers(_x53) {
|
|
1044
1081
|
return _createTeamContainers.apply(this, arguments);
|
|
1045
1082
|
}
|
|
1046
1083
|
return createTeamContainers;
|