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
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
import { getClient } from "@microsoft/power-apps/data";
|
|
2
|
-
|
|
3
|
-
// ── Data source name (must match connectionReferences in power.config.json) ──
|
|
4
|
-
const DATA_SOURCE = "Office365Outlook";
|
|
5
|
-
|
|
6
|
-
// ── Initialize SDK client for the Office 365 Outlook connector ──
|
|
7
|
-
function initClient() {
|
|
8
|
-
const dataSourcesInfo = {
|
|
9
|
-
[DATA_SOURCE]: {
|
|
10
|
-
tableId: "",
|
|
11
|
-
version: "",
|
|
12
|
-
primaryKey: "",
|
|
13
|
-
dataSourceType: "Connector",
|
|
14
|
-
apis: {},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
return getClient(dataSourcesInfo);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// ── Internal: execute a connector operation ────────────────────
|
|
21
|
-
async function execOp(operationName, parameters) {
|
|
22
|
-
const client = await initClient();
|
|
23
|
-
return client.executeAsync({
|
|
24
|
-
connectorOperation: {
|
|
25
|
-
tableName: DATA_SOURCE,
|
|
26
|
-
operationName,
|
|
27
|
-
parameters,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// ═══════════════════════════════════════════════════════════════
|
|
33
|
-
// GENERIC
|
|
34
|
-
// ═══════════════════════════════════════════════════════════════
|
|
35
|
-
|
|
36
|
-
// ── Call any Outlook connector operation by name ───────────────
|
|
37
|
-
export async function callOutlookOperation(operationName, parameters = {}) {
|
|
38
|
-
return execOp(operationName, parameters);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// ═══════════════════════════════════════════════════════════════
|
|
42
|
-
// MAIL
|
|
43
|
-
// ═══════════════════════════════════════════════════════════════
|
|
44
|
-
|
|
45
|
-
// ── Send Email ─────────────────────────────────────────────────
|
|
46
|
-
export async function sendEmail({ to, cc, bcc, subject, body, isHtml = true, importance = "Normal", attachments }) {
|
|
47
|
-
return execOp("SendEmailV2", {
|
|
48
|
-
"emailMessage/To": to,
|
|
49
|
-
"emailMessage/Subject": subject,
|
|
50
|
-
"emailMessage/Body": body,
|
|
51
|
-
"emailMessage/Cc": cc || "",
|
|
52
|
-
"emailMessage/Bcc": bcc || "",
|
|
53
|
-
"emailMessage/Importance": importance,
|
|
54
|
-
"emailMessage/IsHtml": isHtml,
|
|
55
|
-
"emailMessage/Attachments": attachments || [],
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// ── Forward Email ──────────────────────────────────────────────
|
|
60
|
-
export async function forwardEmail(messageId, { to, comment = "" }) {
|
|
61
|
-
return execOp("ForwardEmailV2", {
|
|
62
|
-
message_id: messageId,
|
|
63
|
-
"emailMessage/To": to,
|
|
64
|
-
"emailMessage/Comment": comment,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ── Reply to Email ─────────────────────────────────────────────
|
|
69
|
-
export async function replyToEmail(messageId, { comment, replyAll = false }) {
|
|
70
|
-
return execOp(replyAll ? "ReplyAllToV3" : "ReplyToV3", {
|
|
71
|
-
message_id: messageId,
|
|
72
|
-
comment,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// ── List Emails ────────────────────────────────────────────────
|
|
77
|
-
export async function listEmails({ folderId = "Inbox", fetchOnlyUnread, searchQuery, top, skip } = {}) {
|
|
78
|
-
const params = { folderPath: folderId };
|
|
79
|
-
if (fetchOnlyUnread != null) params.fetchOnlyUnread = fetchOnlyUnread;
|
|
80
|
-
if (searchQuery) params.searchQuery = searchQuery;
|
|
81
|
-
if (top != null) params.top = top;
|
|
82
|
-
if (skip != null) params.skip = skip;
|
|
83
|
-
return execOp("GetEmailsV3", params);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ── Send from Shared Mailbox ───────────────────────────────────
|
|
87
|
-
export async function sendFromSharedMailbox(sharedMailbox, { to, cc, bcc, subject, body, isHtml = true, importance = "Normal", attachments }) {
|
|
88
|
-
return execOp("SharedMailboxSendEmailV2", {
|
|
89
|
-
"emailMessage/To": to,
|
|
90
|
-
"emailMessage/Subject": subject,
|
|
91
|
-
"emailMessage/Body": body,
|
|
92
|
-
"emailMessage/Cc": cc || "",
|
|
93
|
-
"emailMessage/Bcc": bcc || "",
|
|
94
|
-
"emailMessage/Importance": importance,
|
|
95
|
-
"emailMessage/IsHtml": isHtml,
|
|
96
|
-
"emailMessage/Attachments": attachments || [],
|
|
97
|
-
mailboxAddress: sharedMailbox,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// ── Move Email ─────────────────────────────────────────────────
|
|
102
|
-
export async function moveEmail(messageId, destinationFolderId) {
|
|
103
|
-
return execOp("MoveEmailV2", {
|
|
104
|
-
message_id: messageId,
|
|
105
|
-
folderPath: destinationFolderId,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// ── Delete Email ───────────────────────────────────────────────
|
|
110
|
-
export async function deleteEmail(messageId) {
|
|
111
|
-
return execOp("DeleteEmailV2", {
|
|
112
|
-
message_id: messageId,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// ═══════════════════════════════════════════════════════════════
|
|
117
|
-
// CALENDAR
|
|
118
|
-
// ═══════════════════════════════════════════════════════════════
|
|
119
|
-
|
|
120
|
-
// ── Create Event ───────────────────────────────────────────────
|
|
121
|
-
export async function createEvent({ calendarId = "Calendar", subject, body, start, end, location, attendees, isAllDay = false, importance = "Normal", isHtml = true, timeZone = "UTC" }) {
|
|
122
|
-
return execOp("V4CalendarPostItem", {
|
|
123
|
-
table: calendarId,
|
|
124
|
-
"item/subject": subject,
|
|
125
|
-
"item/body": body || "",
|
|
126
|
-
"item/start": start,
|
|
127
|
-
"item/end": end,
|
|
128
|
-
"item/timeZone": timeZone,
|
|
129
|
-
"item/location": location || "",
|
|
130
|
-
"item/requiredAttendees": Array.isArray(attendees) ? attendees.join(";") : (attendees || ""),
|
|
131
|
-
"item/isAllDay": isAllDay,
|
|
132
|
-
"item/importance": importance,
|
|
133
|
-
"item/isHtml": isHtml,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// ── List Events ────────────────────────────────────────────────
|
|
138
|
-
export async function listEvents({ calendarId = "Calendar", filter, orderBy, top, skip } = {}) {
|
|
139
|
-
const params = { table: calendarId };
|
|
140
|
-
if (filter) params.$filter = filter;
|
|
141
|
-
if (orderBy) params.$orderby = orderBy;
|
|
142
|
-
if (top != null) params.$top = top;
|
|
143
|
-
if (skip != null) params.$skip = skip;
|
|
144
|
-
return execOp("V2CalendarGetItems", params);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// ── Edit Event ─────────────────────────────────────────────────
|
|
148
|
-
export async function editEvent(eventId, changedFields, calendarId = "Calendar") {
|
|
149
|
-
return execOp("V4CalendarPatchItem", {
|
|
150
|
-
table: calendarId,
|
|
151
|
-
id: eventId,
|
|
152
|
-
...changedFields,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// ── Delete Event ───────────────────────────────────────────────
|
|
157
|
-
export async function deleteEvent(eventId, calendarId = "Calendar") {
|
|
158
|
-
return execOp("V2CalendarDeleteItem", {
|
|
159
|
-
table: calendarId,
|
|
160
|
-
id: eventId,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
1
|
+
import { getClient } from "@microsoft/power-apps/data";
|
|
2
|
+
|
|
3
|
+
// ── Data source name (must match connectionReferences in power.config.json) ──
|
|
4
|
+
const DATA_SOURCE = "Office365Outlook";
|
|
5
|
+
|
|
6
|
+
// ── Initialize SDK client for the Office 365 Outlook connector ──
|
|
7
|
+
function initClient() {
|
|
8
|
+
const dataSourcesInfo = {
|
|
9
|
+
[DATA_SOURCE]: {
|
|
10
|
+
tableId: "",
|
|
11
|
+
version: "",
|
|
12
|
+
primaryKey: "",
|
|
13
|
+
dataSourceType: "Connector",
|
|
14
|
+
apis: {},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
return getClient(dataSourcesInfo);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ── Internal: execute a connector operation ────────────────────
|
|
21
|
+
async function execOp(operationName, parameters) {
|
|
22
|
+
const client = await initClient();
|
|
23
|
+
return client.executeAsync({
|
|
24
|
+
connectorOperation: {
|
|
25
|
+
tableName: DATA_SOURCE,
|
|
26
|
+
operationName,
|
|
27
|
+
parameters,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ═══════════════════════════════════════════════════════════════
|
|
33
|
+
// GENERIC
|
|
34
|
+
// ═══════════════════════════════════════════════════════════════
|
|
35
|
+
|
|
36
|
+
// ── Call any Outlook connector operation by name ───────────────
|
|
37
|
+
export async function callOutlookOperation(operationName, parameters = {}) {
|
|
38
|
+
return execOp(operationName, parameters);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ═══════════════════════════════════════════════════════════════
|
|
42
|
+
// MAIL
|
|
43
|
+
// ═══════════════════════════════════════════════════════════════
|
|
44
|
+
|
|
45
|
+
// ── Send Email ─────────────────────────────────────────────────
|
|
46
|
+
export async function sendEmail({ to, cc, bcc, subject, body, isHtml = true, importance = "Normal", attachments }) {
|
|
47
|
+
return execOp("SendEmailV2", {
|
|
48
|
+
"emailMessage/To": to,
|
|
49
|
+
"emailMessage/Subject": subject,
|
|
50
|
+
"emailMessage/Body": body,
|
|
51
|
+
"emailMessage/Cc": cc || "",
|
|
52
|
+
"emailMessage/Bcc": bcc || "",
|
|
53
|
+
"emailMessage/Importance": importance,
|
|
54
|
+
"emailMessage/IsHtml": isHtml,
|
|
55
|
+
"emailMessage/Attachments": attachments || [],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── Forward Email ──────────────────────────────────────────────
|
|
60
|
+
export async function forwardEmail(messageId, { to, comment = "" }) {
|
|
61
|
+
return execOp("ForwardEmailV2", {
|
|
62
|
+
message_id: messageId,
|
|
63
|
+
"emailMessage/To": to,
|
|
64
|
+
"emailMessage/Comment": comment,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ── Reply to Email ─────────────────────────────────────────────
|
|
69
|
+
export async function replyToEmail(messageId, { comment, replyAll = false }) {
|
|
70
|
+
return execOp(replyAll ? "ReplyAllToV3" : "ReplyToV3", {
|
|
71
|
+
message_id: messageId,
|
|
72
|
+
comment,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ── List Emails ────────────────────────────────────────────────
|
|
77
|
+
export async function listEmails({ folderId = "Inbox", fetchOnlyUnread, searchQuery, top, skip } = {}) {
|
|
78
|
+
const params = { folderPath: folderId };
|
|
79
|
+
if (fetchOnlyUnread != null) params.fetchOnlyUnread = fetchOnlyUnread;
|
|
80
|
+
if (searchQuery) params.searchQuery = searchQuery;
|
|
81
|
+
if (top != null) params.top = top;
|
|
82
|
+
if (skip != null) params.skip = skip;
|
|
83
|
+
return execOp("GetEmailsV3", params);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ── Send from Shared Mailbox ───────────────────────────────────
|
|
87
|
+
export async function sendFromSharedMailbox(sharedMailbox, { to, cc, bcc, subject, body, isHtml = true, importance = "Normal", attachments }) {
|
|
88
|
+
return execOp("SharedMailboxSendEmailV2", {
|
|
89
|
+
"emailMessage/To": to,
|
|
90
|
+
"emailMessage/Subject": subject,
|
|
91
|
+
"emailMessage/Body": body,
|
|
92
|
+
"emailMessage/Cc": cc || "",
|
|
93
|
+
"emailMessage/Bcc": bcc || "",
|
|
94
|
+
"emailMessage/Importance": importance,
|
|
95
|
+
"emailMessage/IsHtml": isHtml,
|
|
96
|
+
"emailMessage/Attachments": attachments || [],
|
|
97
|
+
mailboxAddress: sharedMailbox,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ── Move Email ─────────────────────────────────────────────────
|
|
102
|
+
export async function moveEmail(messageId, destinationFolderId) {
|
|
103
|
+
return execOp("MoveEmailV2", {
|
|
104
|
+
message_id: messageId,
|
|
105
|
+
folderPath: destinationFolderId,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ── Delete Email ───────────────────────────────────────────────
|
|
110
|
+
export async function deleteEmail(messageId) {
|
|
111
|
+
return execOp("DeleteEmailV2", {
|
|
112
|
+
message_id: messageId,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ═══════════════════════════════════════════════════════════════
|
|
117
|
+
// CALENDAR
|
|
118
|
+
// ═══════════════════════════════════════════════════════════════
|
|
119
|
+
|
|
120
|
+
// ── Create Event ───────────────────────────────────────────────
|
|
121
|
+
export async function createEvent({ calendarId = "Calendar", subject, body, start, end, location, attendees, isAllDay = false, importance = "Normal", isHtml = true, timeZone = "UTC" }) {
|
|
122
|
+
return execOp("V4CalendarPostItem", {
|
|
123
|
+
table: calendarId,
|
|
124
|
+
"item/subject": subject,
|
|
125
|
+
"item/body": body || "",
|
|
126
|
+
"item/start": start,
|
|
127
|
+
"item/end": end,
|
|
128
|
+
"item/timeZone": timeZone,
|
|
129
|
+
"item/location": location || "",
|
|
130
|
+
"item/requiredAttendees": Array.isArray(attendees) ? attendees.join(";") : (attendees || ""),
|
|
131
|
+
"item/isAllDay": isAllDay,
|
|
132
|
+
"item/importance": importance,
|
|
133
|
+
"item/isHtml": isHtml,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ── List Events ────────────────────────────────────────────────
|
|
138
|
+
export async function listEvents({ calendarId = "Calendar", filter, orderBy, top, skip } = {}) {
|
|
139
|
+
const params = { table: calendarId };
|
|
140
|
+
if (filter) params.$filter = filter;
|
|
141
|
+
if (orderBy) params.$orderby = orderBy;
|
|
142
|
+
if (top != null) params.$top = top;
|
|
143
|
+
if (skip != null) params.$skip = skip;
|
|
144
|
+
return execOp("V2CalendarGetItems", params);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ── Edit Event ─────────────────────────────────────────────────
|
|
148
|
+
export async function editEvent(eventId, changedFields, calendarId = "Calendar") {
|
|
149
|
+
return execOp("V4CalendarPatchItem", {
|
|
150
|
+
table: calendarId,
|
|
151
|
+
id: eventId,
|
|
152
|
+
...changedFields,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// ── Delete Event ───────────────────────────────────────────────
|
|
157
|
+
export async function deleteEvent(eventId, calendarId = "Calendar") {
|
|
158
|
+
return execOp("V2CalendarDeleteItem", {
|
|
159
|
+
table: calendarId,
|
|
160
|
+
id: eventId,
|
|
161
|
+
});
|
|
162
|
+
}
|