notebooklm-sdk 0.1.7 → 0.2.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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AuthTokens, a as ConnectOptions } from './auth-Ba2hsZW_.cjs';
2
- export { C as CookieMap, d as connect } from './auth-Ba2hsZW_.cjs';
1
+ import { A as AuthTokens, a as ConnectOptions } from './auth-Dxsm8894.cjs';
2
+ export { C as CookieMap, d as connect } from './auth-Dxsm8894.cjs';
3
3
  export { ArtifactDownloadError, ArtifactError, ArtifactNotFoundError, ArtifactNotReadyError, ArtifactParseError, AuthError, ChatError, ClientError, NetworkError, NotebookError, NotebookLMError, NotebookNotFoundError, RPCError, RPCTimeoutError, RateLimitError, ServerError, SourceAddError, SourceError, SourceNotFoundError, SourceProcessingError, SourceTimeoutError } from './errors.cjs';
4
4
 
5
5
  /** RPC method IDs for NotebookLM batchexecute API. */
@@ -280,11 +280,19 @@ interface Note {
280
280
  createdAt: Date | null;
281
281
  updatedAt: Date | null;
282
282
  }
283
- interface MindMap {
284
- id: string;
285
- title: string | null;
286
- content: string;
287
- createdAt: Date | null;
283
+
284
+ declare class NotesAPI {
285
+ private readonly rpc;
286
+ constructor(rpc: RPCCore);
287
+ list(notebookId: string): Promise<Note[]>;
288
+ listMindMaps(notebookId: string): Promise<Note[]>;
289
+ create(notebookId: string, content: string, title?: string): Promise<Note>;
290
+ update(notebookId: string, noteId: string, content: string, title?: string): Promise<Note>;
291
+ delete(notebookId: string, noteId: string): Promise<boolean>;
292
+ private _fetchAll;
293
+ private _isMindMap;
294
+ private _extractContent;
295
+ private _parseItem;
288
296
  }
289
297
 
290
298
  interface CreateAudioOptions {
@@ -322,6 +330,15 @@ interface CreateSlideDeckOptions {
322
330
  instructions?: string;
323
331
  language?: string;
324
332
  }
333
+ interface CreateDataTableOptions {
334
+ sourceIds?: string[];
335
+ instructions?: string;
336
+ language?: string;
337
+ }
338
+ interface DataTableContent {
339
+ headers: string[];
340
+ rows: string[][];
341
+ }
325
342
  type ReportFormat = "briefing_doc" | "study_guide" | "blog_post" | "custom";
326
343
  interface CreateReportOptions {
327
344
  format?: ReportFormat;
@@ -333,8 +350,10 @@ interface CreateReportOptions {
333
350
  declare class ArtifactsAPI {
334
351
  private readonly rpc;
335
352
  private readonly auth;
336
- constructor(rpc: RPCCore, auth: AuthTokens);
353
+ private readonly notes;
354
+ constructor(rpc: RPCCore, auth: AuthTokens, notes: NotesAPI);
337
355
  list(notebookId: string): Promise<Artifact[]>;
356
+ private _listRaw;
338
357
  get(notebookId: string, artifactId: string): Promise<Artifact | null>;
339
358
  delete(notebookId: string, artifactId: string): Promise<boolean>;
340
359
  rename(notebookId: string, artifactId: string, newTitle: string): Promise<boolean>;
@@ -344,8 +363,9 @@ declare class ArtifactsAPI {
344
363
  createFlashcards(notebookId: string, opts?: CreateQuizOptions): Promise<GenerationStatus>;
345
364
  createInfographic(notebookId: string, opts?: CreateInfographicOptions): Promise<GenerationStatus>;
346
365
  createSlideDeck(notebookId: string, opts?: CreateSlideDeckOptions): Promise<GenerationStatus>;
366
+ createDataTable(notebookId: string, opts?: CreateDataTableOptions): Promise<GenerationStatus>;
347
367
  createReport(notebookId: string, opts?: CreateReportOptions): Promise<GenerationStatus>;
348
- createMindMap(notebookId: string, sourceIds?: string[]): Promise<GenerationStatus>;
368
+ createMindMap(notebookId: string, sourceIds?: string[]): Promise<Note>;
349
369
  /** Poll until artifact reaches completed/failed status. */
350
370
  waitUntilReady(notebookId: string, artifactId: string, timeout?: number, pollInterval?: number): Promise<Artifact>;
351
371
  /** Download audio content as a Buffer. */
@@ -356,6 +376,12 @@ declare class ArtifactsAPI {
356
376
  getReportMarkdown(notebookId: string, artifactId: string): Promise<string | null>;
357
377
  /** Get interactive HTML for quiz/flashcard artifacts. */
358
378
  getInteractiveHtml(notebookId: string, artifactId: string): Promise<string | null>;
379
+ /** Download a completed slide deck as PDF or PPTX. Returns a Buffer. */
380
+ downloadSlideDeck(notebookId: string, artifactId: string, format?: "pdf" | "pptx"): Promise<Buffer>;
381
+ /** Download a completed infographic as PNG. Returns a Buffer. */
382
+ downloadInfographic(notebookId: string, artifactId: string): Promise<Buffer>;
383
+ /** Get parsed headers and rows from a completed data table artifact. */
384
+ getDataTableContent(notebookId: string, artifactId: string): Promise<DataTableContent | null>;
359
385
  /**
360
386
  * Fetch a Google-hosted media URL, manually following redirects to ensure
361
387
  * cookies are included on every hop. Node/Bun fetch strips the Cookie header
@@ -395,18 +421,6 @@ declare class NotebooksAPI {
395
421
  getDescription(notebookId: string): Promise<NotebookDescription>;
396
422
  }
397
423
 
398
- declare class NotesAPI {
399
- private readonly rpc;
400
- constructor(rpc: RPCCore);
401
- list(notebookId: string): Promise<{
402
- notes: Note[];
403
- mindMaps: MindMap[];
404
- }>;
405
- create(notebookId: string, content: string, title?: string): Promise<Note>;
406
- update(notebookId: string, noteId: string, content: string, title?: string): Promise<Note>;
407
- delete(notebookId: string, noteId: string): Promise<boolean>;
408
- }
409
-
410
424
  interface ResearchTask {
411
425
  taskId: string;
412
426
  reportId: string | null;
@@ -523,10 +537,12 @@ interface ClientOptions {
523
537
  *
524
538
  * @example
525
539
  * ```ts
526
- * const client = await NotebookLMClient.connect({
527
- * cookies: process.env.NOTEBOOKLM_COOKIES,
528
- * });
540
+ * // After running `npx notebooklm-sdk login` once:
541
+ * const client = await NotebookLMClient.connect();
529
542
  * const notebooks = await client.notebooks.list();
543
+ *
544
+ * // Or with explicit credentials:
545
+ * const client = await NotebookLMClient.connect({ cookiesFile: './session.json' });
530
546
  * ```
531
547
  */
532
548
  declare class NotebookLMClient {
@@ -544,11 +560,11 @@ declare class NotebookLMClient {
544
560
  * Connect to NotebookLM using cookies.
545
561
  * Fetches CSRF and session tokens from the NotebookLM homepage.
546
562
  */
547
- static connect(opts: ConnectOptions, clientOpts?: ClientOptions): Promise<NotebookLMClient>;
563
+ static connect(opts?: ConnectOptions, clientOpts?: ClientOptions): Promise<NotebookLMClient>;
548
564
  /**
549
565
  * Refresh CSRF and session tokens (e.g. if they expire mid-session).
550
566
  */
551
567
  refreshTokens(): Promise<void>;
552
568
  }
553
569
 
554
- export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, type ChatReference, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type MindMap, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
570
+ export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, type ChatReference, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AuthTokens, a as ConnectOptions } from './auth-Ba2hsZW_.js';
2
- export { C as CookieMap, d as connect } from './auth-Ba2hsZW_.js';
1
+ import { A as AuthTokens, a as ConnectOptions } from './auth-Dxsm8894.js';
2
+ export { C as CookieMap, d as connect } from './auth-Dxsm8894.js';
3
3
  export { ArtifactDownloadError, ArtifactError, ArtifactNotFoundError, ArtifactNotReadyError, ArtifactParseError, AuthError, ChatError, ClientError, NetworkError, NotebookError, NotebookLMError, NotebookNotFoundError, RPCError, RPCTimeoutError, RateLimitError, ServerError, SourceAddError, SourceError, SourceNotFoundError, SourceProcessingError, SourceTimeoutError } from './errors.js';
4
4
 
5
5
  /** RPC method IDs for NotebookLM batchexecute API. */
@@ -280,11 +280,19 @@ interface Note {
280
280
  createdAt: Date | null;
281
281
  updatedAt: Date | null;
282
282
  }
283
- interface MindMap {
284
- id: string;
285
- title: string | null;
286
- content: string;
287
- createdAt: Date | null;
283
+
284
+ declare class NotesAPI {
285
+ private readonly rpc;
286
+ constructor(rpc: RPCCore);
287
+ list(notebookId: string): Promise<Note[]>;
288
+ listMindMaps(notebookId: string): Promise<Note[]>;
289
+ create(notebookId: string, content: string, title?: string): Promise<Note>;
290
+ update(notebookId: string, noteId: string, content: string, title?: string): Promise<Note>;
291
+ delete(notebookId: string, noteId: string): Promise<boolean>;
292
+ private _fetchAll;
293
+ private _isMindMap;
294
+ private _extractContent;
295
+ private _parseItem;
288
296
  }
289
297
 
290
298
  interface CreateAudioOptions {
@@ -322,6 +330,15 @@ interface CreateSlideDeckOptions {
322
330
  instructions?: string;
323
331
  language?: string;
324
332
  }
333
+ interface CreateDataTableOptions {
334
+ sourceIds?: string[];
335
+ instructions?: string;
336
+ language?: string;
337
+ }
338
+ interface DataTableContent {
339
+ headers: string[];
340
+ rows: string[][];
341
+ }
325
342
  type ReportFormat = "briefing_doc" | "study_guide" | "blog_post" | "custom";
326
343
  interface CreateReportOptions {
327
344
  format?: ReportFormat;
@@ -333,8 +350,10 @@ interface CreateReportOptions {
333
350
  declare class ArtifactsAPI {
334
351
  private readonly rpc;
335
352
  private readonly auth;
336
- constructor(rpc: RPCCore, auth: AuthTokens);
353
+ private readonly notes;
354
+ constructor(rpc: RPCCore, auth: AuthTokens, notes: NotesAPI);
337
355
  list(notebookId: string): Promise<Artifact[]>;
356
+ private _listRaw;
338
357
  get(notebookId: string, artifactId: string): Promise<Artifact | null>;
339
358
  delete(notebookId: string, artifactId: string): Promise<boolean>;
340
359
  rename(notebookId: string, artifactId: string, newTitle: string): Promise<boolean>;
@@ -344,8 +363,9 @@ declare class ArtifactsAPI {
344
363
  createFlashcards(notebookId: string, opts?: CreateQuizOptions): Promise<GenerationStatus>;
345
364
  createInfographic(notebookId: string, opts?: CreateInfographicOptions): Promise<GenerationStatus>;
346
365
  createSlideDeck(notebookId: string, opts?: CreateSlideDeckOptions): Promise<GenerationStatus>;
366
+ createDataTable(notebookId: string, opts?: CreateDataTableOptions): Promise<GenerationStatus>;
347
367
  createReport(notebookId: string, opts?: CreateReportOptions): Promise<GenerationStatus>;
348
- createMindMap(notebookId: string, sourceIds?: string[]): Promise<GenerationStatus>;
368
+ createMindMap(notebookId: string, sourceIds?: string[]): Promise<Note>;
349
369
  /** Poll until artifact reaches completed/failed status. */
350
370
  waitUntilReady(notebookId: string, artifactId: string, timeout?: number, pollInterval?: number): Promise<Artifact>;
351
371
  /** Download audio content as a Buffer. */
@@ -356,6 +376,12 @@ declare class ArtifactsAPI {
356
376
  getReportMarkdown(notebookId: string, artifactId: string): Promise<string | null>;
357
377
  /** Get interactive HTML for quiz/flashcard artifacts. */
358
378
  getInteractiveHtml(notebookId: string, artifactId: string): Promise<string | null>;
379
+ /** Download a completed slide deck as PDF or PPTX. Returns a Buffer. */
380
+ downloadSlideDeck(notebookId: string, artifactId: string, format?: "pdf" | "pptx"): Promise<Buffer>;
381
+ /** Download a completed infographic as PNG. Returns a Buffer. */
382
+ downloadInfographic(notebookId: string, artifactId: string): Promise<Buffer>;
383
+ /** Get parsed headers and rows from a completed data table artifact. */
384
+ getDataTableContent(notebookId: string, artifactId: string): Promise<DataTableContent | null>;
359
385
  /**
360
386
  * Fetch a Google-hosted media URL, manually following redirects to ensure
361
387
  * cookies are included on every hop. Node/Bun fetch strips the Cookie header
@@ -395,18 +421,6 @@ declare class NotebooksAPI {
395
421
  getDescription(notebookId: string): Promise<NotebookDescription>;
396
422
  }
397
423
 
398
- declare class NotesAPI {
399
- private readonly rpc;
400
- constructor(rpc: RPCCore);
401
- list(notebookId: string): Promise<{
402
- notes: Note[];
403
- mindMaps: MindMap[];
404
- }>;
405
- create(notebookId: string, content: string, title?: string): Promise<Note>;
406
- update(notebookId: string, noteId: string, content: string, title?: string): Promise<Note>;
407
- delete(notebookId: string, noteId: string): Promise<boolean>;
408
- }
409
-
410
424
  interface ResearchTask {
411
425
  taskId: string;
412
426
  reportId: string | null;
@@ -523,10 +537,12 @@ interface ClientOptions {
523
537
  *
524
538
  * @example
525
539
  * ```ts
526
- * const client = await NotebookLMClient.connect({
527
- * cookies: process.env.NOTEBOOKLM_COOKIES,
528
- * });
540
+ * // After running `npx notebooklm-sdk login` once:
541
+ * const client = await NotebookLMClient.connect();
529
542
  * const notebooks = await client.notebooks.list();
543
+ *
544
+ * // Or with explicit credentials:
545
+ * const client = await NotebookLMClient.connect({ cookiesFile: './session.json' });
530
546
  * ```
531
547
  */
532
548
  declare class NotebookLMClient {
@@ -544,11 +560,11 @@ declare class NotebookLMClient {
544
560
  * Connect to NotebookLM using cookies.
545
561
  * Fetches CSRF and session tokens from the NotebookLM homepage.
546
562
  */
547
- static connect(opts: ConnectOptions, clientOpts?: ClientOptions): Promise<NotebookLMClient>;
563
+ static connect(opts?: ConnectOptions, clientOpts?: ClientOptions): Promise<NotebookLMClient>;
548
564
  /**
549
565
  * Refresh CSRF and session tokens (e.g. if they expire mid-session).
550
566
  */
551
567
  refreshTokens(): Promise<void>;
552
568
  }
553
569
 
554
- export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, type ChatReference, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type MindMap, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
570
+ export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, type ChatReference, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };