@opentabs-dev/opentabs-plugin-onenote 0.0.74

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 (65) hide show
  1. package/README.md +159 -0
  2. package/dist/adapter.iife.js +14878 -0
  3. package/dist/adapter.iife.js.map +7 -0
  4. package/dist/index.d.ts +14 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +47 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/onenote-api.d.ts +13 -0
  9. package/dist/onenote-api.d.ts.map +1 -0
  10. package/dist/onenote-api.js +127 -0
  11. package/dist/onenote-api.js.map +1 -0
  12. package/dist/tools/create-notebook.d.ts +26 -0
  13. package/dist/tools/create-notebook.d.ts.map +1 -0
  14. package/dist/tools/create-notebook.js +26 -0
  15. package/dist/tools/create-notebook.js.map +1 -0
  16. package/dist/tools/create-page.d.ts +16 -0
  17. package/dist/tools/create-page.d.ts.map +1 -0
  18. package/dist/tools/create-page.js +35 -0
  19. package/dist/tools/create-page.js.map +1 -0
  20. package/dist/tools/create-section-group.d.ts +25 -0
  21. package/dist/tools/create-section-group.d.ts.map +1 -0
  22. package/dist/tools/create-section-group.js +27 -0
  23. package/dist/tools/create-section-group.js.map +1 -0
  24. package/dist/tools/create-section.d.ts +25 -0
  25. package/dist/tools/create-section.d.ts.map +1 -0
  26. package/dist/tools/create-section.js +27 -0
  27. package/dist/tools/create-section.js.map +1 -0
  28. package/dist/tools/get-current-user.d.ts +12 -0
  29. package/dist/tools/get-current-user.d.ts.map +1 -0
  30. package/dist/tools/get-current-user.js +21 -0
  31. package/dist/tools/get-current-user.js.map +1 -0
  32. package/dist/tools/get-notebook.d.ts +26 -0
  33. package/dist/tools/get-notebook.d.ts.map +1 -0
  34. package/dist/tools/get-notebook.js +23 -0
  35. package/dist/tools/get-notebook.js.map +1 -0
  36. package/dist/tools/get-recent-notebooks.d.ts +12 -0
  37. package/dist/tools/get-recent-notebooks.d.ts.map +1 -0
  38. package/dist/tools/get-recent-notebooks.js +27 -0
  39. package/dist/tools/get-recent-notebooks.js.map +1 -0
  40. package/dist/tools/get-section-group.d.ts +24 -0
  41. package/dist/tools/get-section-group.d.ts.map +1 -0
  42. package/dist/tools/get-section-group.js +23 -0
  43. package/dist/tools/get-section-group.js.map +1 -0
  44. package/dist/tools/get-section.d.ts +24 -0
  45. package/dist/tools/get-section.d.ts.map +1 -0
  46. package/dist/tools/get-section.js +23 -0
  47. package/dist/tools/get-section.js.map +1 -0
  48. package/dist/tools/list-notebooks.d.ts +27 -0
  49. package/dist/tools/list-notebooks.d.ts.map +1 -0
  50. package/dist/tools/list-notebooks.js +38 -0
  51. package/dist/tools/list-notebooks.js.map +1 -0
  52. package/dist/tools/list-section-groups.d.ts +25 -0
  53. package/dist/tools/list-section-groups.d.ts.map +1 -0
  54. package/dist/tools/list-section-groups.js +38 -0
  55. package/dist/tools/list-section-groups.js.map +1 -0
  56. package/dist/tools/list-sections.d.ts +25 -0
  57. package/dist/tools/list-sections.d.ts.map +1 -0
  58. package/dist/tools/list-sections.js +35 -0
  59. package/dist/tools/list-sections.js.map +1 -0
  60. package/dist/tools/schemas.d.ts +254 -0
  61. package/dist/tools/schemas.d.ts.map +1 -0
  62. package/dist/tools/schemas.js +139 -0
  63. package/dist/tools/schemas.js.map +1 -0
  64. package/dist/tools.json +1347 -0
  65. package/package.json +55 -0
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const getSectionGroup: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ section_group_id: z.ZodString;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ section_group: z.ZodObject<{
6
+ id: z.ZodString;
7
+ display_name: z.ZodString;
8
+ created_at: z.ZodString;
9
+ last_modified_at: z.ZodString;
10
+ sections_url: z.ZodString;
11
+ section_groups_url: z.ZodString;
12
+ parent_notebook_id: z.ZodString;
13
+ parent_notebook_name: z.ZodString;
14
+ created_by: z.ZodObject<{
15
+ id: z.ZodString;
16
+ display_name: z.ZodString;
17
+ }, z.core.$strip>;
18
+ last_modified_by: z.ZodObject<{
19
+ id: z.ZodString;
20
+ display_name: z.ZodString;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>>;
24
+ //# sourceMappingURL=get-section-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-section-group.d.ts","sourceRoot":"","sources":["../../src/tools/get-section-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;kBAkB1B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { api } from '../onenote-api.js';
4
+ import { mapSectionGroup, sectionGroupSchema } from './schemas.js';
5
+ export const getSectionGroup = defineTool({
6
+ name: 'get_section_group',
7
+ displayName: 'Get Section Group',
8
+ description: 'Get detailed information about a specific OneNote section group by its ID. Section groups are folders that organize sections within a notebook.',
9
+ summary: 'Get a section group by ID',
10
+ icon: 'folder',
11
+ group: 'Section Groups',
12
+ input: z.object({
13
+ section_group_id: z.string().min(1).describe('Section group ID'),
14
+ }),
15
+ output: z.object({
16
+ section_group: sectionGroupSchema.describe('Section group details'),
17
+ }),
18
+ handle: async (params) => {
19
+ const data = await api(`/me/onenote/sectionGroups/${params.section_group_id}`);
20
+ return { section_group: mapSectionGroup(data) };
21
+ },
22
+ });
23
+ //# sourceMappingURL=get-section-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-section-group.js","sourceRoot":"","sources":["../../src/tools/get-section-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAwB,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEzF,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EACT,iJAAiJ;IACnJ,OAAO,EAAE,2BAA2B;IACpC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,gBAAgB;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;KACjE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,aAAa,EAAE,kBAAkB,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KACpE,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAkB,6BAA6B,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAChG,OAAO,EAAE,aAAa,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;IAClD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const getSection: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ section_id: z.ZodString;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ section: z.ZodObject<{
6
+ id: z.ZodString;
7
+ display_name: z.ZodString;
8
+ created_at: z.ZodString;
9
+ last_modified_at: z.ZodString;
10
+ is_default: z.ZodBoolean;
11
+ pages_url: z.ZodString;
12
+ parent_notebook_id: z.ZodString;
13
+ parent_notebook_name: z.ZodString;
14
+ created_by: z.ZodObject<{
15
+ id: z.ZodString;
16
+ display_name: z.ZodString;
17
+ }, z.core.$strip>;
18
+ last_modified_by: z.ZodObject<{
19
+ id: z.ZodString;
20
+ display_name: z.ZodString;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>>;
24
+ //# sourceMappingURL=get-section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-section.d.ts","sourceRoot":"","sources":["../../src/tools/get-section.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;kBAkBrB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { api } from '../onenote-api.js';
4
+ import { mapSection, sectionSchema } from './schemas.js';
5
+ export const getSection = defineTool({
6
+ name: 'get_section',
7
+ displayName: 'Get Section',
8
+ description: 'Get detailed information about a specific OneNote section by its ID. Returns section metadata including name, parent notebook, and creation date.',
9
+ summary: 'Get a section by ID',
10
+ icon: 'layers',
11
+ group: 'Sections',
12
+ input: z.object({
13
+ section_id: z.string().min(1).describe('Section ID'),
14
+ }),
15
+ output: z.object({
16
+ section: sectionSchema.describe('Section details'),
17
+ }),
18
+ handle: async (params) => {
19
+ const data = await api(`/me/onenote/sections/${params.section_id}`);
20
+ return { section: mapSection(data) };
21
+ },
22
+ });
23
+ //# sourceMappingURL=get-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-section.js","sourceRoot":"","sources":["../../src/tools/get-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAmB,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EACT,mJAAmJ;IACrJ,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;KACrD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC;KACnD,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAa,wBAAwB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAChF,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;IACvC,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const listNotebooks: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ order_by: z.ZodOptional<z.ZodString>;
4
+ top: z.ZodOptional<z.ZodNumber>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ notebooks: z.ZodArray<z.ZodObject<{
7
+ id: z.ZodString;
8
+ display_name: z.ZodString;
9
+ created_at: z.ZodString;
10
+ last_modified_at: z.ZodString;
11
+ is_default: z.ZodBoolean;
12
+ is_shared: z.ZodBoolean;
13
+ user_role: z.ZodString;
14
+ sections_url: z.ZodString;
15
+ section_groups_url: z.ZodString;
16
+ created_by: z.ZodObject<{
17
+ id: z.ZodString;
18
+ display_name: z.ZodString;
19
+ }, z.core.$strip>;
20
+ last_modified_by: z.ZodObject<{
21
+ id: z.ZodString;
22
+ display_name: z.ZodString;
23
+ }, z.core.$strip>;
24
+ web_url: z.ZodString;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>>;
27
+ //# sourceMappingURL=list-notebooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-notebooks.d.ts","sourceRoot":"","sources":["../../src/tools/list-notebooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;kBAmCxB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { api } from '../onenote-api.js';
4
+ import { mapNotebook, notebookSchema } from './schemas.js';
5
+ export const listNotebooks = defineTool({
6
+ name: 'list_notebooks',
7
+ displayName: 'List Notebooks',
8
+ description: 'List all OneNote notebooks for the current user. Returns notebook names, IDs, creation dates, and sharing status. Results are sorted by last modified date (newest first).',
9
+ summary: 'List all OneNote notebooks',
10
+ icon: 'book-open',
11
+ group: 'Notebooks',
12
+ input: z.object({
13
+ order_by: z
14
+ .string()
15
+ .optional()
16
+ .describe('OData $orderby expression (default "lastModifiedDateTime desc"). Examples: "displayName", "createdDateTime desc"'),
17
+ top: z
18
+ .number()
19
+ .int()
20
+ .min(1)
21
+ .max(100)
22
+ .optional()
23
+ .describe('Maximum number of notebooks to return (default 20, max 100)'),
24
+ }),
25
+ output: z.object({
26
+ notebooks: z.array(notebookSchema).describe('List of notebooks'),
27
+ }),
28
+ handle: async (params) => {
29
+ const data = await api('/me/onenote/notebooks', {
30
+ query: {
31
+ $orderby: params.order_by ?? 'lastModifiedDateTime desc',
32
+ $top: params.top ?? 20,
33
+ },
34
+ });
35
+ return { notebooks: (data.value ?? []).map(mapNotebook) };
36
+ },
37
+ });
38
+ //# sourceMappingURL=list-notebooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-notebooks.js","sourceRoot":"","sources":["../../src/tools/list-notebooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EA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
+ export declare const listSectionGroups: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ notebook_id: z.ZodOptional<z.ZodString>;
4
+ top: z.ZodOptional<z.ZodNumber>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ section_groups: z.ZodArray<z.ZodObject<{
7
+ id: z.ZodString;
8
+ display_name: z.ZodString;
9
+ created_at: z.ZodString;
10
+ last_modified_at: z.ZodString;
11
+ sections_url: z.ZodString;
12
+ section_groups_url: z.ZodString;
13
+ parent_notebook_id: z.ZodString;
14
+ parent_notebook_name: z.ZodString;
15
+ created_by: z.ZodObject<{
16
+ id: z.ZodString;
17
+ display_name: z.ZodString;
18
+ }, z.core.$strip>;
19
+ last_modified_by: z.ZodObject<{
20
+ id: z.ZodString;
21
+ display_name: z.ZodString;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>>;
25
+ //# sourceMappingURL=list-section-groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-section-groups.d.ts","sourceRoot":"","sources":["../../src/tools/list-section-groups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;kBAkC5B,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { api } from '../onenote-api.js';
4
+ import { mapSectionGroup, sectionGroupSchema } from './schemas.js';
5
+ export const listSectionGroups = defineTool({
6
+ name: 'list_section_groups',
7
+ displayName: 'List Section Groups',
8
+ description: 'List OneNote section groups. When a notebook_id is provided, returns section groups in that notebook. Otherwise returns all section groups across all notebooks. Section groups are folders that organize sections within a notebook.',
9
+ summary: 'List section groups in a notebook or across all notebooks',
10
+ icon: 'folder',
11
+ group: 'Section Groups',
12
+ input: z.object({
13
+ notebook_id: z
14
+ .string()
15
+ .optional()
16
+ .describe('Notebook ID to list section groups for. Omit to list all section groups.'),
17
+ top: z
18
+ .number()
19
+ .int()
20
+ .min(1)
21
+ .max(100)
22
+ .optional()
23
+ .describe('Maximum number of section groups to return (default 20, max 100)'),
24
+ }),
25
+ output: z.object({
26
+ section_groups: z.array(sectionGroupSchema).describe('List of section groups'),
27
+ }),
28
+ handle: async (params) => {
29
+ const endpoint = params.notebook_id
30
+ ? `/me/onenote/notebooks/${params.notebook_id}/sectionGroups`
31
+ : '/me/onenote/sectionGroups';
32
+ const data = await api(endpoint, {
33
+ query: { $top: params.top ?? 20 },
34
+ });
35
+ return { section_groups: (data.value ?? []).map(mapSectionGroup) };
36
+ },
37
+ });
38
+ //# sourceMappingURL=list-section-groups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-section-groups.js","sourceRoot":"","sources":["../../src/tools/list-section-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAwB,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMzF,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,uOAAuO;IACzO,OAAO,EAAE,2DAA2D;IACpE,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,gBAAgB;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0EAA0E,CAAC;QACvF,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,kEAAkE,CAAC;KAChF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KAC/E,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW;YACjC,CAAC,CAAC,yBAAyB,MAAM,CAAC,WAAW,gBAAgB;YAC7D,CAAC,CAAC,2BAA2B,CAAC;QAEhC,MAAM,IAAI,GAAG,MAAM,GAAG,CAA4B,QAAQ,EAAE;YAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,EAAE,EAAE;SAClC,CAAC,CAAC;QACH,OAAO,EAAE,cAAc,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;IACrE,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare const listSections: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ notebook_id: z.ZodOptional<z.ZodString>;
4
+ top: z.ZodOptional<z.ZodNumber>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ sections: z.ZodArray<z.ZodObject<{
7
+ id: z.ZodString;
8
+ display_name: z.ZodString;
9
+ created_at: z.ZodString;
10
+ last_modified_at: z.ZodString;
11
+ is_default: z.ZodBoolean;
12
+ pages_url: z.ZodString;
13
+ parent_notebook_id: z.ZodString;
14
+ parent_notebook_name: z.ZodString;
15
+ created_by: z.ZodObject<{
16
+ id: z.ZodString;
17
+ display_name: z.ZodString;
18
+ }, z.core.$strip>;
19
+ last_modified_by: z.ZodObject<{
20
+ id: z.ZodString;
21
+ display_name: z.ZodString;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>>;
25
+ //# sourceMappingURL=list-sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-sections.d.ts","sourceRoot":"","sources":["../../src/tools/list-sections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;kBA+BvB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { api } from '../onenote-api.js';
4
+ import { mapSection, sectionSchema } from './schemas.js';
5
+ export const listSections = defineTool({
6
+ name: 'list_sections',
7
+ displayName: 'List Sections',
8
+ description: 'List OneNote sections. When a notebook_id is provided, returns only sections in that notebook. Otherwise returns all sections across all notebooks.',
9
+ summary: 'List sections in a notebook or across all notebooks',
10
+ icon: 'layers',
11
+ group: 'Sections',
12
+ input: z.object({
13
+ notebook_id: z.string().optional().describe('Notebook ID to list sections for. Omit to list all sections.'),
14
+ top: z
15
+ .number()
16
+ .int()
17
+ .min(1)
18
+ .max(100)
19
+ .optional()
20
+ .describe('Maximum number of sections to return (default 20, max 100)'),
21
+ }),
22
+ output: z.object({
23
+ sections: z.array(sectionSchema).describe('List of sections'),
24
+ }),
25
+ handle: async (params) => {
26
+ const endpoint = params.notebook_id
27
+ ? `/me/onenote/notebooks/${params.notebook_id}/sections`
28
+ : '/me/onenote/sections';
29
+ const data = await api(endpoint, {
30
+ query: { $top: params.top ?? 20 },
31
+ });
32
+ return { sections: (data.value ?? []).map(mapSection) };
33
+ },
34
+ });
35
+ //# sourceMappingURL=list-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-sections.js","sourceRoot":"","sources":["../../src/tools/list-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,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}
@@ -0,0 +1,254 @@
1
+ import { z } from 'zod';
2
+ export declare const identitySchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ display_name: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export interface RawIdentitySet {
7
+ user?: {
8
+ id?: string;
9
+ displayName?: string;
10
+ };
11
+ }
12
+ export declare const mapIdentity: (i: RawIdentitySet | undefined) => {
13
+ id: string;
14
+ display_name: string;
15
+ };
16
+ export declare const notebookSchema: z.ZodObject<{
17
+ id: z.ZodString;
18
+ display_name: z.ZodString;
19
+ created_at: z.ZodString;
20
+ last_modified_at: z.ZodString;
21
+ is_default: z.ZodBoolean;
22
+ is_shared: z.ZodBoolean;
23
+ user_role: z.ZodString;
24
+ sections_url: z.ZodString;
25
+ section_groups_url: z.ZodString;
26
+ created_by: z.ZodObject<{
27
+ id: z.ZodString;
28
+ display_name: z.ZodString;
29
+ }, z.core.$strip>;
30
+ last_modified_by: z.ZodObject<{
31
+ id: z.ZodString;
32
+ display_name: z.ZodString;
33
+ }, z.core.$strip>;
34
+ web_url: z.ZodString;
35
+ }, z.core.$strip>;
36
+ export interface RawNotebook {
37
+ id?: string;
38
+ displayName?: string;
39
+ createdDateTime?: string;
40
+ lastModifiedDateTime?: string;
41
+ isDefault?: boolean;
42
+ isShared?: boolean;
43
+ userRole?: string;
44
+ sectionsUrl?: string;
45
+ sectionGroupsUrl?: string;
46
+ createdBy?: RawIdentitySet;
47
+ lastModifiedBy?: RawIdentitySet;
48
+ links?: {
49
+ oneNoteWebUrl?: {
50
+ href?: string;
51
+ };
52
+ };
53
+ }
54
+ export declare const mapNotebook: (n: RawNotebook) => {
55
+ id: string;
56
+ display_name: string;
57
+ created_at: string;
58
+ last_modified_at: string;
59
+ is_default: boolean;
60
+ is_shared: boolean;
61
+ user_role: string;
62
+ sections_url: string;
63
+ section_groups_url: string;
64
+ created_by: {
65
+ id: string;
66
+ display_name: string;
67
+ };
68
+ last_modified_by: {
69
+ id: string;
70
+ display_name: string;
71
+ };
72
+ web_url: string;
73
+ };
74
+ export declare const recentNotebookSchema: z.ZodObject<{
75
+ display_name: z.ZodString;
76
+ last_accessed_time: z.ZodString;
77
+ source_service: z.ZodString;
78
+ web_url: z.ZodString;
79
+ }, z.core.$strip>;
80
+ export interface RawRecentNotebook {
81
+ displayName?: string;
82
+ lastAccessedTime?: string;
83
+ sourceService?: string;
84
+ links?: {
85
+ oneNoteWebUrl?: {
86
+ href?: string;
87
+ };
88
+ };
89
+ }
90
+ export declare const mapRecentNotebook: (n: RawRecentNotebook) => {
91
+ display_name: string;
92
+ last_accessed_time: string;
93
+ source_service: string;
94
+ web_url: string;
95
+ };
96
+ export declare const sectionSchema: z.ZodObject<{
97
+ id: z.ZodString;
98
+ display_name: z.ZodString;
99
+ created_at: z.ZodString;
100
+ last_modified_at: z.ZodString;
101
+ is_default: z.ZodBoolean;
102
+ pages_url: z.ZodString;
103
+ parent_notebook_id: z.ZodString;
104
+ parent_notebook_name: z.ZodString;
105
+ created_by: z.ZodObject<{
106
+ id: z.ZodString;
107
+ display_name: z.ZodString;
108
+ }, z.core.$strip>;
109
+ last_modified_by: z.ZodObject<{
110
+ id: z.ZodString;
111
+ display_name: z.ZodString;
112
+ }, z.core.$strip>;
113
+ }, z.core.$strip>;
114
+ export interface RawSection {
115
+ id?: string;
116
+ displayName?: string;
117
+ createdDateTime?: string;
118
+ lastModifiedDateTime?: string;
119
+ isDefault?: boolean;
120
+ pagesUrl?: string;
121
+ createdBy?: RawIdentitySet;
122
+ lastModifiedBy?: RawIdentitySet;
123
+ parentNotebook?: {
124
+ id?: string;
125
+ displayName?: string;
126
+ };
127
+ }
128
+ export declare const mapSection: (s: RawSection) => {
129
+ id: string;
130
+ display_name: string;
131
+ created_at: string;
132
+ last_modified_at: string;
133
+ is_default: boolean;
134
+ pages_url: string;
135
+ parent_notebook_id: string;
136
+ parent_notebook_name: string;
137
+ created_by: {
138
+ id: string;
139
+ display_name: string;
140
+ };
141
+ last_modified_by: {
142
+ id: string;
143
+ display_name: string;
144
+ };
145
+ };
146
+ export declare const sectionGroupSchema: z.ZodObject<{
147
+ id: z.ZodString;
148
+ display_name: z.ZodString;
149
+ created_at: z.ZodString;
150
+ last_modified_at: z.ZodString;
151
+ sections_url: z.ZodString;
152
+ section_groups_url: z.ZodString;
153
+ parent_notebook_id: z.ZodString;
154
+ parent_notebook_name: z.ZodString;
155
+ created_by: z.ZodObject<{
156
+ id: z.ZodString;
157
+ display_name: z.ZodString;
158
+ }, z.core.$strip>;
159
+ last_modified_by: z.ZodObject<{
160
+ id: z.ZodString;
161
+ display_name: z.ZodString;
162
+ }, z.core.$strip>;
163
+ }, z.core.$strip>;
164
+ export interface RawSectionGroup {
165
+ id?: string;
166
+ displayName?: string;
167
+ createdDateTime?: string;
168
+ lastModifiedDateTime?: string;
169
+ sectionsUrl?: string;
170
+ sectionGroupsUrl?: string;
171
+ createdBy?: RawIdentitySet;
172
+ lastModifiedBy?: RawIdentitySet;
173
+ parentNotebook?: {
174
+ id?: string;
175
+ displayName?: string;
176
+ };
177
+ }
178
+ export declare const mapSectionGroup: (sg: RawSectionGroup) => {
179
+ id: string;
180
+ display_name: string;
181
+ created_at: string;
182
+ last_modified_at: string;
183
+ sections_url: string;
184
+ section_groups_url: string;
185
+ parent_notebook_id: string;
186
+ parent_notebook_name: string;
187
+ created_by: {
188
+ id: string;
189
+ display_name: string;
190
+ };
191
+ last_modified_by: {
192
+ id: string;
193
+ display_name: string;
194
+ };
195
+ };
196
+ export declare const pageSchema: z.ZodObject<{
197
+ id: z.ZodString;
198
+ title: z.ZodString;
199
+ created_at: z.ZodString;
200
+ last_modified_at: z.ZodString;
201
+ web_url: z.ZodString;
202
+ content_url: z.ZodString;
203
+ parent_section_id: z.ZodString;
204
+ }, z.core.$strip>;
205
+ export interface RawPage {
206
+ id?: string;
207
+ title?: string;
208
+ createdDateTime?: string;
209
+ lastModifiedDateTime?: string;
210
+ links?: {
211
+ oneNoteWebUrl?: {
212
+ href?: string;
213
+ };
214
+ };
215
+ contentUrl?: string;
216
+ parentSection?: {
217
+ id?: string;
218
+ };
219
+ }
220
+ export declare const mapPage: (p: RawPage) => {
221
+ id: string;
222
+ title: string;
223
+ created_at: string;
224
+ last_modified_at: string;
225
+ web_url: string;
226
+ content_url: string;
227
+ parent_section_id: string;
228
+ };
229
+ export declare const userSchema: z.ZodObject<{
230
+ id: z.ZodString;
231
+ display_name: z.ZodString;
232
+ email: z.ZodString;
233
+ given_name: z.ZodString;
234
+ surname: z.ZodString;
235
+ preferred_language: z.ZodString;
236
+ }, z.core.$strip>;
237
+ export interface RawUser {
238
+ id?: string;
239
+ displayName?: string;
240
+ mail?: string;
241
+ userPrincipalName?: string;
242
+ givenName?: string;
243
+ surname?: string;
244
+ preferredLanguage?: string;
245
+ }
246
+ export declare const mapUser: (u: RawUser) => {
247
+ id: string;
248
+ display_name: string;
249
+ email: string;
250
+ given_name: string;
251
+ surname: string;
252
+ preferred_language: string;
253
+ };
254
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED,eAAO,MAAM,WAAW,GAAI,GAAG,cAAc,GAAG,SAAS;;;CAGvD,CAAC;AAIH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;iBAazB,CAAC;AAEH,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE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