ask-marcel-office-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +267 -0
  3. package/dist/cli.js +27084 -0
  4. package/dist/composition/build-deps.d.ts +15 -0
  5. package/dist/composition/cli.d.ts +11 -0
  6. package/dist/composition/env.d.ts +2 -0
  7. package/dist/domain/access-token.d.ts +13 -0
  8. package/dist/domain/env-var.d.ts +10 -0
  9. package/dist/domain/jwt-utils.d.ts +3 -0
  10. package/dist/domain/result.d.ts +19 -0
  11. package/dist/domain/utilities/format-error.d.ts +1 -0
  12. package/dist/index.d.ts +21 -0
  13. package/dist/index.js +24823 -0
  14. package/dist/infra/auth.d.ts +23 -0
  15. package/dist/infra/browser-auth.d.ts +59 -0
  16. package/dist/infra/filesystem-bun.d.ts +2 -0
  17. package/dist/infra/filesystem-node.d.ts +2 -0
  18. package/dist/infra/graph-client.d.ts +20 -0
  19. package/dist/infra/logger.d.ts +5 -0
  20. package/dist/main.d.ts +1 -0
  21. package/dist/presenter/output.d.ts +4 -0
  22. package/dist/use-cases/commands/build-command.d.ts +4 -0
  23. package/dist/use-cases/commands/command-types.d.ts +10 -0
  24. package/dist/use-cases/commands/download-onedrive-file-content.d.ts +9 -0
  25. package/dist/use-cases/commands/get-calendar-event.d.ts +6 -0
  26. package/dist/use-cases/commands/get-calendar-view.d.ts +4 -0
  27. package/dist/use-cases/commands/get-channel-files-folder.d.ts +7 -0
  28. package/dist/use-cases/commands/get-channel-message-hosted-content.d.ts +9 -0
  29. package/dist/use-cases/commands/get-channel-message.d.ts +8 -0
  30. package/dist/use-cases/commands/get-chat-message-hosted-content.d.ts +8 -0
  31. package/dist/use-cases/commands/get-chat-message.d.ts +7 -0
  32. package/dist/use-cases/commands/get-chat.d.ts +6 -0
  33. package/dist/use-cases/commands/get-current-user.d.ts +4 -0
  34. package/dist/use-cases/commands/get-drive-delta.d.ts +7 -0
  35. package/dist/use-cases/commands/get-drive-item.d.ts +7 -0
  36. package/dist/use-cases/commands/get-drive-root-item.d.ts +6 -0
  37. package/dist/use-cases/commands/get-excel-range.d.ts +9 -0
  38. package/dist/use-cases/commands/get-excel-table.d.ts +8 -0
  39. package/dist/use-cases/commands/get-mail-attachment.d.ts +7 -0
  40. package/dist/use-cases/commands/get-mail-message.d.ts +6 -0
  41. package/dist/use-cases/commands/get-mailbox-settings.d.ts +4 -0
  42. package/dist/use-cases/commands/get-my-profile-photo.d.ts +4 -0
  43. package/dist/use-cases/commands/get-onenote-page-content.d.ts +6 -0
  44. package/dist/use-cases/commands/get-outlook-contact.d.ts +6 -0
  45. package/dist/use-cases/commands/get-planner-bucket.d.ts +6 -0
  46. package/dist/use-cases/commands/get-planner-plan.d.ts +6 -0
  47. package/dist/use-cases/commands/get-planner-task-details.d.ts +6 -0
  48. package/dist/use-cases/commands/get-planner-task.d.ts +6 -0
  49. package/dist/use-cases/commands/get-sharepoint-site-by-path.d.ts +7 -0
  50. package/dist/use-cases/commands/get-sharepoint-site-drive-by-id.d.ts +7 -0
  51. package/dist/use-cases/commands/get-sharepoint-site-item.d.ts +7 -0
  52. package/dist/use-cases/commands/get-sharepoint-site-list-item.d.ts +8 -0
  53. package/dist/use-cases/commands/get-sharepoint-site-list.d.ts +7 -0
  54. package/dist/use-cases/commands/get-sharepoint-site.d.ts +6 -0
  55. package/dist/use-cases/commands/get-sharepoint-sites-delta.d.ts +4 -0
  56. package/dist/use-cases/commands/get-specific-calendar-event.d.ts +7 -0
  57. package/dist/use-cases/commands/get-specific-calendar-view.d.ts +6 -0
  58. package/dist/use-cases/commands/get-team-channel.d.ts +7 -0
  59. package/dist/use-cases/commands/get-team.d.ts +6 -0
  60. package/dist/use-cases/commands/get-todo-task.d.ts +7 -0
  61. package/dist/use-cases/commands/index.d.ts +3 -0
  62. package/dist/use-cases/commands/list-all-onenote-sections.d.ts +4 -0
  63. package/dist/use-cases/commands/list-calendar-event-instances.d.ts +7 -0
  64. package/dist/use-cases/commands/list-calendar-events-delta.d.ts +4 -0
  65. package/dist/use-cases/commands/list-calendar-events.d.ts +4 -0
  66. package/dist/use-cases/commands/list-calendar-view-delta.d.ts +4 -0
  67. package/dist/use-cases/commands/list-calendars.d.ts +4 -0
  68. package/dist/use-cases/commands/list-channel-message-hosted-contents.d.ts +8 -0
  69. package/dist/use-cases/commands/list-channel-message-replies.d.ts +8 -0
  70. package/dist/use-cases/commands/list-channel-messages.d.ts +7 -0
  71. package/dist/use-cases/commands/list-channel-tabs.d.ts +7 -0
  72. package/dist/use-cases/commands/list-chat-members.d.ts +6 -0
  73. package/dist/use-cases/commands/list-chat-message-hosted-contents.d.ts +7 -0
  74. package/dist/use-cases/commands/list-chat-message-replies.d.ts +7 -0
  75. package/dist/use-cases/commands/list-chat-messages.d.ts +6 -0
  76. package/dist/use-cases/commands/list-chats.d.ts +4 -0
  77. package/dist/use-cases/commands/list-drive-item-permissions.d.ts +7 -0
  78. package/dist/use-cases/commands/list-drive-item-versions.d.ts +7 -0
  79. package/dist/use-cases/commands/list-drives.d.ts +4 -0
  80. package/dist/use-cases/commands/list-excel-table-rows.d.ts +8 -0
  81. package/dist/use-cases/commands/list-excel-tables.d.ts +7 -0
  82. package/dist/use-cases/commands/list-excel-worksheets.d.ts +7 -0
  83. package/dist/use-cases/commands/list-folder-files.d.ts +7 -0
  84. package/dist/use-cases/commands/list-joined-teams.d.ts +4 -0
  85. package/dist/use-cases/commands/list-mail-attachments.d.ts +6 -0
  86. package/dist/use-cases/commands/list-mail-child-folders.d.ts +6 -0
  87. package/dist/use-cases/commands/list-mail-folder-messages.d.ts +6 -0
  88. package/dist/use-cases/commands/list-mail-folders.d.ts +4 -0
  89. package/dist/use-cases/commands/list-mail-messages.d.ts +4 -0
  90. package/dist/use-cases/commands/list-mail-rules.d.ts +6 -0
  91. package/dist/use-cases/commands/list-onenote-notebook-sections.d.ts +6 -0
  92. package/dist/use-cases/commands/list-onenote-notebooks.d.ts +4 -0
  93. package/dist/use-cases/commands/list-onenote-section-pages.d.ts +6 -0
  94. package/dist/use-cases/commands/list-outlook-contacts.d.ts +4 -0
  95. package/dist/use-cases/commands/list-pinned-chat-messages.d.ts +6 -0
  96. package/dist/use-cases/commands/list-plan-buckets.d.ts +6 -0
  97. package/dist/use-cases/commands/list-plan-tasks.d.ts +6 -0
  98. package/dist/use-cases/commands/list-planner-tasks.d.ts +4 -0
  99. package/dist/use-cases/commands/list-sharepoint-site-drives.d.ts +6 -0
  100. package/dist/use-cases/commands/list-sharepoint-site-items.d.ts +6 -0
  101. package/dist/use-cases/commands/list-sharepoint-site-list-items.d.ts +7 -0
  102. package/dist/use-cases/commands/list-sharepoint-site-lists.d.ts +6 -0
  103. package/dist/use-cases/commands/list-specific-calendar-events.d.ts +6 -0
  104. package/dist/use-cases/commands/list-team-channels.d.ts +6 -0
  105. package/dist/use-cases/commands/list-team-members.d.ts +6 -0
  106. package/dist/use-cases/commands/list-todo-linked-resources.d.ts +7 -0
  107. package/dist/use-cases/commands/list-todo-task-lists.d.ts +4 -0
  108. package/dist/use-cases/commands/list-todo-tasks.d.ts +6 -0
  109. package/dist/use-cases/commands/login.d.ts +6 -0
  110. package/dist/use-cases/commands/logout.d.ts +6 -0
  111. package/dist/use-cases/commands/search-onedrive-files.d.ts +9 -0
  112. package/dist/use-cases/commands/search-sharepoint-sites.d.ts +4 -0
  113. package/dist/use-cases/ports/filesystem.d.ts +15 -0
  114. package/dist/use-cases/ports/logger.d.ts +6 -0
  115. package/package.json +87 -0
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ driveId: z.ZodString;
4
+ itemId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const execute: import("./command-types.js").CommandExecute;
7
+ export { execute, schema };
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ driveId: z.ZodString;
4
+ itemId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const execute: import("./command-types.js").CommandExecute;
7
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ messageId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ mailFolderId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ mailFolderId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ mailFolderId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ notebookId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ onenoteSectionId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ chatId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ plannerPlanId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ plannerPlanId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ siteId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ siteId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ siteId: z.ZodString;
4
+ listId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const execute: import("./command-types.js").CommandExecute;
7
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ siteId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ calendarId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ teamId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ teamId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ todoTaskListId: z.ZodString;
4
+ todoTaskId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const execute: import("./command-types.js").CommandExecute;
7
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{
3
+ todoTaskListId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ declare const execute: import("./command-types.js").CommandExecute;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import type { Result } from '../../domain/result.js';
3
+ import type { AuthManager } from '../../infra/auth.js';
4
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
5
+ declare const execute: (auth: AuthManager) => Promise<Result<string, import("../../infra/auth.js").AuthError>>;
6
+ export { execute, schema };
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import type { Result } from '../../domain/result.js';
3
+ import type { AuthManager } from '../../infra/auth.js';
4
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
5
+ declare const execute: (auth: AuthManager) => Promise<Result<void, import("../../infra/auth.js").AuthError>>;
6
+ export { execute, schema };
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import type { Result } from '../../domain/result.js';
3
+ import type { GraphClient } from '../../infra/graph-client.js';
4
+ declare const schema: z.ZodObject<{
5
+ driveId: z.ZodString;
6
+ query: z.ZodString;
7
+ }, z.core.$strip>;
8
+ declare const execute: (graph: GraphClient, params: Record<string, string>) => Promise<Result<unknown, import("../../infra/graph-client.js").GraphError>>;
9
+ export { execute, schema };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const schema: z.ZodObject<{}, z.core.$strict>;
3
+ declare const execute: import("./command-types.js").CommandExecute;
4
+ export { execute, schema };
@@ -0,0 +1,15 @@
1
+ import type { Result } from '../../domain/result.js';
2
+ export type FileSystemError = {
3
+ type: 'not_found';
4
+ } | {
5
+ type: 'parse_failed';
6
+ message: string;
7
+ } | {
8
+ type: 'io_failed';
9
+ message: string;
10
+ };
11
+ export type FileSystem = {
12
+ readonly readJson: <T>(path: string) => Promise<Result<T, FileSystemError>>;
13
+ readonly writeText: (path: string, content: string) => Promise<Result<void, FileSystemError>>;
14
+ readonly deleteIfExists: (path: string) => Promise<Result<void, FileSystemError>>;
15
+ };
@@ -0,0 +1,6 @@
1
+ export type LogMeta = Readonly<Record<string, unknown>>;
2
+ export type Logger = {
3
+ readonly info: (event: string, meta?: LogMeta) => void;
4
+ readonly warn: (event: string, meta?: LogMeta) => void;
5
+ readonly error: (event: string, meta?: LogMeta) => void;
6
+ };
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "ask-marcel-office-cli",
3
+ "version": "0.1.0",
4
+ "description": "Microsoft Graph CLI + library — typed Bun/TypeScript wrapper around 100+ Graph API operations with browser-fallback OAuth.",
5
+ "license": "MIT",
6
+ "author": "Vincent Delacourt <vincent.delacourt@adama-development.com>",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/vdelacou/ask-marcel-office-cli.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/vdelacou/ask-marcel-office-cli/issues"
13
+ },
14
+ "homepage": "https://github.com/vdelacou/ask-marcel-office-cli#readme",
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "module": "./dist/index.js",
18
+ "types": "./dist/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js"
23
+ },
24
+ "./package.json": "./package.json"
25
+ },
26
+ "bin": {
27
+ "ask-marcel": "./dist/cli.js"
28
+ },
29
+ "files": [
30
+ "dist/",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "engines": {
35
+ "node": ">=20",
36
+ "bun": ">=1.0"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "keywords": [
42
+ "microsoft-graph",
43
+ "office-365",
44
+ "cli",
45
+ "bun",
46
+ "typescript",
47
+ "graph-api",
48
+ "outlook",
49
+ "teams",
50
+ "onedrive",
51
+ "sharepoint"
52
+ ],
53
+ "scripts": {
54
+ "start": "bun run src/main.ts",
55
+ "lint": "eslint --cache",
56
+ "lint:strict": "LINT_STRICT=1 eslint",
57
+ "typecheck": "tsc --noEmit",
58
+ "coverage": "bun run scripts/check-coverage.ts",
59
+ "mutate": "stryker run",
60
+ "mutate:changed": "bash scripts/mutate-changed.sh",
61
+ "mutate:staged": "bash scripts/mutate-staged.sh",
62
+ "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",
63
+ "build:types": "tsc -p tsconfig.build.json",
64
+ "build": "rm -rf dist && bun run build:js && bun run build:types && bun run scripts/fix-dts-extensions.ts && bun run scripts/add-shebang.ts",
65
+ "prepublishOnly": "bun run build && bun test && bun run lint:strict && bun run typecheck && bun run coverage"
66
+ },
67
+ "devDependencies": {
68
+ "@eslint/js": "^9.28.0",
69
+ "@stryker-mutator/core": "^9.6.1",
70
+ "@types/bun": "^1.2.0",
71
+ "@types/update-notifier": "^6.0.8",
72
+ "eslint": "^9.28.0",
73
+ "eslint-plugin-prettier": "^5.4.1",
74
+ "eslint-plugin-security": "^3.0.1",
75
+ "eslint-plugin-sonarjs": "^4.0.3",
76
+ "eslint-plugin-unicorn": "^59.0.1",
77
+ "typescript": "^5.0.0",
78
+ "typescript-eslint": "^8.33.1"
79
+ },
80
+ "dependencies": {
81
+ "commander": "^14.0.3",
82
+ "playwright": "^1.59.1",
83
+ "update-notifier": "^7.3.1",
84
+ "winston": "^3.19.0",
85
+ "zod": "^4.3.6"
86
+ }
87
+ }