codeapp-js 0.1.1 → 0.2.2
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/codeApp/dist/codeapp.js +552 -78
- package/codeApp/dist/power-apps-data.js +2531 -2531
- package/dev files/outlook.js +218 -9
- package/examples/combined demo/dist/codeapp.js +1098 -0
- package/examples/combined demo/dist/index.js +69 -114
- package/examples/combined demo/dist/power-apps-data.js +646 -170
- package/examples/combined demo/power.config.json +42 -42
- package/examples/dataverse Demo/dist/codeapp.js +1085 -0
- package/examples/dataverse Demo/dist/index.html +54 -54
- package/examples/dataverse Demo/dist/index.js +82 -70
- package/examples/dataverse Demo/dist/power-apps-data.js +551 -170
- package/examples/dataverse Demo/power.config.json +34 -34
- package/examples/dataverse Demo/readme.md +79 -79
- package/examples/groups Demo/dist/codeapp.js +1085 -0
- package/examples/groups Demo/dist/index.js +27 -27
- package/examples/groups Demo/dist/power-apps-data.js +551 -170
- package/examples/kanban/dist/dataverse.js +94 -94
- package/examples/kanban/dist/environmentVar.js +55 -55
- package/examples/kanban/dist/office365groups.js +97 -97
- package/examples/kanban/dist/office365users.js +169 -169
- package/examples/kanban/dist/outlook.js +162 -162
- package/examples/kanban/dist/power-apps-data.js +560 -138
- package/examples/kanban/dist/sharepoint.js +339 -339
- package/examples/myProfile/dist/index.html +184 -184
- package/examples/myProfile/dist/index.js +141 -141
- package/examples/myProfile/dist/office365users.js +169 -169
- package/examples/myProfile/dist/power-apps-data.js +560 -138
- package/examples/myProfile/power.config.json +22 -22
- package/examples/myProfile/readme.md +79 -79
- package/examples/outlook Demo/dist/codeapp.js +1085 -0
- package/examples/outlook Demo/dist/index.html +35 -35
- package/examples/outlook Demo/dist/index.js +170 -166
- package/examples/outlook Demo/dist/outlook.js +121 -121
- package/examples/outlook Demo/dist/power-apps-data.js +551 -170
- package/examples/outlook Demo/dist/styles.css +84 -84
- package/examples/outlook Demo/readme.md +82 -82
- package/examples/outlook Demo2/OutlookDemo_1_0_0_1.zip +0 -0
- package/examples/outlook Demo2/agent/decision-log.md +7 -0
- package/examples/outlook Demo2/dist/codeapp.js +1334 -0
- package/examples/outlook Demo2/dist/icon-512.png +0 -0
- package/examples/outlook Demo2/dist/index.html +98 -0
- package/examples/outlook Demo2/dist/index.js +346 -0
- package/examples/outlook Demo2/dist/power-apps-data.js +3007 -0
- package/examples/outlook Demo2/dist/styles.css +639 -0
- package/examples/outlook Demo2/power.config.json +23 -0
- package/examples/outlook Demo2/src/generated/index.ts +14 -0
- package/examples/outlook Demo2/src/generated/models/Office365GroupsModel.ts +363 -0
- package/examples/outlook Demo2/src/generated/models/Office365OutlookModel.ts +2046 -0
- package/examples/outlook Demo2/src/generated/models/Office365UsersModel.ts +254 -0
- package/examples/outlook Demo2/src/generated/services/Office365GroupsService.ts +326 -0
- package/examples/outlook Demo2/src/generated/services/Office365OutlookService.ts +2476 -0
- package/examples/outlook Demo2/src/generated/services/Office365UsersService.ts +358 -0
- package/examples/planning Poker/.vscode/settings.json +4 -4
- package/examples/planning Poker/additional files/customizations (tables).xml +6428 -6428
- package/examples/planning Poker/additional files/dataverse-tables.json +165 -165
- package/examples/planning Poker/additional files/readme.md +122 -122
- package/examples/planning Poker/dist/dataverse.js +78 -78
- package/examples/planning Poker/dist/index.html +198 -198
- package/examples/planning Poker/dist/index.js +954 -954
- package/examples/planning Poker/dist/power-apps-data.js +560 -138
- package/examples/planning Poker/dist/styles.css +815 -815
- package/examples/sharePoint Demo/agent/decision-log.md +5 -5
- package/examples/sharePoint Demo/dist/codeapp.js +1085 -0
- package/examples/sharePoint Demo/dist/index.js +44 -51
- package/examples/sharePoint Demo/dist/power-apps-data.js +551 -170
- package/examples/sharePoint Demo/power.config.json +22 -22
- package/examples/solution explorer/agent/decision-log.md +27 -0
- package/examples/solution explorer/agent/mockup-01-swiss-grid.html +452 -0
- package/examples/solution explorer/agent/mockup-02-dark-glass.html +496 -0
- package/examples/solution explorer/agent/mockup-03-paper-console.html +510 -0
- package/examples/solution explorer/agent/mockup-04-neon-noir.html +546 -0
- package/examples/solution explorer/agent/mockup-05-zen-garden.html +534 -0
- package/examples/solution explorer/dist/codeapp.js +1098 -0
- package/examples/solution explorer/dist/icon-512.png +0 -0
- package/examples/solution explorer/dist/index.html +80 -0
- package/examples/solution explorer/dist/index.js +735 -0
- package/examples/solution explorer/dist/power-apps-data.js +3007 -0
- package/examples/solution explorer/dist/styles.css +571 -0
- package/examples/solution explorer/power.config.json +151 -0
- package/examples/todo/dist/dataverse.js +64 -64
- package/examples/todo/dist/index.html +75 -75
- package/examples/todo/dist/index.js +8 -8
- package/examples/todo/dist/power-apps-data.js +560 -138
- package/examples/todo/dist/renderer.js +375 -375
- package/examples/todo/dist/styles.css +691 -691
- package/examples/todo/power.config.json +34 -34
- package/package.json +1 -8
- package/docs-mockups/atelier/index.html +0 -120
- package/docs-mockups/atelier/script.js +0 -23
- package/docs-mockups/atelier/styles.css +0 -361
- package/docs-mockups/field-guide/index.html +0 -112
- package/docs-mockups/field-guide/script.js +0 -20
- package/docs-mockups/field-guide/styles.css +0 -272
- package/docs-mockups/index.html +0 -80
- package/docs-mockups/maker-hub/index.html +0 -178
- package/docs-mockups/maker-hub/script.js +0 -20
- package/docs-mockups/maker-hub/styles.css +0 -404
- package/docs-mockups/script.js +0 -26
- package/docs-mockups/signal/index.html +0 -146
- package/docs-mockups/signal/script.js +0 -20
- package/docs-mockups/signal/styles.css +0 -314
- package/docs-mockups/styles.css +0 -287
- package/examples/combined demo/dist/dataverse.js +0 -86
- package/examples/combined demo/dist/environmentVar.js +0 -55
- package/examples/combined demo/dist/office365groups.js +0 -97
- package/examples/combined demo/dist/office365users.js +0 -169
- package/examples/combined demo/dist/outlook.js +0 -162
- package/examples/combined demo/dist/sharepoint.js +0 -339
- package/examples/dataverse Demo/dist/dataverse.js +0 -86
- package/examples/groups Demo/dist/dataverse.js +0 -86
- package/examples/groups Demo/dist/environmentVar.js +0 -55
- package/examples/groups Demo/dist/office365groups.js +0 -97
- package/examples/groups Demo/dist/office365users.js +0 -169
- package/examples/groups Demo/dist/outlook.js +0 -162
- package/examples/groups Demo/dist/sharepoint.js +0 -339
- package/examples/sharePoint Demo/dist/dataverse.js +0 -94
- package/examples/sharePoint Demo/dist/environmentVar.js +0 -55
- package/examples/sharePoint Demo/dist/office365groups.js +0 -97
- package/examples/sharePoint Demo/dist/office365users.js +0 -169
- package/examples/sharePoint Demo/dist/outlook.js +0 -162
- package/examples/sharePoint Demo/dist/sharepoint.js +0 -339
package/dev files/outlook.js
CHANGED
|
@@ -3,6 +3,7 @@ import { getClient } from "@microsoft/power-apps/data";
|
|
|
3
3
|
// ── Data source name (must match connectionReferences in power.config.json) ──
|
|
4
4
|
const DATA_SOURCE_CANDIDATES = ["office365outlook", "Office365Outlook", "office365"];
|
|
5
5
|
const OUTLOOK_APIS = {
|
|
6
|
+
// ── Email operations ──
|
|
6
7
|
GetEmailsV3: {
|
|
7
8
|
path: "/{connectionId}/v3/Mail",
|
|
8
9
|
method: "GET",
|
|
@@ -24,6 +25,100 @@ const OUTLOOK_APIS = {
|
|
|
24
25
|
{ name: "top", in: "query", required: false },
|
|
25
26
|
],
|
|
26
27
|
},
|
|
28
|
+
SendEmailV2: {
|
|
29
|
+
path: "/{connectionId}/v2/Mail",
|
|
30
|
+
method: "POST",
|
|
31
|
+
parameters: [
|
|
32
|
+
{ name: "connectionId", in: "path", required: true },
|
|
33
|
+
{ name: "emailMessage", in: "body", required: true },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
ForwardEmail: {
|
|
37
|
+
path: "/{connectionId}/codeless/api/v2.0/me/messages/{message_id}/forward",
|
|
38
|
+
method: "POST",
|
|
39
|
+
parameters: [
|
|
40
|
+
{ name: "connectionId", in: "path", required: true },
|
|
41
|
+
{ name: "message_id", in: "path", required: true },
|
|
42
|
+
{ name: "body", in: "body", required: true },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
ReplyToV3: {
|
|
46
|
+
path: "/{connectionId}/v3/Mail/ReplyTo/{messageId}",
|
|
47
|
+
method: "POST",
|
|
48
|
+
parameters: [
|
|
49
|
+
{ name: "connectionId", in: "path", required: true },
|
|
50
|
+
{ name: "messageId", in: "path", required: true },
|
|
51
|
+
{ name: "replyParameters", in: "body", required: true },
|
|
52
|
+
{ name: "mailboxAddress", in: "query", required: false },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
MoveV2: {
|
|
56
|
+
path: "/{connectionId}/v2/Mail/Move/{messageId}",
|
|
57
|
+
method: "POST",
|
|
58
|
+
parameters: [
|
|
59
|
+
{ name: "connectionId", in: "path", required: true },
|
|
60
|
+
{ name: "messageId", in: "path", required: true },
|
|
61
|
+
{ name: "folderPath", in: "query", required: true },
|
|
62
|
+
{ name: "mailboxAddress", in: "query", required: false },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
DeleteEmail: {
|
|
66
|
+
path: "/{connectionId}/Mail/{messageId}",
|
|
67
|
+
method: "DELETE",
|
|
68
|
+
parameters: [
|
|
69
|
+
{ name: "connectionId", in: "path", required: true },
|
|
70
|
+
{ name: "messageId", in: "path", required: true },
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
SharedMailboxSendEmailV2: {
|
|
74
|
+
path: "/{connectionId}/v2/SharedMailbox/Mail",
|
|
75
|
+
method: "POST",
|
|
76
|
+
parameters: [
|
|
77
|
+
{ name: "connectionId", in: "path", required: true },
|
|
78
|
+
{ name: "emailMessage", in: "body", required: true },
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
// ── Calendar operations ──
|
|
82
|
+
V4CalendarGetItems: {
|
|
83
|
+
path: "/{connectionId}/datasets/calendars/v4/tables/{table}/items",
|
|
84
|
+
method: "GET",
|
|
85
|
+
parameters: [
|
|
86
|
+
{ name: "connectionId", in: "path", required: true },
|
|
87
|
+
{ name: "table", in: "path", required: true },
|
|
88
|
+
{ name: "$filter", in: "query", required: false },
|
|
89
|
+
{ name: "$orderby", in: "query", required: false },
|
|
90
|
+
{ name: "$top", in: "query", required: false },
|
|
91
|
+
{ name: "$skip", in: "query", required: false },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
V4CalendarPostItem: {
|
|
95
|
+
path: "/{connectionId}/datasets/calendars/v4/tables/{table}/items",
|
|
96
|
+
method: "POST",
|
|
97
|
+
parameters: [
|
|
98
|
+
{ name: "connectionId", in: "path", required: true },
|
|
99
|
+
{ name: "table", in: "path", required: true },
|
|
100
|
+
{ name: "item", in: "body", required: true },
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
V4CalendarPatchItem: {
|
|
104
|
+
path: "/{connectionId}/datasets/calendars/v4/tables/{table}/items/{id}",
|
|
105
|
+
method: "PATCH",
|
|
106
|
+
parameters: [
|
|
107
|
+
{ name: "connectionId", in: "path", required: true },
|
|
108
|
+
{ name: "table", in: "path", required: true },
|
|
109
|
+
{ name: "id", in: "path", required: true },
|
|
110
|
+
{ name: "item", in: "body", required: true },
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
CalendarDeleteItem: {
|
|
114
|
+
path: "/{connectionId}/datasets/calendars/tables/{table}/items/{id}",
|
|
115
|
+
method: "DELETE",
|
|
116
|
+
parameters: [
|
|
117
|
+
{ name: "connectionId", in: "path", required: true },
|
|
118
|
+
{ name: "table", in: "path", required: true },
|
|
119
|
+
{ name: "id", in: "path", required: true },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
27
122
|
};
|
|
28
123
|
|
|
29
124
|
// ── Initialize SDK client for the Office 365 Outlook connector ──
|
|
@@ -78,7 +173,7 @@ function unwrapResult(oResult) {
|
|
|
78
173
|
}
|
|
79
174
|
|
|
80
175
|
// ── Internal: execute a connector operation ────────────────────
|
|
81
|
-
async function execOp(
|
|
176
|
+
async function execOp(sOperationName, oParameters) {
|
|
82
177
|
const client = await initClient();
|
|
83
178
|
const aErrors = [];
|
|
84
179
|
|
|
@@ -86,15 +181,15 @@ async function execOp(operationName, parameters) {
|
|
|
86
181
|
const sDataSourceName = DATA_SOURCE_CANDIDATES[iIndex];
|
|
87
182
|
|
|
88
183
|
try {
|
|
89
|
-
const
|
|
184
|
+
const oResult = await client.executeAsync({
|
|
90
185
|
connectorOperation: {
|
|
91
186
|
tableName: sDataSourceName,
|
|
92
|
-
operationName,
|
|
93
|
-
parameters,
|
|
187
|
+
operationName: sOperationName,
|
|
188
|
+
parameters: oParameters,
|
|
94
189
|
},
|
|
95
190
|
});
|
|
96
191
|
|
|
97
|
-
return unwrapResult(
|
|
192
|
+
return unwrapResult(oResult);
|
|
98
193
|
} catch (oErr) {
|
|
99
194
|
const sMessage = stringifyErrorDetails(oErr);
|
|
100
195
|
aErrors.push(sDataSourceName + ": " + sMessage);
|
|
@@ -108,14 +203,128 @@ async function execOp(operationName, parameters) {
|
|
|
108
203
|
throw new Error("No Outlook connection reference matched. Tried: " + aErrors.join(" || "));
|
|
109
204
|
}
|
|
110
205
|
|
|
206
|
+
// ── Generic: call any Outlook connector operation ──────────────
|
|
207
|
+
export async function callOutlookOperation(sOperationName, oParameters) {
|
|
208
|
+
return execOp(sOperationName, oParameters);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// ── Send Email ─────────────────────────────────────────────────
|
|
212
|
+
export async function sendEmail({ to, cc, bcc, subject, body, isHtml, importance, attachments } = {}) {
|
|
213
|
+
var oMessage = {
|
|
214
|
+
To: to,
|
|
215
|
+
Subject: subject,
|
|
216
|
+
Body: body,
|
|
217
|
+
};
|
|
218
|
+
if (cc) oMessage.Cc = cc;
|
|
219
|
+
if (bcc) oMessage.Bcc = bcc;
|
|
220
|
+
if (importance) oMessage.Importance = importance;
|
|
221
|
+
if (attachments) oMessage.Attachments = attachments;
|
|
222
|
+
if (isHtml === false) oMessage.IsHtml = false;
|
|
223
|
+
|
|
224
|
+
return execOp("SendEmailV2", { emailMessage: oMessage });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ── Forward Email ──────────────────────────────────────────────
|
|
228
|
+
export async function forwardEmail(sMessageId, { to, comment } = {}) {
|
|
229
|
+
return execOp("ForwardEmail", {
|
|
230
|
+
message_id: sMessageId,
|
|
231
|
+
body: { ToRecipients: to, Comment: comment },
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ── Reply to Email ─────────────────────────────────────────────
|
|
236
|
+
export async function replyToEmail(sMessageId, { comment, replyAll } = {}) {
|
|
237
|
+
return execOp("ReplyToV3", {
|
|
238
|
+
messageId: sMessageId,
|
|
239
|
+
replyParameters: { Body: comment, ReplyAll: replyAll === true },
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
111
243
|
// ── List Emails ────────────────────────────────────────────────
|
|
112
244
|
export async function listEmails({ folderId = "Inbox", fetchOnlyUnread, searchQuery, top, skip } = {}) {
|
|
113
|
-
void skip;
|
|
114
|
-
|
|
115
245
|
return execOp("GetEmailsV3", {
|
|
116
246
|
folderPath: folderId,
|
|
117
|
-
fetchOnlyUnread,
|
|
118
|
-
searchQuery,
|
|
247
|
+
fetchOnlyUnread: fetchOnlyUnread,
|
|
248
|
+
searchQuery: searchQuery,
|
|
119
249
|
top: top != null ? top : 10,
|
|
250
|
+
skip: skip,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// ── Send from Shared Mailbox ───────────────────────────────────
|
|
255
|
+
export async function sendFromSharedMailbox(sSharedMailbox, { to, cc, bcc, subject, body, importance, attachments } = {}) {
|
|
256
|
+
var oMessage = {
|
|
257
|
+
MailboxAddress: sSharedMailbox,
|
|
258
|
+
To: to,
|
|
259
|
+
Subject: subject,
|
|
260
|
+
Body: body,
|
|
261
|
+
};
|
|
262
|
+
if (cc) oMessage.Cc = cc;
|
|
263
|
+
if (bcc) oMessage.Bcc = bcc;
|
|
264
|
+
if (importance) oMessage.Importance = importance;
|
|
265
|
+
if (attachments) oMessage.Attachments = attachments;
|
|
266
|
+
|
|
267
|
+
return execOp("SharedMailboxSendEmailV2", { emailMessage: oMessage });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// ── Move Email ─────────────────────────────────────────────────
|
|
271
|
+
export async function moveEmail(sMessageId, sDestinationFolderId) {
|
|
272
|
+
return execOp("MoveV2", {
|
|
273
|
+
messageId: sMessageId,
|
|
274
|
+
folderPath: sDestinationFolderId,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ── Delete Email ───────────────────────────────────────────────
|
|
279
|
+
export async function deleteEmail(sMessageId) {
|
|
280
|
+
return execOp("DeleteEmail", { messageId: sMessageId });
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ── Create Event ───────────────────────────────────────────────
|
|
284
|
+
export async function createEvent({ subject, start, end, attendees, body, location, importance, isAllDay, timeZone, calendarId } = {}) {
|
|
285
|
+
var sAttendees = Array.isArray(attendees) ? attendees.join(";") : attendees;
|
|
286
|
+
var oItem = {
|
|
287
|
+
subject: subject,
|
|
288
|
+
start: start,
|
|
289
|
+
end: end,
|
|
290
|
+
timeZone: timeZone || "",
|
|
291
|
+
};
|
|
292
|
+
if (sAttendees) oItem.requiredAttendees = sAttendees;
|
|
293
|
+
if (body) oItem.body = body;
|
|
294
|
+
if (location) oItem.location = location;
|
|
295
|
+
if (importance) oItem.importance = importance;
|
|
296
|
+
if (isAllDay) oItem.isAllDay = true;
|
|
297
|
+
|
|
298
|
+
return execOp("V4CalendarPostItem", {
|
|
299
|
+
table: calendarId || "Calendar",
|
|
300
|
+
item: oItem,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// ── List Events ────────────────────────────────────────────────
|
|
305
|
+
export async function listEvents({ calendarId = "Calendar", filter, orderBy, top, skip } = {}) {
|
|
306
|
+
return execOp("V4CalendarGetItems", {
|
|
307
|
+
table: calendarId,
|
|
308
|
+
$filter: filter,
|
|
309
|
+
$orderby: orderBy,
|
|
310
|
+
$top: top,
|
|
311
|
+
$skip: skip,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// ── Edit Event ─────────────────────────────────────────────────
|
|
316
|
+
export async function editEvent(sEventId, oChangedFields, sCalendarId) {
|
|
317
|
+
return execOp("V4CalendarPatchItem", {
|
|
318
|
+
table: sCalendarId || "Calendar",
|
|
319
|
+
id: sEventId,
|
|
320
|
+
item: oChangedFields,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// ── Delete Event ───────────────────────────────────────────────
|
|
325
|
+
export async function deleteEvent(sEventId, sCalendarId) {
|
|
326
|
+
return execOp("CalendarDeleteItem", {
|
|
327
|
+
table: sCalendarId || "Calendar",
|
|
328
|
+
id: sEventId,
|
|
120
329
|
});
|
|
121
330
|
}
|