ask-marcel-office-cli 0.5.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/README.md +275 -74
- package/dist/cli.js +96882 -14770
- package/dist/commands.json +5365 -489
- package/dist/composition/build-deps.d.ts +1 -0
- package/dist/composition/cli.d.ts +2 -0
- package/dist/index.js +94720 -13245
- package/dist/infra/auth.d.ts +31 -3
- package/dist/infra/browser-auth.d.ts +98 -1
- package/dist/infra/graph-client.d.ts +61 -2
- package/dist/infra/mammoth-adapter.d.ts +4 -0
- package/dist/infra/sheetjs-adapter.d.ts +9 -0
- package/dist/infra/turndown-adapter.d.ts +4 -0
- package/dist/presenter/output-text.d.ts +2 -0
- package/dist/presenter/output.d.ts +4 -2
- package/dist/use-cases/commands/build-command.d.ts +45 -1
- package/dist/use-cases/commands/command-types.d.ts +97 -3
- package/dist/use-cases/commands/convert-mail-attachment-to-markdown.d.ts +11 -0
- package/dist/use-cases/commands/convert-mail-attachment-to-pdf.d.ts +11 -0
- package/dist/use-cases/commands/convert-mail-to-markdown.d.ts +10 -0
- package/dist/use-cases/commands/docs-render.d.ts +7 -0
- package/dist/use-cases/commands/docx-to-markdown.d.ts +11 -0
- package/dist/use-cases/commands/download-drive-item-as-markdown.d.ts +11 -0
- package/dist/use-cases/commands/download-drive-item-as-pdf.d.ts +11 -0
- package/dist/use-cases/commands/download-drive-item-version-as-markdown.d.ts +12 -0
- package/dist/use-cases/commands/download-drive-item-version-as-pdf.d.ts +12 -0
- package/dist/use-cases/commands/download-onedrive-file-content.d.ts +2 -2
- package/dist/use-cases/commands/embedded-item-to-markdown.d.ts +59 -0
- package/dist/use-cases/commands/excel-error.d.ts +6 -0
- package/dist/use-cases/commands/extract-sharepoint-links-in-mail.d.ts +26 -0
- package/dist/use-cases/commands/fetch-raw-bytes.d.ts +56 -0
- package/dist/use-cases/commands/format-zod-error.d.ts +14 -0
- package/dist/use-cases/commands/get-calendar-event.d.ts +1 -5
- package/dist/use-cases/commands/get-calendar-view.d.ts +1 -6
- package/dist/use-cases/commands/get-channel-files-folder.d.ts +4 -0
- package/dist/use-cases/commands/get-chat.d.ts +8 -0
- package/dist/use-cases/commands/get-current-user.d.ts +1 -3
- package/dist/use-cases/commands/get-drive-delta.d.ts +1 -6
- package/dist/use-cases/commands/get-drive-item-analytics.d.ts +9 -0
- package/dist/use-cases/commands/get-drive-item-created-by-user.d.ts +4 -0
- package/dist/use-cases/commands/get-drive-item-last-modified-by-user.d.ts +4 -0
- package/dist/use-cases/commands/get-drive-item-list-item.d.ts +4 -0
- package/dist/use-cases/commands/get-drive-item.d.ts +1 -6
- package/dist/use-cases/commands/get-drive-root-delta.d.ts +4 -0
- package/dist/use-cases/commands/get-drive-root-item.d.ts +1 -5
- package/dist/use-cases/commands/get-drive-special-folder.d.ts +4 -0
- package/dist/use-cases/commands/get-excel-range.d.ts +1 -1
- package/dist/use-cases/commands/get-excel-table.d.ts +1 -1
- package/dist/use-cases/commands/get-excel-used-range.d.ts +10 -0
- package/dist/use-cases/commands/get-group-calendar-view.d.ts +4 -0
- package/dist/use-cases/commands/get-group.d.ts +4 -0
- package/dist/use-cases/commands/get-mail-attachment.d.ts +4 -2
- package/dist/use-cases/commands/get-mail-message-mime.d.ts +8 -0
- package/dist/use-cases/commands/get-mail-message.d.ts +1 -5
- package/dist/use-cases/commands/get-mail-rule.d.ts +9 -0
- package/dist/use-cases/commands/get-mailbox-settings.d.ts +1 -1
- package/dist/use-cases/commands/get-my-calendar.d.ts +4 -0
- package/dist/use-cases/commands/get-my-manager.d.ts +9 -0
- package/dist/use-cases/commands/get-onenote-page-as-markdown.d.ts +10 -0
- package/dist/use-cases/commands/get-organization.d.ts +4 -0
- package/dist/use-cases/commands/get-shared-calendar-view.d.ts +4 -0
- package/dist/use-cases/commands/get-shared-mailbox-message.d.ts +4 -0
- package/dist/use-cases/commands/get-sharepoint-list-column.d.ts +4 -0
- package/dist/use-cases/commands/get-sharepoint-site-drive-by-id.d.ts +1 -6
- package/dist/use-cases/commands/get-sharepoint-site-list-item.d.ts +1 -7
- package/dist/use-cases/commands/get-sharepoint-site-list.d.ts +1 -6
- package/dist/use-cases/commands/get-sharepoint-site-onenote-page-content.d.ts +9 -0
- package/dist/use-cases/commands/get-sharepoint-site.d.ts +1 -5
- package/dist/use-cases/commands/get-site-analytics.d.ts +8 -0
- package/dist/use-cases/commands/get-specific-calendar-event.d.ts +1 -6
- package/dist/use-cases/commands/get-specific-calendar-view.d.ts +1 -7
- package/dist/use-cases/commands/get-team-channel.d.ts +3 -7
- package/dist/use-cases/commands/get-team-primary-channel.d.ts +4 -0
- package/dist/use-cases/commands/get-team.d.ts +1 -5
- package/dist/use-cases/commands/get-todo-task.d.ts +1 -6
- package/dist/use-cases/commands/get-user-manager.d.ts +10 -0
- package/dist/use-cases/commands/graph-scopes.d.ts +29 -0
- package/dist/use-cases/commands/inline-image-embedder.d.ts +20 -0
- package/dist/use-cases/commands/list-all-onenote-sections.d.ts +1 -3
- package/dist/use-cases/commands/list-calendar-event-instances.d.ts +3 -9
- package/dist/use-cases/commands/list-calendar-events-delta.d.ts +5 -3
- package/dist/use-cases/commands/list-calendar-events.d.ts +1 -3
- package/dist/use-cases/commands/list-calendar-group-calendars.d.ts +4 -0
- package/dist/use-cases/commands/list-calendar-groups.d.ts +4 -0
- package/dist/use-cases/commands/list-calendar-view-delta.d.ts +3 -2
- package/dist/use-cases/commands/list-calendars.d.ts +1 -3
- package/dist/use-cases/commands/list-chat-members.d.ts +3 -6
- package/dist/use-cases/commands/list-chats.d.ts +4 -0
- package/dist/use-cases/commands/list-conversation-messages.d.ts +12 -0
- package/dist/use-cases/commands/list-drive-item-permissions.d.ts +1 -6
- package/dist/use-cases/commands/list-drive-item-thumbnails.d.ts +4 -0
- package/dist/use-cases/commands/list-drive-item-versions.d.ts +1 -6
- package/dist/use-cases/commands/list-drives.d.ts +1 -3
- package/dist/use-cases/commands/list-excel-comments.d.ts +5 -0
- package/dist/use-cases/commands/list-excel-defined-names.d.ts +5 -0
- package/dist/use-cases/commands/list-excel-table-rows.d.ts +2 -7
- package/dist/use-cases/commands/list-excel-tables.d.ts +2 -6
- package/dist/use-cases/commands/list-excel-worksheet-charts.d.ts +5 -0
- package/dist/use-cases/commands/list-excel-worksheet-pivot-tables.d.ts +5 -0
- package/dist/use-cases/commands/list-excel-worksheets.d.ts +2 -6
- package/dist/use-cases/commands/list-focused-inbox-overrides.d.ts +4 -0
- package/dist/use-cases/commands/list-folder-files.d.ts +1 -6
- package/dist/use-cases/commands/list-followed-drive-items.d.ts +4 -0
- package/dist/use-cases/commands/list-group-conversations.d.ts +4 -0
- package/dist/use-cases/commands/list-group-events.d.ts +4 -0
- package/dist/use-cases/commands/list-group-members.d.ts +4 -0
- package/dist/use-cases/commands/list-group-owners.d.ts +4 -0
- package/dist/use-cases/commands/list-group-threads.d.ts +4 -0
- package/dist/use-cases/commands/list-groups.d.ts +4 -0
- package/dist/use-cases/commands/list-incomplete-planner-tasks.d.ts +10 -3
- package/dist/use-cases/commands/list-incomplete-todo-tasks.d.ts +8 -2
- package/dist/use-cases/commands/list-mail-attachments.d.ts +8 -2
- package/dist/use-cases/commands/list-mail-child-folders.d.ts +1 -5
- package/dist/use-cases/commands/list-mail-folder-messages-delta.d.ts +4 -0
- package/dist/use-cases/commands/list-mail-folder-messages.d.ts +1 -5
- package/dist/use-cases/commands/list-mail-folders.d.ts +1 -3
- package/dist/use-cases/commands/list-mail-messages.d.ts +1 -3
- package/dist/use-cases/commands/list-mail-rules.d.ts +1 -1
- package/dist/use-cases/commands/list-my-direct-reports.d.ts +13 -0
- package/dist/use-cases/commands/list-my-memberships.d.ts +4 -0
- package/dist/use-cases/commands/list-my-transitive-memberships.d.ts +4 -0
- package/dist/use-cases/commands/list-onenote-notebook-sections.d.ts +1 -5
- package/dist/use-cases/commands/list-onenote-notebooks.d.ts +1 -3
- package/dist/use-cases/commands/list-onenote-section-pages.d.ts +1 -5
- package/dist/use-cases/commands/list-outlook-categories.d.ts +6 -0
- package/dist/use-cases/commands/list-plan-buckets.d.ts +1 -5
- package/dist/use-cases/commands/list-planner-plans.d.ts +1 -3
- package/dist/use-cases/commands/list-planner-tasks.d.ts +1 -3
- package/dist/use-cases/commands/list-recent-files.d.ts +4 -0
- package/dist/use-cases/commands/list-recently-used-insights.d.ts +4 -0
- package/dist/use-cases/commands/list-relevant-people.d.ts +4 -0
- package/dist/use-cases/commands/list-room-lists.d.ts +4 -0
- package/dist/use-cases/commands/list-rooms.d.ts +4 -0
- package/dist/use-cases/commands/list-sensitivity-labels.d.ts +4 -0
- package/dist/use-cases/commands/list-shared-calendar-events.d.ts +4 -0
- package/dist/use-cases/commands/list-shared-insights.d.ts +4 -0
- package/dist/use-cases/commands/list-shared-mailbox-folder-messages.d.ts +4 -0
- package/dist/use-cases/commands/list-shared-mailbox-messages.d.ts +4 -0
- package/dist/use-cases/commands/list-shared-with-me.d.ts +6 -0
- package/dist/use-cases/commands/list-sharepoint-list-columns.d.ts +4 -0
- package/dist/use-cases/commands/list-sharepoint-list-item-versions.d.ts +4 -0
- package/dist/use-cases/commands/list-sharepoint-site-drives.d.ts +1 -5
- package/dist/use-cases/commands/list-sharepoint-site-list-items.d.ts +1 -6
- package/dist/use-cases/commands/list-sharepoint-site-lists.d.ts +7 -2
- package/dist/use-cases/commands/list-sharepoint-site-onenote-notebook-sections.d.ts +5 -0
- package/dist/use-cases/commands/list-sharepoint-site-onenote-notebooks.d.ts +5 -0
- package/dist/use-cases/commands/list-sharepoint-site-onenote-section-pages.d.ts +5 -0
- package/dist/use-cases/commands/list-sharepoint-site-pages.d.ts +4 -0
- package/dist/use-cases/commands/list-site-columns.d.ts +4 -0
- package/dist/use-cases/commands/list-site-content-types.d.ts +4 -0
- package/dist/use-cases/commands/list-specific-calendar-events.d.ts +1 -5
- package/dist/use-cases/commands/list-team-channels.d.ts +1 -5
- package/dist/use-cases/commands/list-team-installed-apps.d.ts +8 -0
- package/dist/use-cases/commands/list-todo-linked-resources.d.ts +1 -6
- package/dist/use-cases/commands/list-todo-task-lists.d.ts +1 -3
- package/dist/use-cases/commands/list-todo-tasks-delta.d.ts +8 -0
- package/dist/use-cases/commands/list-todo-tasks.d.ts +8 -2
- package/dist/use-cases/commands/list-trending-insights.d.ts +4 -0
- package/dist/use-cases/commands/list-user-direct-reports.d.ts +4 -0
- package/dist/use-cases/commands/markdown-pipeline.d.ts +23 -0
- package/dist/use-cases/commands/microsoft-search-query.d.ts +8 -0
- package/dist/use-cases/commands/my-quick-context.d.ts +6 -0
- package/dist/use-cases/commands/next-page.d.ts +2 -2
- package/dist/use-cases/commands/odata-query.d.ts +90 -0
- package/dist/use-cases/commands/office-to-markdown.d.ts +6 -0
- package/dist/use-cases/commands/onenote-5k-limit.d.ts +3 -0
- package/dist/use-cases/commands/output-path.d.ts +37 -0
- package/dist/use-cases/commands/scopes-check.d.ts +6 -0
- package/dist/use-cases/commands/search-mail-messages.d.ts +3 -6
- package/dist/use-cases/commands/search-my-documents.d.ts +1 -5
- package/dist/use-cases/commands/search-onedrive-files.d.ts +1 -8
- package/dist/use-cases/commands/search-onenote-pages.d.ts +7 -2
- package/dist/use-cases/commands/search-sharepoint-sites-by-name.d.ts +1 -5
- package/dist/use-cases/commands/sharepoint-link-extractor.d.ts +14 -0
- package/dist/use-cases/commands/text-passthrough.d.ts +24 -0
- package/dist/use-cases/commands/version-id.d.ts +18 -0
- package/dist/use-cases/commands/xlsx-to-markdown.d.ts +6 -0
- package/dist/use-cases/ports/filesystem.d.ts +8 -0
- package/docs/commands.json +5365 -489
- package/package.json +9 -2
- /package/dist/use-cases/commands/{search-sharepoint-sites.d.ts → list-mail-folders-delta.d.ts} +0 -0
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
siteId: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
7
3
|
declare const meta: CommandMeta;
|
|
8
4
|
export { execute, meta, schema };
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
siteId: z.ZodString;
|
|
5
|
-
listId: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
8
3
|
declare const meta: CommandMeta;
|
|
9
4
|
export { execute, meta, schema };
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CommandMeta } from './command-types.js';
|
|
2
|
+
import type { Command, CommandMeta } from './command-types.js';
|
|
3
3
|
declare const schema: z.ZodObject<{
|
|
4
4
|
siteId: z.ZodString;
|
|
5
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
6
|
+
select: z.ZodOptional<z.ZodString>;
|
|
7
|
+
top: z.ZodOptional<z.ZodString>;
|
|
8
|
+
orderby: z.ZodOptional<z.ZodString>;
|
|
9
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
5
10
|
}, z.core.$strip>;
|
|
6
|
-
declare const execute:
|
|
11
|
+
declare const execute: Command['execute'];
|
|
7
12
|
declare const meta: CommandMeta;
|
|
8
13
|
export { execute, meta, schema };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
calendarId: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
7
3
|
declare const meta: CommandMeta;
|
|
8
4
|
export { execute, meta, schema };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
teamId: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
7
3
|
declare const meta: CommandMeta;
|
|
8
4
|
export { execute, meta, schema };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandMeta } from './command-types.js';
|
|
3
|
+
declare const schema: z.ZodObject<{
|
|
4
|
+
teamId: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const execute: import("./command-types.js").CommandExecute;
|
|
7
|
+
declare const meta: CommandMeta;
|
|
8
|
+
export { execute, meta, schema };
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
todoTaskListId: z.ZodString;
|
|
5
|
-
todoTaskId: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
8
3
|
declare const meta: CommandMeta;
|
|
9
4
|
export { execute, meta, schema };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const
|
|
4
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
5
3
|
declare const meta: CommandMeta;
|
|
6
4
|
export { execute, meta, schema };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandMeta } from './command-types.js';
|
|
3
|
+
declare const schema: z.ZodObject<{
|
|
4
|
+
todoTaskListId: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const execute: import("./command-types.js").CommandExecute;
|
|
7
|
+
declare const meta: CommandMeta;
|
|
8
|
+
export { execute, meta, schema };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CommandMeta } from './command-types.js';
|
|
2
|
+
import type { Command, CommandMeta } from './command-types.js';
|
|
3
3
|
declare const schema: z.ZodObject<{
|
|
4
4
|
todoTaskListId: z.ZodString;
|
|
5
|
+
top: z.ZodOptional<z.ZodString>;
|
|
6
|
+
skip: z.ZodOptional<z.ZodString>;
|
|
7
|
+
select: z.ZodOptional<z.ZodString>;
|
|
8
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
9
|
+
orderby: z.ZodOptional<z.ZodString>;
|
|
10
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
5
11
|
}, z.core.$strip>;
|
|
6
|
-
declare const execute:
|
|
12
|
+
declare const execute: Command['execute'];
|
|
7
13
|
declare const meta: CommandMeta;
|
|
8
14
|
export { execute, meta, schema };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Result } from '../../domain/result.js';
|
|
2
|
+
import type { GraphClient, GraphError } from '../../infra/graph-client.js';
|
|
3
|
+
import { type InlineAttachment } from './inline-image-embedder.js';
|
|
4
|
+
/**
|
|
5
|
+
* Orchestrate the four steps that turn a Graph `?format=html` content
|
|
6
|
+
* call into a markdown envelope:
|
|
7
|
+
*
|
|
8
|
+
* 1. getBinary(contentPath)
|
|
9
|
+
* 2. if Graph returned a 302 downloadUrl, follow via fetchUrl (host
|
|
10
|
+
* allow-list enforced inside fetchUrl, Hardening #3)
|
|
11
|
+
* 3. embedInlineImages over any cid: refs (Hardening #1: image/* only)
|
|
12
|
+
* 4. htmlToMarkdown via turndown
|
|
13
|
+
*
|
|
14
|
+
* Returns `{ contentType: 'text/markdown', size, text }` on success.
|
|
15
|
+
*/
|
|
16
|
+
type MarkdownEnvelope = {
|
|
17
|
+
readonly contentType: 'text/markdown';
|
|
18
|
+
readonly size: number;
|
|
19
|
+
readonly text: string;
|
|
20
|
+
};
|
|
21
|
+
declare const convertToMarkdown: (graph: GraphClient, contentPath: string, inlineAttachments?: ReadonlyArray<InlineAttachment>) => Promise<Result<MarkdownEnvelope, GraphError>>;
|
|
22
|
+
export { convertToMarkdown };
|
|
23
|
+
export type { MarkdownEnvelope };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Command, CommandMeta } from './command-types.js';
|
|
3
|
+
declare const schema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const execute: Command['execute'];
|
|
7
|
+
declare const meta: CommandMeta;
|
|
8
|
+
export { execute, meta, schema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CommandMeta } from './command-types.js';
|
|
2
|
+
import type { Command, CommandMeta } from './command-types.js';
|
|
3
3
|
declare const schema: z.ZodObject<{
|
|
4
4
|
url: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
declare const execute:
|
|
6
|
+
declare const execute: Command['execute'];
|
|
7
7
|
declare const meta: CommandMeta;
|
|
8
8
|
export { execute, meta, schema };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandOptionMeta } from './command-types.js';
|
|
3
|
+
declare const odataQuerySchema: z.ZodObject<{
|
|
4
|
+
top: z.ZodOptional<z.ZodString>;
|
|
5
|
+
skip: z.ZodOptional<z.ZodString>;
|
|
6
|
+
select: z.ZodOptional<z.ZodString>;
|
|
7
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
8
|
+
orderby: z.ZodOptional<z.ZodString>;
|
|
9
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
type ODataQueryParams = z.infer<typeof odataQuerySchema>;
|
|
12
|
+
declare const appendOData: (path: string, params: ODataQueryParams) => string;
|
|
13
|
+
declare const odataQueryOptions: ReadonlyArray<CommandOptionMeta>;
|
|
14
|
+
/**
|
|
15
|
+
* Subset for single-resource GETs that support `$select` and `$expand` but
|
|
16
|
+
* have no collection to slice (`$top`/`$skip`/`$filter`/`$orderby` make no
|
|
17
|
+
* sense). Keeping this as a separate Zod fragment lets `buildSelectableCommand`
|
|
18
|
+
* advertise only the two relevant flags in `--help`.
|
|
19
|
+
*/
|
|
20
|
+
declare const selectExpandSchema: z.ZodObject<{
|
|
21
|
+
select: z.ZodOptional<z.ZodString>;
|
|
22
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type SelectExpandParams = z.infer<typeof selectExpandSchema>;
|
|
25
|
+
declare const selectExpandOptions: ReadonlyArray<CommandOptionMeta>;
|
|
26
|
+
/**
|
|
27
|
+
* Subset for collection endpoints that Microsoft documents as supporting only
|
|
28
|
+
* `$filter` + `$select` (e.g. `/teams/{id}/channels`). Advertising the other
|
|
29
|
+
* OData passthroughs would be a usability lie since Graph rejects them with
|
|
30
|
+
* `BadRequest`.
|
|
31
|
+
*/
|
|
32
|
+
declare const filterSelectSchema: z.ZodObject<{
|
|
33
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
34
|
+
select: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type FilterSelectParams = z.infer<typeof filterSelectSchema>;
|
|
37
|
+
declare const filterSelectOptions: ReadonlyArray<CommandOptionMeta>;
|
|
38
|
+
/**
|
|
39
|
+
* Subset for collection endpoints that REJECT `$skip` with
|
|
40
|
+
* `invalidRequest: $skip is not supported on this API. Only URLs returned
|
|
41
|
+
* by the API can be used to page.` (e.g. `/sites/{id}/lists`). Drop --skip
|
|
42
|
+
* from the advertised flags; pagination still works via `nextLink` →
|
|
43
|
+
* `next-page`.
|
|
44
|
+
*/
|
|
45
|
+
declare const noSkipShape: Omit<typeof odataQuerySchema.shape, "skip">;
|
|
46
|
+
declare const noSkipOptions: ReadonlyArray<CommandOptionMeta>;
|
|
47
|
+
type ODataKey = keyof typeof odataQuerySchema.shape;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a zod-extension shape containing ONLY the named OData fields.
|
|
50
|
+
* Use for endpoints where Graph silently ignores some passthroughs — the
|
|
51
|
+
* CLI advertises only the ones the endpoint honors.
|
|
52
|
+
*/
|
|
53
|
+
declare const pickODataShape: <K extends ODataKey>(keys: ReadonlyArray<K>) => Pick<typeof odataQuerySchema.shape, K>;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the matching CommandOptionMeta entries for use in `meta.options`.
|
|
56
|
+
* Order is preserved from the canonical `odataQueryOptions` definition.
|
|
57
|
+
*/
|
|
58
|
+
declare const pickODataOptions: (keys: ReadonlyArray<ODataKey>) => ReadonlyArray<CommandOptionMeta>;
|
|
59
|
+
/**
|
|
60
|
+
* Subset for delta-tracking endpoints where Graph silently ignores every
|
|
61
|
+
* OData passthrough except `$top` (which itself must be translated to a
|
|
62
|
+
* `Prefer: odata.maxpagesize` header — `$top` as a query parameter returns
|
|
63
|
+
* `ErrorInvalidUrlQuery`). The CLI keeps `--top` as the user-facing flag
|
|
64
|
+
* and drops the others rather than advertising no-ops.
|
|
65
|
+
*/
|
|
66
|
+
declare const topOnlyShape: Pick<{
|
|
67
|
+
top: z.ZodOptional<z.ZodString>;
|
|
68
|
+
skip: z.ZodOptional<z.ZodString>;
|
|
69
|
+
select: z.ZodOptional<z.ZodString>;
|
|
70
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
71
|
+
orderby: z.ZodOptional<z.ZodString>;
|
|
72
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, "top">;
|
|
74
|
+
declare const topOnlyOptions: readonly CommandOptionMeta[];
|
|
75
|
+
/**
|
|
76
|
+
* Subset for endpoints where Graph honors ONLY `$select` (e.g.
|
|
77
|
+
* `/me/planner/plans`, `/planner/plans/{id}/buckets` — the other OData
|
|
78
|
+
* passthroughs are silently dropped server-side).
|
|
79
|
+
*/
|
|
80
|
+
declare const selectOnlyShape: Pick<{
|
|
81
|
+
top: z.ZodOptional<z.ZodString>;
|
|
82
|
+
skip: z.ZodOptional<z.ZodString>;
|
|
83
|
+
select: z.ZodOptional<z.ZodString>;
|
|
84
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
85
|
+
orderby: z.ZodOptional<z.ZodString>;
|
|
86
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, "select">;
|
|
88
|
+
declare const selectOnlyOptions: readonly CommandOptionMeta[];
|
|
89
|
+
export { appendOData, filterSelectOptions, filterSelectSchema, noSkipOptions, noSkipShape, odataQueryOptions, odataQuerySchema, pickODataOptions, pickODataShape, selectExpandOptions, selectExpandSchema, selectOnlyOptions, selectOnlyShape, topOnlyOptions, topOnlyShape, };
|
|
90
|
+
export type { FilterSelectParams, ODataKey, ODataQueryParams, SelectExpandParams };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Result } from '../../domain/result.js';
|
|
2
|
+
import type { GraphClient, GraphError } from '../../infra/graph-client.js';
|
|
3
|
+
import type { FetchOptions } from './fetch-raw-bytes.js';
|
|
4
|
+
declare const officeToMarkdown: (graph: GraphClient, contentPath: string, filename: string, opts?: FetchOptions) => Promise<Result<unknown, GraphError>>;
|
|
5
|
+
export { officeToMarkdown };
|
|
6
|
+
export type { FetchOptions };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Result } from '../../domain/result.js';
|
|
2
|
+
import type { FileSystem } from '../ports/filesystem.js';
|
|
3
|
+
/**
|
|
4
|
+
* Generic interceptor used by the global `--output-path` flag in `cli.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Given a use-case's success value, if the user passed `--output-path
|
|
7
|
+
* <path>` the CLI calls this helper to land the inlined bytes on disk
|
|
8
|
+
* and rewrite the envelope so the LLM never sees a multi-MB base64
|
|
9
|
+
* string in stdout.
|
|
10
|
+
*
|
|
11
|
+
* Two recognized inline shapes — both produced by `inlineBinary` and
|
|
12
|
+
* `office-to-markdown`:
|
|
13
|
+
*
|
|
14
|
+
* 1. `{ contentType, size, base64 }` — written via `fs.writeBytes`,
|
|
15
|
+
* with `base64` replaced by `savedTo`.
|
|
16
|
+
* 2. `{ contentType, size, text }` — written via `fs.writeText`,
|
|
17
|
+
* with `text` replaced by `savedTo`.
|
|
18
|
+
*
|
|
19
|
+
* Anything else (plain JSON gets, error envelopes, etc.) returns
|
|
20
|
+
* `no_inlined_bytes` so the CLI can surface a clear error rather than
|
|
21
|
+
* silently no-op'ing.
|
|
22
|
+
*/
|
|
23
|
+
export type OutputPathError = {
|
|
24
|
+
readonly type: 'no_inlined_bytes';
|
|
25
|
+
} | {
|
|
26
|
+
readonly type: 'write_failed';
|
|
27
|
+
readonly message: string;
|
|
28
|
+
} | {
|
|
29
|
+
readonly type: 'empty_path';
|
|
30
|
+
} | {
|
|
31
|
+
readonly type: 'is_directory';
|
|
32
|
+
} | {
|
|
33
|
+
readonly type: 'passthrough_extension_mismatch';
|
|
34
|
+
readonly contentType: string;
|
|
35
|
+
readonly requestedExtension: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const persistIfRequested: (fs: FileSystem, outputPath: string | undefined, data: unknown) => Promise<Result<unknown, OutputPathError>>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const schema:
|
|
4
|
-
query: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
1
|
+
import type { Command, CommandMeta } from './command-types.js';
|
|
2
|
+
declare const execute: Command['execute'];
|
|
3
|
+
declare const schema: import("./command-types.js").CommandSchema;
|
|
7
4
|
declare const meta: CommandMeta;
|
|
8
5
|
export { execute, meta, schema };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
query: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
7
3
|
declare const meta: CommandMeta;
|
|
8
4
|
export { execute, meta, schema };
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { Result } from '../../domain/result.js';
|
|
3
|
-
import type { GraphClient } from '../../infra/graph-client.js';
|
|
4
1
|
import type { CommandMeta } from './command-types.js';
|
|
5
|
-
declare const schema:
|
|
6
|
-
driveId: z.ZodString;
|
|
7
|
-
query: z.ZodString;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
declare const execute: (graph: GraphClient, params: Record<string, string>) => Promise<Result<unknown, import("../../infra/graph-client.js").GraphError>>;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
10
3
|
declare const meta: CommandMeta;
|
|
11
4
|
export { execute, meta, schema };
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CommandMeta } from './command-types.js';
|
|
2
|
+
import type { Command, CommandMeta } from './command-types.js';
|
|
3
3
|
declare const schema: z.ZodObject<{
|
|
4
4
|
titleSubstring: z.ZodString;
|
|
5
|
+
select: z.ZodOptional<z.ZodString>;
|
|
6
|
+
top: z.ZodOptional<z.ZodString>;
|
|
7
|
+
skip: z.ZodOptional<z.ZodString>;
|
|
8
|
+
orderby: z.ZodOptional<z.ZodString>;
|
|
9
|
+
expand: z.ZodOptional<z.ZodString>;
|
|
5
10
|
}, z.core.$strip>;
|
|
6
|
-
declare const execute:
|
|
11
|
+
declare const execute: Command['execute'];
|
|
7
12
|
declare const meta: CommandMeta;
|
|
8
13
|
export { execute, meta, schema };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CommandMeta } from './command-types.js';
|
|
3
|
-
declare const schema:
|
|
4
|
-
query: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
declare const execute: import("./command-types.js").CommandExecute;
|
|
2
|
+
declare const execute: import("./command-types.js").CommandExecute, schema: import("./command-types.js").CommandSchema;
|
|
7
3
|
declare const meta: CommandMeta;
|
|
8
4
|
export { execute, meta, schema };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for `extract-sharepoint-links-in-mail`.
|
|
3
|
+
*
|
|
4
|
+
* `extractSharepointUrls(htmlBody)` finds every `https://*.sharepoint.com/...`
|
|
5
|
+
* URL inside an HTML mail body — both `<a href=...>` and bare-text
|
|
6
|
+
* occurrences — and returns the deduplicated list.
|
|
7
|
+
*
|
|
8
|
+
* `buildShareToken(url)` encodes a URL for Graph's `/shares/{token}`
|
|
9
|
+
* resolver per [shares-get](https://learn.microsoft.com/en-us/graph/api/shares-get):
|
|
10
|
+
* `u!` + base64url(url) with no padding.
|
|
11
|
+
*/
|
|
12
|
+
declare const extractSharepointUrls: (htmlBody: string) => ReadonlyArray<string>;
|
|
13
|
+
declare const buildShareToken: (url: string) => string;
|
|
14
|
+
export { buildShareToken, extractSharepointUrls };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Microsoft Graph's `?format=pdf` / `?format=html` conversion accepts a
|
|
3
|
+
* fixed set of source extensions. For anything outside that whitelist
|
|
4
|
+
* Graph (or its downstream Office Online sandbox) returns a 4xx, which
|
|
5
|
+
* is a cryptic failure mode for an LLM agent.
|
|
6
|
+
*
|
|
7
|
+
* The conversion commands short-circuit on the extensions below and
|
|
8
|
+
* return the raw bytes instead of attempting (and wasting) a Graph
|
|
9
|
+
* round-trip:
|
|
10
|
+
*
|
|
11
|
+
* - PLAIN_TEXT_EXTENSIONS: extensions that are themselves plain text
|
|
12
|
+
* (txt/md/json/yaml/etc.) — turning these through `?format=pdf` or
|
|
13
|
+
* `?format=html` is meaningless; just return the bytes.
|
|
14
|
+
*
|
|
15
|
+
* - `pdf`: the `*-as-pdf` commands ask Graph to convert TO pdf, but
|
|
16
|
+
* `pdf` is NOT in Graph's `format=pdf` source-input list (verified
|
|
17
|
+
* 2026-05 against svc.ms; CDN responds 406 InputFormatNotSupported).
|
|
18
|
+
* The user wanted a PDF and the source IS a PDF, so return its
|
|
19
|
+
* bytes directly.
|
|
20
|
+
*/
|
|
21
|
+
declare const PLAIN_TEXT_EXTENSIONS: ReadonlySet<string>;
|
|
22
|
+
declare const isPlainTextFilename: (name: string) => boolean;
|
|
23
|
+
declare const isPdfSource: (name: string) => boolean;
|
|
24
|
+
export { isPdfSource, isPlainTextFilename, PLAIN_TEXT_EXTENSIONS };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph's historical-version endpoints template `{version-id}` as a string
|
|
3
|
+
* that must look like a stringified float (`"79.0"`, `"4.0"`). An LLM
|
|
4
|
+
* (reasonably) types `79`, and the response is wildly inconsistent across
|
|
5
|
+
* the three sibling commands:
|
|
6
|
+
*
|
|
7
|
+
* - download-drive-item-version-content → `invalidRequest`
|
|
8
|
+
* - download-drive-item-version-as-markdown → `invalidRequest`
|
|
9
|
+
* - download-drive-item-version-as-pdf → accepts (Graph quirk)
|
|
10
|
+
*
|
|
11
|
+
* Audit round-6 §1.4 caught the inconsistency. Normalize at the CLI
|
|
12
|
+
* boundary: a pure-integer version-id gets `.0` appended before path
|
|
13
|
+
* substitution, so all three commands accept both spellings.
|
|
14
|
+
*
|
|
15
|
+
* Already-floated values (`79.0`, `12.5`, `4.1`) and non-numeric values
|
|
16
|
+
* (a bad input the schema will then reject) pass through unchanged.
|
|
17
|
+
*/
|
|
18
|
+
export declare const normalizeVersionId: (raw: string) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Result } from '../../domain/result.js';
|
|
2
|
+
import type { GraphError } from '../../infra/graph-client.js';
|
|
3
|
+
import type { MarkdownEnvelope } from './docx-to-markdown.js';
|
|
4
|
+
declare const csvToMarkdownTable: (csv: string) => string;
|
|
5
|
+
declare const xlsxToMarkdown: (bytes: Uint8Array) => Result<MarkdownEnvelope, GraphError>;
|
|
6
|
+
export { csvToMarkdownTable, xlsxToMarkdown };
|
|
@@ -11,5 +11,13 @@ export type FileSystemError = {
|
|
|
11
11
|
export type FileSystem = {
|
|
12
12
|
readonly readJson: <T>(path: string) => Promise<Result<T, FileSystemError>>;
|
|
13
13
|
readonly writeText: (path: string, content: string) => Promise<Result<void, FileSystemError>>;
|
|
14
|
+
readonly writeBytes: (path: string, bytes: Uint8Array) => Promise<Result<void, FileSystemError>>;
|
|
14
15
|
readonly deleteIfExists: (path: string) => Promise<Result<void, FileSystemError>>;
|
|
16
|
+
/**
|
|
17
|
+
* Recursively delete a directory (and all its contents). Used by `logout`
|
|
18
|
+
* to wipe the Playwright persistent browser profile so stale auth cookies
|
|
19
|
+
* don't survive across login attempts. Returns ok even when the
|
|
20
|
+
* directory does not exist — semantics mirror `deleteIfExists`.
|
|
21
|
+
*/
|
|
22
|
+
readonly deleteDirIfExists: (path: string) => Promise<Result<void, FileSystemError>>;
|
|
15
23
|
};
|