@esri/hub-common 14.21.1 → 14.23.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.
Files changed (86) hide show
  1. package/dist/esm/core/getRelativeWorkspaceUrl.js +5 -1
  2. package/dist/esm/core/getRelativeWorkspaceUrl.js.map +1 -1
  3. package/dist/esm/groups/HubGroups.js +2 -7
  4. package/dist/esm/groups/HubGroups.js.map +1 -1
  5. package/dist/esm/groups/_internal/computeLinks.js +24 -0
  6. package/dist/esm/groups/_internal/computeLinks.js.map +1 -0
  7. package/dist/esm/groups/_internal/computeProps.js +2 -0
  8. package/dist/esm/groups/_internal/computeProps.js.map +1 -1
  9. package/dist/esm/groups/addGroupMembers.js +79 -0
  10. package/dist/esm/groups/addGroupMembers.js.map +1 -0
  11. package/dist/esm/groups/index.js +1 -2
  12. package/dist/esm/groups/index.js.map +1 -1
  13. package/dist/esm/initiatives/HubInitiatives.js +7 -12
  14. package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
  15. package/dist/esm/initiatives/_internal/computeLinks.js +28 -0
  16. package/dist/esm/initiatives/_internal/computeLinks.js.map +1 -0
  17. package/dist/esm/initiatives/_internal/computeProps.js +2 -0
  18. package/dist/esm/initiatives/_internal/computeProps.js.map +1 -1
  19. package/dist/esm/projects/_internal/computeLinks.js +26 -0
  20. package/dist/esm/projects/_internal/computeLinks.js.map +1 -0
  21. package/dist/esm/projects/_internal/computeProps.js +2 -0
  22. package/dist/esm/projects/_internal/computeProps.js.map +1 -1
  23. package/dist/esm/projects/fetch.js +2 -10
  24. package/dist/esm/projects/fetch.js.map +1 -1
  25. package/dist/node/core/getRelativeWorkspaceUrl.js +5 -1
  26. package/dist/node/core/getRelativeWorkspaceUrl.js.map +1 -1
  27. package/dist/node/groups/HubGroups.js +4 -9
  28. package/dist/node/groups/HubGroups.js.map +1 -1
  29. package/dist/node/groups/_internal/computeLinks.js +28 -0
  30. package/dist/node/groups/_internal/computeLinks.js.map +1 -0
  31. package/dist/node/groups/_internal/computeProps.js +2 -0
  32. package/dist/node/groups/_internal/computeProps.js.map +1 -1
  33. package/dist/node/groups/addGroupMembers.js +83 -0
  34. package/dist/node/groups/addGroupMembers.js.map +1 -0
  35. package/dist/node/groups/index.js +1 -2
  36. package/dist/node/groups/index.js.map +1 -1
  37. package/dist/node/initiatives/HubInitiatives.js +6 -11
  38. package/dist/node/initiatives/HubInitiatives.js.map +1 -1
  39. package/dist/node/initiatives/_internal/computeLinks.js +32 -0
  40. package/dist/node/initiatives/_internal/computeLinks.js.map +1 -0
  41. package/dist/node/initiatives/_internal/computeProps.js +2 -0
  42. package/dist/node/initiatives/_internal/computeProps.js.map +1 -1
  43. package/dist/node/projects/_internal/computeLinks.js +30 -0
  44. package/dist/node/projects/_internal/computeLinks.js.map +1 -0
  45. package/dist/node/projects/_internal/computeProps.js +2 -0
  46. package/dist/node/projects/_internal/computeProps.js.map +1 -1
  47. package/dist/node/projects/fetch.js +2 -10
  48. package/dist/node/projects/fetch.js.map +1 -1
  49. package/dist/types/core/types/IHubEntityBase.d.ts +33 -29
  50. package/dist/types/groups/_internal/computeLinks.d.ts +11 -0
  51. package/dist/types/groups/addGroupMembers.d.ts +16 -0
  52. package/dist/types/groups/index.d.ts +1 -2
  53. package/dist/types/groups/types/types.d.ts +10 -61
  54. package/dist/types/initiatives/_internal/computeLinks.d.ts +11 -0
  55. package/dist/types/projects/_internal/computeLinks.d.ts +11 -0
  56. package/package.json +1 -1
  57. package/dist/esm/groups/_internal/AddOrInviteUsersToGroupUtils.js +0 -195
  58. package/dist/esm/groups/_internal/AddOrInviteUsersToGroupUtils.js.map +0 -1
  59. package/dist/esm/groups/_internal/processAutoAddUsers.js +0 -62
  60. package/dist/esm/groups/_internal/processAutoAddUsers.js.map +0 -1
  61. package/dist/esm/groups/_internal/processEmailUsers.js +0 -50
  62. package/dist/esm/groups/_internal/processEmailUsers.js.map +0 -1
  63. package/dist/esm/groups/_internal/processInviteUsers.js +0 -51
  64. package/dist/esm/groups/_internal/processInviteUsers.js.map +0 -1
  65. package/dist/esm/groups/addOrInviteUsersToGroup.js +0 -67
  66. package/dist/esm/groups/addOrInviteUsersToGroup.js.map +0 -1
  67. package/dist/esm/groups/addOrInviteUsersToGroups.js +0 -51
  68. package/dist/esm/groups/addOrInviteUsersToGroups.js.map +0 -1
  69. package/dist/node/groups/_internal/AddOrInviteUsersToGroupUtils.js +0 -205
  70. package/dist/node/groups/_internal/AddOrInviteUsersToGroupUtils.js.map +0 -1
  71. package/dist/node/groups/_internal/processAutoAddUsers.js +0 -66
  72. package/dist/node/groups/_internal/processAutoAddUsers.js.map +0 -1
  73. package/dist/node/groups/_internal/processEmailUsers.js +0 -54
  74. package/dist/node/groups/_internal/processEmailUsers.js.map +0 -1
  75. package/dist/node/groups/_internal/processInviteUsers.js +0 -55
  76. package/dist/node/groups/_internal/processInviteUsers.js.map +0 -1
  77. package/dist/node/groups/addOrInviteUsersToGroup.js +0 -71
  78. package/dist/node/groups/addOrInviteUsersToGroup.js.map +0 -1
  79. package/dist/node/groups/addOrInviteUsersToGroups.js +0 -55
  80. package/dist/node/groups/addOrInviteUsersToGroups.js.map +0 -1
  81. package/dist/types/groups/_internal/AddOrInviteUsersToGroupUtils.d.ts +0 -82
  82. package/dist/types/groups/_internal/processAutoAddUsers.d.ts +0 -15
  83. package/dist/types/groups/_internal/processEmailUsers.d.ts +0 -14
  84. package/dist/types/groups/_internal/processInviteUsers.d.ts +0 -13
  85. package/dist/types/groups/addOrInviteUsersToGroup.d.ts +0 -18
  86. package/dist/types/groups/addOrInviteUsersToGroups.d.ts +0 -30
@@ -1,205 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.groupUsersByOrgRelationship = exports.handleNoUsers = exports.addOrInviteWorldUsers = exports.addOrInvitePartneredUsers = exports.addOrInviteOrgUsers = exports.addOrInviteCommunityUsers = exports.addOrInviteCollaborationCoordinators = void 0;
4
- const processAutoAddUsers_1 = require("./processAutoAddUsers");
5
- const processInviteUsers_1 = require("./processInviteUsers");
6
- // Add or invite flow based on the type of user begins here
7
- /**
8
- * @private
9
- * Handles add/invite logic for collaboration coordinators inside partnered orgs.
10
- * This is intentionally split out from the invitation of partnered org normal members,
11
- * because the two types of partnered org usres (regular and collaboration coordinator)
12
- * always come from the same 'bucket', however have distinctly different add paths Invite vs auto add.
13
- * It returns either an empty instance of the addOrInviteResponse
14
- * object, or their response from auto adding users.
15
- *
16
- * @export
17
- * @param {IAddOrInviteContext} context context object
18
- * @return {IAddOrInviteResponse} response object
19
- */
20
- async function addOrInviteCollaborationCoordinators(context) {
21
- // If there are no org users return handling no users
22
- if (!context.collaborationCoordinator ||
23
- context.collaborationCoordinator.length === 0) {
24
- // we return an empty object because
25
- // if you leave out any of the props
26
- // from the final object and you are concatting together arrays you can concat
27
- // an undeifined inside an array which will throw off array lengths.
28
- return handleNoUsers();
29
- }
30
- return processAutoAddUsers_1.processAutoAddUsers(context, "collaborationCoordinator");
31
- }
32
- exports.addOrInviteCollaborationCoordinators = addOrInviteCollaborationCoordinators;
33
- /**
34
- * @private
35
- * Handles add/invite logic for community users
36
- * It returns either an empty instance of the addOrInviteResponse
37
- * object, or either ther esponse from processing auto adding
38
- * users or inviting users. If an email has been passed in it also notifies
39
- * processAutoAddUsers that emails should be sent.
40
- *
41
- * @export
42
- * @param {IAddOrInviteContext} context context object
43
- * @return {IAddOrInviteResponse} response object
44
- */
45
- async function addOrInviteCommunityUsers(context) {
46
- // We default to handleNoUsers
47
- // we return an empty object because
48
- // if you leave out any of the props
49
- // from the final object and you are concatting together arrays you can concat
50
- // an undeifined inside an array which will throw off array lengths.
51
- let fnToCall = handleNoUsers;
52
- let shouldEmail = false;
53
- // If community users were passed in...
54
- if (context.community && context.community.length > 0) {
55
- // Default to either autoAdd or invite based on canAutoAddUser.
56
- fnToCall = context.canAutoAddUser
57
- ? processAutoAddUsers_1.processAutoAddUsers
58
- : processInviteUsers_1.processInviteUsers;
59
- // If we have an email object
60
- // Then we will auto add...
61
- // But whether or not we email is still in question
62
- if (context.email) {
63
- // If the email object has the groupId property...
64
- if (context.email.hasOwnProperty("groupId")) {
65
- // If the email objects groupId property is the same as the current groupId in context...
66
- // (This function is part of a flow that could work for N groupIds)
67
- if (context.email.groupId === context.groupId) {
68
- // Then we auto add and send email
69
- fnToCall = processAutoAddUsers_1.processAutoAddUsers;
70
- shouldEmail = true;
71
- } // ELSE if the groupId's do NOT match, we will fall back
72
- // To autoAdd or invite as per line 32.
73
- // We are doing the above logic (lines 43 - 47) because
74
- // We wish to add users to core groups, followers, and content groups
75
- // but only to email the core group.
76
- }
77
- else {
78
- // If it does not have a groupId at all then we will autoAdd and email.
79
- fnToCall = processAutoAddUsers_1.processAutoAddUsers;
80
- shouldEmail = true;
81
- }
82
- }
83
- }
84
- // Return/call the function
85
- return fnToCall(context, "community", shouldEmail);
86
- }
87
- exports.addOrInviteCommunityUsers = addOrInviteCommunityUsers;
88
- /**
89
- * @private
90
- * Handles add/invite logic for Org users
91
- * It returns either an empty instance of the addOrInviteResponse
92
- * object, or either ther esponse from processing auto adding a users or inviting a user
93
- *
94
- * @export
95
- * @param {IAddOrInviteContext} context context object
96
- * @return {IAddOrInviteResponse} response object
97
- */
98
- async function addOrInviteOrgUsers(context) {
99
- // If there are no org users return handling no users
100
- if (!context.org || context.org.length === 0) {
101
- // we return an empty object because
102
- // if you leave out any of the props
103
- // from the final object and you are concatting together arrays you can concat
104
- // an undeifined inside an array which will throw off array lengths.
105
- return handleNoUsers();
106
- }
107
- // for org user if you have assignUsers then auto add the user
108
- // if not then invite the user
109
- return context.canAutoAddUser
110
- ? processAutoAddUsers_1.processAutoAddUsers(context, "org")
111
- : processInviteUsers_1.processInviteUsers(context, "org");
112
- }
113
- exports.addOrInviteOrgUsers = addOrInviteOrgUsers;
114
- /**
115
- * @private
116
- * Handles add/invite logic for partnered org users.
117
- * It returns either an empty instance of the addOrInviteResponse
118
- * object, or their response from inviting users.
119
- *
120
- * @export
121
- * @param {IAddOrInviteContext} context context object
122
- * @return {IAddOrInviteResponse} response object
123
- */
124
- async function addOrInvitePartneredUsers(context) {
125
- // If there are no org users return handling no users
126
- if (!context.partnered || context.partnered.length === 0) {
127
- // we return an empty object because
128
- // if you leave out any of the props
129
- // from the final object and you are concatting together arrays you can concat
130
- // an undeifined inside an array which will throw off array lengths.
131
- return handleNoUsers();
132
- }
133
- // process invite
134
- return processInviteUsers_1.processInviteUsers(context, "partnered");
135
- }
136
- exports.addOrInvitePartneredUsers = addOrInvitePartneredUsers;
137
- /**
138
- * @private
139
- * Handles add/invite logic for world users
140
- * It either returns an empty instance of the add/invite response
141
- * object, or a populated version from processInviteUsers
142
- *
143
- * @export
144
- * @param {IAddOrInviteContext} context Context object
145
- * @return {IAddOrInviteResponse} Response object
146
- */
147
- async function addOrInviteWorldUsers(context) {
148
- // If there are no world users return handling no users
149
- if (!context.world || context.world.length === 0) {
150
- // we return an empty object because
151
- // if you leave out any of the props
152
- // from the final object and you are concatting together arrays you can concat
153
- // an undeifined inside an array which will throw off array lengths.
154
- return handleNoUsers();
155
- }
156
- // process invite
157
- return processInviteUsers_1.processInviteUsers(context, "world");
158
- }
159
- exports.addOrInviteWorldUsers = addOrInviteWorldUsers;
160
- // Add or invite flow based on the type of user ends here
161
- /**
162
- * @private
163
- * Returns an empty instance of the addorinviteresponse object.
164
- * We are using this because if you leave out any of the props
165
- * from the final object and you are concatting together arrays you can concat
166
- * an undeifined inside an array which will throw off array lengths.
167
- *
168
- * @export
169
- * @return {IAddOrInviteResponse}
170
- */
171
- async function handleNoUsers(context, userType, shouldEmail) {
172
- return {
173
- notAdded: [],
174
- notEmailed: [],
175
- notInvited: [],
176
- users: [],
177
- errors: [],
178
- };
179
- }
180
- exports.handleNoUsers = handleNoUsers;
181
- /**
182
- * @private
183
- * Takes users array and sorts them into an object by the type of user they are
184
- * based on the orgType prop (world|org|community)
185
- *
186
- * @export
187
- * @param {IUserWithOrgType[]} users array of users
188
- * @return {IUserOrgRelationship} Object of users sorted by type (world, org, community)
189
- */
190
- function groupUsersByOrgRelationship(users) {
191
- return users.reduce((acc, user) => {
192
- // keyof needed to make bracket notation work without TS throwing a wobbly.
193
- const orgType = user.orgType;
194
- acc[orgType].push(user);
195
- return acc;
196
- }, {
197
- world: [],
198
- org: [],
199
- community: [],
200
- partnered: [],
201
- collaborationCoordinator: [],
202
- });
203
- }
204
- exports.groupUsersByOrgRelationship = groupUsersByOrgRelationship;
205
- //# sourceMappingURL=AddOrInviteUsersToGroupUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddOrInviteUsersToGroupUtils.js","sourceRoot":"","sources":["../../../../src/groups/_internal/AddOrInviteUsersToGroupUtils.ts"],"names":[],"mappings":"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"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processAutoAddUsers = void 0;
4
- const get_prop_1 = require("../../objects/get-prop");
5
- const autoAddUsers_1 = require("../autoAddUsers");
6
- const processEmailUsers_1 = require("./processEmailUsers");
7
- const autoAddUsersAsAdmins_1 = require("./autoAddUsersAsAdmins");
8
- /**
9
- * @private
10
- * Governs logic for automatically adding N users to a group.
11
- * Users are added as either a regular user OR as an administrator of the group
12
- * depending on the addUserAsGroupAdmin prop on the IAddOrInviteContext.
13
- * If there is an email object on the IAddOrInviteContext, then email notifications are sent.
14
- *
15
- * @export
16
- * @param {IAddOrInviteContext} context context object
17
- * @param {string} userType what type of user is it: org | world | community
18
- * @param {boolean} [shouldEmail=false] should the user be emailed?
19
- * @return {IAddOrInviteResponse} response object
20
- */
21
- async function processAutoAddUsers(context, userType, shouldEmail = false) {
22
- // fetch users out of context object
23
- const users = get_prop_1.getProp(context, userType);
24
- let autoAddResponse;
25
- let emailResponse;
26
- let notAdded = [];
27
- let errors = [];
28
- // fetch addUserAsGroupAdmin out of context
29
- const { addUserAsGroupAdmin } = context;
30
- if (addUserAsGroupAdmin) {
31
- // if is core group we elevate user to admin
32
- autoAddResponse = await autoAddUsersAsAdmins_1.autoAddUsersAsAdmins(get_prop_1.getProp(context, "groupId"), users, get_prop_1.getProp(context, "primaryRO"));
33
- }
34
- else {
35
- // if not then we are just auto adding them
36
- autoAddResponse = await autoAddUsers_1.autoAddUsers(get_prop_1.getProp(context, "groupId"), users, get_prop_1.getProp(context, "primaryRO"));
37
- }
38
- // handle notAdded users
39
- if (autoAddResponse.notAdded) {
40
- notAdded = notAdded.concat(autoAddResponse.notAdded);
41
- }
42
- // Merge errors into empty array
43
- if (autoAddResponse.errors) {
44
- errors = errors.concat(autoAddResponse.errors);
45
- }
46
- // run email process
47
- if (shouldEmail) {
48
- emailResponse = await processEmailUsers_1.processEmailUsers(context);
49
- // merge errors in to overall errors array to keep things flat
50
- if (emailResponse.errors && emailResponse.errors.length > 0) {
51
- errors = errors.concat(emailResponse.errors);
52
- }
53
- }
54
- // if you leave out any of the props
55
- // from the final object and you are concatting together arrays you can concat
56
- // an undeifined inside an array which will throw off array lengths.
57
- return {
58
- users: users.map((u) => u.username),
59
- notAdded,
60
- errors,
61
- notEmailed: (emailResponse === null || emailResponse === void 0 ? void 0 : emailResponse.notEmailed) || [],
62
- notInvited: [],
63
- };
64
- }
65
- exports.processAutoAddUsers = processAutoAddUsers;
66
- //# sourceMappingURL=processAutoAddUsers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processAutoAddUsers.js","sourceRoot":"","sources":["../../../../src/groups/_internal/processAutoAddUsers.ts"],"names":[],"mappings":";;;AAEA,qDAAiD;AAEjD,kDAA+C;AAC/C,2DAAwD;AACxD,iEAA8D;AAE9D;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAA4B,EAC5B,QAK8B,EAC9B,cAAuB,KAAK;IAE5B,oCAAoC;IACpC,MAAM,KAAK,GAAY,kBAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAClD,IAAI,eAAe,CAAC;IACpB,IAAI,aAAa,CAAC;IAClB,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,IAAI,MAAM,GAAyB,EAAE,CAAC;IACtC,2CAA2C;IAC3C,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;IAExC,IAAI,mBAAmB,EAAE;QACvB,4CAA4C;QAC5C,eAAe,GAAG,MAAM,2CAAoB,CAC1C,kBAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAC3B,KAAK,EACL,kBAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAC9B,CAAC;KACH;SAAM;QACL,2CAA2C;QAC3C,eAAe,GAAG,MAAM,2BAAY,CAClC,kBAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAC3B,KAAK,EACL,kBAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAC9B,CAAC;KACH;IACD,wBAAwB;IACxB,IAAI,eAAe,CAAC,QAAQ,EAAE;QAC5B,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;KACtD;IACD,gCAAgC;IAChC,IAAI,eAAe,CAAC,MAAM,EAAE;QAC1B,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;KAChD;IACD,oBAAoB;IACpB,IAAI,WAAW,EAAE;QACf,aAAa,GAAG,MAAM,qCAAiB,CAAC,OAAO,CAAC,CAAC;QACjD,8DAA8D;QAC9D,IAAI,aAAa,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3D,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC9C;KACF;IACD,oCAAoC;IACpC,8EAA8E;IAC9E,oEAAoE;IACpE,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QACnC,QAAQ;QACR,MAAM;QACN,UAAU,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,UAAU,KAAI,EAAE;QAC3C,UAAU,EAAE,EAAE;KACf,CAAC;AACJ,CAAC;AA5DD,kDA4DC"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processEmailUsers = void 0;
4
- const get_prop_1 = require("../../objects/get-prop");
5
- const emailOrgUsers_1 = require("../emailOrgUsers");
6
- /**
7
- * @private
8
- * Governs the logic for emailing N users. It acts under the assumption
9
- * that all the 'community' users are the ones being emailed (this is due to platform rules we conform to)
10
- * Function is called upstream depending on if an email object is attached to the context.
11
- * Email object contains its own auth as it'll require the community admin to send the email itself.
12
- * An individual email call goes out for each user due to how the response of multiple users in a single call works.
13
- *
14
- * @export
15
- * @param {IAddOrInviteContext} context context object
16
- * @return {IAddOrInviteResponse} response object
17
- */
18
- async function processEmailUsers(context) {
19
- // Fetch users out of context. We only email community users so we are
20
- // explicit about that
21
- const users = get_prop_1.getProp(context, "community");
22
- const notEmailed = [];
23
- let errors = [];
24
- // iterate through users as we want a distinct email call per user due to how
25
- // batch email will only respond with success: true/false
26
- // and if there is an error then it gets priority even though successes do still go through
27
- for (const user of users) {
28
- // Make email call...
29
- const emailResponse = await emailOrgUsers_1.emailOrgUsers([user], get_prop_1.getProp(context, "email.message"), get_prop_1.getProp(context, "email.auth"), true);
30
- // If it's just a failed email
31
- // then add username to notEmailed array
32
- if (!emailResponse.success) {
33
- notEmailed.push(user.username);
34
- // If there was a legit error
35
- // Then only the error returns from
36
- // online. Add error AND include username in notEmailed array.
37
- if (emailResponse.errors) {
38
- errors = errors.concat(emailResponse.errors);
39
- }
40
- }
41
- }
42
- // if you leave out any of the props
43
- // from the final object and you are concatting together arrays you can concat
44
- // an undeifined inside an array which will throw off array lengths.
45
- return {
46
- users: users.map((u) => u.username),
47
- notEmailed,
48
- errors,
49
- notInvited: [],
50
- notAdded: [],
51
- };
52
- }
53
- exports.processEmailUsers = processEmailUsers;
54
- //# sourceMappingURL=processEmailUsers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processEmailUsers.js","sourceRoot":"","sources":["../../../../src/groups/_internal/processEmailUsers.ts"],"names":[],"mappings":";;;AAEA,qDAAiD;AAEjD,oDAAiD;AAEjD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,iBAAiB,CACrC,OAA4B;IAE5B,sEAAsE;IACtE,sBAAsB;IACtB,MAAM,KAAK,GAAY,kBAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACrD,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,MAAM,GAAyB,EAAE,CAAC;IACtC,6EAA6E;IAC7E,yDAAyD;IACzD,2FAA2F;IAC3F,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,qBAAqB;QACrB,MAAM,aAAa,GAAG,MAAM,6BAAa,CACvC,CAAC,IAAI,CAAC,EACN,kBAAO,CAAC,OAAO,EAAE,eAAe,CAAC,EACjC,kBAAO,CAAC,OAAO,EAAE,YAAY,CAAC,EAC9B,IAAI,CACL,CAAC;QACF,8BAA8B;QAC9B,wCAAwC;QACxC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;YAC1B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/B,6BAA6B;YAC7B,mCAAmC;YACnC,8DAA8D;YAC9D,IAAI,aAAa,CAAC,MAAM,EAAE;gBACxB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;aAC9C;SACF;KACF;IACD,oCAAoC;IACpC,8EAA8E;IAC9E,oEAAoE;IACpE,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QACnC,UAAU;QACV,MAAM;QACN,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;AAzCD,8CAyCC"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processInviteUsers = void 0;
4
- const get_prop_1 = require("../../objects/get-prop");
5
- const inviteUsers_1 = require("../inviteUsers");
6
- /**
7
- * @private
8
- * Governs the logic for inviting N users to a single group.
9
- * An individual invite call goes out for each user and the results are consolidated.
10
- * See comment in function about the for...of loop which explains reasoning.
11
- *
12
- * @export
13
- * @param {IAddOrInviteContext} context context object
14
- * @param {string} userType what type of user is it: org | world | community
15
- * @return {IAddOrInviteResponse} response object
16
- */
17
- async function processInviteUsers(context, userType) {
18
- // Fetch users out of context based on userType
19
- const users = get_prop_1.getProp(context, userType);
20
- const notInvited = [];
21
- let errors = [];
22
- const { addUserAsGroupAdmin } = context;
23
- // iterate through users as we want a distinct invite call per user due to how
24
- // batch invites will only respond with success: true/false
25
- // and if there is an error then it gets priority even though successes do still go through
26
- for (const user of users) {
27
- // Invite users call
28
- const inviteResponse = await inviteUsers_1.inviteUsers(get_prop_1.getProp(context, "groupId"), [user], get_prop_1.getProp(context, "primaryRO"), 20160, // timeout
29
- addUserAsGroupAdmin ? "group_admin" : "group_member" // if we are in a core group we want to invite them as a group admin, otherwise a group member
30
- );
31
- // If it's just a failed invite then
32
- // add username to notInvited array
33
- if (!inviteResponse.success) {
34
- notInvited.push(user.username);
35
- // If there was a legit error
36
- // Then only the error returns from
37
- // online. Add error AND include username in notInvited array.
38
- if (inviteResponse.errors) {
39
- errors = errors.concat(inviteResponse.errors);
40
- }
41
- }
42
- }
43
- // if you leave out any of the props
44
- // from the final object and you are concatting together arrays you can concat
45
- // an undeifined inside an array which will throw off array lengths.
46
- return {
47
- users: users.map((u) => u.username),
48
- notInvited,
49
- errors,
50
- notEmailed: [],
51
- notAdded: [],
52
- };
53
- }
54
- exports.processInviteUsers = processInviteUsers;
55
- //# sourceMappingURL=processInviteUsers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processInviteUsers.js","sourceRoot":"","sources":["../../../../src/groups/_internal/processInviteUsers.ts"],"names":[],"mappings":";;;AAEA,qDAAiD;AAEjD,gDAA6C;AAC7C;;;;;;;;;;GAUG;AACI,KAAK,UAAU,kBAAkB,CACtC,OAA4B,EAC5B,QAAqD;IAErD,+CAA+C;IAC/C,MAAM,KAAK,GAAY,kBAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAClD,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,MAAM,GAAyB,EAAE,CAAC;IACtC,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;IACxC,8EAA8E;IAC9E,2DAA2D;IAC3D,2FAA2F;IAC3F,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,oBAAoB;QACpB,MAAM,cAAc,GAAG,MAAM,yBAAW,CACtC,kBAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAC3B,CAAC,IAAI,CAAC,EACN,kBAAO,CAAC,OAAO,EAAE,WAAW,CAAC,EAC7B,KAAK,EAAE,UAAU;QACjB,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,8FAA8F;SACpJ,CAAC;QACF,oCAAoC;QACpC,mCAAmC;QACnC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YAC3B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/B,6BAA6B;YAC7B,mCAAmC;YACnC,8DAA8D;YAC9D,IAAI,cAAc,CAAC,MAAM,EAAE;gBACzB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;aAC/C;SACF;KACF;IACD,oCAAoC;IACpC,8EAA8E;IAC9E,oEAAoE;IACpE,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QACnC,UAAU;QACV,MAAM;QACN,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;AA3CD,gDA2CC"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addOrInviteUsersToGroup = void 0;
4
- const AddOrInviteUsersToGroupUtils_1 = require("./_internal/AddOrInviteUsersToGroupUtils");
5
- /**
6
- * Add or invite N users to a single group
7
- * Org|community|world logic flows are run even if there are no users applicable for that particular path.
8
- * Results from each path are consolidated and surfaced in the return object as failures and errors are of
9
- * more importance than successes.
10
- *
11
- * @export
12
- * @param {string} groupId Group we are adding users to
13
- * @param {IUserWithOrgType[]} users array of users to add
14
- * @param {IAuthenticationManager} primaryRO primary requestOptions
15
- * @param {boolean} canAutoAddUser Can we automatically add a user to the group?
16
- * @param {boolean} addUserAsGroupAdmin Should the user be added as a group administrator
17
- * @param {IAddOrInviteEmail} email Email object
18
- * @return {IAddOrInviteToGroupResult} Result object
19
- */
20
- async function addOrInviteUsersToGroup(groupId, users, primaryRO, canAutoAddUser, addUserAsGroupAdmin, email) {
21
- // Group users by their org relationship
22
- const parsedUsers = AddOrInviteUsersToGroupUtils_1.groupUsersByOrgRelationship(users);
23
- // build up params for the context
24
- const inputParams = {
25
- groupId,
26
- primaryRO,
27
- allUsers: users,
28
- canAutoAddUser,
29
- addUserAsGroupAdmin,
30
- email,
31
- };
32
- // create context from params and parsed users
33
- const context = Object.assign(inputParams, parsedUsers);
34
- // result obj by org relationship
35
- const result = {
36
- community: await AddOrInviteUsersToGroupUtils_1.addOrInviteCommunityUsers(context),
37
- org: await AddOrInviteUsersToGroupUtils_1.addOrInviteOrgUsers(context),
38
- world: await AddOrInviteUsersToGroupUtils_1.addOrInviteWorldUsers(context),
39
- partnered: await AddOrInviteUsersToGroupUtils_1.addOrInvitePartneredUsers(context),
40
- collaborationCoordinator: await AddOrInviteUsersToGroupUtils_1.addOrInviteCollaborationCoordinators(context),
41
- notAdded: [],
42
- notInvited: [],
43
- notEmailed: [],
44
- errors: [],
45
- groupId,
46
- };
47
- // Bring not added / invited / emailed / errors up to the top level
48
- result.notAdded = [
49
- ...result.community.notAdded,
50
- ...result.org.notAdded,
51
- ...result.world.notAdded,
52
- ];
53
- result.notInvited = [
54
- ...result.community.notInvited,
55
- ...result.org.notInvited,
56
- ...result.world.notInvited,
57
- ];
58
- result.notEmailed = [
59
- ...result.community.notEmailed,
60
- ...result.org.notEmailed,
61
- ...result.world.notEmailed,
62
- ];
63
- result.errors = [
64
- ...result.community.errors,
65
- ...result.org.errors,
66
- ...result.world.errors,
67
- ];
68
- return result;
69
- }
70
- exports.addOrInviteUsersToGroup = addOrInviteUsersToGroup;
71
- //# sourceMappingURL=addOrInviteUsersToGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addOrInviteUsersToGroup.js","sourceRoot":"","sources":["../../../src/groups/addOrInviteUsersToGroup.ts"],"names":[],"mappings":";;;AAQA,2FAOkD;AAElD;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,uBAAuB,CAC3C,OAAe,EACf,KAAyB,EACzB,SAAiC,EACjC,cAAuB,EACvB,mBAA4B,EAC5B,KAAwB;IAExB,wCAAwC;IACxC,MAAM,WAAW,GAAyB,0DAA2B,CAAC,KAAK,CAAC,CAAC;IAC7E,kCAAkC;IAClC,MAAM,WAAW,GAAG;QAClB,OAAO;QACP,SAAS;QACT,QAAQ,EAAE,KAAK;QACf,cAAc;QACd,mBAAmB;QACnB,KAAK;KACN,CAAC;IACF,8CAA8C;IAC9C,MAAM,OAAO,GAAwB,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC7E,iCAAiC;IACjC,MAAM,MAAM,GAA8B;QACxC,SAAS,EAAE,MAAM,wDAAyB,CAAC,OAAO,CAAC;QACnD,GAAG,EAAE,MAAM,kDAAmB,CAAC,OAAO,CAAC;QACvC,KAAK,EAAE,MAAM,oDAAqB,CAAC,OAAO,CAAC;QAC3C,SAAS,EAAE,MAAM,wDAAyB,CAAC,OAAO,CAAC;QACnD,wBAAwB,EAAE,MAAM,mEAAoC,CAClE,OAAO,CACR;QACD,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,EAAE;QACV,OAAO;KACR,CAAC;IACF,mEAAmE;IACnE,MAAM,CAAC,QAAQ,GAAG;QAChB,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ;QAC5B,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ;QACtB,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ;KACzB,CAAC;IACF,MAAM,CAAC,UAAU,GAAG;QAClB,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU;QAC9B,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU;QACxB,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU;KAC3B,CAAC;IACF,MAAM,CAAC,UAAU,GAAG;QAClB,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU;QAC9B,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU;QACxB,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU;KAC3B,CAAC;IACF,MAAM,CAAC,MAAM,GAAG;QACd,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM;QAC1B,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM;QACpB,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM;KACvB,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AA1DD,0DA0DC"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addOrInviteUsersToGroups = void 0;
4
- const addOrInviteUsersToGroup_1 = require("./addOrInviteUsersToGroup");
5
- /**
6
- * addOrInviteUsersToGroups adds/invites N users to N groups
7
- * Initial entry point function for add/invite members flow
8
- * when dealing with multiple groups.
9
- * Responses from each group are then consolidated into the final returned object.
10
- *
11
- * @export
12
- * @param {string[]} groupIds array of groups we are adding users to
13
- * @param {IUserWithOrgType[]} users array of users to add to those groups
14
- * @param {IAuthenticationManager} primaryRO primary requestOptions
15
- * @param {boolean} [canAutoAddUser=false] Can we automatically add a user to the group?
16
- * @param {boolean} [addUserAsGroupAdmin=false] Can the user be added to a group as an administrator of that group?
17
- * @param {IAddOrInviteEmail} [email] Email object contains auth for the email && the email object itself
18
- * @return {*} {Promise<{
19
- * notAdded: string[];
20
- * notInvited: string[];
21
- * notEmailed: string[];
22
- * errors: ArcGISRequestError[];
23
- * responses: IAddOrInviteToGroupResult[];
24
- * }>} Results object
25
- */
26
- async function addOrInviteUsersToGroups(groupIds, users, primaryRO, canAutoAddUser = false, addUserAsGroupAdmin = false, email) {
27
- let notAdded = [];
28
- let notInvited = [];
29
- let notEmailed = [];
30
- let errors = [];
31
- const responses = [];
32
- // need to for..of loop this as a reduce will overwrite promises during execution
33
- // this way we get an object of each group id nicely.
34
- for (const groupId of groupIds) {
35
- // For each group we'll add the users to them.
36
- const result = await addOrInviteUsersToGroup_1.addOrInviteUsersToGroup(groupId, users, primaryRO, canAutoAddUser, addUserAsGroupAdmin, email);
37
- // attach each groups results
38
- responses.push(result);
39
- // surface results to the top of the stack...
40
- notAdded = notAdded.concat(result.notAdded);
41
- errors = errors.concat(result.errors);
42
- notInvited = notInvited.concat(result.notInvited);
43
- notEmailed = notEmailed.concat(result.notEmailed);
44
- }
45
- // Return built up result object.
46
- return {
47
- notAdded,
48
- notInvited,
49
- notEmailed,
50
- errors,
51
- responses,
52
- };
53
- }
54
- exports.addOrInviteUsersToGroups = addOrInviteUsersToGroups;
55
- //# sourceMappingURL=addOrInviteUsersToGroups.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addOrInviteUsersToGroups.js","sourceRoot":"","sources":["../../../src/groups/addOrInviteUsersToGroups.ts"],"names":[],"mappings":";;;AASA,uEAAoE;AAEpE;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,KAAK,UAAU,wBAAwB,CAC5C,QAAkB,EAClB,KAAyB,EACzB,SAAiC,EACjC,iBAA0B,KAAK,EAC/B,sBAA+B,KAAK,EACpC,KAAyB;IAQzB,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,IAAI,UAAU,GAAa,EAAE,CAAC;IAC9B,IAAI,UAAU,GAAa,EAAE,CAAC;IAC9B,IAAI,MAAM,GAAyB,EAAE,CAAC;IACtC,MAAM,SAAS,GAAgC,EAAE,CAAC;IAClD,iFAAiF;IACjF,qDAAqD;IACrD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,8CAA8C;QAC9C,MAAM,MAAM,GAAG,MAAM,iDAAuB,CAC1C,OAAO,EACP,KAAK,EACL,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,KAAK,CACN,CAAC;QACF,6BAA6B;QAC7B,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,6CAA6C;QAC7C,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAClD,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KACnD;IACD,iCAAiC;IACjC,OAAO;QACL,QAAQ;QACR,UAAU;QACV,UAAU;QACV,MAAM;QACN,SAAS;KACV,CAAC;AACJ,CAAC;AA/CD,4DA+CC"}
@@ -1,82 +0,0 @@
1
- import { IAddOrInviteContext, IAddOrInviteResponse, IUserOrgRelationship, IUserWithOrgType } from "../types";
2
- /**
3
- * @private
4
- * Handles add/invite logic for collaboration coordinators inside partnered orgs.
5
- * This is intentionally split out from the invitation of partnered org normal members,
6
- * because the two types of partnered org usres (regular and collaboration coordinator)
7
- * always come from the same 'bucket', however have distinctly different add paths Invite vs auto add.
8
- * It returns either an empty instance of the addOrInviteResponse
9
- * object, or their response from auto adding users.
10
- *
11
- * @export
12
- * @param {IAddOrInviteContext} context context object
13
- * @return {IAddOrInviteResponse} response object
14
- */
15
- export declare function addOrInviteCollaborationCoordinators(context: IAddOrInviteContext): Promise<IAddOrInviteResponse>;
16
- /**
17
- * @private
18
- * Handles add/invite logic for community users
19
- * It returns either an empty instance of the addOrInviteResponse
20
- * object, or either ther esponse from processing auto adding
21
- * users or inviting users. If an email has been passed in it also notifies
22
- * processAutoAddUsers that emails should be sent.
23
- *
24
- * @export
25
- * @param {IAddOrInviteContext} context context object
26
- * @return {IAddOrInviteResponse} response object
27
- */
28
- export declare function addOrInviteCommunityUsers(context: IAddOrInviteContext): Promise<IAddOrInviteResponse>;
29
- /**
30
- * @private
31
- * Handles add/invite logic for Org users
32
- * It returns either an empty instance of the addOrInviteResponse
33
- * object, or either ther esponse from processing auto adding a users or inviting a user
34
- *
35
- * @export
36
- * @param {IAddOrInviteContext} context context object
37
- * @return {IAddOrInviteResponse} response object
38
- */
39
- export declare function addOrInviteOrgUsers(context: IAddOrInviteContext): Promise<IAddOrInviteResponse>;
40
- /**
41
- * @private
42
- * Handles add/invite logic for partnered org users.
43
- * It returns either an empty instance of the addOrInviteResponse
44
- * object, or their response from inviting users.
45
- *
46
- * @export
47
- * @param {IAddOrInviteContext} context context object
48
- * @return {IAddOrInviteResponse} response object
49
- */
50
- export declare function addOrInvitePartneredUsers(context: IAddOrInviteContext): Promise<IAddOrInviteResponse>;
51
- /**
52
- * @private
53
- * Handles add/invite logic for world users
54
- * It either returns an empty instance of the add/invite response
55
- * object, or a populated version from processInviteUsers
56
- *
57
- * @export
58
- * @param {IAddOrInviteContext} context Context object
59
- * @return {IAddOrInviteResponse} Response object
60
- */
61
- export declare function addOrInviteWorldUsers(context: IAddOrInviteContext): Promise<IAddOrInviteResponse>;
62
- /**
63
- * @private
64
- * Returns an empty instance of the addorinviteresponse object.
65
- * We are using this because if you leave out any of the props
66
- * from the final object and you are concatting together arrays you can concat
67
- * an undeifined inside an array which will throw off array lengths.
68
- *
69
- * @export
70
- * @return {IAddOrInviteResponse}
71
- */
72
- export declare function handleNoUsers(context?: IAddOrInviteContext, userType?: "world" | "org" | "community" | "partnered", shouldEmail?: boolean): Promise<IAddOrInviteResponse>;
73
- /**
74
- * @private
75
- * Takes users array and sorts them into an object by the type of user they are
76
- * based on the orgType prop (world|org|community)
77
- *
78
- * @export
79
- * @param {IUserWithOrgType[]} users array of users
80
- * @return {IUserOrgRelationship} Object of users sorted by type (world, org, community)
81
- */
82
- export declare function groupUsersByOrgRelationship(users: IUserWithOrgType[]): IUserOrgRelationship;
@@ -1,15 +0,0 @@
1
- import { IAddOrInviteContext, IAddOrInviteResponse } from "../types";
2
- /**
3
- * @private
4
- * Governs logic for automatically adding N users to a group.
5
- * Users are added as either a regular user OR as an administrator of the group
6
- * depending on the addUserAsGroupAdmin prop on the IAddOrInviteContext.
7
- * If there is an email object on the IAddOrInviteContext, then email notifications are sent.
8
- *
9
- * @export
10
- * @param {IAddOrInviteContext} context context object
11
- * @param {string} userType what type of user is it: org | world | community
12
- * @param {boolean} [shouldEmail=false] should the user be emailed?
13
- * @return {IAddOrInviteResponse} response object
14
- */
15
- export declare function processAutoAddUsers(context: IAddOrInviteContext, userType: "world" | "org" | "community" | "partnered" | "collaborationCoordinator", shouldEmail?: boolean): Promise<IAddOrInviteResponse>;
@@ -1,14 +0,0 @@
1
- import { IAddOrInviteContext, IAddOrInviteResponse } from "../types";
2
- /**
3
- * @private
4
- * Governs the logic for emailing N users. It acts under the assumption
5
- * that all the 'community' users are the ones being emailed (this is due to platform rules we conform to)
6
- * Function is called upstream depending on if an email object is attached to the context.
7
- * Email object contains its own auth as it'll require the community admin to send the email itself.
8
- * An individual email call goes out for each user due to how the response of multiple users in a single call works.
9
- *
10
- * @export
11
- * @param {IAddOrInviteContext} context context object
12
- * @return {IAddOrInviteResponse} response object
13
- */
14
- export declare function processEmailUsers(context: IAddOrInviteContext): Promise<IAddOrInviteResponse>;