ask-marcel-office-cli 0.1.0 → 0.5.5
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/README.md +112 -114
- package/dist/cli.js +1849 -585
- package/dist/commands.json +1436 -0
- package/dist/composition/build-deps.d.ts +5 -1
- package/dist/composition/cli.d.ts +12 -6
- package/dist/composition/package-manager.d.ts +2 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1666 -548
- package/dist/infra/browser-auth.d.ts +9 -2
- package/dist/infra/graph-client.d.ts +2 -0
- package/dist/infra/playwright-loader.d.ts +4 -0
- package/dist/infra/process-runner-bun.d.ts +2 -0
- package/dist/infra/process-runner-node.d.ts +2 -0
- package/dist/use-cases/commands/build-command.d.ts +1 -1
- package/dist/use-cases/commands/command-types.d.ts +21 -1
- package/dist/use-cases/commands/docs-render.d.ts +24 -0
- package/dist/use-cases/commands/docs.d.ts +10 -0
- package/dist/use-cases/commands/download-drive-item-version-content.d.ts +12 -0
- package/dist/use-cases/commands/download-onedrive-file-content.d.ts +3 -1
- package/dist/use-cases/commands/get-calendar-event.d.ts +3 -1
- package/dist/use-cases/commands/get-calendar-view.d.ts +7 -2
- package/dist/use-cases/commands/get-current-user.d.ts +3 -1
- package/dist/use-cases/commands/get-drive-delta.d.ts +3 -1
- package/dist/use-cases/commands/get-drive-item.d.ts +3 -1
- package/dist/use-cases/commands/get-drive-root-item.d.ts +3 -1
- package/dist/use-cases/commands/get-excel-range.d.ts +3 -1
- package/dist/use-cases/commands/get-excel-table.d.ts +3 -1
- package/dist/use-cases/commands/get-mail-attachment.d.ts +3 -1
- package/dist/use-cases/commands/get-mail-message.d.ts +3 -1
- package/dist/use-cases/commands/get-mailbox-settings.d.ts +3 -1
- package/dist/use-cases/commands/get-my-profile-photo.d.ts +6 -2
- package/dist/use-cases/commands/get-onenote-page-content.d.ts +6 -2
- package/dist/use-cases/commands/get-planner-bucket.d.ts +3 -1
- package/dist/use-cases/commands/get-planner-plan.d.ts +3 -1
- package/dist/use-cases/commands/get-planner-task-details.d.ts +3 -1
- package/dist/use-cases/commands/get-planner-task.d.ts +3 -1
- package/dist/use-cases/commands/get-sharepoint-site-by-path.d.ts +4 -2
- package/dist/use-cases/commands/get-sharepoint-site-drive-by-id.d.ts +3 -1
- package/dist/use-cases/commands/get-sharepoint-site-list-item.d.ts +3 -1
- package/dist/use-cases/commands/get-sharepoint-site-list.d.ts +3 -1
- package/dist/use-cases/commands/get-sharepoint-site.d.ts +3 -1
- package/dist/use-cases/commands/get-specific-calendar-event.d.ts +3 -1
- package/dist/use-cases/commands/get-specific-calendar-view.d.ts +5 -1
- package/dist/use-cases/commands/get-team-channel.d.ts +3 -1
- package/dist/use-cases/commands/get-team.d.ts +3 -1
- package/dist/use-cases/commands/get-todo-task.d.ts +3 -1
- package/dist/use-cases/commands/list-all-onenote-sections.d.ts +3 -1
- package/dist/use-cases/commands/list-calendar-event-instances.d.ts +5 -1
- package/dist/use-cases/commands/list-calendar-events-delta.d.ts +3 -1
- package/dist/use-cases/commands/list-calendar-events.d.ts +3 -1
- package/dist/use-cases/commands/list-calendar-view-delta.d.ts +7 -2
- package/dist/use-cases/commands/list-calendars.d.ts +3 -1
- package/dist/use-cases/commands/list-chat-members.d.ts +3 -1
- package/dist/use-cases/commands/list-drive-item-permissions.d.ts +3 -1
- package/dist/use-cases/commands/list-drive-item-versions.d.ts +3 -1
- package/dist/use-cases/commands/list-drives.d.ts +3 -1
- package/dist/use-cases/commands/list-excel-table-rows.d.ts +3 -1
- package/dist/use-cases/commands/list-excel-tables.d.ts +3 -1
- package/dist/use-cases/commands/list-excel-worksheets.d.ts +3 -1
- package/dist/use-cases/commands/list-folder-files.d.ts +3 -1
- package/dist/use-cases/commands/{get-sharepoint-sites-delta.d.ts → list-incomplete-planner-tasks.d.ts} +3 -1
- package/dist/use-cases/commands/list-incomplete-todo-tasks.d.ts +8 -0
- package/dist/use-cases/commands/list-joined-teams.d.ts +3 -1
- package/dist/use-cases/commands/list-mail-attachments.d.ts +3 -1
- package/dist/use-cases/commands/list-mail-child-folders.d.ts +3 -1
- package/dist/use-cases/commands/list-mail-folder-messages.d.ts +3 -1
- package/dist/use-cases/commands/list-mail-folders.d.ts +3 -1
- package/dist/use-cases/commands/list-mail-messages.d.ts +3 -1
- package/dist/use-cases/commands/list-mail-rules.d.ts +3 -1
- package/dist/use-cases/commands/list-onenote-notebook-sections.d.ts +3 -1
- package/dist/use-cases/commands/list-onenote-notebooks.d.ts +3 -1
- package/dist/use-cases/commands/list-onenote-section-pages.d.ts +3 -1
- package/dist/use-cases/commands/list-plan-buckets.d.ts +3 -1
- package/dist/use-cases/commands/list-plan-tasks.d.ts +3 -1
- package/dist/use-cases/commands/{list-chats.d.ts → list-planner-plans.d.ts} +3 -1
- package/dist/use-cases/commands/list-planner-tasks.d.ts +3 -1
- package/dist/use-cases/commands/list-sharepoint-site-drives.d.ts +3 -1
- package/dist/use-cases/commands/list-sharepoint-site-list-items.d.ts +3 -1
- package/dist/use-cases/commands/list-sharepoint-site-lists.d.ts +3 -1
- package/dist/use-cases/commands/list-specific-calendar-events.d.ts +3 -1
- package/dist/use-cases/commands/list-team-channels.d.ts +3 -1
- package/dist/use-cases/commands/list-todo-linked-resources.d.ts +3 -1
- package/dist/use-cases/commands/list-todo-task-lists.d.ts +3 -1
- package/dist/use-cases/commands/list-todo-tasks.d.ts +3 -1
- package/dist/use-cases/commands/{get-channel-files-folder.d.ts → next-page.d.ts} +4 -3
- package/dist/use-cases/commands/{get-chat-message.d.ts → search-mail-messages.d.ts} +4 -3
- package/dist/use-cases/commands/{get-channel-message.d.ts → search-my-documents.d.ts} +4 -4
- package/dist/use-cases/commands/search-onedrive-files.d.ts +3 -1
- package/dist/use-cases/commands/search-onenote-pages.d.ts +8 -0
- package/dist/use-cases/commands/{get-chat-message-hosted-content.d.ts → search-sharepoint-sites-by-name.d.ts} +4 -4
- package/dist/use-cases/commands/search-sharepoint-sites.d.ts +3 -1
- package/dist/use-cases/commands/update.d.ts +16 -0
- package/dist/use-cases/ports/process-runner.d.ts +11 -0
- package/docs/commands.json +1436 -0
- package/package.json +6 -3
- package/dist/use-cases/commands/get-channel-message-hosted-content.d.ts +0 -9
- package/dist/use-cases/commands/get-chat.d.ts +0 -6
- package/dist/use-cases/commands/get-outlook-contact.d.ts +0 -6
- package/dist/use-cases/commands/get-sharepoint-site-item.d.ts +0 -7
- package/dist/use-cases/commands/list-channel-message-hosted-contents.d.ts +0 -8
- package/dist/use-cases/commands/list-channel-message-replies.d.ts +0 -8
- package/dist/use-cases/commands/list-channel-messages.d.ts +0 -7
- package/dist/use-cases/commands/list-channel-tabs.d.ts +0 -7
- package/dist/use-cases/commands/list-chat-message-hosted-contents.d.ts +0 -7
- package/dist/use-cases/commands/list-chat-message-replies.d.ts +0 -7
- package/dist/use-cases/commands/list-chat-messages.d.ts +0 -6
- package/dist/use-cases/commands/list-outlook-contacts.d.ts +0 -4
- package/dist/use-cases/commands/list-pinned-chat-messages.d.ts +0 -6
- package/dist/use-cases/commands/list-sharepoint-site-items.d.ts +0 -6
- package/dist/use-cases/commands/list-team-members.d.ts +0 -6
package/dist/cli.js
CHANGED
|
@@ -12003,8 +12003,8 @@ import updateNotifier from "update-notifier";
|
|
|
12003
12003
|
// package.json
|
|
12004
12004
|
var package_default = {
|
|
12005
12005
|
name: "ask-marcel-office-cli",
|
|
12006
|
-
version: "0.
|
|
12007
|
-
description: "Microsoft Graph CLI + library — typed Bun/TypeScript wrapper around
|
|
12006
|
+
version: "0.5.5",
|
|
12007
|
+
description: "Microsoft Graph CLI + library — typed Bun/TypeScript wrapper around 70+ read-side Graph operations reachable from a Teams browser-OAuth token.",
|
|
12008
12008
|
license: "MIT",
|
|
12009
12009
|
author: "Vincent Delacourt <vincent.delacourt@adama-development.com>",
|
|
12010
12010
|
repository: {
|
|
@@ -12024,6 +12024,7 @@ var package_default = {
|
|
|
12024
12024
|
types: "./dist/index.d.ts",
|
|
12025
12025
|
import: "./dist/index.js"
|
|
12026
12026
|
},
|
|
12027
|
+
"./commands.json": "./dist/commands.json",
|
|
12027
12028
|
"./package.json": "./package.json"
|
|
12028
12029
|
},
|
|
12029
12030
|
bin: {
|
|
@@ -12031,6 +12032,7 @@ var package_default = {
|
|
|
12031
12032
|
},
|
|
12032
12033
|
files: [
|
|
12033
12034
|
"dist/",
|
|
12035
|
+
"docs/commands.json",
|
|
12034
12036
|
"README.md",
|
|
12035
12037
|
"LICENSE"
|
|
12036
12038
|
],
|
|
@@ -12064,7 +12066,8 @@ var package_default = {
|
|
|
12064
12066
|
"mutate:staged": "bash scripts/mutate-staged.sh",
|
|
12065
12067
|
"build:js": "bun build src/main.ts --target=node --outfile=dist/cli.js --format=esm --external playwright --external update-notifier && bun build src/index.ts --target=node --outfile=dist/index.js --format=esm --external playwright --external update-notifier",
|
|
12066
12068
|
"build:types": "tsc -p tsconfig.build.json",
|
|
12067
|
-
|
|
12069
|
+
"docs:gen": "bun run scripts/gen-docs.ts",
|
|
12070
|
+
build: "rm -rf dist && bun run docs:gen && bun run build:js && bun run build:types && bun run scripts/fix-dts-extensions.ts && bun run scripts/add-shebang.ts && cp docs/commands.json dist/commands.json",
|
|
12068
12071
|
prepublishOnly: "bun run build && bun test && bun run lint:strict && bun run typecheck && bun run coverage"
|
|
12069
12072
|
},
|
|
12070
12073
|
devDependencies: {
|
|
@@ -12157,6 +12160,7 @@ var formatError = (err2) => {
|
|
|
12157
12160
|
};
|
|
12158
12161
|
|
|
12159
12162
|
// src/infra/filesystem-bun.ts
|
|
12163
|
+
var isMissingError = (e) => e instanceof Error && e.code === "ENOENT";
|
|
12160
12164
|
var createBunFileSystem = () => ({
|
|
12161
12165
|
readJson: async (path) => {
|
|
12162
12166
|
const file = Bun.file(path);
|
|
@@ -12177,13 +12181,12 @@ var createBunFileSystem = () => ({
|
|
|
12177
12181
|
}
|
|
12178
12182
|
},
|
|
12179
12183
|
deleteIfExists: async (path) => {
|
|
12180
|
-
const file = Bun.file(path);
|
|
12181
|
-
if (!await file.exists())
|
|
12182
|
-
return ok(undefined);
|
|
12183
12184
|
try {
|
|
12184
|
-
await file.delete();
|
|
12185
|
+
await Bun.file(path).delete();
|
|
12185
12186
|
return ok(undefined);
|
|
12186
12187
|
} catch (e) {
|
|
12188
|
+
if (isMissingError(e))
|
|
12189
|
+
return ok(undefined);
|
|
12187
12190
|
return err({ type: "io_failed", message: formatError(e) });
|
|
12188
12191
|
}
|
|
12189
12192
|
}
|
|
@@ -12230,8 +12233,12 @@ var createNodeFileSystem = () => ({
|
|
|
12230
12233
|
}
|
|
12231
12234
|
});
|
|
12232
12235
|
|
|
12236
|
+
// src/infra/playwright-loader.ts
|
|
12237
|
+
var loadPlaywright = async () => import("playwright");
|
|
12238
|
+
|
|
12233
12239
|
// src/infra/browser-auth.ts
|
|
12234
12240
|
var TOKEN_HOSTS = ["login.microsoftonline.com", "login.live.com", "login.microsoft.com"];
|
|
12241
|
+
var PROXY_ENV_KEYS = ["HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"];
|
|
12235
12242
|
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
12236
12243
|
var defaultProfileDir = () => {
|
|
12237
12244
|
const envOverride = process.env.ASKMARCEL_BROWSER_PROFILE;
|
|
@@ -12245,9 +12252,20 @@ var cleanupSingletonLocks = async (dir, fs) => {
|
|
|
12245
12252
|
await fs.deleteIfExists(join(dir, name));
|
|
12246
12253
|
}
|
|
12247
12254
|
};
|
|
12255
|
+
var stripProxyEnv = () => {
|
|
12256
|
+
for (const k of PROXY_ENV_KEYS)
|
|
12257
|
+
delete process.env[k];
|
|
12258
|
+
};
|
|
12259
|
+
var createPlaywrightApi = (loader) => ({
|
|
12260
|
+
launchPersistentContext: async (profileDir, options) => {
|
|
12261
|
+
stripProxyEnv();
|
|
12262
|
+
const { chromium } = await loader();
|
|
12263
|
+
return chromium.launchPersistentContext(profileDir, options);
|
|
12264
|
+
}
|
|
12265
|
+
});
|
|
12248
12266
|
var createBrowserAuthFromApi = (api, config) => {
|
|
12249
12267
|
const { logger, fs } = config;
|
|
12250
|
-
const trace = config.trace ?? ((
|
|
12268
|
+
const trace = config.trace ?? (() => {});
|
|
12251
12269
|
const profileDir = config.profileDir ?? defaultProfileDir();
|
|
12252
12270
|
const initialSettleMs = config.initialSettleMs ?? 5000;
|
|
12253
12271
|
const postReloginSettleMs = config.postReloginSettleMs ?? 3000;
|
|
@@ -12255,6 +12273,21 @@ var createBrowserAuthFromApi = (api, config) => {
|
|
|
12255
12273
|
const pollDeadlineMs = config.pollDeadlineMs ?? 5 * 60 * 1000;
|
|
12256
12274
|
const navigationTimeoutMs = config.navigationTimeoutMs ?? 30000;
|
|
12257
12275
|
let context = null;
|
|
12276
|
+
let page = null;
|
|
12277
|
+
const cleanup = async () => {
|
|
12278
|
+
if (page) {
|
|
12279
|
+
try {
|
|
12280
|
+
await page.close();
|
|
12281
|
+
} catch {}
|
|
12282
|
+
page = null;
|
|
12283
|
+
}
|
|
12284
|
+
if (context) {
|
|
12285
|
+
try {
|
|
12286
|
+
await context.close();
|
|
12287
|
+
} catch {}
|
|
12288
|
+
context = null;
|
|
12289
|
+
}
|
|
12290
|
+
};
|
|
12258
12291
|
const launchContext = async () => {
|
|
12259
12292
|
for (const channel of ["msedge", "chrome"]) {
|
|
12260
12293
|
try {
|
|
@@ -12287,7 +12320,8 @@ var createBrowserAuthFromApi = (api, config) => {
|
|
|
12287
12320
|
let capturedAccess = null;
|
|
12288
12321
|
let capturedRefresh = null;
|
|
12289
12322
|
context = await launchContext();
|
|
12290
|
-
|
|
12323
|
+
page = await context.newPage();
|
|
12324
|
+
const activePage = page;
|
|
12291
12325
|
const handleResponse = async (response) => {
|
|
12292
12326
|
if (capturedAccess)
|
|
12293
12327
|
return;
|
|
@@ -12316,14 +12350,14 @@ var createBrowserAuthFromApi = (api, config) => {
|
|
|
12316
12350
|
`);
|
|
12317
12351
|
} catch {}
|
|
12318
12352
|
};
|
|
12319
|
-
|
|
12353
|
+
activePage.on("response", (r) => {
|
|
12320
12354
|
handleResponse(r);
|
|
12321
12355
|
});
|
|
12322
12356
|
logger.info("browser_navigating", { url: startUrl });
|
|
12323
12357
|
trace(`[DEBUG] navigating to: ${startUrl}
|
|
12324
12358
|
`);
|
|
12325
12359
|
try {
|
|
12326
|
-
await
|
|
12360
|
+
await activePage.goto(startUrl, { waitUntil: "domcontentloaded", timeout: navigationTimeoutMs });
|
|
12327
12361
|
logger.info("browser_navigated", { url: startUrl });
|
|
12328
12362
|
} catch (navError) {
|
|
12329
12363
|
const navMsg = navError instanceof Error ? navError.message : String(navError);
|
|
@@ -12331,56 +12365,45 @@ var createBrowserAuthFromApi = (api, config) => {
|
|
|
12331
12365
|
`);
|
|
12332
12366
|
logger.info("browser_navigation_error", { message: navMsg });
|
|
12333
12367
|
}
|
|
12334
|
-
const
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
|
|
12338
|
-
try {
|
|
12339
|
-
if (context)
|
|
12340
|
-
await context.close();
|
|
12341
|
-
} catch {}
|
|
12342
|
-
context = null;
|
|
12343
|
-
};
|
|
12344
|
-
await sleep(initialSettleMs);
|
|
12345
|
-
if (capturedAccess) {
|
|
12346
|
-
trace(`[DEBUG] token captured during initial settle
|
|
12368
|
+
const tryReturnCaptured = async (label) => {
|
|
12369
|
+
if (!capturedAccess)
|
|
12370
|
+
return null;
|
|
12371
|
+
trace(`[DEBUG] ${label}
|
|
12347
12372
|
`);
|
|
12348
12373
|
await cleanup();
|
|
12349
12374
|
return { accessToken: capturedAccess, refreshToken: capturedRefresh };
|
|
12350
|
-
}
|
|
12351
|
-
|
|
12375
|
+
};
|
|
12376
|
+
await sleep(initialSettleMs);
|
|
12377
|
+
const settleResult = await tryReturnCaptured("token captured during initial settle");
|
|
12378
|
+
if (settleResult)
|
|
12379
|
+
return settleResult;
|
|
12380
|
+
const currentUrl = activePage.url();
|
|
12352
12381
|
if (!currentUrl.includes("login.microsoftonline.com") && !currentUrl.includes("login.live.com")) {
|
|
12353
12382
|
trace(`[DEBUG] already signed in — clearing session to force fresh login
|
|
12354
12383
|
`);
|
|
12355
12384
|
logger.info("browser_force_relogin", { url: currentUrl });
|
|
12356
12385
|
await context.clearCookies();
|
|
12357
12386
|
try {
|
|
12358
|
-
await
|
|
12387
|
+
await activePage.evaluate(() => {
|
|
12359
12388
|
localStorage.clear();
|
|
12360
12389
|
sessionStorage.clear();
|
|
12361
12390
|
});
|
|
12362
12391
|
} catch {}
|
|
12363
12392
|
try {
|
|
12364
|
-
await
|
|
12393
|
+
await activePage.goto(startUrl, { waitUntil: "domcontentloaded", timeout: navigationTimeoutMs });
|
|
12365
12394
|
} catch {}
|
|
12366
12395
|
await sleep(postReloginSettleMs);
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
await cleanup();
|
|
12371
|
-
return { accessToken: capturedAccess, refreshToken: capturedRefresh };
|
|
12372
|
-
}
|
|
12396
|
+
const reloginResult = await tryReturnCaptured("token captured after force relogin");
|
|
12397
|
+
if (reloginResult)
|
|
12398
|
+
return reloginResult;
|
|
12373
12399
|
}
|
|
12374
12400
|
trace(`[DEBUG] complete sign-in in the browser window — waiting up to 5 min
|
|
12375
12401
|
`);
|
|
12376
12402
|
const deadline = Date.now() + pollDeadlineMs;
|
|
12377
12403
|
while (Date.now() < deadline) {
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
await cleanup();
|
|
12382
|
-
return { accessToken: capturedAccess, refreshToken: capturedRefresh };
|
|
12383
|
-
}
|
|
12404
|
+
const polledResult = await tryReturnCaptured("token found in polling loop, closing browser");
|
|
12405
|
+
if (polledResult)
|
|
12406
|
+
return polledResult;
|
|
12384
12407
|
await sleep(pollIntervalMs);
|
|
12385
12408
|
}
|
|
12386
12409
|
trace(`[DEBUG] polling loop timeout expired, no token captured
|
|
@@ -12390,29 +12413,12 @@ var createBrowserAuthFromApi = (api, config) => {
|
|
|
12390
12413
|
};
|
|
12391
12414
|
const close = async () => {
|
|
12392
12415
|
logger.info("browser_auth_close");
|
|
12393
|
-
|
|
12394
|
-
try {
|
|
12395
|
-
await context.close();
|
|
12396
|
-
} catch {}
|
|
12397
|
-
context = null;
|
|
12398
|
-
}
|
|
12416
|
+
await cleanup();
|
|
12399
12417
|
};
|
|
12400
12418
|
return { acquireToken, close };
|
|
12401
12419
|
};
|
|
12402
12420
|
var defaultFileSystem = () => typeof globalThis.Bun !== "undefined" ? createBunFileSystem() : createNodeFileSystem();
|
|
12403
|
-
var createBrowserAuth = (deps) => {
|
|
12404
|
-
const api = {
|
|
12405
|
-
launchPersistentContext: async (profileDir, options) => {
|
|
12406
|
-
for (const k of ["HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"]) {
|
|
12407
|
-
delete process.env[k];
|
|
12408
|
-
}
|
|
12409
|
-
const { chromium } = await import("playwright");
|
|
12410
|
-
const ctx = await chromium.launchPersistentContext(profileDir, options);
|
|
12411
|
-
return ctx;
|
|
12412
|
-
}
|
|
12413
|
-
};
|
|
12414
|
-
return createBrowserAuthFromApi(api, { logger: deps.logger, fs: deps.fs ?? defaultFileSystem() });
|
|
12415
|
-
};
|
|
12421
|
+
var createBrowserAuth = (deps) => createBrowserAuthFromApi(createPlaywrightApi(loadPlaywright), { logger: deps.logger, fs: deps.fs ?? defaultFileSystem() });
|
|
12416
12422
|
|
|
12417
12423
|
// src/infra/auth.ts
|
|
12418
12424
|
var CLIENT_ID = "5e3ce6c0-2b1f-4285-8d4b-75ee78787346";
|
|
@@ -12499,39 +12505,97 @@ var defaultFileSystem2 = () => typeof globalThis.Bun !== "undefined" ? createBun
|
|
|
12499
12505
|
var createAuthManager = (deps) => createAuthManagerFromApi(createBrowserAuth({ logger: deps.logger, fs: deps.fs ?? defaultFileSystem2() }), deps.cachePath, deps.logger, deps.fs ?? defaultFileSystem2());
|
|
12500
12506
|
|
|
12501
12507
|
// src/infra/graph-client.ts
|
|
12508
|
+
var isJson = (contentType) => contentType !== null && contentType.toLowerCase().includes("application/json");
|
|
12509
|
+
var isText = (contentType) => {
|
|
12510
|
+
if (contentType === null)
|
|
12511
|
+
return false;
|
|
12512
|
+
const lower = contentType.toLowerCase();
|
|
12513
|
+
return lower.startsWith("text/") || lower.includes("+xml") || lower.includes("application/xml") || lower.includes("application/javascript");
|
|
12514
|
+
};
|
|
12515
|
+
var toBase64 = (bytes) => {
|
|
12516
|
+
let binary = "";
|
|
12517
|
+
for (const byte of bytes)
|
|
12518
|
+
binary += String.fromCharCode(byte);
|
|
12519
|
+
return btoa(binary);
|
|
12520
|
+
};
|
|
12521
|
+
var networkErrorMessage = (e) => {
|
|
12522
|
+
if (e instanceof Error)
|
|
12523
|
+
return e.message;
|
|
12524
|
+
if (typeof e === "string")
|
|
12525
|
+
return e;
|
|
12526
|
+
return "network request failed";
|
|
12527
|
+
};
|
|
12502
12528
|
var createGraphClient = (auth, fetchFn = globalThis.fetch) => {
|
|
12503
|
-
const
|
|
12529
|
+
const authHeaders = async () => {
|
|
12504
12530
|
const tokenResult = await auth.getAccessToken();
|
|
12505
12531
|
if (!tokenResult.ok) {
|
|
12506
12532
|
const msg = tokenResult.error.type === "auth_cancelled" ? "Auth cancelled" : tokenResult.error.message;
|
|
12507
12533
|
return err({ type: "auth_failed", message: msg });
|
|
12508
12534
|
}
|
|
12535
|
+
return ok({ Authorization: `Bearer ${tokenResult.value}` });
|
|
12536
|
+
};
|
|
12537
|
+
const request = async (method, path, body) => {
|
|
12538
|
+
const headers = await authHeaders();
|
|
12539
|
+
if (!headers.ok)
|
|
12540
|
+
return headers;
|
|
12509
12541
|
try {
|
|
12510
12542
|
const res = await fetchFn(`https://graph.microsoft.com/v1.0${path}`, {
|
|
12511
|
-
|
|
12543
|
+
method,
|
|
12544
|
+
headers: { ...headers.value, "content-type": "application/json" },
|
|
12545
|
+
...body === undefined ? {} : { body: JSON.stringify(body) }
|
|
12512
12546
|
});
|
|
12513
12547
|
if (!res.ok) {
|
|
12514
|
-
const
|
|
12515
|
-
return err({ type: "api_error", status: res.status, message:
|
|
12548
|
+
const errBody = await res.json().catch(() => ({}));
|
|
12549
|
+
return err({ type: "api_error", status: res.status, message: errBody.error?.message ?? res.statusText });
|
|
12516
12550
|
}
|
|
12517
12551
|
return ok(await res.json());
|
|
12518
12552
|
} catch (e) {
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12553
|
+
return err({ type: "network_error", message: networkErrorMessage(e) });
|
|
12554
|
+
}
|
|
12555
|
+
};
|
|
12556
|
+
const getBinary = async (path) => {
|
|
12557
|
+
const headers = await authHeaders();
|
|
12558
|
+
if (!headers.ok)
|
|
12559
|
+
return headers;
|
|
12560
|
+
try {
|
|
12561
|
+
const res = await fetchFn(`https://graph.microsoft.com/v1.0${path}`, {
|
|
12562
|
+
method: "GET",
|
|
12563
|
+
headers: headers.value,
|
|
12564
|
+
redirect: "manual"
|
|
12565
|
+
});
|
|
12566
|
+
if (res.status >= 300 && res.status < 400) {
|
|
12567
|
+
const location = res.headers.get("location");
|
|
12568
|
+
if (location !== null)
|
|
12569
|
+
return ok({ "@microsoft.graph.downloadUrl": location });
|
|
12570
|
+
}
|
|
12571
|
+
if (!res.ok) {
|
|
12572
|
+
const errBody = await res.json().catch(() => ({}));
|
|
12573
|
+
return err({ type: "api_error", status: res.status, message: errBody.error?.message ?? res.statusText });
|
|
12574
|
+
}
|
|
12575
|
+
const contentType = res.headers.get("content-type");
|
|
12576
|
+
if (isJson(contentType))
|
|
12577
|
+
return ok(await res.json());
|
|
12578
|
+
if (isText(contentType)) {
|
|
12579
|
+
const text = await res.text();
|
|
12580
|
+
return ok({ contentType: contentType ?? "text/plain", size: text.length, text });
|
|
12581
|
+
}
|
|
12582
|
+
const buffer = await res.arrayBuffer();
|
|
12583
|
+
return ok({ contentType: contentType ?? "application/octet-stream", size: buffer.byteLength, base64: toBase64(new Uint8Array(buffer)) });
|
|
12584
|
+
} catch (e) {
|
|
12585
|
+
return err({ type: "network_error", message: networkErrorMessage(e) });
|
|
12527
12586
|
}
|
|
12528
12587
|
};
|
|
12529
|
-
return {
|
|
12588
|
+
return {
|
|
12589
|
+
get: (path) => request("GET", path),
|
|
12590
|
+
post: (path, body) => request("POST", path, body),
|
|
12591
|
+
getBinary
|
|
12592
|
+
};
|
|
12530
12593
|
};
|
|
12531
12594
|
|
|
12532
12595
|
// src/infra/logger.ts
|
|
12533
12596
|
var import_winston = __toESM(require_winston(), 1);
|
|
12534
12597
|
var REDACTED_KEYS = new Set(["password", "token", "authorization", "apikey", "secret"]);
|
|
12598
|
+
var ALL_LEVELS = ["error", "warn", "info", "http", "verbose", "debug", "silly"];
|
|
12535
12599
|
var redactFormat = import_winston.format((info) => {
|
|
12536
12600
|
for (const key of Object.keys(info)) {
|
|
12537
12601
|
if (REDACTED_KEYS.has(key.toLowerCase()))
|
|
@@ -12541,9 +12605,9 @@ var redactFormat = import_winston.format((info) => {
|
|
|
12541
12605
|
});
|
|
12542
12606
|
var createWinstonLogger = (config = {}) => {
|
|
12543
12607
|
const winston = import_winston.createLogger({
|
|
12544
|
-
level: config.logLevel ?? process.env.
|
|
12608
|
+
level: config.logLevel ?? process.env.ASKMARCEL_LOG_LEVEL ?? "error",
|
|
12545
12609
|
format: import_winston.format.combine(redactFormat(), import_winston.format.json()),
|
|
12546
|
-
transports: [new import_winston.transports.Console]
|
|
12610
|
+
transports: [new import_winston.transports.Console({ stderrLevels: ALL_LEVELS })]
|
|
12547
12611
|
});
|
|
12548
12612
|
return {
|
|
12549
12613
|
info: (event, meta) => winston.info(event, meta),
|
|
@@ -12552,18 +12616,47 @@ var createWinstonLogger = (config = {}) => {
|
|
|
12552
12616
|
};
|
|
12553
12617
|
};
|
|
12554
12618
|
|
|
12619
|
+
// src/infra/process-runner-bun.ts
|
|
12620
|
+
var createBunProcessRunner = () => ({
|
|
12621
|
+
runInherit: async (command, args) => {
|
|
12622
|
+
try {
|
|
12623
|
+
const proc = Bun.spawn([command, ...args], { stdio: ["inherit", "inherit", "inherit"] });
|
|
12624
|
+
const exitCode = await proc.exited;
|
|
12625
|
+
return ok({ exitCode });
|
|
12626
|
+
} catch (e) {
|
|
12627
|
+
return err({ type: "spawn_failed", message: formatError(e) });
|
|
12628
|
+
}
|
|
12629
|
+
}
|
|
12630
|
+
});
|
|
12631
|
+
|
|
12632
|
+
// src/infra/process-runner-node.ts
|
|
12633
|
+
import { spawn } from "node:child_process";
|
|
12634
|
+
var createNodeProcessRunner = () => ({
|
|
12635
|
+
runInherit: async (command, args) => new Promise((resolve) => {
|
|
12636
|
+
try {
|
|
12637
|
+
const child = spawn(command, [...args], { stdio: "inherit" });
|
|
12638
|
+
child.on("exit", (exitCode) => resolve(ok({ exitCode: exitCode ?? 0 })));
|
|
12639
|
+
child.on("error", (e) => resolve(err({ type: "spawn_failed", message: formatError(e) })));
|
|
12640
|
+
} catch (e) {
|
|
12641
|
+
resolve(err({ type: "spawn_failed", message: formatError(e) }));
|
|
12642
|
+
}
|
|
12643
|
+
})
|
|
12644
|
+
});
|
|
12645
|
+
|
|
12555
12646
|
// src/composition/build-deps.ts
|
|
12556
12647
|
var defaultCachePath = (home) => join2(home, ".ask-marcel", "token-cache.json");
|
|
12557
12648
|
var defaultFileSystem3 = () => typeof globalThis.Bun !== "undefined" ? createBunFileSystem() : createNodeFileSystem();
|
|
12649
|
+
var defaultProcessRunner = () => typeof globalThis.Bun !== "undefined" ? createBunProcessRunner() : createNodeProcessRunner();
|
|
12558
12650
|
var buildDeps = (config = {}) => {
|
|
12559
12651
|
const home = config.home ?? process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
12560
12652
|
const cachePath = config.cachePath ?? defaultCachePath(home);
|
|
12561
|
-
const logLevel = config.logLevel ?? process.env.
|
|
12653
|
+
const logLevel = config.logLevel ?? process.env.ASKMARCEL_LOG_LEVEL ?? "error";
|
|
12562
12654
|
const fs = config.fs ?? defaultFileSystem3();
|
|
12655
|
+
const processRunner = config.processRunner ?? defaultProcessRunner();
|
|
12563
12656
|
const logger = createWinstonLogger({ logLevel });
|
|
12564
12657
|
const auth = createAuthManager({ cachePath, logger, fs });
|
|
12565
12658
|
const graph = createGraphClient(auth);
|
|
12566
|
-
return { logger, auth, graph };
|
|
12659
|
+
return { logger, auth, graph, processRunner };
|
|
12567
12660
|
};
|
|
12568
12661
|
|
|
12569
12662
|
// node_modules/commander/esm.mjs
|
|
@@ -12594,10 +12687,73 @@ var renderError = (message, logger) => {
|
|
|
12594
12687
|
`);
|
|
12595
12688
|
};
|
|
12596
12689
|
|
|
12597
|
-
// src/use-cases/commands/
|
|
12598
|
-
var
|
|
12599
|
-
|
|
12690
|
+
// src/use-cases/commands/docs-render.ts
|
|
12691
|
+
var CATEGORY_LABELS = {
|
|
12692
|
+
auth: "Authentication",
|
|
12693
|
+
drive: "OneDrive Files",
|
|
12694
|
+
excel: "Excel (workbook files)",
|
|
12695
|
+
sharepoint: "SharePoint Sites",
|
|
12696
|
+
tasks: "Tasks (To Do + Planner)",
|
|
12697
|
+
mail: "Mail",
|
|
12698
|
+
notes: "Notes (OneNote)",
|
|
12699
|
+
user: "User",
|
|
12700
|
+
calendar: "Calendar",
|
|
12701
|
+
contacts: "Contacts",
|
|
12702
|
+
chats: "Chats",
|
|
12703
|
+
teams: "Teams",
|
|
12704
|
+
meta: "Meta / Pagination"
|
|
12705
|
+
};
|
|
12706
|
+
var CATEGORY_ORDER = ["drive", "excel", "sharepoint", "tasks", "mail", "notes", "user", "calendar", "contacts", "chats", "teams", "meta"];
|
|
12707
|
+
var renderCommandMarkdown = (entry) => {
|
|
12708
|
+
const lines = [
|
|
12709
|
+
`# \`${entry.name}\``,
|
|
12710
|
+
"",
|
|
12711
|
+
entry.summary,
|
|
12712
|
+
"",
|
|
12713
|
+
`- **Category:** ${CATEGORY_LABELS[entry.category]}`,
|
|
12714
|
+
`- **Graph endpoint:** \`${entry.graphMethod} ${entry.graphPathTemplate}\``,
|
|
12715
|
+
`- **Microsoft Learn:** ${entry.graphDocsUrl}`
|
|
12716
|
+
];
|
|
12717
|
+
if (entry.responseShape)
|
|
12718
|
+
lines.push(`- **Response:** ${entry.responseShape}`);
|
|
12719
|
+
if (entry.options.length > 0) {
|
|
12720
|
+
lines.push("", "## Options", "");
|
|
12721
|
+
lines.push("| Flag | Description |", "|------|-------------|");
|
|
12722
|
+
for (const o of entry.options)
|
|
12723
|
+
lines.push(`| \`--${o.name}\` | ${o.description} |`);
|
|
12724
|
+
}
|
|
12725
|
+
if (entry.bodyTemplate)
|
|
12726
|
+
lines.push("", "## Request body", "", "```json", entry.bodyTemplate, "```");
|
|
12727
|
+
lines.push("", "## Example", "", "```bash", entry.example, "```");
|
|
12728
|
+
return lines.join(`
|
|
12729
|
+
`);
|
|
12730
|
+
};
|
|
12731
|
+
|
|
12732
|
+
// src/use-cases/commands/docs.ts
|
|
12733
|
+
var toEntry = (name, cmd) => ({
|
|
12734
|
+
name,
|
|
12735
|
+
summary: cmd.meta.summary,
|
|
12736
|
+
category: cmd.meta.category,
|
|
12737
|
+
graphMethod: cmd.meta.graphMethod,
|
|
12738
|
+
graphPathTemplate: cmd.meta.graphPathTemplate,
|
|
12739
|
+
graphDocsUrl: cmd.meta.graphDocsUrl,
|
|
12740
|
+
options: cmd.meta.options,
|
|
12741
|
+
example: cmd.meta.example,
|
|
12742
|
+
...cmd.meta.responseShape ? { responseShape: cmd.meta.responseShape } : {},
|
|
12743
|
+
...cmd.meta.bodyTemplate ? { bodyTemplate: cmd.meta.bodyTemplate } : {}
|
|
12744
|
+
});
|
|
12745
|
+
var renderSingleCommand = (registry, name) => {
|
|
12746
|
+
const cmd = registry[name];
|
|
12747
|
+
if (!cmd)
|
|
12748
|
+
return err({ type: "unknown_command", name, available: Object.keys(registry).toSorted((a, b) => a.localeCompare(b)) });
|
|
12749
|
+
return ok(renderCommandMarkdown(toEntry(name, cmd)));
|
|
12750
|
+
};
|
|
12751
|
+
|
|
12752
|
+
// src/use-cases/commands/download-drive-item-version-content.ts
|
|
12753
|
+
var exports_download_drive_item_version_content = {};
|
|
12754
|
+
__export(exports_download_drive_item_version_content, {
|
|
12600
12755
|
schema: () => schema,
|
|
12756
|
+
meta: () => meta3,
|
|
12601
12757
|
execute: () => execute
|
|
12602
12758
|
});
|
|
12603
12759
|
|
|
@@ -26133,798 +26289,1829 @@ function date4(params) {
|
|
|
26133
26289
|
|
|
26134
26290
|
// node_modules/zod/v4/classic/external.js
|
|
26135
26291
|
config(en_default());
|
|
26136
|
-
// src/use-cases/commands/download-
|
|
26137
|
-
var schema = exports_external.object({
|
|
26292
|
+
// src/use-cases/commands/download-drive-item-version-content.ts
|
|
26293
|
+
var schema = exports_external.object({
|
|
26294
|
+
driveId: exports_external.string().min(1),
|
|
26295
|
+
itemId: exports_external.string().min(1),
|
|
26296
|
+
versionId: exports_external.string().min(1)
|
|
26297
|
+
});
|
|
26138
26298
|
var execute = async (graph, params) => {
|
|
26139
26299
|
const parsed = schema.safeParse(params);
|
|
26140
26300
|
if (!parsed.success)
|
|
26141
26301
|
throw new Error(`validation failed: ${parsed.error.message}`);
|
|
26142
|
-
return graph.
|
|
26302
|
+
return graph.getBinary(`/drives/${parsed.data.driveId}/items/${parsed.data.itemId}/versions/${parsed.data.versionId}/content`);
|
|
26303
|
+
};
|
|
26304
|
+
var meta3 = {
|
|
26305
|
+
summary: 'Download the binary content of a specific *non-current* historical version of a OneDrive / SharePoint file. Graph refuses to serve the current version through this endpoint with "You cannot get the content of the current version" — for the current version use `download-onedrive-file-content` instead. Same envelope as that command (302 → downloadUrl, or base64 bytes).',
|
|
26306
|
+
category: "drive",
|
|
26307
|
+
graphMethod: "GET",
|
|
26308
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/versions/{version-id}/content",
|
|
26309
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitemversion-get-content",
|
|
26310
|
+
options: [
|
|
26311
|
+
{
|
|
26312
|
+
name: "drive-id",
|
|
26313
|
+
key: "driveId",
|
|
26314
|
+
required: true,
|
|
26315
|
+
description: "Microsoft Graph drive ID. Use `ask-marcel list-drives` for the personal OneDrive, " + "or `ask-marcel list-sharepoint-site-drives --site-id <id>` for a SharePoint document library."
|
|
26316
|
+
},
|
|
26317
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the file. Returned by `list-folder-files` or `search-onedrive-files`." },
|
|
26318
|
+
{
|
|
26319
|
+
name: "version-id",
|
|
26320
|
+
key: "versionId",
|
|
26321
|
+
required: true,
|
|
26322
|
+
description: "driveItemVersion ID. Returned by `ask-marcel list-drive-item-versions`. Use the `id` field of an entry under `value[]`. " + "Pick a non-current version — the first entry (e.g. `12.0`) is the live file and Graph rejects this endpoint for it; use `value[1]` or older."
|
|
26323
|
+
}
|
|
26324
|
+
],
|
|
26325
|
+
example: "ask-marcel download-drive-item-version-content --drive-id 'b!1234' --item-id '01ABC' --version-id '4.0'",
|
|
26326
|
+
responseShape: '`{ "@microsoft.graph.downloadUrl": "..." }` for the typical 302 case, or `{ contentType, size, base64 }` when Graph streams bytes directly'
|
|
26327
|
+
};
|
|
26328
|
+
|
|
26329
|
+
// src/use-cases/commands/download-onedrive-file-content.ts
|
|
26330
|
+
var exports_download_onedrive_file_content = {};
|
|
26331
|
+
__export(exports_download_onedrive_file_content, {
|
|
26332
|
+
schema: () => schema2,
|
|
26333
|
+
meta: () => meta4,
|
|
26334
|
+
execute: () => execute2
|
|
26335
|
+
});
|
|
26336
|
+
var schema2 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
26337
|
+
var execute2 = async (graph, params) => {
|
|
26338
|
+
const parsed = schema2.safeParse(params);
|
|
26339
|
+
if (!parsed.success)
|
|
26340
|
+
throw new Error(`validation failed: ${parsed.error.message}`);
|
|
26341
|
+
return graph.getBinary(`/drives/${parsed.data.driveId}/items/${parsed.data.itemId}/content`);
|
|
26342
|
+
};
|
|
26343
|
+
var meta4 = {
|
|
26344
|
+
summary: "Download the binary content of a file stored in OneDrive / SharePoint. Graph normally returns a 302 redirect to a pre-signed CDN URL, surfaced as `@microsoft.graph.downloadUrl`; if it returns bytes directly they are base64-encoded for safe JSON output.",
|
|
26345
|
+
category: "drive",
|
|
26346
|
+
graphMethod: "GET",
|
|
26347
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/content",
|
|
26348
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-get-content",
|
|
26349
|
+
options: [
|
|
26350
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID. Returned by `ask-marcel list-drives`." },
|
|
26351
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the file to download. Returned by `ask-marcel list-folder-files` or `search-onedrive-files`." }
|
|
26352
|
+
],
|
|
26353
|
+
example: "ask-marcel download-onedrive-file-content --drive-id 'b!1234' --item-id '01ABC'",
|
|
26354
|
+
responseShape: '`{ "@microsoft.graph.downloadUrl": "..." }` for the typical 302 case, or `{ contentType, size, base64 }` when Graph streams bytes directly'
|
|
26143
26355
|
};
|
|
26144
26356
|
|
|
26145
26357
|
// src/use-cases/commands/get-calendar-event.ts
|
|
26146
26358
|
var exports_get_calendar_event = {};
|
|
26147
26359
|
__export(exports_get_calendar_event, {
|
|
26148
|
-
schema: () =>
|
|
26149
|
-
|
|
26360
|
+
schema: () => schema3,
|
|
26361
|
+
meta: () => meta5,
|
|
26362
|
+
execute: () => execute3
|
|
26150
26363
|
});
|
|
26151
26364
|
|
|
26152
26365
|
// src/use-cases/commands/build-command.ts
|
|
26153
|
-
var buildCommand = (pathFn,
|
|
26154
|
-
const
|
|
26155
|
-
const parsed =
|
|
26366
|
+
var buildCommand = (pathFn, schema3) => {
|
|
26367
|
+
const execute3 = async (graph, params) => {
|
|
26368
|
+
const parsed = schema3.safeParse(params);
|
|
26156
26369
|
if (!parsed.success)
|
|
26157
26370
|
throw new Error(`validation failed: ${parsed.error.message}`);
|
|
26158
26371
|
const path = pathFn(parsed.data);
|
|
26159
26372
|
return graph.get(path);
|
|
26160
26373
|
};
|
|
26161
|
-
return { schema:
|
|
26374
|
+
return { schema: schema3, execute: execute3 };
|
|
26162
26375
|
};
|
|
26163
26376
|
|
|
26164
26377
|
// src/use-cases/commands/get-calendar-event.ts
|
|
26165
|
-
var
|
|
26166
|
-
var { execute:
|
|
26378
|
+
var schema3 = exports_external.object({ eventId: exports_external.string().min(1) });
|
|
26379
|
+
var { execute: execute3 } = buildCommand((p) => `/me/events/${p.eventId}`, schema3);
|
|
26380
|
+
var meta5 = {
|
|
26381
|
+
summary: "Fetch a single calendar event by ID from the signed-in user’s default calendar.",
|
|
26382
|
+
category: "calendar",
|
|
26383
|
+
graphMethod: "GET",
|
|
26384
|
+
graphPathTemplate: "/me/events/{event-id}",
|
|
26385
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/event-get",
|
|
26386
|
+
options: [
|
|
26387
|
+
{
|
|
26388
|
+
name: "event-id",
|
|
26389
|
+
key: "eventId",
|
|
26390
|
+
required: true,
|
|
26391
|
+
description: "Microsoft Graph event ID. Returned by `ask-marcel list-calendar-events` in the `id` field of each event."
|
|
26392
|
+
}
|
|
26393
|
+
],
|
|
26394
|
+
example: "ask-marcel get-calendar-event --event-id 'AAMkAGI2THVS...'",
|
|
26395
|
+
responseShape: "single Microsoft Graph `event` resource"
|
|
26396
|
+
};
|
|
26167
26397
|
|
|
26168
26398
|
// src/use-cases/commands/get-calendar-view.ts
|
|
26169
26399
|
var exports_get_calendar_view = {};
|
|
26170
26400
|
__export(exports_get_calendar_view, {
|
|
26171
|
-
schema: () => schema3,
|
|
26172
|
-
execute: () => execute3
|
|
26173
|
-
});
|
|
26174
|
-
var schema3 = exports_external.object({}).strict();
|
|
26175
|
-
var { execute: execute3 } = buildCommand(() => "/me/calendarView", schema3);
|
|
26176
|
-
|
|
26177
|
-
// src/use-cases/commands/get-channel-files-folder.ts
|
|
26178
|
-
var exports_get_channel_files_folder = {};
|
|
26179
|
-
__export(exports_get_channel_files_folder, {
|
|
26180
26401
|
schema: () => schema4,
|
|
26402
|
+
meta: () => meta6,
|
|
26181
26403
|
execute: () => execute4
|
|
26182
26404
|
});
|
|
26183
|
-
var schema4 = exports_external.object({
|
|
26184
|
-
|
|
26185
|
-
|
|
26186
|
-
|
|
26187
|
-
var
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26196
|
-
|
|
26197
|
-
|
|
26198
|
-
|
|
26199
|
-
|
|
26200
|
-
}
|
|
26201
|
-
|
|
26202
|
-
|
|
26203
|
-
|
|
26204
|
-
|
|
26205
|
-
|
|
26206
|
-
|
|
26207
|
-
|
|
26208
|
-
|
|
26209
|
-
|
|
26210
|
-
|
|
26211
|
-
var { execute: execute7 } = buildCommand((p) => `/chats/${p.chatId}/messages/${p.chatMessageId}/hostedContents/${p.chatMessageHostedContentId}/$value`, schema7);
|
|
26212
|
-
|
|
26213
|
-
// src/use-cases/commands/get-chat-message.ts
|
|
26214
|
-
var exports_get_chat_message = {};
|
|
26215
|
-
__export(exports_get_chat_message, {
|
|
26216
|
-
schema: () => schema8,
|
|
26217
|
-
execute: () => execute8
|
|
26218
|
-
});
|
|
26219
|
-
var schema8 = exports_external.object({ chatId: exports_external.string().min(1), chatMessageId: exports_external.string().min(1) });
|
|
26220
|
-
var { execute: execute8 } = buildCommand((p) => `/chats/${p.chatId}/messages/${p.chatMessageId}`, schema8);
|
|
26221
|
-
|
|
26222
|
-
// src/use-cases/commands/get-chat.ts
|
|
26223
|
-
var exports_get_chat = {};
|
|
26224
|
-
__export(exports_get_chat, {
|
|
26225
|
-
schema: () => schema9,
|
|
26226
|
-
execute: () => execute9
|
|
26227
|
-
});
|
|
26228
|
-
var schema9 = exports_external.object({ chatId: exports_external.string().min(1) });
|
|
26229
|
-
var { execute: execute9 } = buildCommand((p) => `/chats/${p.chatId}`, schema9);
|
|
26405
|
+
var schema4 = exports_external.object({
|
|
26406
|
+
startDateTime: exports_external.string().min(1),
|
|
26407
|
+
endDateTime: exports_external.string().min(1)
|
|
26408
|
+
});
|
|
26409
|
+
var { execute: execute4 } = buildCommand((p) => `/me/calendarView?startDateTime=${p.startDateTime}&endDateTime=${p.endDateTime}`, schema4);
|
|
26410
|
+
var meta6 = {
|
|
26411
|
+
summary: "List the signed-in user’s default-calendar events with recurrence expanded into individual occurrences in a date range. Both ISO date-time params are required by Graph.",
|
|
26412
|
+
category: "calendar",
|
|
26413
|
+
graphMethod: "GET",
|
|
26414
|
+
graphPathTemplate: "/me/calendarView?startDateTime={start-date-time}&endDateTime={end-date-time}",
|
|
26415
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-calendarview",
|
|
26416
|
+
options: [
|
|
26417
|
+
{
|
|
26418
|
+
name: "start-date-time",
|
|
26419
|
+
key: "startDateTime",
|
|
26420
|
+
required: true,
|
|
26421
|
+
description: "ISO 8601 lower bound (UTC). Example: `2026-04-01T00:00:00Z`. Required by Graph; the request fails without it."
|
|
26422
|
+
},
|
|
26423
|
+
{
|
|
26424
|
+
name: "end-date-time",
|
|
26425
|
+
key: "endDateTime",
|
|
26426
|
+
required: true,
|
|
26427
|
+
description: "ISO 8601 upper bound (UTC). Example: `2026-05-01T00:00:00Z`. Required by Graph; the request fails without it."
|
|
26428
|
+
}
|
|
26429
|
+
],
|
|
26430
|
+
example: "ask-marcel get-calendar-view --start-date-time '2026-04-01T00:00:00Z' --end-date-time '2026-05-01T00:00:00Z'",
|
|
26431
|
+
responseShape: "collection of Microsoft Graph `event` resources (single occurrences) under `value[]`"
|
|
26432
|
+
};
|
|
26230
26433
|
|
|
26231
26434
|
// src/use-cases/commands/get-current-user.ts
|
|
26232
26435
|
var exports_get_current_user = {};
|
|
26233
26436
|
__export(exports_get_current_user, {
|
|
26234
|
-
schema: () =>
|
|
26235
|
-
|
|
26437
|
+
schema: () => schema5,
|
|
26438
|
+
meta: () => meta7,
|
|
26439
|
+
execute: () => execute5
|
|
26236
26440
|
});
|
|
26237
|
-
var
|
|
26238
|
-
var { execute:
|
|
26441
|
+
var schema5 = exports_external.object({}).strict();
|
|
26442
|
+
var { execute: execute5 } = buildCommand(() => "/me", schema5);
|
|
26443
|
+
var meta7 = {
|
|
26444
|
+
summary: "Return the signed-in user’s Microsoft Graph profile (id, displayName, mail, jobTitle, etc.).",
|
|
26445
|
+
category: "user",
|
|
26446
|
+
graphMethod: "GET",
|
|
26447
|
+
graphPathTemplate: "/me",
|
|
26448
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-get",
|
|
26449
|
+
options: [],
|
|
26450
|
+
example: "ask-marcel get-current-user",
|
|
26451
|
+
responseShape: "single Microsoft Graph `user` resource"
|
|
26452
|
+
};
|
|
26239
26453
|
|
|
26240
26454
|
// src/use-cases/commands/get-drive-delta.ts
|
|
26241
26455
|
var exports_get_drive_delta = {};
|
|
26242
26456
|
__export(exports_get_drive_delta, {
|
|
26243
|
-
schema: () =>
|
|
26244
|
-
|
|
26457
|
+
schema: () => schema6,
|
|
26458
|
+
meta: () => meta8,
|
|
26459
|
+
execute: () => execute6
|
|
26245
26460
|
});
|
|
26246
|
-
var
|
|
26247
|
-
var { execute:
|
|
26461
|
+
var schema6 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
26462
|
+
var { execute: execute6 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/delta()`, schema6);
|
|
26463
|
+
var meta8 = {
|
|
26464
|
+
summary: "Get the incremental change set (added / modified / deleted items) under a OneDrive / SharePoint folder. Use the `@odata.deltaLink` from a previous response to resume.",
|
|
26465
|
+
category: "drive",
|
|
26466
|
+
graphMethod: "GET",
|
|
26467
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/delta()",
|
|
26468
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-delta",
|
|
26469
|
+
options: [
|
|
26470
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID. Returned by `ask-marcel list-drives`." },
|
|
26471
|
+
{
|
|
26472
|
+
name: "item-id",
|
|
26473
|
+
key: "itemId",
|
|
26474
|
+
required: true,
|
|
26475
|
+
description: "driveItem ID of the folder whose subtree to track. Use the root folder ID from `get-drive-root-item` to track the entire drive."
|
|
26476
|
+
}
|
|
26477
|
+
],
|
|
26478
|
+
example: "ask-marcel get-drive-delta --drive-id 'b!1234' --item-id '01ROOT'",
|
|
26479
|
+
responseShape: "collection of changed Microsoft Graph `driveItem` resources under `value[]` plus an `@odata.deltaLink` token"
|
|
26480
|
+
};
|
|
26248
26481
|
|
|
26249
26482
|
// src/use-cases/commands/get-drive-item.ts
|
|
26250
26483
|
var exports_get_drive_item = {};
|
|
26251
26484
|
__export(exports_get_drive_item, {
|
|
26252
|
-
schema: () =>
|
|
26253
|
-
|
|
26485
|
+
schema: () => schema7,
|
|
26486
|
+
meta: () => meta9,
|
|
26487
|
+
execute: () => execute7
|
|
26254
26488
|
});
|
|
26255
|
-
var
|
|
26256
|
-
var { execute:
|
|
26489
|
+
var schema7 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
26490
|
+
var { execute: execute7 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}`, schema7);
|
|
26491
|
+
var meta9 = {
|
|
26492
|
+
summary: "Get the metadata (driveItem resource) of a single file or folder in OneDrive / SharePoint.",
|
|
26493
|
+
category: "drive",
|
|
26494
|
+
graphMethod: "GET",
|
|
26495
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}",
|
|
26496
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-get",
|
|
26497
|
+
options: [
|
|
26498
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID. Returned by `ask-marcel list-drives`." },
|
|
26499
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID. Returned by `list-folder-files`, `search-onedrive-files`, or `get-drive-root-item`." }
|
|
26500
|
+
],
|
|
26501
|
+
example: "ask-marcel get-drive-item --drive-id 'b!1234' --item-id '01ABC'",
|
|
26502
|
+
responseShape: "single Microsoft Graph `driveItem` resource"
|
|
26503
|
+
};
|
|
26257
26504
|
|
|
26258
26505
|
// src/use-cases/commands/get-drive-root-item.ts
|
|
26259
26506
|
var exports_get_drive_root_item = {};
|
|
26260
26507
|
__export(exports_get_drive_root_item, {
|
|
26261
|
-
schema: () =>
|
|
26262
|
-
|
|
26508
|
+
schema: () => schema8,
|
|
26509
|
+
meta: () => meta10,
|
|
26510
|
+
execute: () => execute8
|
|
26263
26511
|
});
|
|
26264
|
-
var
|
|
26265
|
-
var { execute:
|
|
26512
|
+
var schema8 = exports_external.object({ driveId: exports_external.string().min(1) });
|
|
26513
|
+
var { execute: execute8 } = buildCommand((p) => `/drives/${p.driveId}/root`, schema8);
|
|
26514
|
+
var meta10 = {
|
|
26515
|
+
summary: "Get the root folder (driveItem) of a OneDrive / SharePoint drive.",
|
|
26516
|
+
category: "drive",
|
|
26517
|
+
graphMethod: "GET",
|
|
26518
|
+
graphPathTemplate: "/drives/{drive-id}/root",
|
|
26519
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-get",
|
|
26520
|
+
options: [{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID. Returned by `ask-marcel list-drives` in the `id` field." }],
|
|
26521
|
+
example: "ask-marcel get-drive-root-item --drive-id 'b!1234'",
|
|
26522
|
+
responseShape: "single Microsoft Graph `driveItem` resource (the root folder)"
|
|
26523
|
+
};
|
|
26266
26524
|
|
|
26267
26525
|
// src/use-cases/commands/get-excel-range.ts
|
|
26268
26526
|
var exports_get_excel_range = {};
|
|
26269
26527
|
__export(exports_get_excel_range, {
|
|
26270
|
-
schema: () =>
|
|
26271
|
-
|
|
26528
|
+
schema: () => schema9,
|
|
26529
|
+
meta: () => meta11,
|
|
26530
|
+
execute: () => execute9
|
|
26272
26531
|
});
|
|
26273
|
-
var
|
|
26274
|
-
var { execute:
|
|
26532
|
+
var schema9 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1), worksheetId: exports_external.string().min(1), address: exports_external.string().min(1) });
|
|
26533
|
+
var { execute: execute9 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/workbook/worksheets/${p.worksheetId}/range(address='${p.address}')`, schema9);
|
|
26534
|
+
var meta11 = {
|
|
26535
|
+
summary: "Get the cell values, formulas, and formats of a specific Excel range (e.g. `A1:C10`).",
|
|
26536
|
+
category: "excel",
|
|
26537
|
+
graphMethod: "GET",
|
|
26538
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')",
|
|
26539
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/worksheet-range",
|
|
26540
|
+
options: [
|
|
26541
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID containing the workbook. Returned by `ask-marcel list-drives`." },
|
|
26542
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the .xlsx file." },
|
|
26543
|
+
{ name: "worksheet-id", key: "worksheetId", required: true, description: "Worksheet ID or worksheet name. Returned by `ask-marcel list-excel-worksheets`." },
|
|
26544
|
+
{ name: "address", key: "address", required: true, description: "A1-style range address, e.g. `A1:C10` or a single cell like `B7`." }
|
|
26545
|
+
],
|
|
26546
|
+
example: "ask-marcel get-excel-range --drive-id 'b!1234' --item-id '01XLSX' --worksheet-id 'Sheet1' --address 'A1:C10'",
|
|
26547
|
+
responseShape: "single Microsoft Graph `workbookRange` resource (values, formulas, format)"
|
|
26548
|
+
};
|
|
26275
26549
|
|
|
26276
26550
|
// src/use-cases/commands/get-excel-table.ts
|
|
26277
26551
|
var exports_get_excel_table = {};
|
|
26278
26552
|
__export(exports_get_excel_table, {
|
|
26279
|
-
schema: () =>
|
|
26280
|
-
|
|
26553
|
+
schema: () => schema10,
|
|
26554
|
+
meta: () => meta12,
|
|
26555
|
+
execute: () => execute10
|
|
26281
26556
|
});
|
|
26282
|
-
var
|
|
26283
|
-
var { execute:
|
|
26557
|
+
var schema10 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1), tableId: exports_external.string().min(1) });
|
|
26558
|
+
var { execute: execute10 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/workbook/tables/${p.tableId}`, schema10);
|
|
26559
|
+
var meta12 = {
|
|
26560
|
+
summary: "Get the metadata (style, header row, total row) of a single named Excel table.",
|
|
26561
|
+
category: "excel",
|
|
26562
|
+
graphMethod: "GET",
|
|
26563
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}",
|
|
26564
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/workbooktable-get",
|
|
26565
|
+
options: [
|
|
26566
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID containing the workbook. Returned by `ask-marcel list-drives`." },
|
|
26567
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the .xlsx file." },
|
|
26568
|
+
{ name: "table-id", key: "tableId", required: true, description: "Workbook table ID or table name. Returned by `ask-marcel list-excel-tables`." }
|
|
26569
|
+
],
|
|
26570
|
+
example: "ask-marcel get-excel-table --drive-id 'b!1234' --item-id '01XLSX' --table-id 'Table1'",
|
|
26571
|
+
responseShape: "single Microsoft Graph `workbookTable` resource"
|
|
26572
|
+
};
|
|
26284
26573
|
|
|
26285
26574
|
// src/use-cases/commands/get-mail-attachment.ts
|
|
26286
26575
|
var exports_get_mail_attachment = {};
|
|
26287
26576
|
__export(exports_get_mail_attachment, {
|
|
26288
|
-
schema: () =>
|
|
26289
|
-
|
|
26577
|
+
schema: () => schema11,
|
|
26578
|
+
meta: () => meta13,
|
|
26579
|
+
execute: () => execute11
|
|
26290
26580
|
});
|
|
26291
|
-
var
|
|
26292
|
-
var { execute:
|
|
26581
|
+
var schema11 = exports_external.object({ messageId: exports_external.string().min(1), attachmentId: exports_external.string().min(1) });
|
|
26582
|
+
var { execute: execute11 } = buildCommand((p) => `/me/messages/${p.messageId}/attachments/${p.attachmentId}`, schema11);
|
|
26583
|
+
var meta13 = {
|
|
26584
|
+
summary: "Get a single attachment on an Outlook message (metadata, plus the base64 `contentBytes` for file attachments).",
|
|
26585
|
+
category: "mail",
|
|
26586
|
+
graphMethod: "GET",
|
|
26587
|
+
graphPathTemplate: "/me/messages/{message-id}/attachments/{attachment-id}",
|
|
26588
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/attachment-get",
|
|
26589
|
+
options: [
|
|
26590
|
+
{ name: "message-id", key: "messageId", required: true, description: "Outlook message ID. Returned by `ask-marcel list-mail-messages`." },
|
|
26591
|
+
{ name: "attachment-id", key: "attachmentId", required: true, description: "Attachment ID. Returned by `ask-marcel list-mail-attachments`." }
|
|
26592
|
+
],
|
|
26593
|
+
example: "ask-marcel get-mail-attachment --message-id 'AAMkAGI2...' --attachment-id 'AAMkABC...'",
|
|
26594
|
+
responseShape: "single Microsoft Graph `attachment` resource"
|
|
26595
|
+
};
|
|
26293
26596
|
|
|
26294
26597
|
// src/use-cases/commands/get-mail-message.ts
|
|
26295
26598
|
var exports_get_mail_message = {};
|
|
26296
26599
|
__export(exports_get_mail_message, {
|
|
26297
|
-
schema: () =>
|
|
26298
|
-
|
|
26600
|
+
schema: () => schema12,
|
|
26601
|
+
meta: () => meta14,
|
|
26602
|
+
execute: () => execute12
|
|
26299
26603
|
});
|
|
26300
|
-
var
|
|
26301
|
-
var { execute:
|
|
26604
|
+
var schema12 = exports_external.object({ messageId: exports_external.string().min(1) });
|
|
26605
|
+
var { execute: execute12 } = buildCommand((p) => `/me/messages/${p.messageId}`, schema12);
|
|
26606
|
+
var meta14 = {
|
|
26607
|
+
summary: "Get a single Outlook message by ID, including subject, sender, body, and flags.",
|
|
26608
|
+
category: "mail",
|
|
26609
|
+
graphMethod: "GET",
|
|
26610
|
+
graphPathTemplate: "/me/messages/{message-id}",
|
|
26611
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/message-get",
|
|
26612
|
+
options: [
|
|
26613
|
+
{ name: "message-id", key: "messageId", required: true, description: "Outlook message ID. Returned by `ask-marcel list-mail-messages` or `list-mail-folder-messages`." }
|
|
26614
|
+
],
|
|
26615
|
+
example: "ask-marcel get-mail-message --message-id 'AAMkAGI2...'",
|
|
26616
|
+
responseShape: "single Microsoft Graph `message` resource"
|
|
26617
|
+
};
|
|
26302
26618
|
|
|
26303
26619
|
// src/use-cases/commands/get-mailbox-settings.ts
|
|
26304
26620
|
var exports_get_mailbox_settings = {};
|
|
26305
26621
|
__export(exports_get_mailbox_settings, {
|
|
26306
|
-
schema: () =>
|
|
26307
|
-
|
|
26622
|
+
schema: () => schema13,
|
|
26623
|
+
meta: () => meta15,
|
|
26624
|
+
execute: () => execute13
|
|
26308
26625
|
});
|
|
26309
|
-
var
|
|
26310
|
-
var { execute:
|
|
26626
|
+
var schema13 = exports_external.object({}).strict();
|
|
26627
|
+
var { execute: execute13 } = buildCommand(() => "/me/mailboxSettings", schema13);
|
|
26628
|
+
var meta15 = {
|
|
26629
|
+
summary: "Get the signed-in user’s Outlook mailbox settings (timezone, working hours, automatic replies).",
|
|
26630
|
+
category: "mail",
|
|
26631
|
+
graphMethod: "GET",
|
|
26632
|
+
graphPathTemplate: "/me/mailboxSettings",
|
|
26633
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-get-mailboxsettings",
|
|
26634
|
+
options: [],
|
|
26635
|
+
example: "ask-marcel get-mailbox-settings",
|
|
26636
|
+
responseShape: "single Microsoft Graph `mailboxSettings` resource"
|
|
26637
|
+
};
|
|
26311
26638
|
|
|
26312
26639
|
// src/use-cases/commands/get-my-profile-photo.ts
|
|
26313
26640
|
var exports_get_my_profile_photo = {};
|
|
26314
26641
|
__export(exports_get_my_profile_photo, {
|
|
26315
|
-
schema: () =>
|
|
26316
|
-
|
|
26642
|
+
schema: () => schema14,
|
|
26643
|
+
meta: () => meta16,
|
|
26644
|
+
execute: () => execute14
|
|
26317
26645
|
});
|
|
26318
|
-
var
|
|
26319
|
-
var
|
|
26646
|
+
var schema14 = exports_external.object({}).strict();
|
|
26647
|
+
var execute14 = async (graph, params) => {
|
|
26648
|
+
const parsed = schema14.safeParse(params);
|
|
26649
|
+
if (!parsed.success)
|
|
26650
|
+
throw new Error(`validation failed: ${parsed.error.message}`);
|
|
26651
|
+
return graph.getBinary("/me/photo/$value");
|
|
26652
|
+
};
|
|
26653
|
+
var meta16 = {
|
|
26654
|
+
summary: "Download the signed-in user’s profile photo (largest available size). Returned as a base64 envelope so the binary survives JSON output.",
|
|
26655
|
+
category: "user",
|
|
26656
|
+
graphMethod: "GET",
|
|
26657
|
+
graphPathTemplate: "/me/photo/$value",
|
|
26658
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/profilephoto-get",
|
|
26659
|
+
options: [],
|
|
26660
|
+
example: "ask-marcel get-my-profile-photo",
|
|
26661
|
+
responseShape: '`{ contentType: "image/jpeg", size: <bytes>, base64: "<encoded>" }` (or `{ "@microsoft.graph.downloadUrl": "..." }` when Graph returns a 302 redirect to a CDN URL)'
|
|
26662
|
+
};
|
|
26320
26663
|
|
|
26321
26664
|
// src/use-cases/commands/get-onenote-page-content.ts
|
|
26322
26665
|
var exports_get_onenote_page_content = {};
|
|
26323
26666
|
__export(exports_get_onenote_page_content, {
|
|
26324
|
-
schema: () =>
|
|
26325
|
-
|
|
26326
|
-
|
|
26327
|
-
var schema20 = exports_external.object({ onenotePageId: exports_external.string().min(1) });
|
|
26328
|
-
var { execute: execute20 } = buildCommand((p) => `/me/onenote/pages/${p.onenotePageId}/content`, schema20);
|
|
26329
|
-
|
|
26330
|
-
// src/use-cases/commands/get-outlook-contact.ts
|
|
26331
|
-
var exports_get_outlook_contact = {};
|
|
26332
|
-
__export(exports_get_outlook_contact, {
|
|
26333
|
-
schema: () => schema21,
|
|
26334
|
-
execute: () => execute21
|
|
26667
|
+
schema: () => schema15,
|
|
26668
|
+
meta: () => meta17,
|
|
26669
|
+
execute: () => execute15
|
|
26335
26670
|
});
|
|
26336
|
-
var
|
|
26337
|
-
var
|
|
26671
|
+
var schema15 = exports_external.object({ onenotePageId: exports_external.string().min(1) });
|
|
26672
|
+
var execute15 = async (graph, params) => {
|
|
26673
|
+
const parsed = schema15.safeParse(params);
|
|
26674
|
+
if (!parsed.success)
|
|
26675
|
+
throw new Error(`validation failed: ${parsed.error.message}`);
|
|
26676
|
+
return graph.getBinary(`/me/onenote/pages/${parsed.data.onenotePageId}/content`);
|
|
26677
|
+
};
|
|
26678
|
+
var meta17 = {
|
|
26679
|
+
summary: "Get the HTML body of a single OneNote page. Returned in a JSON envelope so the HTML survives transport.",
|
|
26680
|
+
category: "notes",
|
|
26681
|
+
graphMethod: "GET",
|
|
26682
|
+
graphPathTemplate: "/me/onenote/pages/{onenote-page-id}/content",
|
|
26683
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/page-get",
|
|
26684
|
+
options: [{ name: "onenote-page-id", key: "onenotePageId", required: true, description: "OneNote page ID. Returned by `ask-marcel list-onenote-section-pages`." }],
|
|
26685
|
+
example: "ask-marcel get-onenote-page-content --onenote-page-id '1-abc...'",
|
|
26686
|
+
responseShape: '`{ contentType: "text/html", size: <chars>, text: "<html>..." }` — the rendered OneNote page body wrapped in a JSON envelope'
|
|
26687
|
+
};
|
|
26338
26688
|
|
|
26339
26689
|
// src/use-cases/commands/get-planner-bucket.ts
|
|
26340
26690
|
var exports_get_planner_bucket = {};
|
|
26341
26691
|
__export(exports_get_planner_bucket, {
|
|
26342
|
-
schema: () =>
|
|
26343
|
-
|
|
26692
|
+
schema: () => schema16,
|
|
26693
|
+
meta: () => meta18,
|
|
26694
|
+
execute: () => execute16
|
|
26344
26695
|
});
|
|
26345
|
-
var
|
|
26346
|
-
var { execute:
|
|
26696
|
+
var schema16 = exports_external.object({ plannerBucketId: exports_external.string().min(1) });
|
|
26697
|
+
var { execute: execute16 } = buildCommand((p) => `/planner/buckets/${p.plannerBucketId}`, schema16);
|
|
26698
|
+
var meta18 = {
|
|
26699
|
+
summary: "Get the metadata of a single Microsoft Planner bucket (column / lane).",
|
|
26700
|
+
category: "tasks",
|
|
26701
|
+
graphMethod: "GET",
|
|
26702
|
+
graphPathTemplate: "/planner/buckets/{planner-bucket-id}",
|
|
26703
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/plannerbucket-get",
|
|
26704
|
+
options: [{ name: "planner-bucket-id", key: "plannerBucketId", required: true, description: "Planner bucket ID. Returned by `ask-marcel list-plan-buckets`." }],
|
|
26705
|
+
example: "ask-marcel get-planner-bucket --planner-bucket-id 'sFNeQRFu_kqhxpwwAhmA15gAGfoT'",
|
|
26706
|
+
responseShape: "single Microsoft Graph `plannerBucket` resource"
|
|
26707
|
+
};
|
|
26347
26708
|
|
|
26348
26709
|
// src/use-cases/commands/get-planner-plan.ts
|
|
26349
26710
|
var exports_get_planner_plan = {};
|
|
26350
26711
|
__export(exports_get_planner_plan, {
|
|
26351
|
-
schema: () =>
|
|
26352
|
-
|
|
26712
|
+
schema: () => schema17,
|
|
26713
|
+
meta: () => meta19,
|
|
26714
|
+
execute: () => execute17
|
|
26353
26715
|
});
|
|
26354
|
-
var
|
|
26355
|
-
var { execute:
|
|
26716
|
+
var schema17 = exports_external.object({ plannerPlanId: exports_external.string().min(1) });
|
|
26717
|
+
var { execute: execute17 } = buildCommand((p) => `/planner/plans/${p.plannerPlanId}`, schema17);
|
|
26718
|
+
var meta19 = {
|
|
26719
|
+
summary: "Get the metadata of a single Microsoft Planner plan (title, owner group, container).",
|
|
26720
|
+
category: "tasks",
|
|
26721
|
+
graphMethod: "GET",
|
|
26722
|
+
graphPathTemplate: "/planner/plans/{planner-plan-id}",
|
|
26723
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/plannerplan-get",
|
|
26724
|
+
options: [
|
|
26725
|
+
{
|
|
26726
|
+
name: "planner-plan-id",
|
|
26727
|
+
key: "plannerPlanId",
|
|
26728
|
+
required: true,
|
|
26729
|
+
description: "Planner plan ID. Returned in the `planId` field of any task from `ask-marcel list-planner-tasks`."
|
|
26730
|
+
}
|
|
26731
|
+
],
|
|
26732
|
+
example: "ask-marcel get-planner-plan --planner-plan-id 'xqQg5FS2LkCp935s-FIFm5gAB6'",
|
|
26733
|
+
responseShape: "single Microsoft Graph `plannerPlan` resource"
|
|
26734
|
+
};
|
|
26356
26735
|
|
|
26357
26736
|
// src/use-cases/commands/get-planner-task-details.ts
|
|
26358
26737
|
var exports_get_planner_task_details = {};
|
|
26359
26738
|
__export(exports_get_planner_task_details, {
|
|
26360
|
-
schema: () =>
|
|
26361
|
-
|
|
26739
|
+
schema: () => schema18,
|
|
26740
|
+
meta: () => meta20,
|
|
26741
|
+
execute: () => execute18
|
|
26362
26742
|
});
|
|
26363
|
-
var
|
|
26364
|
-
var { execute:
|
|
26743
|
+
var schema18 = exports_external.object({ plannerTaskId: exports_external.string().min(1) });
|
|
26744
|
+
var { execute: execute18 } = buildCommand((p) => `/planner/tasks/${p.plannerTaskId}/details`, schema18);
|
|
26745
|
+
var meta20 = {
|
|
26746
|
+
summary: "Get the rich details (description, checklist, references) of a Microsoft Planner task.",
|
|
26747
|
+
category: "tasks",
|
|
26748
|
+
graphMethod: "GET",
|
|
26749
|
+
graphPathTemplate: "/planner/tasks/{planner-task-id}/details",
|
|
26750
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/plannertaskdetails-get",
|
|
26751
|
+
options: [{ name: "planner-task-id", key: "plannerTaskId", required: true, description: "Planner task ID. Returned by `ask-marcel list-planner-tasks` or `list-plan-tasks`." }],
|
|
26752
|
+
example: "ask-marcel get-planner-task-details --planner-task-id '01tx7Ic7-USXEwt0lvR1cmgAH8gK'",
|
|
26753
|
+
responseShape: "single Microsoft Graph `plannerTaskDetails` resource"
|
|
26754
|
+
};
|
|
26365
26755
|
|
|
26366
26756
|
// src/use-cases/commands/get-planner-task.ts
|
|
26367
26757
|
var exports_get_planner_task = {};
|
|
26368
26758
|
__export(exports_get_planner_task, {
|
|
26369
|
-
schema: () =>
|
|
26370
|
-
|
|
26759
|
+
schema: () => schema19,
|
|
26760
|
+
meta: () => meta21,
|
|
26761
|
+
execute: () => execute19
|
|
26371
26762
|
});
|
|
26372
|
-
var
|
|
26373
|
-
var { execute:
|
|
26763
|
+
var schema19 = exports_external.object({ plannerTaskId: exports_external.string().min(1) });
|
|
26764
|
+
var { execute: execute19 } = buildCommand((p) => `/planner/tasks/${p.plannerTaskId}`, schema19);
|
|
26765
|
+
var meta21 = {
|
|
26766
|
+
summary: "Get the metadata of a single Microsoft Planner task (title, assignees, dates, completion).",
|
|
26767
|
+
category: "tasks",
|
|
26768
|
+
graphMethod: "GET",
|
|
26769
|
+
graphPathTemplate: "/planner/tasks/{planner-task-id}",
|
|
26770
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/plannertask-get",
|
|
26771
|
+
options: [{ name: "planner-task-id", key: "plannerTaskId", required: true, description: "Planner task ID. Returned by `ask-marcel list-planner-tasks` or `list-plan-tasks`." }],
|
|
26772
|
+
example: "ask-marcel get-planner-task --planner-task-id '01tx7Ic7-USXEwt0lvR1cmgAH8gK'",
|
|
26773
|
+
responseShape: "single Microsoft Graph `plannerTask` resource"
|
|
26774
|
+
};
|
|
26374
26775
|
|
|
26375
26776
|
// src/use-cases/commands/get-sharepoint-site-by-path.ts
|
|
26376
26777
|
var exports_get_sharepoint_site_by_path = {};
|
|
26377
26778
|
__export(exports_get_sharepoint_site_by_path, {
|
|
26378
|
-
schema: () =>
|
|
26379
|
-
|
|
26779
|
+
schema: () => schema20,
|
|
26780
|
+
meta: () => meta22,
|
|
26781
|
+
execute: () => execute20
|
|
26380
26782
|
});
|
|
26381
|
-
var
|
|
26382
|
-
|
|
26783
|
+
var schema20 = exports_external.object({
|
|
26784
|
+
hostname: exports_external.string().min(1),
|
|
26785
|
+
path: exports_external.string().min(1).refine((v) => v.startsWith("/"), { message: "must start with `/` (server-relative path, e.g. /sites/Marketing)" })
|
|
26786
|
+
});
|
|
26787
|
+
var { execute: execute20 } = buildCommand((p) => `/sites/${p.hostname}:${p.path}`, schema20);
|
|
26788
|
+
var meta22 = {
|
|
26789
|
+
summary: "Resolve a SharePoint site by its hostname + server-relative path. Use this when you have a SharePoint URL (e.g. `https://contoso.sharepoint.com/sites/Marketing`) but no site ID.",
|
|
26790
|
+
category: "sharepoint",
|
|
26791
|
+
graphMethod: "GET",
|
|
26792
|
+
graphPathTemplate: "/sites/{hostname}:{path}",
|
|
26793
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/site-get",
|
|
26794
|
+
options: [
|
|
26795
|
+
{
|
|
26796
|
+
name: "hostname",
|
|
26797
|
+
key: "hostname",
|
|
26798
|
+
required: true,
|
|
26799
|
+
description: "SharePoint host, e.g. `contoso.sharepoint.com` (or `contoso-my.sharepoint.com` for personal sites). Take the host portion of your SharePoint URL."
|
|
26800
|
+
},
|
|
26801
|
+
{
|
|
26802
|
+
name: "path",
|
|
26803
|
+
key: "path",
|
|
26804
|
+
required: true,
|
|
26805
|
+
description: "Server-relative path starting with `/`, e.g. `/sites/Marketing` or `/teams/Marketing/Subsite`. Take the URL pathname after the hostname."
|
|
26806
|
+
}
|
|
26807
|
+
],
|
|
26808
|
+
example: "ask-marcel get-sharepoint-site-by-path --hostname 'contoso.sharepoint.com' --path '/sites/Marketing'",
|
|
26809
|
+
responseShape: "single Microsoft Graph `site` resource"
|
|
26810
|
+
};
|
|
26383
26811
|
|
|
26384
26812
|
// src/use-cases/commands/get-sharepoint-site-drive-by-id.ts
|
|
26385
26813
|
var exports_get_sharepoint_site_drive_by_id = {};
|
|
26386
26814
|
__export(exports_get_sharepoint_site_drive_by_id, {
|
|
26387
|
-
schema: () =>
|
|
26388
|
-
|
|
26389
|
-
|
|
26390
|
-
var schema27 = exports_external.object({ siteId: exports_external.string().min(1), driveId: exports_external.string().min(1) });
|
|
26391
|
-
var { execute: execute27 } = buildCommand((p) => `/sites/${p.siteId}/drives/${p.driveId}`, schema27);
|
|
26392
|
-
|
|
26393
|
-
// src/use-cases/commands/get-sharepoint-site-item.ts
|
|
26394
|
-
var exports_get_sharepoint_site_item = {};
|
|
26395
|
-
__export(exports_get_sharepoint_site_item, {
|
|
26396
|
-
schema: () => schema28,
|
|
26397
|
-
execute: () => execute28
|
|
26815
|
+
schema: () => schema21,
|
|
26816
|
+
meta: () => meta23,
|
|
26817
|
+
execute: () => execute21
|
|
26398
26818
|
});
|
|
26399
|
-
var
|
|
26400
|
-
var { execute:
|
|
26819
|
+
var schema21 = exports_external.object({ siteId: exports_external.string().min(1), driveId: exports_external.string().min(1) });
|
|
26820
|
+
var { execute: execute21 } = buildCommand((p) => `/sites/${p.siteId}/drives/${p.driveId}`, schema21);
|
|
26821
|
+
var meta23 = {
|
|
26822
|
+
summary: "Get the metadata of a single document library (drive) on a SharePoint site by drive ID.",
|
|
26823
|
+
category: "sharepoint",
|
|
26824
|
+
graphMethod: "GET",
|
|
26825
|
+
graphPathTemplate: "/sites/{site-id}/drives/{drive-id}",
|
|
26826
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/drive-get",
|
|
26827
|
+
options: [
|
|
26828
|
+
{ name: "site-id", key: "siteId", required: true, description: "SharePoint site ID. Returned by `ask-marcel search-sharepoint-sites`." },
|
|
26829
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Drive (document library) ID on the site. Returned by `ask-marcel list-sharepoint-site-drives`." }
|
|
26830
|
+
],
|
|
26831
|
+
example: "ask-marcel get-sharepoint-site-drive-by-id --site-id 'contoso.sharepoint.com,1234,5678' --drive-id 'b!abcd'",
|
|
26832
|
+
responseShape: "single Microsoft Graph `drive` resource"
|
|
26833
|
+
};
|
|
26401
26834
|
|
|
26402
26835
|
// src/use-cases/commands/get-sharepoint-site-list-item.ts
|
|
26403
26836
|
var exports_get_sharepoint_site_list_item = {};
|
|
26404
26837
|
__export(exports_get_sharepoint_site_list_item, {
|
|
26405
|
-
schema: () =>
|
|
26406
|
-
|
|
26838
|
+
schema: () => schema22,
|
|
26839
|
+
meta: () => meta24,
|
|
26840
|
+
execute: () => execute22
|
|
26407
26841
|
});
|
|
26408
|
-
var
|
|
26409
|
-
var { execute:
|
|
26842
|
+
var schema22 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1), listItemId: exports_external.string().min(1) });
|
|
26843
|
+
var { execute: execute22 } = buildCommand((p) => `/sites/${p.siteId}/lists/${p.listId}/items/${p.listItemId}`, schema22);
|
|
26844
|
+
var meta24 = {
|
|
26845
|
+
summary: "Get a single row (listItem) of a SharePoint list by ID.",
|
|
26846
|
+
category: "sharepoint",
|
|
26847
|
+
graphMethod: "GET",
|
|
26848
|
+
graphPathTemplate: "/sites/{site-id}/lists/{list-id}/items/{list-item-id}",
|
|
26849
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/listitem-get",
|
|
26850
|
+
options: [
|
|
26851
|
+
{ name: "site-id", key: "siteId", required: true, description: "SharePoint site ID. Returned by `ask-marcel search-sharepoint-sites`." },
|
|
26852
|
+
{ name: "list-id", key: "listId", required: true, description: "SharePoint list ID or display name. Returned by `ask-marcel list-sharepoint-site-lists`." },
|
|
26853
|
+
{ name: "list-item-id", key: "listItemId", required: true, description: "listItem ID (typically a small integer). Returned by `ask-marcel list-sharepoint-site-list-items`." }
|
|
26854
|
+
],
|
|
26855
|
+
example: "ask-marcel get-sharepoint-site-list-item --site-id 'contoso.sharepoint.com,1234,5678' --list-id 'Tasks' --list-item-id '7'",
|
|
26856
|
+
responseShape: "single Microsoft Graph `listItem` resource"
|
|
26857
|
+
};
|
|
26410
26858
|
|
|
26411
26859
|
// src/use-cases/commands/get-sharepoint-site-list.ts
|
|
26412
26860
|
var exports_get_sharepoint_site_list = {};
|
|
26413
26861
|
__export(exports_get_sharepoint_site_list, {
|
|
26414
|
-
schema: () =>
|
|
26415
|
-
|
|
26862
|
+
schema: () => schema23,
|
|
26863
|
+
meta: () => meta25,
|
|
26864
|
+
execute: () => execute23
|
|
26416
26865
|
});
|
|
26417
|
-
var
|
|
26418
|
-
var { execute:
|
|
26866
|
+
var schema23 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1) });
|
|
26867
|
+
var { execute: execute23 } = buildCommand((p) => `/sites/${p.siteId}/lists/${p.listId}`, schema23);
|
|
26868
|
+
var meta25 = {
|
|
26869
|
+
summary: "Get the metadata (display name, template, columns) of a single SharePoint list.",
|
|
26870
|
+
category: "sharepoint",
|
|
26871
|
+
graphMethod: "GET",
|
|
26872
|
+
graphPathTemplate: "/sites/{site-id}/lists/{list-id}",
|
|
26873
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/list-get",
|
|
26874
|
+
options: [
|
|
26875
|
+
{ name: "site-id", key: "siteId", required: true, description: "SharePoint site ID. Returned by `ask-marcel search-sharepoint-sites`." },
|
|
26876
|
+
{ name: "list-id", key: "listId", required: true, description: "SharePoint list ID or display name. Returned by `ask-marcel list-sharepoint-site-lists`." }
|
|
26877
|
+
],
|
|
26878
|
+
example: "ask-marcel get-sharepoint-site-list --site-id 'contoso.sharepoint.com,1234,5678' --list-id 'Documents'",
|
|
26879
|
+
responseShape: "single Microsoft Graph `list` resource"
|
|
26880
|
+
};
|
|
26419
26881
|
|
|
26420
26882
|
// src/use-cases/commands/get-sharepoint-site.ts
|
|
26421
26883
|
var exports_get_sharepoint_site = {};
|
|
26422
26884
|
__export(exports_get_sharepoint_site, {
|
|
26423
|
-
schema: () =>
|
|
26424
|
-
|
|
26425
|
-
|
|
26426
|
-
var schema31 = exports_external.object({ siteId: exports_external.string().min(1) });
|
|
26427
|
-
var { execute: execute31 } = buildCommand((p) => `/sites/${p.siteId}`, schema31);
|
|
26428
|
-
|
|
26429
|
-
// src/use-cases/commands/get-sharepoint-sites-delta.ts
|
|
26430
|
-
var exports_get_sharepoint_sites_delta = {};
|
|
26431
|
-
__export(exports_get_sharepoint_sites_delta, {
|
|
26432
|
-
schema: () => schema32,
|
|
26433
|
-
execute: () => execute32
|
|
26885
|
+
schema: () => schema24,
|
|
26886
|
+
meta: () => meta26,
|
|
26887
|
+
execute: () => execute24
|
|
26434
26888
|
});
|
|
26435
|
-
var
|
|
26436
|
-
var { execute:
|
|
26889
|
+
var schema24 = exports_external.object({ siteId: exports_external.string().min(1) });
|
|
26890
|
+
var { execute: execute24 } = buildCommand((p) => `/sites/${p.siteId}`, schema24);
|
|
26891
|
+
var meta26 = {
|
|
26892
|
+
summary: "Get the metadata of a single SharePoint site by its site ID.",
|
|
26893
|
+
category: "sharepoint",
|
|
26894
|
+
graphMethod: "GET",
|
|
26895
|
+
graphPathTemplate: "/sites/{site-id}",
|
|
26896
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/site-get",
|
|
26897
|
+
options: [
|
|
26898
|
+
{
|
|
26899
|
+
name: "site-id",
|
|
26900
|
+
key: "siteId",
|
|
26901
|
+
required: true,
|
|
26902
|
+
description: "SharePoint site ID. Either the composite ID (`hostname,site-collection-id,site-id`) returned by `ask-marcel search-sharepoint-sites`, or the literal `root` to refer to the tenant root site."
|
|
26903
|
+
}
|
|
26904
|
+
],
|
|
26905
|
+
example: "ask-marcel get-sharepoint-site --site-id 'contoso.sharepoint.com,1234,5678'",
|
|
26906
|
+
responseShape: "single Microsoft Graph `site` resource"
|
|
26907
|
+
};
|
|
26437
26908
|
|
|
26438
26909
|
// src/use-cases/commands/get-specific-calendar-event.ts
|
|
26439
26910
|
var exports_get_specific_calendar_event = {};
|
|
26440
26911
|
__export(exports_get_specific_calendar_event, {
|
|
26441
|
-
schema: () =>
|
|
26442
|
-
|
|
26912
|
+
schema: () => schema25,
|
|
26913
|
+
meta: () => meta27,
|
|
26914
|
+
execute: () => execute25
|
|
26443
26915
|
});
|
|
26444
|
-
var
|
|
26445
|
-
var { execute:
|
|
26916
|
+
var schema25 = exports_external.object({ calendarId: exports_external.string().min(1), eventId: exports_external.string().min(1) });
|
|
26917
|
+
var { execute: execute25 } = buildCommand((p) => `/me/calendars/${p.calendarId}/events/${p.eventId}`, schema25);
|
|
26918
|
+
var meta27 = {
|
|
26919
|
+
summary: "Fetch a single calendar event by ID from a specific (non-default) calendar.",
|
|
26920
|
+
category: "calendar",
|
|
26921
|
+
graphMethod: "GET",
|
|
26922
|
+
graphPathTemplate: "/me/calendars/{calendar-id}/events/{event-id}",
|
|
26923
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/event-get",
|
|
26924
|
+
options: [
|
|
26925
|
+
{ name: "calendar-id", key: "calendarId", required: true, description: "Calendar ID. Returned by `ask-marcel list-calendars`." },
|
|
26926
|
+
{ name: "event-id", key: "eventId", required: true, description: "Event ID. Returned by `ask-marcel list-specific-calendar-events`." }
|
|
26927
|
+
],
|
|
26928
|
+
example: "ask-marcel get-specific-calendar-event --calendar-id 'AAMkAGI2THVS...' --event-id 'AAMkABC...'",
|
|
26929
|
+
responseShape: "single Microsoft Graph `event` resource"
|
|
26930
|
+
};
|
|
26446
26931
|
|
|
26447
26932
|
// src/use-cases/commands/get-specific-calendar-view.ts
|
|
26448
26933
|
var exports_get_specific_calendar_view = {};
|
|
26449
26934
|
__export(exports_get_specific_calendar_view, {
|
|
26450
|
-
schema: () =>
|
|
26451
|
-
|
|
26935
|
+
schema: () => schema26,
|
|
26936
|
+
meta: () => meta28,
|
|
26937
|
+
execute: () => execute26
|
|
26452
26938
|
});
|
|
26453
|
-
var
|
|
26454
|
-
|
|
26939
|
+
var schema26 = exports_external.object({
|
|
26940
|
+
calendarId: exports_external.string().min(1),
|
|
26941
|
+
startDateTime: exports_external.string().min(1),
|
|
26942
|
+
endDateTime: exports_external.string().min(1)
|
|
26943
|
+
});
|
|
26944
|
+
var { execute: execute26 } = buildCommand((p) => `/me/calendars/${p.calendarId}/calendarView?startDateTime=${p.startDateTime}&endDateTime=${p.endDateTime}`, schema26);
|
|
26945
|
+
var meta28 = {
|
|
26946
|
+
summary: "List the events in a specific (non-default) calendar with recurrence expanded into individual occurrences in a date range. Both ISO date-time params are required by Graph.",
|
|
26947
|
+
category: "calendar",
|
|
26948
|
+
graphMethod: "GET",
|
|
26949
|
+
graphPathTemplate: "/me/calendars/{calendar-id}/calendarView?startDateTime={start-date-time}&endDateTime={end-date-time}",
|
|
26950
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/calendar-list-calendarview",
|
|
26951
|
+
options: [
|
|
26952
|
+
{ name: "calendar-id", key: "calendarId", required: true, description: "Calendar ID. Returned by `ask-marcel list-calendars`." },
|
|
26953
|
+
{
|
|
26954
|
+
name: "start-date-time",
|
|
26955
|
+
key: "startDateTime",
|
|
26956
|
+
required: true,
|
|
26957
|
+
description: "ISO 8601 lower bound (UTC). Example: `2026-04-01T00:00:00Z`. Required by Graph; the request fails without it."
|
|
26958
|
+
},
|
|
26959
|
+
{
|
|
26960
|
+
name: "end-date-time",
|
|
26961
|
+
key: "endDateTime",
|
|
26962
|
+
required: true,
|
|
26963
|
+
description: "ISO 8601 upper bound (UTC). Example: `2026-05-01T00:00:00Z`. Required by Graph; the request fails without it."
|
|
26964
|
+
}
|
|
26965
|
+
],
|
|
26966
|
+
example: "ask-marcel get-specific-calendar-view --calendar-id 'AAMkAGI2THVS...' --start-date-time '2026-04-01T00:00:00Z' --end-date-time '2026-05-01T00:00:00Z'",
|
|
26967
|
+
responseShape: "collection of Microsoft Graph `event` resources (single occurrences) under `value[]`"
|
|
26968
|
+
};
|
|
26455
26969
|
|
|
26456
26970
|
// src/use-cases/commands/get-team-channel.ts
|
|
26457
26971
|
var exports_get_team_channel = {};
|
|
26458
26972
|
__export(exports_get_team_channel, {
|
|
26459
|
-
schema: () =>
|
|
26460
|
-
|
|
26973
|
+
schema: () => schema27,
|
|
26974
|
+
meta: () => meta29,
|
|
26975
|
+
execute: () => execute27
|
|
26461
26976
|
});
|
|
26462
|
-
var
|
|
26463
|
-
var { execute:
|
|
26977
|
+
var schema27 = exports_external.object({ teamId: exports_external.string().min(1), channelId: exports_external.string().min(1) });
|
|
26978
|
+
var { execute: execute27 } = buildCommand((p) => `/teams/${p.teamId}/channels/${p.channelId}`, schema27);
|
|
26979
|
+
var meta29 = {
|
|
26980
|
+
summary: "Get the metadata of a single channel inside a Microsoft Team.",
|
|
26981
|
+
category: "teams",
|
|
26982
|
+
graphMethod: "GET",
|
|
26983
|
+
graphPathTemplate: "/teams/{team-id}/channels/{channel-id}",
|
|
26984
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/channel-get",
|
|
26985
|
+
options: [
|
|
26986
|
+
{ name: "team-id", key: "teamId", required: true, description: "Microsoft Teams team ID. Returned by `ask-marcel list-joined-teams`." },
|
|
26987
|
+
{ name: "channel-id", key: "channelId", required: true, description: "Channel ID. Returned by `ask-marcel list-team-channels`." }
|
|
26988
|
+
],
|
|
26989
|
+
example: "ask-marcel get-team-channel --team-id 'abc-1234-...' --channel-id '19:def@thread.tacv2'",
|
|
26990
|
+
responseShape: "single Microsoft Graph `channel` resource"
|
|
26991
|
+
};
|
|
26464
26992
|
|
|
26465
26993
|
// src/use-cases/commands/get-team.ts
|
|
26466
26994
|
var exports_get_team = {};
|
|
26467
26995
|
__export(exports_get_team, {
|
|
26468
|
-
schema: () =>
|
|
26469
|
-
|
|
26996
|
+
schema: () => schema28,
|
|
26997
|
+
meta: () => meta30,
|
|
26998
|
+
execute: () => execute28
|
|
26470
26999
|
});
|
|
26471
|
-
var
|
|
26472
|
-
var { execute:
|
|
27000
|
+
var schema28 = exports_external.object({ teamId: exports_external.string().min(1) });
|
|
27001
|
+
var { execute: execute28 } = buildCommand((p) => `/teams/${p.teamId}`, schema28);
|
|
27002
|
+
var meta30 = {
|
|
27003
|
+
summary: "Get the metadata of a single Microsoft Team (display name, settings, member-settings, owner group).",
|
|
27004
|
+
category: "teams",
|
|
27005
|
+
graphMethod: "GET",
|
|
27006
|
+
graphPathTemplate: "/teams/{team-id}",
|
|
27007
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/team-get",
|
|
27008
|
+
options: [{ name: "team-id", key: "teamId", required: true, description: "Microsoft Teams team ID. Returned by `ask-marcel list-joined-teams`." }],
|
|
27009
|
+
example: "ask-marcel get-team --team-id 'abc-1234-...'",
|
|
27010
|
+
responseShape: "single Microsoft Graph `team` resource"
|
|
27011
|
+
};
|
|
26473
27012
|
|
|
26474
27013
|
// src/use-cases/commands/get-todo-task.ts
|
|
26475
27014
|
var exports_get_todo_task = {};
|
|
26476
27015
|
__export(exports_get_todo_task, {
|
|
26477
|
-
schema: () =>
|
|
26478
|
-
|
|
27016
|
+
schema: () => schema29,
|
|
27017
|
+
meta: () => meta31,
|
|
27018
|
+
execute: () => execute29
|
|
26479
27019
|
});
|
|
26480
|
-
var
|
|
26481
|
-
var { execute:
|
|
27020
|
+
var schema29 = exports_external.object({ todoTaskListId: exports_external.string().min(1), todoTaskId: exports_external.string().min(1) });
|
|
27021
|
+
var { execute: execute29 } = buildCommand((p) => `/me/todo/lists/${p.todoTaskListId}/tasks/${p.todoTaskId}`, schema29);
|
|
27022
|
+
var meta31 = {
|
|
27023
|
+
summary: "Get a single Microsoft To Do task by its ID and its parent list ID.",
|
|
27024
|
+
category: "tasks",
|
|
27025
|
+
graphMethod: "GET",
|
|
27026
|
+
graphPathTemplate: "/me/todo/lists/{todo-task-list-id}/tasks/{todo-task-id}",
|
|
27027
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/todotask-get",
|
|
27028
|
+
options: [
|
|
27029
|
+
{ name: "todo-task-list-id", key: "todoTaskListId", required: true, description: "To Do task list ID. Returned by `ask-marcel list-todo-task-lists`." },
|
|
27030
|
+
{ name: "todo-task-id", key: "todoTaskId", required: true, description: "To Do task ID. Returned by `ask-marcel list-todo-tasks`." }
|
|
27031
|
+
],
|
|
27032
|
+
example: "ask-marcel get-todo-task --todo-task-list-id 'AAMkAGI...' --todo-task-id 'AAMkABC...'",
|
|
27033
|
+
responseShape: "single Microsoft Graph `todoTask` resource"
|
|
27034
|
+
};
|
|
26482
27035
|
|
|
26483
27036
|
// src/use-cases/commands/list-all-onenote-sections.ts
|
|
26484
27037
|
var exports_list_all_onenote_sections = {};
|
|
26485
27038
|
__export(exports_list_all_onenote_sections, {
|
|
26486
|
-
schema: () =>
|
|
26487
|
-
|
|
27039
|
+
schema: () => schema30,
|
|
27040
|
+
meta: () => meta32,
|
|
27041
|
+
execute: () => execute30
|
|
26488
27042
|
});
|
|
26489
|
-
var
|
|
26490
|
-
var { execute:
|
|
27043
|
+
var schema30 = exports_external.object({}).strict();
|
|
27044
|
+
var { execute: execute30 } = buildCommand(() => "/me/onenote/sections", schema30);
|
|
27045
|
+
var meta32 = {
|
|
27046
|
+
summary: "List every OneNote section the signed-in user can see, across all notebooks.",
|
|
27047
|
+
category: "notes",
|
|
27048
|
+
graphMethod: "GET",
|
|
27049
|
+
graphPathTemplate: "/me/onenote/sections",
|
|
27050
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/onenote-list-sections",
|
|
27051
|
+
options: [],
|
|
27052
|
+
example: "ask-marcel list-all-onenote-sections",
|
|
27053
|
+
responseShape: "collection of Microsoft Graph `onenoteSection` resources under `value[]`"
|
|
27054
|
+
};
|
|
26491
27055
|
|
|
26492
27056
|
// src/use-cases/commands/list-calendar-event-instances.ts
|
|
26493
27057
|
var exports_list_calendar_event_instances = {};
|
|
26494
27058
|
__export(exports_list_calendar_event_instances, {
|
|
26495
|
-
schema: () =>
|
|
26496
|
-
|
|
27059
|
+
schema: () => schema31,
|
|
27060
|
+
meta: () => meta33,
|
|
27061
|
+
execute: () => execute31
|
|
26497
27062
|
});
|
|
26498
|
-
var
|
|
26499
|
-
|
|
27063
|
+
var schema31 = exports_external.object({
|
|
27064
|
+
calendarId: exports_external.string().min(1),
|
|
27065
|
+
eventId: exports_external.string().min(1),
|
|
27066
|
+
startDateTime: exports_external.string().min(1),
|
|
27067
|
+
endDateTime: exports_external.string().min(1)
|
|
27068
|
+
});
|
|
27069
|
+
var { execute: execute31 } = buildCommand((p) => `/me/calendars/${p.calendarId}/events/${p.eventId}/instances?startDateTime=${p.startDateTime}&endDateTime=${p.endDateTime}`, schema31);
|
|
27070
|
+
var meta33 = {
|
|
27071
|
+
summary: "List the individual occurrences of a recurring calendar event over a date range. Both ISO date-time params are required by Graph.",
|
|
27072
|
+
category: "calendar",
|
|
27073
|
+
graphMethod: "GET",
|
|
27074
|
+
graphPathTemplate: "/me/calendars/{calendar-id}/events/{event-id}/instances?startDateTime={start-date-time}&endDateTime={end-date-time}",
|
|
27075
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/event-list-instances",
|
|
27076
|
+
options: [
|
|
27077
|
+
{ name: "calendar-id", key: "calendarId", required: true, description: "Calendar ID. Returned by `ask-marcel list-calendars`." },
|
|
27078
|
+
{ name: "event-id", key: "eventId", required: true, description: "Recurring event ID. Returned by `ask-marcel list-specific-calendar-events`." },
|
|
27079
|
+
{
|
|
27080
|
+
name: "start-date-time",
|
|
27081
|
+
key: "startDateTime",
|
|
27082
|
+
required: true,
|
|
27083
|
+
description: "ISO 8601 lower bound (UTC). Example: `2026-04-01T00:00:00Z`. Required by Graph; the request fails without it."
|
|
27084
|
+
},
|
|
27085
|
+
{
|
|
27086
|
+
name: "end-date-time",
|
|
27087
|
+
key: "endDateTime",
|
|
27088
|
+
required: true,
|
|
27089
|
+
description: "ISO 8601 upper bound (UTC). Example: `2026-05-01T00:00:00Z`. Required by Graph; the request fails without it."
|
|
27090
|
+
}
|
|
27091
|
+
],
|
|
27092
|
+
example: "ask-marcel list-calendar-event-instances --calendar-id 'AAMkAGI2THVS...' --event-id 'AAMkABC...' --start-date-time '2026-04-01T00:00:00Z' --end-date-time '2026-05-01T00:00:00Z'",
|
|
27093
|
+
responseShape: "collection of Microsoft Graph `event` resources (single occurrences) under `value[]`"
|
|
27094
|
+
};
|
|
26500
27095
|
|
|
26501
27096
|
// src/use-cases/commands/list-calendar-events-delta.ts
|
|
26502
27097
|
var exports_list_calendar_events_delta = {};
|
|
26503
27098
|
__export(exports_list_calendar_events_delta, {
|
|
26504
|
-
schema: () =>
|
|
26505
|
-
|
|
27099
|
+
schema: () => schema32,
|
|
27100
|
+
meta: () => meta34,
|
|
27101
|
+
execute: () => execute32
|
|
26506
27102
|
});
|
|
26507
|
-
var
|
|
26508
|
-
var { execute:
|
|
27103
|
+
var schema32 = exports_external.object({}).strict();
|
|
27104
|
+
var { execute: execute32 } = buildCommand(() => "/me/events/delta()", schema32);
|
|
27105
|
+
var meta34 = {
|
|
27106
|
+
summary: "Get the incremental change set (added / modified / deleted events) for the signed-in user’s default calendar. Use the `@odata.deltaLink` from a previous response to resume.",
|
|
27107
|
+
category: "calendar",
|
|
27108
|
+
graphMethod: "GET",
|
|
27109
|
+
graphPathTemplate: "/me/events/delta()",
|
|
27110
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/event-delta",
|
|
27111
|
+
options: [],
|
|
27112
|
+
example: "ask-marcel list-calendar-events-delta",
|
|
27113
|
+
responseShape: "collection of changed Microsoft Graph `event` resources under `value[]` plus an `@odata.deltaLink` token"
|
|
27114
|
+
};
|
|
26509
27115
|
|
|
26510
27116
|
// src/use-cases/commands/list-calendar-events.ts
|
|
26511
27117
|
var exports_list_calendar_events = {};
|
|
26512
27118
|
__export(exports_list_calendar_events, {
|
|
26513
|
-
schema: () =>
|
|
26514
|
-
|
|
27119
|
+
schema: () => schema33,
|
|
27120
|
+
meta: () => meta35,
|
|
27121
|
+
execute: () => execute33
|
|
26515
27122
|
});
|
|
26516
|
-
var
|
|
26517
|
-
var { execute:
|
|
27123
|
+
var schema33 = exports_external.object({}).strict();
|
|
27124
|
+
var { execute: execute33 } = buildCommand(() => "/me/events", schema33);
|
|
27125
|
+
var meta35 = {
|
|
27126
|
+
summary: "List the events in the signed-in user’s default calendar (does not expand recurrences).",
|
|
27127
|
+
category: "calendar",
|
|
27128
|
+
graphMethod: "GET",
|
|
27129
|
+
graphPathTemplate: "/me/events",
|
|
27130
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-events",
|
|
27131
|
+
options: [],
|
|
27132
|
+
example: "ask-marcel list-calendar-events",
|
|
27133
|
+
responseShape: "collection of Microsoft Graph `event` resources under `value[]`"
|
|
27134
|
+
};
|
|
26518
27135
|
|
|
26519
27136
|
// src/use-cases/commands/list-calendar-view-delta.ts
|
|
26520
27137
|
var exports_list_calendar_view_delta = {};
|
|
26521
27138
|
__export(exports_list_calendar_view_delta, {
|
|
26522
|
-
schema: () =>
|
|
26523
|
-
|
|
27139
|
+
schema: () => schema34,
|
|
27140
|
+
meta: () => meta36,
|
|
27141
|
+
execute: () => execute34
|
|
26524
27142
|
});
|
|
26525
|
-
var
|
|
26526
|
-
|
|
27143
|
+
var schema34 = exports_external.object({
|
|
27144
|
+
startDateTime: exports_external.string().min(1),
|
|
27145
|
+
endDateTime: exports_external.string().min(1)
|
|
27146
|
+
});
|
|
27147
|
+
var { execute: execute34 } = buildCommand((p) => `/me/calendarView/delta()?startDateTime=${p.startDateTime}&endDateTime=${p.endDateTime}`, schema34);
|
|
27148
|
+
var meta36 = {
|
|
27149
|
+
summary: "Get the first page of the incremental change set of expanded calendar-view occurrences over a date range. Subsequent pages: feed the returned `@odata.nextLink` to `next-page`; resume later via the `@odata.deltaLink`.",
|
|
27150
|
+
category: "calendar",
|
|
27151
|
+
graphMethod: "GET",
|
|
27152
|
+
graphPathTemplate: "/me/calendarView/delta()?startDateTime={start-date-time}&endDateTime={end-date-time}",
|
|
27153
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/event-delta",
|
|
27154
|
+
options: [
|
|
27155
|
+
{
|
|
27156
|
+
name: "start-date-time",
|
|
27157
|
+
key: "startDateTime",
|
|
27158
|
+
required: true,
|
|
27159
|
+
description: "ISO 8601 lower bound (UTC). Required on the first call only — the deltaLink token encodes it for resumes."
|
|
27160
|
+
},
|
|
27161
|
+
{
|
|
27162
|
+
name: "end-date-time",
|
|
27163
|
+
key: "endDateTime",
|
|
27164
|
+
required: true,
|
|
27165
|
+
description: "ISO 8601 upper bound (UTC). Required on the first call only — the deltaLink token encodes it for resumes."
|
|
27166
|
+
}
|
|
27167
|
+
],
|
|
27168
|
+
example: "ask-marcel list-calendar-view-delta --start-date-time '2026-04-01T00:00:00Z' --end-date-time '2026-05-01T00:00:00Z'",
|
|
27169
|
+
responseShape: "collection of changed Microsoft Graph `event` occurrences under `value[]` plus an `@odata.deltaLink` token"
|
|
27170
|
+
};
|
|
26527
27171
|
|
|
26528
27172
|
// src/use-cases/commands/list-calendars.ts
|
|
26529
27173
|
var exports_list_calendars = {};
|
|
26530
27174
|
__export(exports_list_calendars, {
|
|
26531
|
-
schema: () =>
|
|
26532
|
-
|
|
26533
|
-
|
|
26534
|
-
var schema43 = exports_external.object({}).strict();
|
|
26535
|
-
var { execute: execute43 } = buildCommand(() => "/me/calendars", schema43);
|
|
26536
|
-
|
|
26537
|
-
// src/use-cases/commands/list-channel-message-hosted-contents.ts
|
|
26538
|
-
var exports_list_channel_message_hosted_contents = {};
|
|
26539
|
-
__export(exports_list_channel_message_hosted_contents, {
|
|
26540
|
-
schema: () => schema44,
|
|
26541
|
-
execute: () => execute44
|
|
26542
|
-
});
|
|
26543
|
-
var schema44 = exports_external.object({ teamId: exports_external.string().min(1), channelId: exports_external.string().min(1), chatMessageId: exports_external.string().min(1) });
|
|
26544
|
-
var { execute: execute44 } = buildCommand((p) => `/teams/${p.teamId}/channels/${p.channelId}/messages/${p.chatMessageId}/hostedContents`, schema44);
|
|
26545
|
-
|
|
26546
|
-
// src/use-cases/commands/list-channel-message-replies.ts
|
|
26547
|
-
var exports_list_channel_message_replies = {};
|
|
26548
|
-
__export(exports_list_channel_message_replies, {
|
|
26549
|
-
schema: () => schema45,
|
|
26550
|
-
execute: () => execute45
|
|
26551
|
-
});
|
|
26552
|
-
var schema45 = exports_external.object({ teamId: exports_external.string().min(1), channelId: exports_external.string().min(1), chatMessageId: exports_external.string().min(1) });
|
|
26553
|
-
var { execute: execute45 } = buildCommand((p) => `/teams/${p.teamId}/channels/${p.channelId}/messages/${p.chatMessageId}/replies`, schema45);
|
|
26554
|
-
|
|
26555
|
-
// src/use-cases/commands/list-channel-messages.ts
|
|
26556
|
-
var exports_list_channel_messages = {};
|
|
26557
|
-
__export(exports_list_channel_messages, {
|
|
26558
|
-
schema: () => schema46,
|
|
26559
|
-
execute: () => execute46
|
|
26560
|
-
});
|
|
26561
|
-
var schema46 = exports_external.object({ teamId: exports_external.string().min(1), channelId: exports_external.string().min(1) });
|
|
26562
|
-
var { execute: execute46 } = buildCommand((p) => `/teams/${p.teamId}/channels/${p.channelId}/messages`, schema46);
|
|
26563
|
-
|
|
26564
|
-
// src/use-cases/commands/list-channel-tabs.ts
|
|
26565
|
-
var exports_list_channel_tabs = {};
|
|
26566
|
-
__export(exports_list_channel_tabs, {
|
|
26567
|
-
schema: () => schema47,
|
|
26568
|
-
execute: () => execute47
|
|
27175
|
+
schema: () => schema35,
|
|
27176
|
+
meta: () => meta37,
|
|
27177
|
+
execute: () => execute35
|
|
26569
27178
|
});
|
|
26570
|
-
var
|
|
26571
|
-
var { execute:
|
|
27179
|
+
var schema35 = exports_external.object({}).strict();
|
|
27180
|
+
var { execute: execute35 } = buildCommand(() => "/me/calendars", schema35);
|
|
27181
|
+
var meta37 = {
|
|
27182
|
+
summary: "List the calendars in the signed-in user’s mailbox (default + secondary calendars + shared calendars).",
|
|
27183
|
+
category: "calendar",
|
|
27184
|
+
graphMethod: "GET",
|
|
27185
|
+
graphPathTemplate: "/me/calendars",
|
|
27186
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-calendars",
|
|
27187
|
+
options: [],
|
|
27188
|
+
example: "ask-marcel list-calendars",
|
|
27189
|
+
responseShape: "collection of Microsoft Graph `calendar` resources under `value[]`"
|
|
27190
|
+
};
|
|
26572
27191
|
|
|
26573
27192
|
// src/use-cases/commands/list-chat-members.ts
|
|
26574
27193
|
var exports_list_chat_members = {};
|
|
26575
27194
|
__export(exports_list_chat_members, {
|
|
26576
|
-
schema: () =>
|
|
26577
|
-
|
|
26578
|
-
|
|
26579
|
-
var schema48 = exports_external.object({ chatId: exports_external.string().min(1) });
|
|
26580
|
-
var { execute: execute48 } = buildCommand((p) => `/chats/${p.chatId}/members`, schema48);
|
|
26581
|
-
|
|
26582
|
-
// src/use-cases/commands/list-chat-message-hosted-contents.ts
|
|
26583
|
-
var exports_list_chat_message_hosted_contents = {};
|
|
26584
|
-
__export(exports_list_chat_message_hosted_contents, {
|
|
26585
|
-
schema: () => schema49,
|
|
26586
|
-
execute: () => execute49
|
|
26587
|
-
});
|
|
26588
|
-
var schema49 = exports_external.object({ chatId: exports_external.string().min(1), chatMessageId: exports_external.string().min(1) });
|
|
26589
|
-
var { execute: execute49 } = buildCommand((p) => `/chats/${p.chatId}/messages/${p.chatMessageId}/hostedContents`, schema49);
|
|
26590
|
-
|
|
26591
|
-
// src/use-cases/commands/list-chat-message-replies.ts
|
|
26592
|
-
var exports_list_chat_message_replies = {};
|
|
26593
|
-
__export(exports_list_chat_message_replies, {
|
|
26594
|
-
schema: () => schema50,
|
|
26595
|
-
execute: () => execute50
|
|
26596
|
-
});
|
|
26597
|
-
var schema50 = exports_external.object({ chatId: exports_external.string().min(1), chatMessageId: exports_external.string().min(1) });
|
|
26598
|
-
var { execute: execute50 } = buildCommand((p) => `/chats/${p.chatId}/messages/${p.chatMessageId}/replies`, schema50);
|
|
26599
|
-
|
|
26600
|
-
// src/use-cases/commands/list-chat-messages.ts
|
|
26601
|
-
var exports_list_chat_messages = {};
|
|
26602
|
-
__export(exports_list_chat_messages, {
|
|
26603
|
-
schema: () => schema51,
|
|
26604
|
-
execute: () => execute51
|
|
26605
|
-
});
|
|
26606
|
-
var schema51 = exports_external.object({ chatId: exports_external.string().min(1) });
|
|
26607
|
-
var { execute: execute51 } = buildCommand((p) => `/chats/${p.chatId}/messages`, schema51);
|
|
26608
|
-
|
|
26609
|
-
// src/use-cases/commands/list-chats.ts
|
|
26610
|
-
var exports_list_chats = {};
|
|
26611
|
-
__export(exports_list_chats, {
|
|
26612
|
-
schema: () => schema52,
|
|
26613
|
-
execute: () => execute52
|
|
27195
|
+
schema: () => schema36,
|
|
27196
|
+
meta: () => meta38,
|
|
27197
|
+
execute: () => execute36
|
|
26614
27198
|
});
|
|
26615
|
-
var
|
|
26616
|
-
var { execute:
|
|
27199
|
+
var schema36 = exports_external.object({ chatId: exports_external.string().min(1) });
|
|
27200
|
+
var { execute: execute36 } = buildCommand((p) => `/chats/${p.chatId}/members`, schema36);
|
|
27201
|
+
var meta38 = {
|
|
27202
|
+
summary: "List the members of a single Microsoft Teams chat.",
|
|
27203
|
+
category: "chats",
|
|
27204
|
+
graphMethod: "GET",
|
|
27205
|
+
graphPathTemplate: "/chats/{chat-id}/members",
|
|
27206
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/chat-list-members",
|
|
27207
|
+
options: [
|
|
27208
|
+
{
|
|
27209
|
+
name: "chat-id",
|
|
27210
|
+
key: "chatId",
|
|
27211
|
+
required: true,
|
|
27212
|
+
description: "Microsoft Teams chat ID, e.g. `19:abc...@thread.v2`. " + "This CLI does not list chats (the Teams web client token has no `Chat.Read*` scope), so the chat ID has to come from outside. " + "Easiest source from inside this CLI: pick any Teams meeting from `list-calendar-events` and URL-decode the " + "`19%3ameeting_...%40thread.v2` segment of its `onlineMeeting.joinUrl`. " + "Other sources: the Teams desktop / web client (Open in browser → URL contains the chat thread ID), Microsoft Graph Explorer, or Power Automate."
|
|
27213
|
+
}
|
|
27214
|
+
],
|
|
27215
|
+
example: "ask-marcel list-chat-members --chat-id '19:abc...@thread.v2'",
|
|
27216
|
+
responseShape: "collection of Microsoft Graph `conversationMember` resources under `value[]`"
|
|
27217
|
+
};
|
|
26617
27218
|
|
|
26618
27219
|
// src/use-cases/commands/list-drive-item-permissions.ts
|
|
26619
27220
|
var exports_list_drive_item_permissions = {};
|
|
26620
27221
|
__export(exports_list_drive_item_permissions, {
|
|
26621
|
-
schema: () =>
|
|
26622
|
-
|
|
27222
|
+
schema: () => schema37,
|
|
27223
|
+
meta: () => meta39,
|
|
27224
|
+
execute: () => execute37
|
|
26623
27225
|
});
|
|
26624
|
-
var
|
|
26625
|
-
var { execute:
|
|
27226
|
+
var schema37 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
27227
|
+
var { execute: execute37 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/permissions`, schema37);
|
|
27228
|
+
var meta39 = {
|
|
27229
|
+
summary: "List the sharing permissions on a OneDrive / SharePoint file or folder.",
|
|
27230
|
+
category: "drive",
|
|
27231
|
+
graphMethod: "GET",
|
|
27232
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/permissions",
|
|
27233
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-list-permissions",
|
|
27234
|
+
options: [
|
|
27235
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID. Returned by `ask-marcel list-drives`." },
|
|
27236
|
+
{
|
|
27237
|
+
name: "item-id",
|
|
27238
|
+
key: "itemId",
|
|
27239
|
+
required: true,
|
|
27240
|
+
description: "driveItem ID of the file or folder. Returned by `list-folder-files`, `search-onedrive-files`, or `get-drive-item`."
|
|
27241
|
+
}
|
|
27242
|
+
],
|
|
27243
|
+
example: "ask-marcel list-drive-item-permissions --drive-id 'b!1234' --item-id '01ABC'",
|
|
27244
|
+
responseShape: "collection of Microsoft Graph `permission` resources under `value[]`"
|
|
27245
|
+
};
|
|
26626
27246
|
|
|
26627
27247
|
// src/use-cases/commands/list-drive-item-versions.ts
|
|
26628
27248
|
var exports_list_drive_item_versions = {};
|
|
26629
27249
|
__export(exports_list_drive_item_versions, {
|
|
26630
|
-
schema: () =>
|
|
26631
|
-
|
|
27250
|
+
schema: () => schema38,
|
|
27251
|
+
meta: () => meta40,
|
|
27252
|
+
execute: () => execute38
|
|
26632
27253
|
});
|
|
26633
|
-
var
|
|
26634
|
-
var { execute:
|
|
27254
|
+
var schema38 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
27255
|
+
var { execute: execute38 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/versions`, schema38);
|
|
27256
|
+
var meta40 = {
|
|
27257
|
+
summary: "List the historical versions of a OneDrive / SharePoint file (each save creates a new version).",
|
|
27258
|
+
category: "drive",
|
|
27259
|
+
graphMethod: "GET",
|
|
27260
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/versions",
|
|
27261
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-list-versions",
|
|
27262
|
+
options: [
|
|
27263
|
+
{
|
|
27264
|
+
name: "drive-id",
|
|
27265
|
+
key: "driveId",
|
|
27266
|
+
required: true,
|
|
27267
|
+
description: "Microsoft Graph drive ID. Use `ask-marcel list-drives` for the personal OneDrive, " + "or `ask-marcel list-sharepoint-site-drives --site-id <id>` for a SharePoint document library."
|
|
27268
|
+
},
|
|
27269
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the file. Returned by `list-folder-files` or `search-onedrive-files`." }
|
|
27270
|
+
],
|
|
27271
|
+
example: "ask-marcel list-drive-item-versions --drive-id 'b!1234' --item-id '01ABC'",
|
|
27272
|
+
responseShape: "collection of Microsoft Graph `driveItemVersion` resources under `value[]`"
|
|
27273
|
+
};
|
|
26635
27274
|
|
|
26636
27275
|
// src/use-cases/commands/list-drives.ts
|
|
26637
27276
|
var exports_list_drives = {};
|
|
26638
27277
|
__export(exports_list_drives, {
|
|
26639
|
-
schema: () =>
|
|
26640
|
-
|
|
27278
|
+
schema: () => schema39,
|
|
27279
|
+
meta: () => meta41,
|
|
27280
|
+
execute: () => execute39
|
|
26641
27281
|
});
|
|
26642
|
-
var
|
|
26643
|
-
var { execute:
|
|
27282
|
+
var schema39 = exports_external.object({}).strict();
|
|
27283
|
+
var { execute: execute39 } = buildCommand(() => "/me/drives", schema39);
|
|
27284
|
+
var meta41 = {
|
|
27285
|
+
summary: "List all OneDrive / SharePoint drives the signed-in user has access to.",
|
|
27286
|
+
category: "drive",
|
|
27287
|
+
graphMethod: "GET",
|
|
27288
|
+
graphPathTemplate: "/me/drives",
|
|
27289
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/drive-list",
|
|
27290
|
+
options: [],
|
|
27291
|
+
example: "ask-marcel list-drives",
|
|
27292
|
+
responseShape: "collection of Microsoft Graph `drive` resources under `value[]`"
|
|
27293
|
+
};
|
|
26644
27294
|
|
|
26645
27295
|
// src/use-cases/commands/list-excel-table-rows.ts
|
|
26646
27296
|
var exports_list_excel_table_rows = {};
|
|
26647
27297
|
__export(exports_list_excel_table_rows, {
|
|
26648
|
-
schema: () =>
|
|
26649
|
-
|
|
27298
|
+
schema: () => schema40,
|
|
27299
|
+
meta: () => meta42,
|
|
27300
|
+
execute: () => execute40
|
|
26650
27301
|
});
|
|
26651
|
-
var
|
|
26652
|
-
var { execute:
|
|
27302
|
+
var schema40 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1), tableId: exports_external.string().min(1) });
|
|
27303
|
+
var { execute: execute40 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/workbook/tables/${p.tableId}/rows`, schema40);
|
|
27304
|
+
var meta42 = {
|
|
27305
|
+
summary: "List the data rows of a named Excel table (excluding the header row).",
|
|
27306
|
+
category: "excel",
|
|
27307
|
+
graphMethod: "GET",
|
|
27308
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/rows",
|
|
27309
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/workbooktable-list-rows",
|
|
27310
|
+
options: [
|
|
27311
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID containing the workbook. Returned by `ask-marcel list-drives`." },
|
|
27312
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the .xlsx file." },
|
|
27313
|
+
{ name: "table-id", key: "tableId", required: true, description: "Workbook table ID or table name. Returned by `ask-marcel list-excel-tables`." }
|
|
27314
|
+
],
|
|
27315
|
+
example: "ask-marcel list-excel-table-rows --drive-id 'b!1234' --item-id '01XLSX' --table-id 'Table1'",
|
|
27316
|
+
responseShape: "collection of Microsoft Graph `workbookTableRow` resources (each `values` is a 2D array) under `value[]`"
|
|
27317
|
+
};
|
|
26653
27318
|
|
|
26654
27319
|
// src/use-cases/commands/list-excel-tables.ts
|
|
26655
27320
|
var exports_list_excel_tables = {};
|
|
26656
27321
|
__export(exports_list_excel_tables, {
|
|
26657
|
-
schema: () =>
|
|
26658
|
-
|
|
27322
|
+
schema: () => schema41,
|
|
27323
|
+
meta: () => meta43,
|
|
27324
|
+
execute: () => execute41
|
|
26659
27325
|
});
|
|
26660
|
-
var
|
|
26661
|
-
var { execute:
|
|
27326
|
+
var schema41 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
27327
|
+
var { execute: execute41 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/workbook/tables`, schema41);
|
|
27328
|
+
var meta43 = {
|
|
27329
|
+
summary: "List the named tables across every worksheet in an Excel workbook.",
|
|
27330
|
+
category: "excel",
|
|
27331
|
+
graphMethod: "GET",
|
|
27332
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/workbook/tables",
|
|
27333
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/workbook-list-tables",
|
|
27334
|
+
options: [
|
|
27335
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID containing the workbook. Returned by `ask-marcel list-drives`." },
|
|
27336
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the .xlsx file. Returned by `list-folder-files` or `search-onedrive-files`." }
|
|
27337
|
+
],
|
|
27338
|
+
example: "ask-marcel list-excel-tables --drive-id 'b!1234' --item-id '01XLSX'",
|
|
27339
|
+
responseShape: "collection of Microsoft Graph `workbookTable` resources under `value[]`"
|
|
27340
|
+
};
|
|
26662
27341
|
|
|
26663
27342
|
// src/use-cases/commands/list-excel-worksheets.ts
|
|
26664
27343
|
var exports_list_excel_worksheets = {};
|
|
26665
27344
|
__export(exports_list_excel_worksheets, {
|
|
26666
|
-
schema: () =>
|
|
26667
|
-
|
|
27345
|
+
schema: () => schema42,
|
|
27346
|
+
meta: () => meta44,
|
|
27347
|
+
execute: () => execute42
|
|
26668
27348
|
});
|
|
26669
|
-
var
|
|
26670
|
-
var { execute:
|
|
27349
|
+
var schema42 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
27350
|
+
var { execute: execute42 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/workbook/worksheets`, schema42);
|
|
27351
|
+
var meta44 = {
|
|
27352
|
+
summary: "List the worksheets (tabs) inside an Excel workbook stored in OneDrive / SharePoint.",
|
|
27353
|
+
category: "excel",
|
|
27354
|
+
graphMethod: "GET",
|
|
27355
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/workbook/worksheets",
|
|
27356
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/workbook-list-worksheets",
|
|
27357
|
+
options: [
|
|
27358
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID containing the workbook. Returned by `ask-marcel list-drives`." },
|
|
27359
|
+
{ name: "item-id", key: "itemId", required: true, description: "driveItem ID of the .xlsx file. Returned by `list-folder-files` or `search-onedrive-files`." }
|
|
27360
|
+
],
|
|
27361
|
+
example: "ask-marcel list-excel-worksheets --drive-id 'b!1234' --item-id '01XLSX'",
|
|
27362
|
+
responseShape: "collection of Microsoft Graph `worksheet` resources under `value[]`"
|
|
27363
|
+
};
|
|
26671
27364
|
|
|
26672
27365
|
// src/use-cases/commands/list-folder-files.ts
|
|
26673
27366
|
var exports_list_folder_files = {};
|
|
26674
27367
|
__export(exports_list_folder_files, {
|
|
26675
|
-
schema: () =>
|
|
26676
|
-
|
|
27368
|
+
schema: () => schema43,
|
|
27369
|
+
meta: () => meta45,
|
|
27370
|
+
execute: () => execute43
|
|
27371
|
+
});
|
|
27372
|
+
var schema43 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1) });
|
|
27373
|
+
var { execute: execute43 } = buildCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/children`, schema43);
|
|
27374
|
+
var meta45 = {
|
|
27375
|
+
summary: "List the children (files and subfolders) of a folder in OneDrive / SharePoint.",
|
|
27376
|
+
category: "drive",
|
|
27377
|
+
graphMethod: "GET",
|
|
27378
|
+
graphPathTemplate: "/drives/{drive-id}/items/{item-id}/children",
|
|
27379
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-list-children",
|
|
27380
|
+
options: [
|
|
27381
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID. Returned by `ask-marcel list-drives`." },
|
|
27382
|
+
{
|
|
27383
|
+
name: "item-id",
|
|
27384
|
+
key: "itemId",
|
|
27385
|
+
required: true,
|
|
27386
|
+
description: "driveItem ID of the folder. Use the root folder ID from `ask-marcel get-drive-root-item` to list the top of a drive."
|
|
27387
|
+
}
|
|
27388
|
+
],
|
|
27389
|
+
example: "ask-marcel list-folder-files --drive-id 'b!1234' --item-id '01ROOT'",
|
|
27390
|
+
responseShape: "collection of Microsoft Graph `driveItem` resources under `value[]`"
|
|
27391
|
+
};
|
|
27392
|
+
|
|
27393
|
+
// src/use-cases/commands/list-incomplete-planner-tasks.ts
|
|
27394
|
+
var exports_list_incomplete_planner_tasks = {};
|
|
27395
|
+
__export(exports_list_incomplete_planner_tasks, {
|
|
27396
|
+
schema: () => schema44,
|
|
27397
|
+
meta: () => meta46,
|
|
27398
|
+
execute: () => execute44
|
|
26677
27399
|
});
|
|
26678
|
-
var
|
|
26679
|
-
var { execute:
|
|
27400
|
+
var schema44 = exports_external.object({}).strict();
|
|
27401
|
+
var { execute: execute44 } = buildCommand(() => "/me/planner/tasks?$filter=percentComplete ne 100", schema44);
|
|
27402
|
+
var meta46 = {
|
|
27403
|
+
summary: "List every incomplete Microsoft Planner task assigned to or owned by the signed-in user, across every plan.",
|
|
27404
|
+
category: "tasks",
|
|
27405
|
+
graphMethod: "GET",
|
|
27406
|
+
graphPathTemplate: "/me/planner/tasks?$filter=percentComplete ne 100",
|
|
27407
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/planneruser-list-tasks",
|
|
27408
|
+
options: [],
|
|
27409
|
+
example: "ask-marcel list-incomplete-planner-tasks",
|
|
27410
|
+
responseShape: "collection of Microsoft Graph `plannerTask` resources under `value[]` where `percentComplete < 100`"
|
|
27411
|
+
};
|
|
27412
|
+
|
|
27413
|
+
// src/use-cases/commands/list-incomplete-todo-tasks.ts
|
|
27414
|
+
var exports_list_incomplete_todo_tasks = {};
|
|
27415
|
+
__export(exports_list_incomplete_todo_tasks, {
|
|
27416
|
+
schema: () => schema45,
|
|
27417
|
+
meta: () => meta47,
|
|
27418
|
+
execute: () => execute45
|
|
27419
|
+
});
|
|
27420
|
+
var schema45 = exports_external.object({ todoTaskListId: exports_external.string().min(1) });
|
|
27421
|
+
var { execute: execute45 } = buildCommand((p) => `/me/todo/lists/${p.todoTaskListId}/tasks?$filter=status ne 'completed'`, schema45);
|
|
27422
|
+
var meta47 = {
|
|
27423
|
+
summary: "List every incomplete Microsoft To Do task in a given list (status not equal to `completed`).",
|
|
27424
|
+
category: "tasks",
|
|
27425
|
+
graphMethod: "GET",
|
|
27426
|
+
graphPathTemplate: "/me/todo/lists/{todo-task-list-id}/tasks?$filter=status ne 'completed'",
|
|
27427
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/todotasklist-list-tasks",
|
|
27428
|
+
options: [
|
|
27429
|
+
{
|
|
27430
|
+
name: "todo-task-list-id",
|
|
27431
|
+
key: "todoTaskListId",
|
|
27432
|
+
required: true,
|
|
27433
|
+
description: "todoTaskList ID. Returned by `ask-marcel list-todo-task-lists`. Well-known names also work, e.g. `tasks` for the default list. " + "There is no Graph endpoint that returns incomplete tasks across every list — call this once per list."
|
|
27434
|
+
}
|
|
27435
|
+
],
|
|
27436
|
+
example: "ask-marcel list-incomplete-todo-tasks --todo-task-list-id 'tasks'",
|
|
27437
|
+
responseShape: 'collection of Microsoft Graph `todoTask` resources under `value[]` where `status != "completed"`'
|
|
27438
|
+
};
|
|
26680
27439
|
|
|
26681
27440
|
// src/use-cases/commands/list-joined-teams.ts
|
|
26682
27441
|
var exports_list_joined_teams = {};
|
|
26683
27442
|
__export(exports_list_joined_teams, {
|
|
26684
|
-
schema: () =>
|
|
26685
|
-
|
|
27443
|
+
schema: () => schema46,
|
|
27444
|
+
meta: () => meta48,
|
|
27445
|
+
execute: () => execute46
|
|
26686
27446
|
});
|
|
26687
|
-
var
|
|
26688
|
-
var { execute:
|
|
27447
|
+
var schema46 = exports_external.object({}).strict();
|
|
27448
|
+
var { execute: execute46 } = buildCommand(() => "/me/joinedTeams", schema46);
|
|
27449
|
+
var meta48 = {
|
|
27450
|
+
summary: "List the Microsoft Teams the signed-in user is a member of.",
|
|
27451
|
+
category: "teams",
|
|
27452
|
+
graphMethod: "GET",
|
|
27453
|
+
graphPathTemplate: "/me/joinedTeams",
|
|
27454
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-joinedteams",
|
|
27455
|
+
options: [],
|
|
27456
|
+
example: "ask-marcel list-joined-teams",
|
|
27457
|
+
responseShape: "collection of Microsoft Graph `team` resources under `value[]`"
|
|
27458
|
+
};
|
|
26689
27459
|
|
|
26690
27460
|
// src/use-cases/commands/list-mail-attachments.ts
|
|
26691
27461
|
var exports_list_mail_attachments = {};
|
|
26692
27462
|
__export(exports_list_mail_attachments, {
|
|
26693
|
-
schema: () =>
|
|
26694
|
-
|
|
27463
|
+
schema: () => schema47,
|
|
27464
|
+
meta: () => meta49,
|
|
27465
|
+
execute: () => execute47
|
|
26695
27466
|
});
|
|
26696
|
-
var
|
|
26697
|
-
var { execute:
|
|
27467
|
+
var schema47 = exports_external.object({ messageId: exports_external.string().min(1) });
|
|
27468
|
+
var { execute: execute47 } = buildCommand((p) => `/me/messages/${p.messageId}/attachments`, schema47);
|
|
27469
|
+
var meta49 = {
|
|
27470
|
+
summary: "List the attachments (file, item, reference) on a single Outlook message.",
|
|
27471
|
+
category: "mail",
|
|
27472
|
+
graphMethod: "GET",
|
|
27473
|
+
graphPathTemplate: "/me/messages/{message-id}/attachments",
|
|
27474
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/message-list-attachments",
|
|
27475
|
+
options: [
|
|
27476
|
+
{ name: "message-id", key: "messageId", required: true, description: "Outlook message ID. Returned by `ask-marcel list-mail-messages` or `list-mail-folder-messages`." }
|
|
27477
|
+
],
|
|
27478
|
+
example: "ask-marcel list-mail-attachments --message-id 'AAMkAGI2...'",
|
|
27479
|
+
responseShape: "collection of Microsoft Graph `attachment` resources under `value[]`"
|
|
27480
|
+
};
|
|
26698
27481
|
|
|
26699
27482
|
// src/use-cases/commands/list-mail-child-folders.ts
|
|
26700
27483
|
var exports_list_mail_child_folders = {};
|
|
26701
27484
|
__export(exports_list_mail_child_folders, {
|
|
26702
|
-
schema: () =>
|
|
26703
|
-
|
|
27485
|
+
schema: () => schema48,
|
|
27486
|
+
meta: () => meta50,
|
|
27487
|
+
execute: () => execute48
|
|
26704
27488
|
});
|
|
26705
|
-
var
|
|
26706
|
-
var { execute:
|
|
27489
|
+
var schema48 = exports_external.object({ mailFolderId: exports_external.string().min(1) });
|
|
27490
|
+
var { execute: execute48 } = buildCommand((p) => `/me/mailFolders/${p.mailFolderId}/childFolders`, schema48);
|
|
27491
|
+
var meta50 = {
|
|
27492
|
+
summary: "List the subfolders of a single Outlook mail folder (e.g. subfolders of Inbox).",
|
|
27493
|
+
category: "mail",
|
|
27494
|
+
graphMethod: "GET",
|
|
27495
|
+
graphPathTemplate: "/me/mailFolders/{mail-folder-id}/childFolders",
|
|
27496
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/mailfolder-list-childfolders",
|
|
27497
|
+
options: [
|
|
27498
|
+
{
|
|
27499
|
+
name: "mail-folder-id",
|
|
27500
|
+
key: "mailFolderId",
|
|
27501
|
+
required: true,
|
|
27502
|
+
description: "mailFolder ID. Returned by `ask-marcel list-mail-folders`. Well-known names also work, e.g. `inbox`, `sentitems`, `drafts`."
|
|
27503
|
+
}
|
|
27504
|
+
],
|
|
27505
|
+
example: "ask-marcel list-mail-child-folders --mail-folder-id 'inbox'",
|
|
27506
|
+
responseShape: "collection of Microsoft Graph `mailFolder` resources under `value[]`"
|
|
27507
|
+
};
|
|
26707
27508
|
|
|
26708
27509
|
// src/use-cases/commands/list-mail-folder-messages.ts
|
|
26709
27510
|
var exports_list_mail_folder_messages = {};
|
|
26710
27511
|
__export(exports_list_mail_folder_messages, {
|
|
26711
|
-
schema: () =>
|
|
26712
|
-
|
|
27512
|
+
schema: () => schema49,
|
|
27513
|
+
meta: () => meta51,
|
|
27514
|
+
execute: () => execute49
|
|
26713
27515
|
});
|
|
26714
|
-
var
|
|
26715
|
-
var { execute:
|
|
27516
|
+
var schema49 = exports_external.object({ mailFolderId: exports_external.string().min(1) });
|
|
27517
|
+
var { execute: execute49 } = buildCommand((p) => `/me/mailFolders/${p.mailFolderId}/messages`, schema49);
|
|
27518
|
+
var meta51 = {
|
|
27519
|
+
summary: "List the messages inside a specific Outlook mail folder (Inbox, custom folder, etc.).",
|
|
27520
|
+
category: "mail",
|
|
27521
|
+
graphMethod: "GET",
|
|
27522
|
+
graphPathTemplate: "/me/mailFolders/{mail-folder-id}/messages",
|
|
27523
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/mailfolder-list-messages",
|
|
27524
|
+
options: [
|
|
27525
|
+
{
|
|
27526
|
+
name: "mail-folder-id",
|
|
27527
|
+
key: "mailFolderId",
|
|
27528
|
+
required: true,
|
|
27529
|
+
description: "mailFolder ID. Returned by `ask-marcel list-mail-folders`. Well-known names also work, e.g. `inbox`, `sentitems`, `drafts`."
|
|
27530
|
+
}
|
|
27531
|
+
],
|
|
27532
|
+
example: "ask-marcel list-mail-folder-messages --mail-folder-id 'inbox'",
|
|
27533
|
+
responseShape: "collection of Microsoft Graph `message` resources under `value[]`"
|
|
27534
|
+
};
|
|
26716
27535
|
|
|
26717
27536
|
// src/use-cases/commands/list-mail-folders.ts
|
|
26718
27537
|
var exports_list_mail_folders = {};
|
|
26719
27538
|
__export(exports_list_mail_folders, {
|
|
26720
|
-
schema: () =>
|
|
26721
|
-
|
|
27539
|
+
schema: () => schema50,
|
|
27540
|
+
meta: () => meta52,
|
|
27541
|
+
execute: () => execute50
|
|
26722
27542
|
});
|
|
26723
|
-
var
|
|
26724
|
-
var { execute:
|
|
27543
|
+
var schema50 = exports_external.object({}).strict();
|
|
27544
|
+
var { execute: execute50 } = buildCommand(() => "/me/mailFolders", schema50);
|
|
27545
|
+
var meta52 = {
|
|
27546
|
+
summary: "List the top-level mail folders in the signed-in user’s Outlook mailbox (Inbox, Sent Items, etc.).",
|
|
27547
|
+
category: "mail",
|
|
27548
|
+
graphMethod: "GET",
|
|
27549
|
+
graphPathTemplate: "/me/mailFolders",
|
|
27550
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders",
|
|
27551
|
+
options: [],
|
|
27552
|
+
example: "ask-marcel list-mail-folders",
|
|
27553
|
+
responseShape: "collection of Microsoft Graph `mailFolder` resources under `value[]`"
|
|
27554
|
+
};
|
|
26725
27555
|
|
|
26726
27556
|
// src/use-cases/commands/list-mail-messages.ts
|
|
26727
27557
|
var exports_list_mail_messages = {};
|
|
26728
27558
|
__export(exports_list_mail_messages, {
|
|
26729
|
-
schema: () =>
|
|
26730
|
-
|
|
27559
|
+
schema: () => schema51,
|
|
27560
|
+
meta: () => meta53,
|
|
27561
|
+
execute: () => execute51
|
|
26731
27562
|
});
|
|
26732
|
-
var
|
|
26733
|
-
var { execute:
|
|
27563
|
+
var schema51 = exports_external.object({}).strict();
|
|
27564
|
+
var { execute: execute51 } = buildCommand(() => "/me/messages", schema51);
|
|
27565
|
+
var meta53 = {
|
|
27566
|
+
summary: "List the most recent messages from across the signed-in user’s entire Outlook mailbox (every folder including Sent, Archive, Junk; default sort `receivedDateTime` desc). Use `list-mail-folder-messages` to scope to a single folder such as Inbox.",
|
|
27567
|
+
category: "mail",
|
|
27568
|
+
graphMethod: "GET",
|
|
27569
|
+
graphPathTemplate: "/me/messages",
|
|
27570
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-messages",
|
|
27571
|
+
options: [],
|
|
27572
|
+
example: "ask-marcel list-mail-messages",
|
|
27573
|
+
responseShape: "collection of Microsoft Graph `message` resources under `value[]`"
|
|
27574
|
+
};
|
|
26734
27575
|
|
|
26735
27576
|
// src/use-cases/commands/list-mail-rules.ts
|
|
26736
27577
|
var exports_list_mail_rules = {};
|
|
26737
27578
|
__export(exports_list_mail_rules, {
|
|
26738
|
-
schema: () =>
|
|
26739
|
-
|
|
27579
|
+
schema: () => schema52,
|
|
27580
|
+
meta: () => meta54,
|
|
27581
|
+
execute: () => execute52
|
|
26740
27582
|
});
|
|
26741
|
-
var
|
|
26742
|
-
var { execute:
|
|
27583
|
+
var schema52 = exports_external.object({ mailFolderId: exports_external.string().min(1) });
|
|
27584
|
+
var { execute: execute52 } = buildCommand((p) => `/me/mailFolders/${p.mailFolderId}/messageRules`, schema52);
|
|
27585
|
+
var meta54 = {
|
|
27586
|
+
summary: "List the inbox / folder rules attached to a single Outlook mail folder.",
|
|
27587
|
+
category: "mail",
|
|
27588
|
+
graphMethod: "GET",
|
|
27589
|
+
graphPathTemplate: "/me/mailFolders/{mail-folder-id}/messageRules",
|
|
27590
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/mailfolder-list-messagerules",
|
|
27591
|
+
options: [
|
|
27592
|
+
{
|
|
27593
|
+
name: "mail-folder-id",
|
|
27594
|
+
key: "mailFolderId",
|
|
27595
|
+
required: true,
|
|
27596
|
+
description: "mailFolder ID. Returned by `ask-marcel list-mail-folders`. Well-known names also work, e.g. `inbox`."
|
|
27597
|
+
}
|
|
27598
|
+
],
|
|
27599
|
+
example: "ask-marcel list-mail-rules --mail-folder-id 'inbox'",
|
|
27600
|
+
responseShape: "collection of Microsoft Graph `messageRule` resources under `value[]`"
|
|
27601
|
+
};
|
|
26743
27602
|
|
|
26744
27603
|
// src/use-cases/commands/list-onenote-notebook-sections.ts
|
|
26745
27604
|
var exports_list_onenote_notebook_sections = {};
|
|
26746
27605
|
__export(exports_list_onenote_notebook_sections, {
|
|
26747
|
-
schema: () =>
|
|
26748
|
-
|
|
27606
|
+
schema: () => schema53,
|
|
27607
|
+
meta: () => meta55,
|
|
27608
|
+
execute: () => execute53
|
|
26749
27609
|
});
|
|
26750
|
-
var
|
|
26751
|
-
var { execute:
|
|
27610
|
+
var schema53 = exports_external.object({ notebookId: exports_external.string().min(1) });
|
|
27611
|
+
var { execute: execute53 } = buildCommand((p) => `/me/onenote/notebooks/${p.notebookId}/sections`, schema53);
|
|
27612
|
+
var meta55 = {
|
|
27613
|
+
summary: "List the top-level sections of a single OneNote notebook (flat — does NOT recurse into section groups; use `list-all-onenote-sections` to flatten every notebook the user has access to).",
|
|
27614
|
+
category: "notes",
|
|
27615
|
+
graphMethod: "GET",
|
|
27616
|
+
graphPathTemplate: "/me/onenote/notebooks/{notebook-id}/sections",
|
|
27617
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/notebook-list-sections",
|
|
27618
|
+
options: [{ name: "notebook-id", key: "notebookId", required: true, description: "OneNote notebook ID. Returned by `ask-marcel list-onenote-notebooks`." }],
|
|
27619
|
+
example: "ask-marcel list-onenote-notebook-sections --notebook-id '1-12abc...'",
|
|
27620
|
+
responseShape: "collection of Microsoft Graph `onenoteSection` resources under `value[]`"
|
|
27621
|
+
};
|
|
26752
27622
|
|
|
26753
27623
|
// src/use-cases/commands/list-onenote-notebooks.ts
|
|
26754
27624
|
var exports_list_onenote_notebooks = {};
|
|
26755
27625
|
__export(exports_list_onenote_notebooks, {
|
|
26756
|
-
schema: () =>
|
|
26757
|
-
|
|
27626
|
+
schema: () => schema54,
|
|
27627
|
+
meta: () => meta56,
|
|
27628
|
+
execute: () => execute54
|
|
26758
27629
|
});
|
|
26759
|
-
var
|
|
26760
|
-
var { execute:
|
|
27630
|
+
var schema54 = exports_external.object({}).strict();
|
|
27631
|
+
var { execute: execute54 } = buildCommand(() => "/me/onenote/notebooks", schema54);
|
|
27632
|
+
var meta56 = {
|
|
27633
|
+
summary: "List the OneNote notebooks the signed-in user owns or has access to (sorted by `createdDateTime` desc by Graph; soft-deleted notebooks excluded).",
|
|
27634
|
+
category: "notes",
|
|
27635
|
+
graphMethod: "GET",
|
|
27636
|
+
graphPathTemplate: "/me/onenote/notebooks",
|
|
27637
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/onenote-list-notebooks",
|
|
27638
|
+
options: [],
|
|
27639
|
+
example: "ask-marcel list-onenote-notebooks",
|
|
27640
|
+
responseShape: "collection of Microsoft Graph `notebook` resources under `value[]`"
|
|
27641
|
+
};
|
|
26761
27642
|
|
|
26762
27643
|
// src/use-cases/commands/list-onenote-section-pages.ts
|
|
26763
27644
|
var exports_list_onenote_section_pages = {};
|
|
26764
27645
|
__export(exports_list_onenote_section_pages, {
|
|
26765
|
-
schema: () =>
|
|
26766
|
-
|
|
26767
|
-
|
|
26768
|
-
var schema69 = exports_external.object({ onenoteSectionId: exports_external.string().min(1) });
|
|
26769
|
-
var { execute: execute69 } = buildCommand((p) => `/me/onenote/sections/${p.onenoteSectionId}/pages`, schema69);
|
|
26770
|
-
|
|
26771
|
-
// src/use-cases/commands/list-outlook-contacts.ts
|
|
26772
|
-
var exports_list_outlook_contacts = {};
|
|
26773
|
-
__export(exports_list_outlook_contacts, {
|
|
26774
|
-
schema: () => schema70,
|
|
26775
|
-
execute: () => execute70
|
|
26776
|
-
});
|
|
26777
|
-
var schema70 = exports_external.object({}).strict();
|
|
26778
|
-
var { execute: execute70 } = buildCommand(() => "/me/contacts", schema70);
|
|
26779
|
-
|
|
26780
|
-
// src/use-cases/commands/list-pinned-chat-messages.ts
|
|
26781
|
-
var exports_list_pinned_chat_messages = {};
|
|
26782
|
-
__export(exports_list_pinned_chat_messages, {
|
|
26783
|
-
schema: () => schema71,
|
|
26784
|
-
execute: () => execute71
|
|
27646
|
+
schema: () => schema55,
|
|
27647
|
+
meta: () => meta57,
|
|
27648
|
+
execute: () => execute55
|
|
26785
27649
|
});
|
|
26786
|
-
var
|
|
26787
|
-
var { execute:
|
|
27650
|
+
var schema55 = exports_external.object({ onenoteSectionId: exports_external.string().min(1) });
|
|
27651
|
+
var { execute: execute55 } = buildCommand((p) => `/me/onenote/sections/${p.onenoteSectionId}/pages`, schema55);
|
|
27652
|
+
var meta57 = {
|
|
27653
|
+
summary: "List the pages inside a single OneNote section.",
|
|
27654
|
+
category: "notes",
|
|
27655
|
+
graphMethod: "GET",
|
|
27656
|
+
graphPathTemplate: "/me/onenote/sections/{onenote-section-id}/pages",
|
|
27657
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/section-list-pages",
|
|
27658
|
+
options: [
|
|
27659
|
+
{
|
|
27660
|
+
name: "onenote-section-id",
|
|
27661
|
+
key: "onenoteSectionId",
|
|
27662
|
+
required: true,
|
|
27663
|
+
description: "OneNote section ID. Returned by `ask-marcel list-onenote-notebook-sections` or `list-all-onenote-sections`."
|
|
27664
|
+
}
|
|
27665
|
+
],
|
|
27666
|
+
example: "ask-marcel list-onenote-section-pages --onenote-section-id '1-abc...'",
|
|
27667
|
+
responseShape: "collection of Microsoft Graph `onenotePage` resources under `value[]`"
|
|
27668
|
+
};
|
|
26788
27669
|
|
|
26789
27670
|
// src/use-cases/commands/list-plan-buckets.ts
|
|
26790
27671
|
var exports_list_plan_buckets = {};
|
|
26791
27672
|
__export(exports_list_plan_buckets, {
|
|
26792
|
-
schema: () =>
|
|
26793
|
-
|
|
27673
|
+
schema: () => schema56,
|
|
27674
|
+
meta: () => meta58,
|
|
27675
|
+
execute: () => execute56
|
|
26794
27676
|
});
|
|
26795
|
-
var
|
|
26796
|
-
var { execute:
|
|
27677
|
+
var schema56 = exports_external.object({ plannerPlanId: exports_external.string().min(1) });
|
|
27678
|
+
var { execute: execute56 } = buildCommand((p) => `/planner/plans/${p.plannerPlanId}/buckets`, schema56);
|
|
27679
|
+
var meta58 = {
|
|
27680
|
+
summary: "List the buckets (columns / lanes) of a Microsoft Planner plan.",
|
|
27681
|
+
category: "tasks",
|
|
27682
|
+
graphMethod: "GET",
|
|
27683
|
+
graphPathTemplate: "/planner/plans/{planner-plan-id}/buckets",
|
|
27684
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/plannerplan-list-buckets",
|
|
27685
|
+
options: [
|
|
27686
|
+
{
|
|
27687
|
+
name: "planner-plan-id",
|
|
27688
|
+
key: "plannerPlanId",
|
|
27689
|
+
required: true,
|
|
27690
|
+
description: "Planner plan ID. Returned in the `planId` field of any task from `ask-marcel list-planner-tasks`."
|
|
27691
|
+
}
|
|
27692
|
+
],
|
|
27693
|
+
example: "ask-marcel list-plan-buckets --planner-plan-id 'xqQg5FS2LkCp935s-FIFm5gAB6'",
|
|
27694
|
+
responseShape: "collection of Microsoft Graph `plannerBucket` resources under `value[]`"
|
|
27695
|
+
};
|
|
26797
27696
|
|
|
26798
27697
|
// src/use-cases/commands/list-plan-tasks.ts
|
|
26799
27698
|
var exports_list_plan_tasks = {};
|
|
26800
27699
|
__export(exports_list_plan_tasks, {
|
|
26801
|
-
schema: () =>
|
|
26802
|
-
|
|
27700
|
+
schema: () => schema57,
|
|
27701
|
+
meta: () => meta59,
|
|
27702
|
+
execute: () => execute57
|
|
26803
27703
|
});
|
|
26804
|
-
var
|
|
26805
|
-
var { execute:
|
|
27704
|
+
var schema57 = exports_external.object({ plannerPlanId: exports_external.string().min(1) });
|
|
27705
|
+
var { execute: execute57 } = buildCommand((p) => `/planner/plans/${p.plannerPlanId}/tasks`, schema57);
|
|
27706
|
+
var meta59 = {
|
|
27707
|
+
summary: "List every task within a Microsoft Planner plan, regardless of completion status (Graph orders by `orderHint`). Use `list-incomplete-planner-tasks` for the across-plans incomplete view.",
|
|
27708
|
+
category: "tasks",
|
|
27709
|
+
graphMethod: "GET",
|
|
27710
|
+
graphPathTemplate: "/planner/plans/{planner-plan-id}/tasks",
|
|
27711
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/plannerplan-list-tasks",
|
|
27712
|
+
options: [
|
|
27713
|
+
{
|
|
27714
|
+
name: "planner-plan-id",
|
|
27715
|
+
key: "plannerPlanId",
|
|
27716
|
+
required: true,
|
|
27717
|
+
description: "Planner plan ID. Returned in the `planId` field of any task from `ask-marcel list-planner-tasks`."
|
|
27718
|
+
}
|
|
27719
|
+
],
|
|
27720
|
+
example: "ask-marcel list-plan-tasks --planner-plan-id 'xqQg5FS2LkCp935s-FIFm5gAB6'",
|
|
27721
|
+
responseShape: "collection of Microsoft Graph `plannerTask` resources under `value[]`"
|
|
27722
|
+
};
|
|
27723
|
+
|
|
27724
|
+
// src/use-cases/commands/list-planner-plans.ts
|
|
27725
|
+
var exports_list_planner_plans = {};
|
|
27726
|
+
__export(exports_list_planner_plans, {
|
|
27727
|
+
schema: () => schema58,
|
|
27728
|
+
meta: () => meta60,
|
|
27729
|
+
execute: () => execute58
|
|
27730
|
+
});
|
|
27731
|
+
var schema58 = exports_external.object({}).strict();
|
|
27732
|
+
var { execute: execute58 } = buildCommand(() => "/me/planner/plans", schema58);
|
|
27733
|
+
var meta60 = {
|
|
27734
|
+
summary: "List every Microsoft Planner plan the signed-in user has access to (across every group). Use this to discover plan IDs without needing an existing task as the entry point.",
|
|
27735
|
+
category: "tasks",
|
|
27736
|
+
graphMethod: "GET",
|
|
27737
|
+
graphPathTemplate: "/me/planner/plans",
|
|
27738
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/planneruser-list-plans",
|
|
27739
|
+
options: [],
|
|
27740
|
+
example: "ask-marcel list-planner-plans",
|
|
27741
|
+
responseShape: "collection of Microsoft Graph `plannerPlan` resources under `value[]`"
|
|
27742
|
+
};
|
|
26806
27743
|
|
|
26807
27744
|
// src/use-cases/commands/list-planner-tasks.ts
|
|
26808
27745
|
var exports_list_planner_tasks = {};
|
|
26809
27746
|
__export(exports_list_planner_tasks, {
|
|
26810
|
-
schema: () =>
|
|
26811
|
-
|
|
27747
|
+
schema: () => schema59,
|
|
27748
|
+
meta: () => meta61,
|
|
27749
|
+
execute: () => execute59
|
|
26812
27750
|
});
|
|
26813
|
-
var
|
|
26814
|
-
var { execute:
|
|
27751
|
+
var schema59 = exports_external.object({}).strict();
|
|
27752
|
+
var { execute: execute59 } = buildCommand(() => "/me/planner/tasks", schema59);
|
|
27753
|
+
var meta61 = {
|
|
27754
|
+
summary: "List every Microsoft Planner task assigned to or owned by the signed-in user, across all plans.",
|
|
27755
|
+
category: "tasks",
|
|
27756
|
+
graphMethod: "GET",
|
|
27757
|
+
graphPathTemplate: "/me/planner/tasks",
|
|
27758
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/planneruser-list-tasks",
|
|
27759
|
+
options: [],
|
|
27760
|
+
example: "ask-marcel list-planner-tasks",
|
|
27761
|
+
responseShape: "collection of Microsoft Graph `plannerTask` resources under `value[]`"
|
|
27762
|
+
};
|
|
26815
27763
|
|
|
26816
27764
|
// src/use-cases/commands/list-sharepoint-site-drives.ts
|
|
26817
27765
|
var exports_list_sharepoint_site_drives = {};
|
|
26818
27766
|
__export(exports_list_sharepoint_site_drives, {
|
|
26819
|
-
schema: () =>
|
|
26820
|
-
|
|
26821
|
-
|
|
26822
|
-
var schema75 = exports_external.object({ siteId: exports_external.string().min(1) });
|
|
26823
|
-
var { execute: execute75 } = buildCommand((p) => `/sites/${p.siteId}/drives`, schema75);
|
|
26824
|
-
|
|
26825
|
-
// src/use-cases/commands/list-sharepoint-site-items.ts
|
|
26826
|
-
var exports_list_sharepoint_site_items = {};
|
|
26827
|
-
__export(exports_list_sharepoint_site_items, {
|
|
26828
|
-
schema: () => schema76,
|
|
26829
|
-
execute: () => execute76
|
|
27767
|
+
schema: () => schema60,
|
|
27768
|
+
meta: () => meta62,
|
|
27769
|
+
execute: () => execute60
|
|
26830
27770
|
});
|
|
26831
|
-
var
|
|
26832
|
-
var { execute:
|
|
27771
|
+
var schema60 = exports_external.object({ siteId: exports_external.string().min(1) });
|
|
27772
|
+
var { execute: execute60 } = buildCommand((p) => `/sites/${p.siteId}/drives`, schema60);
|
|
27773
|
+
var meta62 = {
|
|
27774
|
+
summary: "List the document libraries (drives) attached to a SharePoint site.",
|
|
27775
|
+
category: "sharepoint",
|
|
27776
|
+
graphMethod: "GET",
|
|
27777
|
+
graphPathTemplate: "/sites/{site-id}/drives",
|
|
27778
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/drive-list",
|
|
27779
|
+
options: [{ name: "site-id", key: "siteId", required: true, description: "SharePoint site ID. Returned by `ask-marcel search-sharepoint-sites`." }],
|
|
27780
|
+
example: "ask-marcel list-sharepoint-site-drives --site-id 'contoso.sharepoint.com,1234,5678'",
|
|
27781
|
+
responseShape: "collection of Microsoft Graph `drive` resources under `value[]`"
|
|
27782
|
+
};
|
|
26833
27783
|
|
|
26834
27784
|
// src/use-cases/commands/list-sharepoint-site-list-items.ts
|
|
26835
27785
|
var exports_list_sharepoint_site_list_items = {};
|
|
26836
27786
|
__export(exports_list_sharepoint_site_list_items, {
|
|
26837
|
-
schema: () =>
|
|
26838
|
-
|
|
27787
|
+
schema: () => schema61,
|
|
27788
|
+
meta: () => meta63,
|
|
27789
|
+
execute: () => execute61
|
|
26839
27790
|
});
|
|
26840
|
-
var
|
|
26841
|
-
var { execute:
|
|
27791
|
+
var schema61 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1) });
|
|
27792
|
+
var { execute: execute61 } = buildCommand((p) => `/sites/${p.siteId}/lists/${p.listId}/items`, schema61);
|
|
27793
|
+
var meta63 = {
|
|
27794
|
+
summary: "List the rows (listItem resources) of a single SharePoint list.",
|
|
27795
|
+
category: "sharepoint",
|
|
27796
|
+
graphMethod: "GET",
|
|
27797
|
+
graphPathTemplate: "/sites/{site-id}/lists/{list-id}/items",
|
|
27798
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/listitem-list",
|
|
27799
|
+
options: [
|
|
27800
|
+
{ name: "site-id", key: "siteId", required: true, description: "SharePoint site ID. Returned by `ask-marcel search-sharepoint-sites`." },
|
|
27801
|
+
{ name: "list-id", key: "listId", required: true, description: "SharePoint list ID or display name. Returned by `ask-marcel list-sharepoint-site-lists`." }
|
|
27802
|
+
],
|
|
27803
|
+
example: "ask-marcel list-sharepoint-site-list-items --site-id 'contoso.sharepoint.com,1234,5678' --list-id 'Tasks'",
|
|
27804
|
+
responseShape: "collection of Microsoft Graph `listItem` resources under `value[]`"
|
|
27805
|
+
};
|
|
26842
27806
|
|
|
26843
27807
|
// src/use-cases/commands/list-sharepoint-site-lists.ts
|
|
26844
27808
|
var exports_list_sharepoint_site_lists = {};
|
|
26845
27809
|
__export(exports_list_sharepoint_site_lists, {
|
|
26846
|
-
schema: () =>
|
|
26847
|
-
|
|
27810
|
+
schema: () => schema62,
|
|
27811
|
+
meta: () => meta64,
|
|
27812
|
+
execute: () => execute62
|
|
26848
27813
|
});
|
|
26849
|
-
var
|
|
26850
|
-
var { execute:
|
|
27814
|
+
var schema62 = exports_external.object({ siteId: exports_external.string().min(1) });
|
|
27815
|
+
var { execute: execute62 } = buildCommand((p) => `/sites/${p.siteId}/lists`, schema62);
|
|
27816
|
+
var meta64 = {
|
|
27817
|
+
summary: "List all SharePoint lists (custom + built-in document libraries) on a site.",
|
|
27818
|
+
category: "sharepoint",
|
|
27819
|
+
graphMethod: "GET",
|
|
27820
|
+
graphPathTemplate: "/sites/{site-id}/lists",
|
|
27821
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/list-list",
|
|
27822
|
+
options: [{ name: "site-id", key: "siteId", required: true, description: "SharePoint site ID. Returned by `ask-marcel search-sharepoint-sites`." }],
|
|
27823
|
+
example: "ask-marcel list-sharepoint-site-lists --site-id 'contoso.sharepoint.com,1234,5678'",
|
|
27824
|
+
responseShape: "collection of Microsoft Graph `list` resources under `value[]`"
|
|
27825
|
+
};
|
|
26851
27826
|
|
|
26852
27827
|
// src/use-cases/commands/list-specific-calendar-events.ts
|
|
26853
27828
|
var exports_list_specific_calendar_events = {};
|
|
26854
27829
|
__export(exports_list_specific_calendar_events, {
|
|
26855
|
-
schema: () =>
|
|
26856
|
-
|
|
27830
|
+
schema: () => schema63,
|
|
27831
|
+
meta: () => meta65,
|
|
27832
|
+
execute: () => execute63
|
|
26857
27833
|
});
|
|
26858
|
-
var
|
|
26859
|
-
var { execute:
|
|
27834
|
+
var schema63 = exports_external.object({ calendarId: exports_external.string().min(1) });
|
|
27835
|
+
var { execute: execute63 } = buildCommand((p) => `/me/calendars/${p.calendarId}/events`, schema63);
|
|
27836
|
+
var meta65 = {
|
|
27837
|
+
summary: "List the events in a specific (non-default) calendar (does not expand recurrences).",
|
|
27838
|
+
category: "calendar",
|
|
27839
|
+
graphMethod: "GET",
|
|
27840
|
+
graphPathTemplate: "/me/calendars/{calendar-id}/events",
|
|
27841
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/calendar-list-events",
|
|
27842
|
+
options: [{ name: "calendar-id", key: "calendarId", required: true, description: "Calendar ID. Returned by `ask-marcel list-calendars`." }],
|
|
27843
|
+
example: "ask-marcel list-specific-calendar-events --calendar-id 'AAMkAGI2THVS...'",
|
|
27844
|
+
responseShape: "collection of Microsoft Graph `event` resources under `value[]`"
|
|
27845
|
+
};
|
|
26860
27846
|
|
|
26861
27847
|
// src/use-cases/commands/list-team-channels.ts
|
|
26862
27848
|
var exports_list_team_channels = {};
|
|
26863
27849
|
__export(exports_list_team_channels, {
|
|
26864
|
-
schema: () =>
|
|
26865
|
-
|
|
26866
|
-
|
|
26867
|
-
var schema80 = exports_external.object({ teamId: exports_external.string().min(1) });
|
|
26868
|
-
var { execute: execute80 } = buildCommand((p) => `/teams/${p.teamId}/channels`, schema80);
|
|
26869
|
-
|
|
26870
|
-
// src/use-cases/commands/list-team-members.ts
|
|
26871
|
-
var exports_list_team_members = {};
|
|
26872
|
-
__export(exports_list_team_members, {
|
|
26873
|
-
schema: () => schema81,
|
|
26874
|
-
execute: () => execute81
|
|
27850
|
+
schema: () => schema64,
|
|
27851
|
+
meta: () => meta66,
|
|
27852
|
+
execute: () => execute64
|
|
26875
27853
|
});
|
|
26876
|
-
var
|
|
26877
|
-
var { execute:
|
|
27854
|
+
var schema64 = exports_external.object({ teamId: exports_external.string().min(1) });
|
|
27855
|
+
var { execute: execute64 } = buildCommand((p) => `/teams/${p.teamId}/channels`, schema64);
|
|
27856
|
+
var meta66 = {
|
|
27857
|
+
summary: "List the channels (standard, private, shared) inside a single Microsoft Team.",
|
|
27858
|
+
category: "teams",
|
|
27859
|
+
graphMethod: "GET",
|
|
27860
|
+
graphPathTemplate: "/teams/{team-id}/channels",
|
|
27861
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/channel-list",
|
|
27862
|
+
options: [{ name: "team-id", key: "teamId", required: true, description: "Microsoft Teams team ID. Returned by `ask-marcel list-joined-teams`." }],
|
|
27863
|
+
example: "ask-marcel list-team-channels --team-id 'abc-1234-...'",
|
|
27864
|
+
responseShape: "collection of Microsoft Graph `channel` resources under `value[]`"
|
|
27865
|
+
};
|
|
26878
27866
|
|
|
26879
27867
|
// src/use-cases/commands/list-todo-linked-resources.ts
|
|
26880
27868
|
var exports_list_todo_linked_resources = {};
|
|
26881
27869
|
__export(exports_list_todo_linked_resources, {
|
|
26882
|
-
schema: () =>
|
|
26883
|
-
|
|
27870
|
+
schema: () => schema65,
|
|
27871
|
+
meta: () => meta67,
|
|
27872
|
+
execute: () => execute65
|
|
26884
27873
|
});
|
|
26885
|
-
var
|
|
26886
|
-
var { execute:
|
|
27874
|
+
var schema65 = exports_external.object({ todoTaskListId: exports_external.string().min(1), todoTaskId: exports_external.string().min(1) });
|
|
27875
|
+
var { execute: execute65 } = buildCommand((p) => `/me/todo/lists/${p.todoTaskListId}/tasks/${p.todoTaskId}/linkedResources`, schema65);
|
|
27876
|
+
var meta67 = {
|
|
27877
|
+
summary: "List the linked resources (URLs, emails, files) attached to a Microsoft To Do task.",
|
|
27878
|
+
category: "tasks",
|
|
27879
|
+
graphMethod: "GET",
|
|
27880
|
+
graphPathTemplate: "/me/todo/lists/{todo-task-list-id}/tasks/{todo-task-id}/linkedResources",
|
|
27881
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/todotask-list-linkedresources",
|
|
27882
|
+
options: [
|
|
27883
|
+
{ name: "todo-task-list-id", key: "todoTaskListId", required: true, description: "To Do task list ID. Returned by `ask-marcel list-todo-task-lists`." },
|
|
27884
|
+
{ name: "todo-task-id", key: "todoTaskId", required: true, description: "To Do task ID. Returned by `ask-marcel list-todo-tasks`." }
|
|
27885
|
+
],
|
|
27886
|
+
example: "ask-marcel list-todo-linked-resources --todo-task-list-id 'AAMkAGI...' --todo-task-id 'AAMkABC...'",
|
|
27887
|
+
responseShape: "collection of Microsoft Graph `linkedResource` resources under `value[]`"
|
|
27888
|
+
};
|
|
26887
27889
|
|
|
26888
27890
|
// src/use-cases/commands/list-todo-task-lists.ts
|
|
26889
27891
|
var exports_list_todo_task_lists = {};
|
|
26890
27892
|
__export(exports_list_todo_task_lists, {
|
|
26891
|
-
schema: () =>
|
|
26892
|
-
|
|
27893
|
+
schema: () => schema66,
|
|
27894
|
+
meta: () => meta68,
|
|
27895
|
+
execute: () => execute66
|
|
26893
27896
|
});
|
|
26894
|
-
var
|
|
26895
|
-
var { execute:
|
|
27897
|
+
var schema66 = exports_external.object({}).strict();
|
|
27898
|
+
var { execute: execute66 } = buildCommand(() => "/me/todo/lists", schema66);
|
|
27899
|
+
var meta68 = {
|
|
27900
|
+
summary: "List the signed-in user’s Microsoft To Do task lists (e.g. `Tasks`, `Flagged Emails`, custom lists).",
|
|
27901
|
+
category: "tasks",
|
|
27902
|
+
graphMethod: "GET",
|
|
27903
|
+
graphPathTemplate: "/me/todo/lists",
|
|
27904
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/todo-list-lists",
|
|
27905
|
+
options: [],
|
|
27906
|
+
example: "ask-marcel list-todo-task-lists",
|
|
27907
|
+
responseShape: "collection of Microsoft Graph `todoTaskList` resources under `value[]`"
|
|
27908
|
+
};
|
|
26896
27909
|
|
|
26897
27910
|
// src/use-cases/commands/list-todo-tasks.ts
|
|
26898
27911
|
var exports_list_todo_tasks = {};
|
|
26899
27912
|
__export(exports_list_todo_tasks, {
|
|
26900
|
-
schema: () =>
|
|
26901
|
-
|
|
27913
|
+
schema: () => schema67,
|
|
27914
|
+
meta: () => meta69,
|
|
27915
|
+
execute: () => execute67
|
|
27916
|
+
});
|
|
27917
|
+
var schema67 = exports_external.object({ todoTaskListId: exports_external.string().min(1) });
|
|
27918
|
+
var { execute: execute67 } = buildCommand((p) => `/me/todo/lists/${p.todoTaskListId}/tasks`, schema67);
|
|
27919
|
+
var meta69 = {
|
|
27920
|
+
summary: "List every task in a single Microsoft To Do task list, regardless of completion status. Use `list-incomplete-todo-tasks` if you only want the open ones.",
|
|
27921
|
+
category: "tasks",
|
|
27922
|
+
graphMethod: "GET",
|
|
27923
|
+
graphPathTemplate: "/me/todo/lists/{todo-task-list-id}/tasks",
|
|
27924
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/todotasklist-list-tasks",
|
|
27925
|
+
options: [{ name: "todo-task-list-id", key: "todoTaskListId", required: true, description: "To Do task list ID. Returned by `ask-marcel list-todo-task-lists`." }],
|
|
27926
|
+
example: "ask-marcel list-todo-tasks --todo-task-list-id 'AAMkAGI...'",
|
|
27927
|
+
responseShape: "collection of Microsoft Graph `todoTask` resources under `value[]`"
|
|
27928
|
+
};
|
|
27929
|
+
|
|
27930
|
+
// src/use-cases/commands/next-page.ts
|
|
27931
|
+
var exports_next_page = {};
|
|
27932
|
+
__export(exports_next_page, {
|
|
27933
|
+
schema: () => schema68,
|
|
27934
|
+
meta: () => meta70,
|
|
27935
|
+
execute: () => execute68
|
|
26902
27936
|
});
|
|
26903
|
-
var
|
|
26904
|
-
var
|
|
27937
|
+
var PREFIX = "https://graph.microsoft.com/v1.0";
|
|
27938
|
+
var schema68 = exports_external.object({
|
|
27939
|
+
url: exports_external.string().min(1).refine((v) => v.startsWith(`${PREFIX}/`), { message: `must be a Microsoft Graph v1.0 URL starting with ${PREFIX}/` })
|
|
27940
|
+
});
|
|
27941
|
+
var { execute: execute68 } = buildCommand((p) => p.url.slice(PREFIX.length), schema68);
|
|
27942
|
+
var meta70 = {
|
|
27943
|
+
summary: "Fetch the next page of a paginated Graph response. Pass the `@odata.nextLink` value returned by any list / search / delta command to walk pagination yourself.",
|
|
27944
|
+
category: "meta",
|
|
27945
|
+
graphMethod: "GET",
|
|
27946
|
+
graphPathTemplate: "{url}",
|
|
27947
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/paging",
|
|
27948
|
+
options: [
|
|
27949
|
+
{
|
|
27950
|
+
name: "url",
|
|
27951
|
+
key: "url",
|
|
27952
|
+
required: true,
|
|
27953
|
+
description: "Full Graph v1.0 URL — copy the `@odata.nextLink` field from the previous response. " + "Example: `https://graph.microsoft.com/v1.0/me/messages?$skiptoken=AKDsfg...`. " + "Loop: keep calling until the response no longer contains `@odata.nextLink`. " + "Also handles `@odata.deltaLink` if you want to resume a delta query."
|
|
27954
|
+
}
|
|
27955
|
+
],
|
|
27956
|
+
example: "ask-marcel next-page --url 'https://graph.microsoft.com/v1.0/me/messages?$skip=10'",
|
|
27957
|
+
responseShape: 'same shape as the originating endpoint (typically `{ value: [...], "@odata.nextLink": "..." }`)'
|
|
27958
|
+
};
|
|
27959
|
+
|
|
27960
|
+
// src/use-cases/commands/search-mail-messages.ts
|
|
27961
|
+
var exports_search_mail_messages = {};
|
|
27962
|
+
__export(exports_search_mail_messages, {
|
|
27963
|
+
schema: () => schema69,
|
|
27964
|
+
meta: () => meta71,
|
|
27965
|
+
execute: () => execute69
|
|
27966
|
+
});
|
|
27967
|
+
var schema69 = exports_external.object({ query: exports_external.string().min(1) });
|
|
27968
|
+
var { execute: execute69 } = buildCommand((p) => `/me/messages?$search="${p.query}"`, schema69);
|
|
27969
|
+
var meta71 = {
|
|
27970
|
+
summary: "Search the signed-in user’s entire Outlook mailbox using KQL or free text. Results are ranked by Graph relevance.",
|
|
27971
|
+
category: "mail",
|
|
27972
|
+
graphMethod: "GET",
|
|
27973
|
+
graphPathTemplate: '/me/messages?$search="{query}"',
|
|
27974
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/user-list-messages",
|
|
27975
|
+
options: [
|
|
27976
|
+
{
|
|
27977
|
+
name: "query",
|
|
27978
|
+
key: "query",
|
|
27979
|
+
required: true,
|
|
27980
|
+
description: "KQL or free-text query. Searches subject, body, sender, and recipients. " + "Examples: `Q3 budget`, `from:alice@contoso.com`, `subject:invoice received>=2026-01-01`."
|
|
27981
|
+
}
|
|
27982
|
+
],
|
|
27983
|
+
example: "ask-marcel search-mail-messages --query 'from:alice subject:Q3'",
|
|
27984
|
+
responseShape: "collection of Microsoft Graph `message` resources under `value[]`, ranked by relevance"
|
|
27985
|
+
};
|
|
27986
|
+
|
|
27987
|
+
// src/use-cases/commands/search-my-documents.ts
|
|
27988
|
+
var exports_search_my_documents = {};
|
|
27989
|
+
__export(exports_search_my_documents, {
|
|
27990
|
+
schema: () => schema70,
|
|
27991
|
+
meta: () => meta72,
|
|
27992
|
+
execute: () => execute70
|
|
27993
|
+
});
|
|
27994
|
+
var schema70 = exports_external.object({ query: exports_external.string().min(1) });
|
|
27995
|
+
var { execute: execute70 } = buildCommand((p) => `/me/drive/search(q='${p.query}')`, schema70);
|
|
27996
|
+
var meta72 = {
|
|
27997
|
+
summary: "Search the signed-in user’s default OneDrive for documents matching a free-text query (filename, content, metadata).",
|
|
27998
|
+
category: "drive",
|
|
27999
|
+
graphMethod: "GET",
|
|
28000
|
+
graphPathTemplate: "/me/drive/search(q='{query}')",
|
|
28001
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-search",
|
|
28002
|
+
options: [
|
|
28003
|
+
{
|
|
28004
|
+
name: "query",
|
|
28005
|
+
key: "query",
|
|
28006
|
+
required: true,
|
|
28007
|
+
description: "Free-text search query. Matches filename, content, and metadata across the user’s personal OneDrive. " + "Use `search-onedrive-files --drive-id <id>` instead to target a specific shared SharePoint or OneDrive drive by ID."
|
|
28008
|
+
}
|
|
28009
|
+
],
|
|
28010
|
+
example: "ask-marcel search-my-documents --query 'q1 budget'",
|
|
28011
|
+
responseShape: "collection of Microsoft Graph `driveItem` resources under `value[]`"
|
|
28012
|
+
};
|
|
26905
28013
|
|
|
26906
28014
|
// src/use-cases/commands/search-onedrive-files.ts
|
|
26907
28015
|
var exports_search_onedrive_files = {};
|
|
26908
28016
|
__export(exports_search_onedrive_files, {
|
|
26909
|
-
schema: () =>
|
|
26910
|
-
|
|
28017
|
+
schema: () => schema71,
|
|
28018
|
+
meta: () => meta73,
|
|
28019
|
+
execute: () => execute71
|
|
26911
28020
|
});
|
|
26912
|
-
var
|
|
26913
|
-
var
|
|
26914
|
-
const parsed =
|
|
28021
|
+
var schema71 = exports_external.object({ driveId: exports_external.string().min(1), query: exports_external.string().min(1) });
|
|
28022
|
+
var execute71 = async (graph, params) => {
|
|
28023
|
+
const parsed = schema71.safeParse(params);
|
|
26915
28024
|
if (!parsed.success)
|
|
26916
28025
|
throw new Error(`validation failed: ${parsed.error.message}`);
|
|
26917
28026
|
return graph.get(`/drives/${parsed.data.driveId}/search(q='${parsed.data.query}')`);
|
|
26918
28027
|
};
|
|
28028
|
+
var meta73 = {
|
|
28029
|
+
summary: "Search a single OneDrive / SharePoint drive for files and folders matching a free-text query.",
|
|
28030
|
+
category: "drive",
|
|
28031
|
+
graphMethod: "GET",
|
|
28032
|
+
graphPathTemplate: "/drives/{drive-id}/search(q='{query}')",
|
|
28033
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/driveitem-search",
|
|
28034
|
+
options: [
|
|
28035
|
+
{ name: "drive-id", key: "driveId", required: true, description: "Microsoft Graph drive ID to search inside. Returned by `ask-marcel list-drives`." },
|
|
28036
|
+
{ name: "query", key: "query", required: true, description: "Free-text search query. Matches filename, content, and metadata." }
|
|
28037
|
+
],
|
|
28038
|
+
example: "ask-marcel search-onedrive-files --drive-id 'b!1234' --query 'q1 budget'",
|
|
28039
|
+
responseShape: "collection of Microsoft Graph `driveItem` resources under `value[]`"
|
|
28040
|
+
};
|
|
28041
|
+
|
|
28042
|
+
// src/use-cases/commands/search-onenote-pages.ts
|
|
28043
|
+
var exports_search_onenote_pages = {};
|
|
28044
|
+
__export(exports_search_onenote_pages, {
|
|
28045
|
+
schema: () => schema72,
|
|
28046
|
+
meta: () => meta74,
|
|
28047
|
+
execute: () => execute72
|
|
28048
|
+
});
|
|
28049
|
+
var schema72 = exports_external.object({ titleSubstring: exports_external.string().min(1) });
|
|
28050
|
+
var { execute: execute72 } = buildCommand((p) => `/me/onenote/pages?$filter=contains(title,'${p.titleSubstring}')`, schema72);
|
|
28051
|
+
var meta74 = {
|
|
28052
|
+
summary: "Find OneNote pages whose title contains a substring (case-sensitive — page content is NOT searched). Microsoft removed full-text OneNote `?search=` from v1.0 Graph; only $filter against `title` remains, which is what this command runs.",
|
|
28053
|
+
category: "notes",
|
|
28054
|
+
graphMethod: "GET",
|
|
28055
|
+
graphPathTemplate: "/me/onenote/pages?$filter=contains(title,'{title-substring}')",
|
|
28056
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/onenote-list-pages",
|
|
28057
|
+
options: [
|
|
28058
|
+
{
|
|
28059
|
+
name: "title-substring",
|
|
28060
|
+
key: "titleSubstring",
|
|
28061
|
+
required: true,
|
|
28062
|
+
description: "Substring to look for inside OneNote page titles (case-sensitive, exact substring). " + "This is title-only — full-text body search is not available on OneNote pages in v1.0 Graph. " + "Use `list-onenote-section-pages` if you already know the section."
|
|
28063
|
+
}
|
|
28064
|
+
],
|
|
28065
|
+
example: "ask-marcel search-onenote-pages --title-substring 'meeting notes'",
|
|
28066
|
+
responseShape: "collection of Microsoft Graph `onenotePage` resources under `value[]` whose title contains the substring"
|
|
28067
|
+
};
|
|
28068
|
+
|
|
28069
|
+
// src/use-cases/commands/search-sharepoint-sites-by-name.ts
|
|
28070
|
+
var exports_search_sharepoint_sites_by_name = {};
|
|
28071
|
+
__export(exports_search_sharepoint_sites_by_name, {
|
|
28072
|
+
schema: () => schema73,
|
|
28073
|
+
meta: () => meta75,
|
|
28074
|
+
execute: () => execute73
|
|
28075
|
+
});
|
|
28076
|
+
var schema73 = exports_external.object({ query: exports_external.string().min(1) });
|
|
28077
|
+
var { execute: execute73 } = buildCommand((p) => `/sites?search=${p.query}`, schema73);
|
|
28078
|
+
var meta75 = {
|
|
28079
|
+
summary: "Search the tenant for SharePoint sites whose display name or description matches a free-text query (returns up to 25).",
|
|
28080
|
+
category: "sharepoint",
|
|
28081
|
+
graphMethod: "GET",
|
|
28082
|
+
graphPathTemplate: "/sites?search={query}",
|
|
28083
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/site-search",
|
|
28084
|
+
options: [
|
|
28085
|
+
{
|
|
28086
|
+
name: "query",
|
|
28087
|
+
key: "query",
|
|
28088
|
+
required: true,
|
|
28089
|
+
description: "Free-text query. Matches site display name and description across the tenant. " + "Use `search-sharepoint-sites` (no query) to instead list the sites the signed-in user follows."
|
|
28090
|
+
}
|
|
28091
|
+
],
|
|
28092
|
+
example: "ask-marcel search-sharepoint-sites-by-name --query 'marketing'",
|
|
28093
|
+
responseShape: "collection of Microsoft Graph `site` resources under `value[]` (up to 25)"
|
|
28094
|
+
};
|
|
26919
28095
|
|
|
26920
28096
|
// src/use-cases/commands/search-sharepoint-sites.ts
|
|
26921
28097
|
var exports_search_sharepoint_sites = {};
|
|
26922
28098
|
__export(exports_search_sharepoint_sites, {
|
|
26923
|
-
schema: () =>
|
|
26924
|
-
|
|
28099
|
+
schema: () => schema74,
|
|
28100
|
+
meta: () => meta76,
|
|
28101
|
+
execute: () => execute74
|
|
26925
28102
|
});
|
|
26926
|
-
var
|
|
26927
|
-
var { execute:
|
|
28103
|
+
var schema74 = exports_external.object({}).strict();
|
|
28104
|
+
var { execute: execute74 } = buildCommand(() => "/sites", schema74);
|
|
28105
|
+
var meta76 = {
|
|
28106
|
+
summary: "List the SharePoint sites the signed-in user has access to (returns the followed sites by default).",
|
|
28107
|
+
category: "sharepoint",
|
|
28108
|
+
graphMethod: "GET",
|
|
28109
|
+
graphPathTemplate: "/sites",
|
|
28110
|
+
graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/site-search",
|
|
28111
|
+
options: [],
|
|
28112
|
+
example: "ask-marcel search-sharepoint-sites",
|
|
28113
|
+
responseShape: "collection of Microsoft Graph `site` resources under `value[]`"
|
|
28114
|
+
};
|
|
26928
28115
|
|
|
26929
28116
|
// src/use-cases/commands/index.ts
|
|
26930
28117
|
var commands = {
|
|
@@ -26935,7 +28122,9 @@ var commands = {
|
|
|
26935
28122
|
"get-drive-item": exports_get_drive_item,
|
|
26936
28123
|
"list-drive-item-permissions": exports_list_drive_item_permissions,
|
|
26937
28124
|
"list-drive-item-versions": exports_list_drive_item_versions,
|
|
28125
|
+
"download-drive-item-version-content": exports_download_drive_item_version_content,
|
|
26938
28126
|
"search-onedrive-files": exports_search_onedrive_files,
|
|
28127
|
+
"search-my-documents": exports_search_my_documents,
|
|
26939
28128
|
"get-excel-range": exports_get_excel_range,
|
|
26940
28129
|
"list-excel-worksheets": exports_list_excel_worksheets,
|
|
26941
28130
|
"list-excel-tables": exports_list_excel_tables,
|
|
@@ -26943,22 +28132,23 @@ var commands = {
|
|
|
26943
28132
|
"list-excel-table-rows": exports_list_excel_table_rows,
|
|
26944
28133
|
"get-drive-delta": exports_get_drive_delta,
|
|
26945
28134
|
"search-sharepoint-sites": exports_search_sharepoint_sites,
|
|
28135
|
+
"search-sharepoint-sites-by-name": exports_search_sharepoint_sites_by_name,
|
|
26946
28136
|
"get-sharepoint-site": exports_get_sharepoint_site,
|
|
26947
28137
|
"list-sharepoint-site-drives": exports_list_sharepoint_site_drives,
|
|
26948
28138
|
"get-sharepoint-site-drive-by-id": exports_get_sharepoint_site_drive_by_id,
|
|
26949
|
-
"list-sharepoint-site-items": exports_list_sharepoint_site_items,
|
|
26950
|
-
"get-sharepoint-site-item": exports_get_sharepoint_site_item,
|
|
26951
28139
|
"list-sharepoint-site-lists": exports_list_sharepoint_site_lists,
|
|
26952
28140
|
"get-sharepoint-site-list": exports_get_sharepoint_site_list,
|
|
26953
28141
|
"list-sharepoint-site-list-items": exports_list_sharepoint_site_list_items,
|
|
26954
28142
|
"get-sharepoint-site-list-item": exports_get_sharepoint_site_list_item,
|
|
26955
28143
|
"get-sharepoint-site-by-path": exports_get_sharepoint_site_by_path,
|
|
26956
|
-
"get-sharepoint-sites-delta": exports_get_sharepoint_sites_delta,
|
|
26957
28144
|
"list-todo-task-lists": exports_list_todo_task_lists,
|
|
26958
28145
|
"list-todo-tasks": exports_list_todo_tasks,
|
|
28146
|
+
"list-incomplete-todo-tasks": exports_list_incomplete_todo_tasks,
|
|
26959
28147
|
"get-todo-task": exports_get_todo_task,
|
|
26960
28148
|
"list-todo-linked-resources": exports_list_todo_linked_resources,
|
|
28149
|
+
"list-planner-plans": exports_list_planner_plans,
|
|
26961
28150
|
"list-planner-tasks": exports_list_planner_tasks,
|
|
28151
|
+
"list-incomplete-planner-tasks": exports_list_incomplete_planner_tasks,
|
|
26962
28152
|
"get-planner-plan": exports_get_planner_plan,
|
|
26963
28153
|
"list-plan-tasks": exports_list_plan_tasks,
|
|
26964
28154
|
"get-planner-task": exports_get_planner_task,
|
|
@@ -26974,11 +28164,13 @@ var commands = {
|
|
|
26974
28164
|
"get-mail-attachment": exports_get_mail_attachment,
|
|
26975
28165
|
"list-mail-rules": exports_list_mail_rules,
|
|
26976
28166
|
"get-mailbox-settings": exports_get_mailbox_settings,
|
|
28167
|
+
"search-mail-messages": exports_search_mail_messages,
|
|
26977
28168
|
"list-onenote-notebooks": exports_list_onenote_notebooks,
|
|
26978
28169
|
"list-onenote-notebook-sections": exports_list_onenote_notebook_sections,
|
|
26979
28170
|
"list-all-onenote-sections": exports_list_all_onenote_sections,
|
|
26980
28171
|
"list-onenote-section-pages": exports_list_onenote_section_pages,
|
|
26981
28172
|
"get-onenote-page-content": exports_get_onenote_page_content,
|
|
28173
|
+
"search-onenote-pages": exports_search_onenote_pages,
|
|
26982
28174
|
"get-current-user": exports_get_current_user,
|
|
26983
28175
|
"get-my-profile-photo": exports_get_my_profile_photo,
|
|
26984
28176
|
"list-calendar-events": exports_list_calendar_events,
|
|
@@ -26991,88 +28183,160 @@ var commands = {
|
|
|
26991
28183
|
"list-calendars": exports_list_calendars,
|
|
26992
28184
|
"list-calendar-events-delta": exports_list_calendar_events_delta,
|
|
26993
28185
|
"list-calendar-view-delta": exports_list_calendar_view_delta,
|
|
26994
|
-
"list-outlook-contacts": exports_list_outlook_contacts,
|
|
26995
|
-
"get-outlook-contact": exports_get_outlook_contact,
|
|
26996
|
-
"list-chats": exports_list_chats,
|
|
26997
|
-
"get-chat": exports_get_chat,
|
|
26998
28186
|
"list-chat-members": exports_list_chat_members,
|
|
26999
|
-
"list-chat-messages": exports_list_chat_messages,
|
|
27000
|
-
"get-chat-message": exports_get_chat_message,
|
|
27001
|
-
"list-chat-message-hosted-contents": exports_list_chat_message_hosted_contents,
|
|
27002
|
-
"get-chat-message-hosted-content": exports_get_chat_message_hosted_content,
|
|
27003
|
-
"list-chat-message-replies": exports_list_chat_message_replies,
|
|
27004
|
-
"list-pinned-chat-messages": exports_list_pinned_chat_messages,
|
|
27005
28187
|
"list-joined-teams": exports_list_joined_teams,
|
|
27006
28188
|
"get-team": exports_get_team,
|
|
27007
28189
|
"list-team-channels": exports_list_team_channels,
|
|
27008
28190
|
"get-team-channel": exports_get_team_channel,
|
|
27009
|
-
"
|
|
27010
|
-
"get-channel-message": exports_get_channel_message,
|
|
27011
|
-
"list-channel-message-hosted-contents": exports_list_channel_message_hosted_contents,
|
|
27012
|
-
"get-channel-message-hosted-content": exports_get_channel_message_hosted_content,
|
|
27013
|
-
"list-channel-message-replies": exports_list_channel_message_replies,
|
|
27014
|
-
"list-channel-tabs": exports_list_channel_tabs,
|
|
27015
|
-
"list-team-members": exports_list_team_members,
|
|
27016
|
-
"get-channel-files-folder": exports_get_channel_files_folder
|
|
28191
|
+
"next-page": exports_next_page
|
|
27017
28192
|
};
|
|
27018
28193
|
|
|
27019
28194
|
// src/use-cases/commands/login.ts
|
|
27020
|
-
var
|
|
27021
|
-
var
|
|
28195
|
+
var schema75 = exports_external.object({}).strict();
|
|
28196
|
+
var execute75 = async (auth) => auth.getAccessToken();
|
|
27022
28197
|
|
|
27023
28198
|
// src/use-cases/commands/logout.ts
|
|
27024
|
-
var
|
|
27025
|
-
var
|
|
28199
|
+
var schema76 = exports_external.object({}).strict();
|
|
28200
|
+
var execute76 = async (auth) => auth.logout();
|
|
28201
|
+
|
|
28202
|
+
// src/use-cases/commands/update.ts
|
|
28203
|
+
var PACKAGE = "ask-marcel-office-cli";
|
|
28204
|
+
var argsFor = (manager) => manager === "bun" ? ["add", "-g", `${PACKAGE}@latest`] : ["i", "-g", `${PACKAGE}@latest`];
|
|
28205
|
+
var schema77 = exports_external.object({}).strict();
|
|
28206
|
+
var execute77 = async (runner, manager) => {
|
|
28207
|
+
const result = await runner.runInherit(manager, argsFor(manager));
|
|
28208
|
+
if (!result.ok)
|
|
28209
|
+
return err({ type: "spawn_failed", message: result.error.message });
|
|
28210
|
+
if (result.value.exitCode !== 0)
|
|
28211
|
+
return err({ type: "install_failed", exitCode: result.value.exitCode });
|
|
28212
|
+
return ok({ exitCode: result.value.exitCode });
|
|
28213
|
+
};
|
|
28214
|
+
|
|
28215
|
+
// src/composition/package-manager.ts
|
|
28216
|
+
var detectPackageManager = (binPath) => {
|
|
28217
|
+
const normalised = binPath.replaceAll("\\", "/");
|
|
28218
|
+
if (normalised.includes("/.bun/") || normalised.endsWith("/.bun"))
|
|
28219
|
+
return "bun";
|
|
28220
|
+
return "npm";
|
|
28221
|
+
};
|
|
27026
28222
|
|
|
27027
28223
|
// src/composition/cli.ts
|
|
27028
28224
|
var buildCli = (deps) => {
|
|
27029
|
-
const { auth, graph, logger, version: version2 } = deps;
|
|
28225
|
+
const { auth, graph, logger, processRunner, version: version2 } = deps;
|
|
27030
28226
|
const program2 = new Command;
|
|
28227
|
+
const fail = (message) => {
|
|
28228
|
+
renderError(message, logger);
|
|
28229
|
+
deps.onCommandError?.();
|
|
28230
|
+
};
|
|
27031
28231
|
program2.name("ask-marcel").description("Microsoft Graph CLI").version(version2 ?? "0.0.0");
|
|
27032
|
-
program2.
|
|
27033
|
-
|
|
28232
|
+
program2.commandsGroup("Lifecycle:");
|
|
28233
|
+
const loginCmd = program2.command("login").description("Authenticate against Microsoft Graph using the Teams web client (cached token → refresh → browser fallback).").action(async () => {
|
|
28234
|
+
const result = await execute75(auth);
|
|
27034
28235
|
if (result.ok)
|
|
27035
28236
|
render({ status: "authenticated" }, logger);
|
|
27036
28237
|
else
|
|
27037
|
-
|
|
27038
|
-
});
|
|
27039
|
-
|
|
27040
|
-
|
|
28238
|
+
fail(result.error.type === "auth_cancelled" ? "Authentication cancelled" : result.error.message);
|
|
28239
|
+
});
|
|
28240
|
+
loginCmd.addHelpText("after", [
|
|
28241
|
+
"",
|
|
28242
|
+
"Token cache: ~/.ask-marcel/token-cache.json (access + refresh tokens, JSON, 0600).",
|
|
28243
|
+
"Browser data: ~/.ask-marcel/browser-profile/ (Playwright persistent context).",
|
|
28244
|
+
"Scopes: granted by Microsoft to the Teams web client (CLIENT_ID 5e3ce6c0-...);",
|
|
28245
|
+
" this CLI cannot request additional scopes. To inspect the granted set:",
|
|
28246
|
+
" bun run scripts/print-token-scopes.ts",
|
|
28247
|
+
"Stuck flow: `ask-marcel logout` then re-run; the browser fallback opens a fresh Edge / Chrome window."
|
|
28248
|
+
].join(`
|
|
28249
|
+
`));
|
|
28250
|
+
const logoutCmd = program2.command("logout").description("Clear the cached Microsoft Graph token so the next command forces a fresh sign-in.").action(async () => {
|
|
28251
|
+
const result = await execute76(auth);
|
|
27041
28252
|
if (result.ok)
|
|
27042
28253
|
render({ status: "logged_out" }, logger);
|
|
27043
28254
|
else
|
|
27044
|
-
|
|
27045
|
-
});
|
|
27046
|
-
|
|
27047
|
-
|
|
27048
|
-
|
|
27049
|
-
|
|
27050
|
-
|
|
27051
|
-
|
|
27052
|
-
|
|
27053
|
-
|
|
27054
|
-
|
|
27055
|
-
|
|
27056
|
-
|
|
27057
|
-
|
|
28255
|
+
fail(result.error.type === "auth_cancelled" ? "Logout cancelled" : result.error.message);
|
|
28256
|
+
});
|
|
28257
|
+
logoutCmd.addHelpText("after", [
|
|
28258
|
+
"",
|
|
28259
|
+
"Removes: ~/.ask-marcel/token-cache.json (access + refresh tokens).",
|
|
28260
|
+
"Leaves alone: ~/.ask-marcel/browser-profile/ (delete it manually if you want a clean Playwright session too).",
|
|
28261
|
+
"Verify clean: ls ~/.ask-marcel/ (token-cache.json should be gone)."
|
|
28262
|
+
].join(`
|
|
28263
|
+
`));
|
|
28264
|
+
const updateCmd = program2.command("update").description("Re-install the latest published ask-marcel from npm, in place. Auto-detects whether you originally installed via npm or bun.").action(async () => {
|
|
28265
|
+
const manager = deps.packageManager ?? detectPackageManager(process.argv[1] ?? "");
|
|
28266
|
+
const result = await execute77(processRunner, manager);
|
|
28267
|
+
if (result.ok)
|
|
28268
|
+
render({ status: "updated", via: manager }, logger);
|
|
28269
|
+
else if (result.error.type === "spawn_failed")
|
|
28270
|
+
fail(`update failed: ${result.error.message}`);
|
|
28271
|
+
else
|
|
28272
|
+
fail(`update install exited with code ${result.error.exitCode}`);
|
|
28273
|
+
});
|
|
28274
|
+
updateCmd.addHelpText("after", [
|
|
28275
|
+
"",
|
|
28276
|
+
"Detection: based on the bin path of the running CLI.",
|
|
28277
|
+
" `/usr/local/lib/node_modules/...` -> npm, `~/.bun/install/...` -> bun.",
|
|
28278
|
+
"Side effect: shells out to `npm i -g ask-marcel-office-cli@latest` or `bun add -g ...`.",
|
|
28279
|
+
"Token cache: preserved (this only re-installs the JS bundle).",
|
|
28280
|
+
"Local clone: do NOT use `update` — pull and re-run `bun install` instead."
|
|
28281
|
+
].join(`
|
|
28282
|
+
`));
|
|
28283
|
+
program2.command("docs").description("Print Markdown docs for a single command (the same per-command page that ships in `docs/commands.json`).").argument("<command>", "Command name to show docs for (run `ask-marcel --help` to list every command).").action((commandName) => {
|
|
28284
|
+
const result = renderSingleCommand(commands, commandName);
|
|
28285
|
+
if (result.ok)
|
|
28286
|
+
process.stdout.write(`${result.value}
|
|
28287
|
+
`);
|
|
28288
|
+
else
|
|
28289
|
+
fail(`Unknown command "${result.error.name}". Run \`ask-marcel --help\` to list every command.`);
|
|
28290
|
+
});
|
|
28291
|
+
for (const category of CATEGORY_ORDER) {
|
|
28292
|
+
const entries = Object.entries(commands).filter(([, c]) => c.meta.category === category);
|
|
28293
|
+
if (entries.length === 0)
|
|
28294
|
+
continue;
|
|
28295
|
+
program2.commandsGroup(`${CATEGORY_LABELS[category]}:`);
|
|
28296
|
+
for (const [name, cmd] of entries) {
|
|
28297
|
+
const commandDef = program2.command(name).description(cmd.meta.summary);
|
|
28298
|
+
for (const opt of cmd.meta.options)
|
|
28299
|
+
commandDef.requiredOption(`--${opt.name} <value>`, opt.description);
|
|
28300
|
+
const helpLines = [
|
|
28301
|
+
`
|
|
28302
|
+
Graph endpoint: ${cmd.meta.graphMethod} ${cmd.meta.graphPathTemplate}`,
|
|
28303
|
+
`Microsoft Learn: ${cmd.meta.graphDocsUrl}`,
|
|
28304
|
+
...cmd.meta.bodyTemplate ? [`
|
|
28305
|
+
Request body:
|
|
28306
|
+
${cmd.meta.bodyTemplate}`] : [],
|
|
28307
|
+
`
|
|
28308
|
+
Example:
|
|
28309
|
+
${cmd.meta.example}`
|
|
28310
|
+
];
|
|
28311
|
+
commandDef.addHelpText("after", helpLines.join(`
|
|
28312
|
+
`));
|
|
28313
|
+
commandDef.action(async (opts) => {
|
|
28314
|
+
const result = await cmd.execute(graph, opts);
|
|
28315
|
+
if (result.ok)
|
|
28316
|
+
render(result.value, logger);
|
|
28317
|
+
else
|
|
28318
|
+
fail(result.error.message);
|
|
28319
|
+
});
|
|
28320
|
+
}
|
|
27058
28321
|
}
|
|
27059
28322
|
return program2;
|
|
27060
28323
|
};
|
|
27061
|
-
var getSchemaKeys = (schema89) => {
|
|
27062
|
-
const def = schema89;
|
|
27063
|
-
const shape = def.shape;
|
|
27064
|
-
if (shape)
|
|
27065
|
-
return Object.keys(shape);
|
|
27066
|
-
return [];
|
|
27067
|
-
};
|
|
27068
|
-
var camelToKebab = (s) => s.replaceAll(/([A-Z])/g, "-$1").toLowerCase();
|
|
27069
28324
|
|
|
27070
28325
|
// src/main.ts
|
|
27071
28326
|
var ONE_WEEK_MS = 1000 * 60 * 60 * 24 * 7;
|
|
27072
28327
|
var main = async () => {
|
|
27073
28328
|
updateNotifier({ pkg: { name: package_default.name, version: package_default.version }, updateCheckInterval: ONE_WEEK_MS }).notify({ defer: false });
|
|
27074
28329
|
const deps = buildDeps();
|
|
27075
|
-
const cli = buildCli({
|
|
28330
|
+
const cli = buildCli({
|
|
28331
|
+
auth: deps.auth,
|
|
28332
|
+
graph: deps.graph,
|
|
28333
|
+
logger: deps.logger,
|
|
28334
|
+
processRunner: deps.processRunner,
|
|
28335
|
+
version: package_default.version,
|
|
28336
|
+
onCommandError: () => {
|
|
28337
|
+
process.exitCode = 1;
|
|
28338
|
+
}
|
|
28339
|
+
});
|
|
27076
28340
|
await cli.parseAsync();
|
|
27077
28341
|
};
|
|
27078
28342
|
try {
|