@moxn/kb-migrate 0.4.31 → 0.4.32

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.
@@ -42,16 +42,18 @@ export class OneNoteApiClient {
42
42
  return this.paginate(`${this.baseUrl}/${this.userSlug}/onenote/sectionGroups/${encodeURIComponent(sectionGroupId)}/sections?$top=${DEFAULT_PAGE_SIZE}`);
43
43
  }
44
44
  async listPages(sectionId, options) {
45
- const select = '$select=id,title,lastModifiedDateTime,links';
45
+ // OneNote uses legacy datetime property names (`createdTime`, `lastModifiedTime`)
46
+ // not Graph's standard `*DateTime`. Selecting the wrong name returns HTTP 400.
47
+ const select = '$select=id,title,createdTime,lastModifiedTime,links';
46
48
  const filters = [];
47
49
  if (options?.modifiedAfter) {
48
- filters.push(`lastModifiedDateTime ge ${options.modifiedAfter.toISOString()}`);
50
+ filters.push(`lastModifiedTime ge ${options.modifiedAfter.toISOString()}`);
49
51
  }
50
52
  if (options?.modifiedBefore) {
51
- filters.push(`lastModifiedDateTime le ${options.modifiedBefore.toISOString()}`);
53
+ filters.push(`lastModifiedTime le ${options.modifiedBefore.toISOString()}`);
52
54
  }
53
55
  const filter = filters.length ? `&$filter=${encodeURIComponent(filters.join(' and '))}` : '';
54
- return this.paginate(`${this.baseUrl}/${this.userSlug}/onenote/sections/${encodeURIComponent(sectionId)}/pages?$top=${DEFAULT_PAGE_SIZE}${filter}${filter ? '' : ''}&${select.slice(1)}`);
56
+ return this.paginate(`${this.baseUrl}/${this.userSlug}/onenote/sections/${encodeURIComponent(sectionId)}/pages?$top=${DEFAULT_PAGE_SIZE}${filter}&${select.slice(1)}`);
55
57
  }
56
58
  async getPage(pageId) {
57
59
  return this.requestJson(`${this.baseUrl}/${this.userSlug}/onenote/pages/${encodeURIComponent(pageId)}`);
@@ -113,8 +113,8 @@ function toDiscovered(page, section, segs, ctx) {
113
113
  sectionName: section.displayName,
114
114
  sectionGroups: ctx.sectionGroups,
115
115
  onenoteWebUrl: page.links?.oneNoteWebUrl?.href,
116
- createdDateTime: page.createdDateTime,
117
- lastModifiedDateTime: page.lastModifiedDateTime,
116
+ createdDateTime: page.createdTime,
117
+ lastModifiedDateTime: page.lastModifiedTime,
118
118
  createdByEmail: page.createdBy?.user?.email ?? page.createdBy?.user?.userPrincipalName,
119
119
  createdByDisplayName: page.createdBy?.user?.displayName,
120
120
  lastModifiedByEmail: page.lastModifiedBy?.user?.email ??
@@ -19,8 +19,8 @@ export interface OneNoteNotebook {
19
19
  displayName: string;
20
20
  isDefault?: boolean;
21
21
  isShared?: boolean;
22
- createdDateTime?: string;
23
- lastModifiedDateTime?: string;
22
+ createdTime?: string;
23
+ lastModifiedTime?: string;
24
24
  createdBy?: GraphIdentity;
25
25
  lastModifiedBy?: GraphIdentity;
26
26
  links?: {
@@ -39,22 +39,22 @@ export interface OneNoteSectionGroup {
39
39
  parentNotebookId?: string;
40
40
  /** ID of parent section group (for nested groups) */
41
41
  parentSectionGroupId?: string;
42
- createdDateTime?: string;
43
- lastModifiedDateTime?: string;
42
+ createdTime?: string;
43
+ lastModifiedTime?: string;
44
44
  }
45
45
  export interface OneNoteSection {
46
46
  id: string;
47
47
  displayName: string;
48
48
  parentNotebookId?: string;
49
49
  parentSectionGroupId?: string;
50
- createdDateTime?: string;
51
- lastModifiedDateTime?: string;
50
+ createdTime?: string;
51
+ lastModifiedTime?: string;
52
52
  }
53
53
  export interface OneNotePage {
54
54
  id: string;
55
55
  title: string;
56
- createdDateTime?: string;
57
- lastModifiedDateTime?: string;
56
+ createdTime?: string;
57
+ lastModifiedTime?: string;
58
58
  contentUrl?: string;
59
59
  parentSection?: {
60
60
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxn/kb-migrate",
3
- "version": "0.4.31",
3
+ "version": "0.4.32",
4
4
  "description": "Migration tool for importing documents into Moxn Knowledge Base from local files, Notion, Google Docs, and more",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",