codeapp-js 1.0.2 → 1.1.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 (128) hide show
  1. package/AI/skills/autoreview/SKILL.md +69 -0
  2. package/AI/skills/connections/SKILL.md +4 -4
  3. package/AI/skills/dataverse/SKILL.md +4 -2
  4. package/AI/skills/keyvault/SKILL.md +139 -0
  5. package/AI/skills/office365-groups/SKILL.md +46 -25
  6. package/AI/skills/office365-outlook/SKILL.md +56 -25
  7. package/AI/skills/office365-users/SKILL.md +41 -36
  8. package/AI/skills/sharepoint/SKILL.md +174 -31
  9. package/AI/skills/start/SKILL.md +1 -0
  10. package/codeApp/dist/connectors/autoreview.js +1654 -0
  11. package/codeApp/dist/connectors/office365groups.js +2995 -432
  12. package/{examples/outlook Demo/.power/schemas/office365/office365.Schema.json → codeApp/dist/connectors/office365outlook.js} +7439 -16
  13. package/codeApp/dist/connectors/office365users.js +2990 -349
  14. package/codeApp/dist/connectors/sharepoint.js +529 -308
  15. package/examples/combined demo/dist/connectors/office365outlook.js +28521 -0
  16. package/examples/combined demo/dist/connectors/office365users.js +3154 -0
  17. package/examples/combined demo/dist/index.js +2 -6
  18. package/examples/combined demo/power.config.json +1 -1
  19. package/examples/groups Demo/{.power/schemas/office365groups/office365groups.Schema.json → dist/connectors/office365groups.js } +3205 -2204
  20. package/examples/groups Demo/dist/index.js +1 -5
  21. package/examples/groups Demo/power.config.json +1 -1
  22. package/examples/myProfile/dist/connectors/office365users.js +3154 -0
  23. package/examples/myProfile/dist/index.js +1 -5
  24. package/examples/myProfile/power.config.json +1 -1
  25. package/examples/outlook Demo/dist/connectors/office365outlook.js +28521 -0
  26. package/examples/outlook Demo/dist/index.js +2 -5
  27. package/examples/outlook Demo/power.config.json +1 -1
  28. package/examples/sharePoint Demo/dist/connectors/sharepoint.js +687 -0
  29. package/examples/sharePoint Demo/dist/index.js +86 -127
  30. package/examples/sharePoint Demo/power.config.json +1 -1
  31. package/package.json +1 -1
  32. package/codeApp/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6275
  33. package/codeApp/.power/schemas/jira/jira.Schema.json +0 -6903
  34. package/codeApp/.power/schemas/keyvault/keyvault.Schema.json +0 -1600
  35. package/codeApp/.power/schemas/office365groups/office365groups.Schema.json +0 -2204
  36. package/codeApp/.power/schemas/teams/teams.Schema.json +0 -11112
  37. package/codeApp/dist/connectors/outlook.js +0 -1393
  38. package/codeApp/src/generated/models/AzureKeyVaultModel.ts +0 -107
  39. package/codeApp/src/generated/models/JiraModel.ts +0 -501
  40. package/codeApp/src/generated/models/Office365GroupsModel.ts +0 -363
  41. package/codeApp/src/generated/models/Office365OutlookModel.ts +0 -2046
  42. package/codeApp/src/generated/models/Office365UsersModel.ts +0 -254
  43. package/codeApp/src/generated/services/AzureKeyVaultService.ts +0 -257
  44. package/codeApp/src/generated/services/JiraService.ts +0 -1124
  45. package/codeApp/src/generated/services/Office365GroupsService.ts +0 -326
  46. package/codeApp/src/generated/services/Office365OutlookService.ts +0 -2476
  47. package/codeApp/src/generated/services/Office365UsersService.ts +0 -358
  48. package/examples/apps/kanban/dist/dataverse.js +0 -94
  49. package/examples/apps/kanban/dist/environmentVar.js +0 -55
  50. package/examples/apps/kanban/dist/index.css +0 -605
  51. package/examples/apps/kanban/dist/index.html +0 -21
  52. package/examples/apps/kanban/dist/index.js +0 -860
  53. package/examples/apps/kanban/dist/office365groups.js +0 -97
  54. package/examples/apps/kanban/dist/office365users.js +0 -451
  55. package/examples/apps/kanban/dist/outlook.js +0 -162
  56. package/examples/apps/kanban/dist/power-apps-data.js +0 -2953
  57. package/examples/apps/kanban/dist/sharepoint.js +0 -435
  58. package/examples/apps/kanban/power.config.json +0 -35
  59. package/examples/apps/kanban/src/generated/index.ts +0 -14
  60. package/examples/apps/kanban/src/generated/models/Office365GroupsModel.ts +0 -363
  61. package/examples/apps/kanban/src/generated/models/Office365OutlookModel.ts +0 -2046
  62. package/examples/apps/kanban/src/generated/models/Office365UsersModel.ts +0 -254
  63. package/examples/apps/kanban/src/generated/services/Office365GroupsService.ts +0 -326
  64. package/examples/apps/kanban/src/generated/services/Office365OutlookService.ts +0 -2476
  65. package/examples/apps/kanban/src/generated/services/Office365UsersService.ts +0 -358
  66. package/examples/apps/planning Poker/additional files/AgilePoker_1_0_0_1.zip +0 -0
  67. package/examples/apps/planning Poker/additional files/PokerTables_1_0_0_1.zip +0 -0
  68. package/examples/apps/planning Poker/additional files/customizations (tables).xml +0 -6429
  69. package/examples/apps/planning Poker/additional files/dataverse-tables.json +0 -165
  70. package/examples/apps/planning Poker/additional files/readme.md +0 -122
  71. package/examples/apps/planning Poker/dist/dataverse.js +0 -78
  72. package/examples/apps/planning Poker/dist/index.html +0 -198
  73. package/examples/apps/planning Poker/dist/index.js +0 -955
  74. package/examples/apps/planning Poker/dist/power-apps-data.js +0 -2953
  75. package/examples/apps/planning Poker/dist/styles.css +0 -815
  76. package/examples/apps/planning Poker/power.config.json +0 -50
  77. package/examples/apps/solution explorer/dist/codeapp.js +0 -1098
  78. package/examples/apps/solution explorer/dist/icon-512.png +0 -0
  79. package/examples/apps/solution explorer/dist/index.html +0 -80
  80. package/examples/apps/solution explorer/dist/index.js +0 -735
  81. package/examples/apps/solution explorer/dist/power-apps-data.js +0 -3007
  82. package/examples/apps/solution explorer/dist/styles.css +0 -571
  83. package/examples/apps/solution explorer/power.config.json +0 -151
  84. package/examples/apps/todo/dist/dataverse.js +0 -64
  85. package/examples/apps/todo/dist/icon192.png +0 -0
  86. package/examples/apps/todo/dist/index.html +0 -75
  87. package/examples/apps/todo/dist/index.js +0 -9
  88. package/examples/apps/todo/dist/power-apps-data.js +0 -2953
  89. package/examples/apps/todo/dist/renderer.js +0 -375
  90. package/examples/apps/todo/dist/styles.css +0 -691
  91. package/examples/apps/todo/power.config.json +0 -35
  92. package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6275
  93. package/examples/combined demo/.power/schemas/jira/jira.Schema.json +0 -6903
  94. package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +0 -1600
  95. package/examples/combined demo/.power/schemas/teams/teams.Schema.json +0 -11112
  96. package/examples/combined demo/dist/office365users.js +0 -513
  97. package/examples/combined demo/dist/outlook.js +0 -1393
  98. package/examples/combined demo/src/generated/index.ts +0 -12
  99. package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +0 -107
  100. package/examples/combined demo/src/generated/models/JiraModel.ts +0 -501
  101. package/examples/combined demo/src/generated/models/Office365GroupsModel.ts +0 -363
  102. package/examples/combined demo/src/generated/models/Office365OutlookModel.ts +0 -2046
  103. package/examples/combined demo/src/generated/models/Office365UsersModel.ts +0 -254
  104. package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +0 -257
  105. package/examples/combined demo/src/generated/services/JiraService.ts +0 -1124
  106. package/examples/combined demo/src/generated/services/Office365GroupsService.ts +0 -326
  107. package/examples/combined demo/src/generated/services/Office365OutlookService.ts +0 -2476
  108. package/examples/combined demo/src/generated/services/Office365UsersService.ts +0 -358
  109. package/examples/groups Demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -613
  110. package/examples/groups Demo/dist/office365groups.js +0 -642
  111. package/examples/groups Demo/src/generated/index.ts +0 -10
  112. package/examples/groups Demo/src/generated/models/Office365GroupsModel.ts +0 -363
  113. package/examples/groups Demo/src/generated/services/Office365GroupsService.ts +0 -326
  114. package/examples/myProfile/dist/office365users.js +0 -517
  115. package/examples/outlook Demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6512
  116. package/examples/outlook Demo/dist/outlook.js +0 -1393
  117. package/examples/outlook Demo/src/generated/index.ts +0 -10
  118. package/examples/outlook Demo/src/generated/models/Office365OutlookModel.ts +0 -2046
  119. package/examples/outlook Demo/src/generated/services/Office365OutlookService.ts +0 -2476
  120. package/examples/sharePoint Demo/dist/sharepoint.js +0 -466
  121. package/examples/sharePoint Demo/src/generated/index.ts +0 -14
  122. package/examples/sharePoint Demo/src/generated/models/Office365GroupsModel.ts +0 -363
  123. package/examples/sharePoint Demo/src/generated/models/Office365OutlookModel.ts +0 -2046
  124. package/examples/sharePoint Demo/src/generated/models/Office365UsersModel.ts +0 -254
  125. package/examples/sharePoint Demo/src/generated/services/Office365GroupsService.ts +0 -326
  126. package/examples/sharePoint Demo/src/generated/services/Office365OutlookService.ts +0 -2476
  127. package/examples/sharePoint Demo/src/generated/services/Office365UsersService.ts +0 -358
  128. package/readme.md +0 -590
@@ -1,642 +0,0 @@
1
- // ────────────────────────────────────────────────────────────────────────────
2
- // ────────────────────────────── O365 Groups──────────────────────────────────
3
- // ────────────────────────────────────────────────────────────────────────────
4
- import { getClient } from "./power-apps-data.js";
5
- import {_dbgWrap,unwrapResult } from "./codeapp.js";
6
- // ── Data source names (must match connectionReferences in power.config.json) ──
7
- const DATA_SOURCE_GROUPS_CANDIDATES = ["office365groups", "Office365Groups"];
8
- const GROUPS_APIS = {
9
- ListGroupMembers: {
10
- path: "/{connectionId}/v1.0/groups/{groupId}/members",
11
- method: "GET",
12
- parameters: [
13
- { name: "connectionId", in: "path", required: true, type: "string" },
14
- { name: "groupId", in: "path", required: true, type: "string" },
15
- { name: "$top", in: "query", required: false, type: "integer" },
16
- ],
17
- responseInfo: { 200: { type: "object" } },
18
- },
19
- OnGroupMembershipChange: {
20
- path: "/{connectionId}/trigger/v1.0/groups/delta",
21
- method: "GET",
22
- parameters: [
23
- { name: "connectionId", in: "path", required: true, type: "string" },
24
- { name: "groupId", in: "query", required: true, type: "string" },
25
- { name: "$select", in: "query", required: false, type: "string" },
26
- ],
27
- responseInfo: { 200: { type: "array" } },
28
- },
29
- AddMemberToGroup: {
30
- path: "/{connectionId}/v1.0/groups/{groupId}/members/$ref",
31
- method: "POST",
32
- parameters: [
33
- { name: "connectionId", in: "path", required: true, type: "string" },
34
- { name: "groupId", in: "path", required: true, type: "string" },
35
- { name: "userUpn", in: "query", required: true, type: "string" },
36
- ],
37
- responseInfo: { 204: { type: "void" } },
38
- },
39
- ListOwnedGroups: {
40
- path: "/{connectionId}/v1.0/me/memberOf/$/microsoft.graph.group",
41
- method: "GET",
42
- parameters: [
43
- { name: "connectionId", in: "path", required: true, type: "string" },
44
- ],
45
- responseInfo: { 200: { type: "object" } },
46
- },
47
- ListOwnedGroups_V2: {
48
- path: "/{connectionId}/v1.0/me/ownedObjects/$/microsoft.graph.group",
49
- method: "GET",
50
- parameters: [
51
- { name: "connectionId", in: "path", required: true, type: "string" },
52
- { name: "extractSensitivityLabel", in: "query", required: false, type: "boolean" },
53
- { name: "fetchSensitivityLabelMetadata", in: "query", required: false, type: "boolean" },
54
- ],
55
- responseInfo: { 200: { type: "object" } },
56
- },
57
- ListOwnedGroups_V3: {
58
- path: "/{connectionId}/v2/v1.0/me/memberOf/$/microsoft.graph.group",
59
- method: "GET",
60
- parameters: [
61
- { name: "connectionId", in: "path", required: true, type: "string" },
62
- { name: "extractSensitivityLabel", in: "query", required: false, type: "boolean" },
63
- { name: "fetchSensitivityLabelMetadata", in: "query", required: false, type: "boolean" },
64
- ],
65
- responseInfo: { 200: { type: "object" } },
66
- },
67
- ListGroups: {
68
- path: "/{connectionId}/v1.0/groups",
69
- method: "GET",
70
- parameters: [
71
- { name: "connectionId", in: "path", required: true, type: "string" },
72
- { name: "extractSensitivityLabel", in: "query", required: false, type: "boolean" },
73
- { name: "fetchSensitivityLabelMetadata", in: "query", required: false, type: "boolean" },
74
- { name: "$filter", in: "query", required: false, type: "string" },
75
- { name: "$top", in: "query", required: false, type: "integer" },
76
- { name: "$skiptoken", in: "query", required: false, type: "string" },
77
- ],
78
- responseInfo: { 200: { type: "object" } },
79
- },
80
- CreateCalendarEvent: {
81
- path: "/{connectionId}/v1.0/groups/{groupId}/events",
82
- method: "POST",
83
- parameters: [
84
- { name: "connectionId", in: "path", required: true, type: "string" },
85
- { name: "groupId", in: "path", required: true, type: "string" },
86
- { name: "body", in: "body", required: true, type: "object" },
87
- ],
88
- responseInfo: { 201: { type: "object" } },
89
- },
90
- CreateCalendarEventV2: {
91
- path: "/{connectionId}/v2/v1.0/groups/{groupId}/events",
92
- method: "POST",
93
- parameters: [
94
- { name: "connectionId", in: "path", required: true, type: "string" },
95
- { name: "groupId", in: "path", required: true, type: "string" },
96
- { name: "body", in: "body", required: true, type: "object" },
97
- ],
98
- responseInfo: { 201: { type: "object" } },
99
- },
100
- CalendarDeleteItem_V2: {
101
- path: "/{connectionId}/v1.0/groups/{groupId}/events/{event}",
102
- method: "DELETE",
103
- parameters: [
104
- { name: "connectionId", in: "path", required: true, type: "string" },
105
- { name: "groupId", in: "path", required: true, type: "string" },
106
- { name: "event", in: "path", required: true, type: "string" },
107
- ],
108
- responseInfo: { 204: { type: "void" }, default: { type: "void" } },
109
- },
110
- UpdateCalendarEvent: {
111
- path: "/{connectionId}/v1.0/groups/{groupId}/events/{event}",
112
- method: "PATCH",
113
- parameters: [
114
- { name: "connectionId", in: "path", required: true, type: "string" },
115
- { name: "groupId", in: "path", required: true, type: "string" },
116
- { name: "event", in: "path", required: true, type: "string" },
117
- { name: "body", in: "body", required: true, type: "object" },
118
- ],
119
- responseInfo: { 200: { type: "object" } },
120
- },
121
- RemoveMemberFromGroup: {
122
- path: "/{connectionId}/v1.0/groups/{groupId}/members/memberId/$ref",
123
- method: "DELETE",
124
- parameters: [
125
- { name: "connectionId", in: "path", required: true, type: "string" },
126
- { name: "groupId", in: "path", required: true, type: "string" },
127
- { name: "userUpn", in: "query", required: true, type: "string" },
128
- ],
129
- responseInfo: { 204: { type: "void" } },
130
- },
131
- OnNewEvent: {
132
- path: "/{connectionId}/trigger/v1.0/groups/{groupId}/events",
133
- method: "GET",
134
- parameters: [
135
- { name: "connectionId", in: "path", required: true, type: "string" },
136
- { name: "groupId", in: "path", required: true, type: "string" },
137
- ],
138
- responseInfo: { 200: { type: "array" } },
139
- },
140
- HttpRequestV2: {
141
- path: "/{connectionId}/v2/httprequest",
142
- method: "POST",
143
- parameters: [
144
- { name: "connectionId", in: "path", required: true, type: "string" },
145
- { name: "Uri", in: "header", required: true, type: "string" },
146
- { name: "Method", in: "header", required: true, type: "string" },
147
- { name: "Body", in: "body", required: false, type: "object" },
148
- { name: "ContentType", in: "header", required: false, type: "string" },
149
- { name: "CustomHeader1", in: "header", required: false, type: "string" },
150
- { name: "CustomHeader2", in: "header", required: false, type: "string" },
151
- { name: "CustomHeader3", in: "header", required: false, type: "string" },
152
- { name: "CustomHeader4", in: "header", required: false, type: "string" },
153
- { name: "CustomHeader5", in: "header", required: false, type: "string" },
154
- ],
155
- responseInfo: { 200: { type: "object" }, default: { type: "void" } },
156
- },
157
- HttpRequest: {
158
- path: "/{connectionId}/httprequest",
159
- method: "POST",
160
- parameters: [
161
- { name: "connectionId", in: "path", required: true, type: "string" },
162
- { name: "Uri", in: "header", required: true, type: "string" },
163
- { name: "Method", in: "header", required: true, type: "string" },
164
- { name: "Body", in: "body", required: false, type: "object" },
165
- { name: "ContentType", in: "header", required: false, type: "string" },
166
- { name: "CustomHeader1", in: "header", required: false, type: "string" },
167
- { name: "CustomHeader2", in: "header", required: false, type: "string" },
168
- { name: "CustomHeader3", in: "header", required: false, type: "string" },
169
- { name: "CustomHeader4", in: "header", required: false, type: "string" },
170
- { name: "CustomHeader5", in: "header", required: false, type: "string" },
171
- ],
172
- responseInfo: { 200: { type: "object" }, default: { type: "void" } },
173
- },
174
- ListDeletedGroups: {
175
- path: "/{connectionId}/v1.0/directory/deletedItems/microsoft.graph.group",
176
- method: "GET",
177
- parameters: [
178
- { name: "connectionId", in: "path", required: true, type: "string" },
179
- ],
180
- responseInfo: { 200: { type: "object" } },
181
- },
182
- RestoreDeletedGroup: {
183
- path: "/{connectionId}/v1.0/directory/deletedItems/{groupId}/restore",
184
- method: "POST",
185
- parameters: [
186
- { name: "connectionId", in: "path", required: true, type: "string" },
187
- { name: "groupId", in: "path", required: true, type: "string" },
188
- ],
189
- responseInfo: { 200: { type: "void" } },
190
- },
191
- ListDeletedGroupsByOwner: {
192
- path: "/{connectionId}/v1.0/directory/deletedItems/getUserOwnedObjects",
193
- method: "POST",
194
- parameters: [
195
- { name: "connectionId", in: "path", required: true, type: "string" },
196
- { name: "userId", in: "header", required: true, type: "string" },
197
- ],
198
- responseInfo: { 200: { type: "object" } },
199
- },
200
- };
201
-
202
- function initGroupsClient() {
203
- const dataSourcesInfo = {};
204
-
205
- DATA_SOURCE_GROUPS_CANDIDATES.forEach(function(sDataSourceName) {
206
- dataSourcesInfo[sDataSourceName] = {
207
- tableId: "",
208
- version: "",
209
- primaryKey: "",
210
- dataSourceType: "Connector",
211
- apis: GROUPS_APIS,
212
- };
213
- });
214
-
215
- return getClient(dataSourcesInfo);
216
- }
217
-
218
- function isGroupsObject(oValue) {
219
- return !!oValue && typeof oValue === "object" && !Array.isArray(oValue);
220
- }
221
-
222
- function pickGroupsValue() {
223
- for (let iIndex = 0; iIndex < arguments.length; iIndex += 1) {
224
- const oValue = arguments[iIndex];
225
- if (oValue !== undefined && oValue !== null) return oValue;
226
- }
227
- return undefined;
228
- }
229
-
230
- function setGroupsIfDefined(oTarget, sKey, oValue) {
231
- if (oValue !== undefined && oValue !== null) {
232
- oTarget[sKey] = oValue;
233
- }
234
- }
235
-
236
- function stringifyGroupsError(oError) {
237
- if (!oError) return "Unknown error";
238
- if (typeof oError === "string") return oError;
239
- if (typeof oError.message === "string" && oError.message) return oError.message;
240
-
241
- try {
242
- return JSON.stringify(oError);
243
- } catch (oErr) {
244
- return String(oError);
245
- }
246
- }
247
-
248
- function normalizeGroupsSelect(oValue) {
249
- if (Array.isArray(oValue)) return oValue.join(",");
250
- return oValue;
251
- }
252
-
253
- function extractGroupsSkipToken(sNextLink) {
254
- if (!sNextLink || typeof sNextLink !== "string") return undefined;
255
-
256
- try {
257
- const oUrl = new URL(sNextLink);
258
- return pickGroupsValue(
259
- oUrl.searchParams.get("$skiptoken"),
260
- oUrl.searchParams.get("$skipToken"),
261
- oUrl.searchParams.get("skiptoken"),
262
- oUrl.searchParams.get("skipToken")
263
- );
264
- } catch (oError) {
265
- return undefined;
266
- }
267
- }
268
-
269
- function getGroupsHeaderValue(oHeaders, sName) {
270
- if (!isGroupsObject(oHeaders)) return undefined;
271
-
272
- const sMatch = String(sName).toLowerCase();
273
- const aEntries = Object.entries(oHeaders);
274
- for (let iIndex = 0; iIndex < aEntries.length; iIndex += 1) {
275
- const [sHeaderName, oValue] = aEntries[iIndex];
276
- if (String(sHeaderName).toLowerCase() === sMatch) {
277
- return oValue;
278
- }
279
- }
280
-
281
- return undefined;
282
- }
283
-
284
- function normalizeGroupsCustomHeaders(oHeaders, aCustomHeaders) {
285
- const aResolved = Array.isArray(aCustomHeaders) ? aCustomHeaders.filter((oValue) => oValue != null) : [];
286
-
287
- if (!isGroupsObject(oHeaders)) return aResolved.slice(0, 5);
288
-
289
- const aEntries = Object.entries(oHeaders);
290
- for (let iIndex = 0; iIndex < aEntries.length; iIndex += 1) {
291
- const [sHeaderName, oValue] = aEntries[iIndex];
292
- if (oValue === undefined || oValue === null) continue;
293
- if (String(sHeaderName).toLowerCase() === "content-type") continue;
294
- aResolved.push(String(sHeaderName) + ": " + String(oValue));
295
- if (aResolved.length >= 5) break;
296
- }
297
-
298
- return aResolved.slice(0, 5);
299
- }
300
-
301
- function normalizeGroupsStartEnd(oSource, sKey) {
302
- const oValue = pickGroupsValue(oSource[sKey], oSource[sKey.charAt(0).toUpperCase() + sKey.slice(1)]);
303
-
304
- if (isGroupsObject(oValue)) {
305
- return {
306
- dateTime: pickGroupsValue(oValue.dateTime, oValue.DateTime),
307
- timeZone: pickGroupsValue(oValue.timeZone, oValue.TimeZone, oSource.timeZone, oSource.TimeZone, oSource.timezone),
308
- };
309
- }
310
-
311
- const sDateTime = pickGroupsValue(
312
- oSource[sKey + "DateTime"],
313
- oSource[sKey + "At"],
314
- oSource[sKey],
315
- oSource[sKey.charAt(0).toUpperCase() + sKey.slice(1) + "DateTime"],
316
- oSource[sKey.charAt(0).toUpperCase() + sKey.slice(1) + "At"]
317
- );
318
-
319
- if (sDateTime === undefined || sDateTime === null) return undefined;
320
-
321
- return {
322
- dateTime: sDateTime,
323
- timeZone: pickGroupsValue(oSource.timeZone, oSource.TimeZone, oSource.timezone),
324
- };
325
- }
326
-
327
- function normalizeGroupsEventBody(oSource) {
328
- const oBodySource = isGroupsObject(oSource.body) ? oSource.body : (isGroupsObject(oSource.Body) ? oSource.Body : null);
329
-
330
- if (oBodySource) {
331
- const oBody = {};
332
- setGroupsIfDefined(oBody, "content", pickGroupsValue(oBodySource.content, oBodySource.Content, oBodySource.body, oBodySource.Body));
333
- setGroupsIfDefined(oBody, "contentType", pickGroupsValue(oBodySource.contentType, oBodySource.ContentType, oSource.contentType, oSource.ContentType, oSource.isHtml === false ? "Text" : undefined));
334
- return Object.keys(oBody).length > 0 ? oBody : undefined;
335
- }
336
-
337
- const sContent = pickGroupsValue(oSource.bodyContent, oSource.description, oSource.content);
338
- if (sContent === undefined || sContent === null) return undefined;
339
-
340
- return {
341
- content: sContent,
342
- contentType: pickGroupsValue(oSource.contentType, oSource.ContentType, oSource.isHtml === false ? "Text" : "Html"),
343
- };
344
- }
345
-
346
- function normalizeGroupsEventLocation(oSource) {
347
- const oLocation = pickGroupsValue(oSource.location, oSource.Location);
348
- if (typeof oLocation === "string") {
349
- return { displayName: oLocation };
350
- }
351
-
352
- if (isGroupsObject(oLocation)) {
353
- return { displayName: pickGroupsValue(oLocation.displayName, oLocation.DisplayName) };
354
- }
355
-
356
- return undefined;
357
- }
358
-
359
- function normalizeGroupsEventPayload(oOptions) {
360
- const oSource = isGroupsObject(oOptions && oOptions.body) && pickGroupsValue(oOptions.body.subject, oOptions.body.Subject, oOptions.body.start, oOptions.body.Start)
361
- ? oOptions.body
362
- : (isGroupsObject(oOptions) ? oOptions : {});
363
-
364
- const oPayload = {};
365
- setGroupsIfDefined(oPayload, "subject", pickGroupsValue(oSource.subject, oSource.Subject, oSource.title));
366
- setGroupsIfDefined(oPayload, "start", normalizeGroupsStartEnd(oSource, "start"));
367
- setGroupsIfDefined(oPayload, "end", normalizeGroupsStartEnd(oSource, "end"));
368
- setGroupsIfDefined(oPayload, "body", normalizeGroupsEventBody(oSource));
369
- setGroupsIfDefined(oPayload, "location", normalizeGroupsEventLocation(oSource));
370
- setGroupsIfDefined(oPayload, "importance", pickGroupsValue(oSource.importance, oSource.Importance));
371
- setGroupsIfDefined(oPayload, "isAllDay", pickGroupsValue(oSource.isAllDay, oSource.IsAllDay));
372
- setGroupsIfDefined(oPayload, "isReminderOn", pickGroupsValue(oSource.isReminderOn, oSource.IsReminderOn));
373
- setGroupsIfDefined(oPayload, "reminderMinutesBeforeStart", pickGroupsValue(oSource.reminderMinutesBeforeStart, oSource.ReminderMinutesBeforeStart, oSource.reminderMinutes, oSource.reminder));
374
- setGroupsIfDefined(oPayload, "showAs", pickGroupsValue(oSource.showAs, oSource.ShowAs));
375
- setGroupsIfDefined(oPayload, "responseRequested", pickGroupsValue(oSource.responseRequested, oSource.ResponseRequested));
376
- return oPayload;
377
- }
378
-
379
- // ── Internal: execute a connector operation ────────────────────
380
- async function execGroupsOp(operationName, parameters) {
381
- if (!Object.prototype.hasOwnProperty.call(GROUPS_APIS, operationName)) {
382
- throw new Error("Office 365 Groups operation metadata is not registered for: " + operationName);
383
- }
384
-
385
- const client = await initGroupsClient();
386
- const aErrors = [];
387
-
388
- for (let iIndex = 0; iIndex < DATA_SOURCE_GROUPS_CANDIDATES.length; iIndex += 1) {
389
- const sDataSourceName = DATA_SOURCE_GROUPS_CANDIDATES[iIndex];
390
-
391
- try {
392
- const result = await client.executeAsync({
393
- connectorOperation: {
394
- tableName: sDataSourceName,
395
- operationName,
396
- parameters,
397
- },
398
- });
399
-
400
- return unwrapResult(result);
401
- } catch (oErr) {
402
- const sMessage = stringifyGroupsError(oErr);
403
- aErrors.push(sDataSourceName + ": " + sMessage);
404
-
405
- if (sMessage.indexOf("Connection reference not found") === -1) {
406
- throw oErr;
407
- }
408
- }
409
- }
410
-
411
- throw new Error("No Office 365 Groups connection reference matched. Tried: " + aErrors.join(" || "));
412
- }
413
-
414
- // ═══════════════════════════════════════════════════════════════
415
- // GENERIC
416
- // ═══════════════════════════════════════════════════════════════
417
-
418
- // ── Call any Office 365 Groups operation by name ───────────────
419
- export async function callGroupsOperation(operationName, parameters = {}) {
420
- return _dbgWrap('callGroupsOperation', [operationName, parameters], async function() {
421
- return execGroupsOp(operationName, parameters);
422
- });
423
- }
424
-
425
- // ── Open HTTP Request ──────────────────────────────────────────
426
- export async function openGroupsHttpRequest({ method = "GET", uri, headers, body, contentType, customHeaders, version, useV2, operationName } = {}) {
427
- return _dbgWrap('openGroupsHttpRequest', [{ method, uri, headers, body, contentType, customHeaders, version, useV2, operationName }], async function() {
428
- const aHeaders = normalizeGroupsCustomHeaders(headers, customHeaders);
429
- const sOperationName = operationName || (pickGroupsValue(version, useV2 ? 2 : undefined) === 2 ? "HttpRequestV2" : "HttpRequest");
430
- return execGroupsOp(sOperationName, {
431
- Uri: uri,
432
- Method: method,
433
- Body: body,
434
- ContentType: pickGroupsValue(contentType, getGroupsHeaderValue(headers, "Content-Type")),
435
- CustomHeader1: aHeaders[0],
436
- CustomHeader2: aHeaders[1],
437
- CustomHeader3: aHeaders[2],
438
- CustomHeader4: aHeaders[3],
439
- CustomHeader5: aHeaders[4],
440
- });
441
- });
442
- }
443
-
444
- // ═══════════════════════════════════════════════════════════════
445
- // GROUPS
446
- // ═══════════════════════════════════════════════════════════════
447
-
448
- // ── List My Groups ─────────────────────────────────────────────
449
- export async function listMyGroups(oOptions = {}) {
450
- return _dbgWrap('listMyGroups', [oOptions], async function() {
451
- if (!isGroupsObject(oOptions)) {
452
- oOptions = {};
453
- }
454
-
455
- const iVersion = pickGroupsValue(oOptions.version, oOptions.v, 1);
456
- const sOperationName = iVersion === 3 ? "ListOwnedGroups_V3" : (iVersion === 2 ? "ListOwnedGroups_V2" : "ListOwnedGroups");
457
- const params = {};
458
- setGroupsIfDefined(params, "extractSensitivityLabel", oOptions.extractSensitivityLabel);
459
- setGroupsIfDefined(params, "fetchSensitivityLabelMetadata", oOptions.fetchSensitivityLabelMetadata);
460
- return execGroupsOp(sOperationName, params);
461
- });
462
- }
463
-
464
- // ── List Members of a Group ────────────────────────────────────
465
- export async function listGroupMembers(groupId, oOptions) {
466
- return _dbgWrap('listGroupMembers', [groupId, oOptions], async function() {
467
- if (isGroupsObject(groupId)) {
468
- oOptions = groupId;
469
- groupId = pickGroupsValue(oOptions.groupId, oOptions.id);
470
- }
471
-
472
- oOptions = isGroupsObject(oOptions) ? oOptions : {};
473
- const params = { groupId };
474
- setGroupsIfDefined(params, "$top", pickGroupsValue(oOptions.top, oOptions.$top));
475
- return execGroupsOp("ListGroupMembers", params);
476
- });
477
- }
478
-
479
- export async function listOwnedGroups(oOptions = {}) {
480
- return _dbgWrap('listOwnedGroups', [oOptions], async function() {
481
- return listMyGroups(oOptions);
482
- });
483
- }
484
-
485
- export async function listGroups(oOptions = {}) {
486
- return _dbgWrap('listGroups', [oOptions], async function() {
487
- oOptions = isGroupsObject(oOptions) ? oOptions : {};
488
- const params = {};
489
- setGroupsIfDefined(params, "extractSensitivityLabel", oOptions.extractSensitivityLabel);
490
- setGroupsIfDefined(params, "fetchSensitivityLabelMetadata", oOptions.fetchSensitivityLabelMetadata);
491
- setGroupsIfDefined(params, "$filter", pickGroupsValue(oOptions.filter, oOptions.$filter));
492
- setGroupsIfDefined(params, "$top", pickGroupsValue(oOptions.top, oOptions.$top));
493
-
494
- const oSkipToken = pickGroupsValue(
495
- oOptions.skipToken,
496
- oOptions.$skipToken,
497
- oOptions.$skiptoken,
498
- extractGroupsSkipToken(oOptions.nextLink),
499
- oOptions.skip
500
- );
501
-
502
- if (oSkipToken !== undefined && oSkipToken !== null) {
503
- params.$skiptoken = String(oSkipToken);
504
- }
505
-
506
- return execGroupsOp("ListGroups", params);
507
- });
508
- }
509
-
510
- export async function onGroupMembershipChange(groupId, oOptions = {}) {
511
- return _dbgWrap('onGroupMembershipChange', [groupId, oOptions], async function() {
512
- if (isGroupsObject(groupId)) {
513
- oOptions = groupId;
514
- groupId = pickGroupsValue(oOptions.groupId, oOptions.id);
515
- }
516
-
517
- oOptions = isGroupsObject(oOptions) ? oOptions : {};
518
- return execGroupsOp("OnGroupMembershipChange", {
519
- groupId,
520
- $select: normalizeGroupsSelect(pickGroupsValue(oOptions.select, oOptions.$select)),
521
- });
522
- });
523
- }
524
-
525
- export async function addMemberToGroup(userUpn, groupId) {
526
- return _dbgWrap('addMemberToGroup', [userUpn, groupId], async function() {
527
- if (isGroupsObject(userUpn)) {
528
- groupId = pickGroupsValue(userUpn.groupId, userUpn.id);
529
- userUpn = pickGroupsValue(userUpn.userUpn, userUpn.upn, userUpn.userPrincipalName, userUpn.email, userUpn.mail);
530
- }
531
-
532
- return execGroupsOp("AddMemberToGroup", {
533
- userUpn,
534
- groupId,
535
- });
536
- });
537
- }
538
-
539
- export async function removeMemberFromGroup(userUpn, groupId) {
540
- return _dbgWrap('removeMemberFromGroup', [userUpn, groupId], async function() {
541
- if (isGroupsObject(userUpn)) {
542
- groupId = pickGroupsValue(userUpn.groupId, userUpn.id);
543
- userUpn = pickGroupsValue(userUpn.userUpn, userUpn.upn, userUpn.userPrincipalName, userUpn.email, userUpn.mail);
544
- }
545
-
546
- return execGroupsOp("RemoveMemberFromGroup", {
547
- userUpn,
548
- groupId,
549
- });
550
- });
551
- }
552
-
553
- export async function createGroupEvent(groupId, oBodyOrOptions) {
554
- return _dbgWrap('createGroupEvent', [groupId, oBodyOrOptions], async function() {
555
- let oOptions = isGroupsObject(oBodyOrOptions) ? oBodyOrOptions : {};
556
-
557
- if (isGroupsObject(groupId)) {
558
- oOptions = groupId;
559
- groupId = pickGroupsValue(oOptions.groupId, oOptions.id);
560
- }
561
-
562
- const iVersion = pickGroupsValue(oOptions.version, oOptions.v, 2);
563
- return execGroupsOp(iVersion === 1 ? "CreateCalendarEvent" : "CreateCalendarEventV2", {
564
- groupId,
565
- body: normalizeGroupsEventPayload(oOptions),
566
- });
567
- });
568
- }
569
-
570
- export async function updateGroupEvent(sEventId, oBodyOrOptions, sGroupId) {
571
- return _dbgWrap('updateGroupEvent', [sEventId, oBodyOrOptions, sGroupId], async function() {
572
- let oOptions = isGroupsObject(oBodyOrOptions) ? oBodyOrOptions : {};
573
-
574
- if (isGroupsObject(sEventId)) {
575
- oOptions = sEventId;
576
- sEventId = pickGroupsValue(oOptions.eventId, oOptions.id, oOptions.event);
577
- sGroupId = pickGroupsValue(oOptions.groupId, oOptions.group, oOptions.ownerGroupId);
578
- }
579
-
580
- return execGroupsOp("UpdateCalendarEvent", {
581
- event: sEventId,
582
- groupId: pickGroupsValue(oOptions.groupId, sGroupId),
583
- body: normalizeGroupsEventPayload(oOptions),
584
- });
585
- });
586
- }
587
-
588
- export async function deleteGroupEvent(sEventId, sGroupId) {
589
- return _dbgWrap('deleteGroupEvent', [sEventId, sGroupId], async function() {
590
- if (isGroupsObject(sEventId)) {
591
- sGroupId = pickGroupsValue(sEventId.groupId, sEventId.group, sEventId.ownerGroupId);
592
- sEventId = pickGroupsValue(sEventId.eventId, sEventId.id, sEventId.event);
593
- }
594
-
595
- return execGroupsOp("CalendarDeleteItem_V2", {
596
- event: sEventId,
597
- groupId: sGroupId,
598
- });
599
- });
600
- }
601
-
602
- export async function onNewGroupEvent(groupId) {
603
- return _dbgWrap('onNewGroupEvent', [groupId], async function() {
604
- if (isGroupsObject(groupId)) {
605
- groupId = pickGroupsValue(groupId.groupId, groupId.id);
606
- }
607
-
608
- return execGroupsOp("OnNewEvent", {
609
- groupId,
610
- });
611
- });
612
- }
613
-
614
- export async function listDeletedGroups() {
615
- return _dbgWrap('listDeletedGroups', [], async function() {
616
- return execGroupsOp("ListDeletedGroups", {});
617
- });
618
- }
619
-
620
- export async function restoreDeletedGroup(groupId) {
621
- return _dbgWrap('restoreDeletedGroup', [groupId], async function() {
622
- if (isGroupsObject(groupId)) {
623
- groupId = pickGroupsValue(groupId.groupId, groupId.id);
624
- }
625
-
626
- return execGroupsOp("RestoreDeletedGroup", {
627
- groupId,
628
- });
629
- });
630
- }
631
-
632
- export async function listDeletedGroupsByOwner(userId) {
633
- return _dbgWrap('listDeletedGroupsByOwner', [userId], async function() {
634
- if (isGroupsObject(userId)) {
635
- userId = pickGroupsValue(userId.userId, userId.id, userId.ownerId);
636
- }
637
-
638
- return execGroupsOp("ListDeletedGroupsByOwner", {
639
- userId,
640
- });
641
- });
642
- }
@@ -1,10 +0,0 @@
1
- /*!
2
- * Copyright (C) Microsoft Corporation. All rights reserved.
3
- * This file is autogenerated. Do not edit this file directly.
4
- */
5
-
6
- // Models
7
- export * as Office365GroupsModel from './models/Office365GroupsModel';
8
-
9
- // Services
10
- export * from './services/Office365GroupsService';