notebooklm-sdk 0.1.2 → 0.1.5

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,32 +1,7 @@
1
+ import { A as AuthTokens, C as ConnectOptions } from './auth-DTugbaf3.cjs';
2
+ export { a as CookieMap, c as connect } from './auth-DTugbaf3.cjs';
1
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';
2
4
 
3
- interface CookieMap {
4
- [key: string]: string;
5
- }
6
- interface AuthTokens {
7
- cookies: CookieMap;
8
- csrfToken: string;
9
- sessionId: string;
10
- cookieHeader: string;
11
- /** Cookie header containing only .google.com domain cookies — for media downloads */
12
- googleCookieHeader: string;
13
- }
14
- interface ConnectOptions {
15
- /** "; "-separated cookie string (e.g. "SID=abc; HSID=xyz") */
16
- cookies?: string;
17
- /** Path to Playwright storage_state.json */
18
- cookiesFile?: string;
19
- /** Pre-parsed cookie map */
20
- cookiesObject?: CookieMap | {
21
- cookies?: Array<{
22
- name: string;
23
- value: string;
24
- domain: string;
25
- }>;
26
- };
27
- }
28
- declare function connect(opts: ConnectOptions): Promise<AuthTokens>;
29
-
30
5
  /** RPC method IDs for NotebookLM batchexecute API. */
31
6
  declare const RPCMethod: {
32
7
  readonly LIST_NOTEBOOKS: "wXbhsf";
@@ -196,6 +171,20 @@ declare const SharePermission: {
196
171
  };
197
172
  type SharePermissionValue = (typeof SharePermission)[keyof typeof SharePermission];
198
173
 
174
+ interface RPCCallOptions {
175
+ sourcePath?: string;
176
+ allowNull?: boolean;
177
+ timeoutMs?: number;
178
+ }
179
+ declare class RPCCore {
180
+ private readonly auth;
181
+ private readonly timeoutMs;
182
+ constructor(auth: AuthTokens, timeoutMs?: number);
183
+ call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions): Promise<unknown>;
184
+ /** Extract source IDs from a notebook (used by chat/artifact APIs). */
185
+ getSourceIds(notebookId: string): Promise<string[]>;
186
+ }
187
+
199
188
  interface Notebook {
200
189
  id: string;
201
190
  title: string;
@@ -298,52 +287,6 @@ interface MindMap {
298
287
  createdAt: Date | null;
299
288
  }
300
289
 
301
- interface RPCCallOptions {
302
- sourcePath?: string;
303
- allowNull?: boolean;
304
- timeoutMs?: number;
305
- }
306
- declare class RPCCore {
307
- private readonly auth;
308
- private readonly timeoutMs;
309
- constructor(auth: AuthTokens, timeoutMs?: number);
310
- call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions): Promise<unknown>;
311
- /** Extract source IDs from a notebook (used by chat/artifact APIs). */
312
- getSourceIds(notebookId: string): Promise<string[]>;
313
- }
314
-
315
- declare class NotebooksAPI {
316
- private readonly rpc;
317
- constructor(rpc: RPCCore);
318
- list(): Promise<Notebook[]>;
319
- create(title: string): Promise<Notebook>;
320
- get(notebookId: string): Promise<Notebook>;
321
- delete(notebookId: string): Promise<boolean>;
322
- rename(notebookId: string, newTitle: string): Promise<Notebook>;
323
- getSummary(notebookId: string): Promise<string>;
324
- getDescription(notebookId: string): Promise<NotebookDescription>;
325
- }
326
-
327
- interface AddSourceOptions {
328
- waitUntilReady?: boolean;
329
- waitTimeout?: number;
330
- }
331
- declare class SourcesAPI {
332
- private readonly rpc;
333
- private readonly auth;
334
- constructor(rpc: RPCCore, auth: AuthTokens);
335
- list(notebookId: string): Promise<Source[]>;
336
- get(notebookId: string, sourceId: string): Promise<Source | null>;
337
- addUrl(notebookId: string, url: string, opts?: AddSourceOptions): Promise<Source>;
338
- addText(notebookId: string, text: string, title?: string, opts?: AddSourceOptions): Promise<Source>;
339
- addFile(notebookId: string, filePath: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
340
- addFileBuffer(notebookId: string, data: Buffer | Uint8Array, fileName: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
341
- private uploadFile;
342
- delete(notebookId: string, sourceId: string): Promise<boolean>;
343
- refresh(notebookId: string, sourceId: string): Promise<boolean>;
344
- waitUntilReady(notebookId: string, sourceId: string, timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source>;
345
- }
346
-
347
290
  interface CreateAudioOptions {
348
291
  format?: AudioFormatValue;
349
292
  length?: AudioLengthValue;
@@ -440,6 +383,18 @@ declare class ChatAPI {
440
383
  private _buildHistory;
441
384
  }
442
385
 
386
+ declare class NotebooksAPI {
387
+ private readonly rpc;
388
+ constructor(rpc: RPCCore);
389
+ list(): Promise<Notebook[]>;
390
+ create(title: string): Promise<Notebook>;
391
+ get(notebookId: string): Promise<Notebook>;
392
+ delete(notebookId: string): Promise<boolean>;
393
+ rename(notebookId: string, newTitle: string): Promise<Notebook>;
394
+ getSummary(notebookId: string): Promise<string>;
395
+ getDescription(notebookId: string): Promise<NotebookDescription>;
396
+ }
397
+
443
398
  declare class NotesAPI {
444
399
  private readonly rpc;
445
400
  constructor(rpc: RPCCore);
@@ -538,6 +493,27 @@ declare class SharingAPI {
538
493
  removeUser(notebookId: string, email: string): Promise<ShareStatus>;
539
494
  }
540
495
 
496
+ interface AddSourceOptions {
497
+ waitUntilReady?: boolean;
498
+ waitTimeout?: number;
499
+ }
500
+ declare class SourcesAPI {
501
+ private readonly rpc;
502
+ private readonly auth;
503
+ constructor(rpc: RPCCore, auth: AuthTokens);
504
+ list(notebookId: string): Promise<Source[]>;
505
+ get(notebookId: string, sourceId: string): Promise<Source | null>;
506
+ addUrl(notebookId: string, url: string, opts?: AddSourceOptions): Promise<Source>;
507
+ addText(notebookId: string, text: string, title?: string, opts?: AddSourceOptions): Promise<Source>;
508
+ addFile(notebookId: string, filePath: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
509
+ addFileBuffer(notebookId: string, data: Buffer | Uint8Array, fileName: string, _mimeType: string, opts?: AddSourceOptions): Promise<Source>;
510
+ private startResumableUpload;
511
+ private uploadFile;
512
+ delete(notebookId: string, sourceId: string): Promise<boolean>;
513
+ refresh(notebookId: string, sourceId: string): Promise<boolean>;
514
+ waitUntilReady(notebookId: string, sourceId: string, timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source>;
515
+ }
516
+
541
517
  interface ClientOptions {
542
518
  /** HTTP request timeout in milliseconds. Default: 30000 */
543
519
  timeoutMs?: number;
@@ -575,4 +551,4 @@ declare class NotebookLMClient {
575
551
  refreshTokens(): Promise<void>;
576
552
  }
577
553
 
578
- export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, type AuthTokens, ChatAPI, type ChatReference, type ClientOptions, type ConnectOptions, type ConversationTurn, type CookieMap, 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, connect };
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 };
package/dist/index.d.ts CHANGED
@@ -1,32 +1,7 @@
1
+ import { A as AuthTokens, C as ConnectOptions } from './auth-DTugbaf3.js';
2
+ export { a as CookieMap, c as connect } from './auth-DTugbaf3.js';
1
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';
2
4
 
3
- interface CookieMap {
4
- [key: string]: string;
5
- }
6
- interface AuthTokens {
7
- cookies: CookieMap;
8
- csrfToken: string;
9
- sessionId: string;
10
- cookieHeader: string;
11
- /** Cookie header containing only .google.com domain cookies — for media downloads */
12
- googleCookieHeader: string;
13
- }
14
- interface ConnectOptions {
15
- /** "; "-separated cookie string (e.g. "SID=abc; HSID=xyz") */
16
- cookies?: string;
17
- /** Path to Playwright storage_state.json */
18
- cookiesFile?: string;
19
- /** Pre-parsed cookie map */
20
- cookiesObject?: CookieMap | {
21
- cookies?: Array<{
22
- name: string;
23
- value: string;
24
- domain: string;
25
- }>;
26
- };
27
- }
28
- declare function connect(opts: ConnectOptions): Promise<AuthTokens>;
29
-
30
5
  /** RPC method IDs for NotebookLM batchexecute API. */
31
6
  declare const RPCMethod: {
32
7
  readonly LIST_NOTEBOOKS: "wXbhsf";
@@ -196,6 +171,20 @@ declare const SharePermission: {
196
171
  };
197
172
  type SharePermissionValue = (typeof SharePermission)[keyof typeof SharePermission];
198
173
 
174
+ interface RPCCallOptions {
175
+ sourcePath?: string;
176
+ allowNull?: boolean;
177
+ timeoutMs?: number;
178
+ }
179
+ declare class RPCCore {
180
+ private readonly auth;
181
+ private readonly timeoutMs;
182
+ constructor(auth: AuthTokens, timeoutMs?: number);
183
+ call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions): Promise<unknown>;
184
+ /** Extract source IDs from a notebook (used by chat/artifact APIs). */
185
+ getSourceIds(notebookId: string): Promise<string[]>;
186
+ }
187
+
199
188
  interface Notebook {
200
189
  id: string;
201
190
  title: string;
@@ -298,52 +287,6 @@ interface MindMap {
298
287
  createdAt: Date | null;
299
288
  }
300
289
 
301
- interface RPCCallOptions {
302
- sourcePath?: string;
303
- allowNull?: boolean;
304
- timeoutMs?: number;
305
- }
306
- declare class RPCCore {
307
- private readonly auth;
308
- private readonly timeoutMs;
309
- constructor(auth: AuthTokens, timeoutMs?: number);
310
- call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions): Promise<unknown>;
311
- /** Extract source IDs from a notebook (used by chat/artifact APIs). */
312
- getSourceIds(notebookId: string): Promise<string[]>;
313
- }
314
-
315
- declare class NotebooksAPI {
316
- private readonly rpc;
317
- constructor(rpc: RPCCore);
318
- list(): Promise<Notebook[]>;
319
- create(title: string): Promise<Notebook>;
320
- get(notebookId: string): Promise<Notebook>;
321
- delete(notebookId: string): Promise<boolean>;
322
- rename(notebookId: string, newTitle: string): Promise<Notebook>;
323
- getSummary(notebookId: string): Promise<string>;
324
- getDescription(notebookId: string): Promise<NotebookDescription>;
325
- }
326
-
327
- interface AddSourceOptions {
328
- waitUntilReady?: boolean;
329
- waitTimeout?: number;
330
- }
331
- declare class SourcesAPI {
332
- private readonly rpc;
333
- private readonly auth;
334
- constructor(rpc: RPCCore, auth: AuthTokens);
335
- list(notebookId: string): Promise<Source[]>;
336
- get(notebookId: string, sourceId: string): Promise<Source | null>;
337
- addUrl(notebookId: string, url: string, opts?: AddSourceOptions): Promise<Source>;
338
- addText(notebookId: string, text: string, title?: string, opts?: AddSourceOptions): Promise<Source>;
339
- addFile(notebookId: string, filePath: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
340
- addFileBuffer(notebookId: string, data: Buffer | Uint8Array, fileName: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
341
- private uploadFile;
342
- delete(notebookId: string, sourceId: string): Promise<boolean>;
343
- refresh(notebookId: string, sourceId: string): Promise<boolean>;
344
- waitUntilReady(notebookId: string, sourceId: string, timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source>;
345
- }
346
-
347
290
  interface CreateAudioOptions {
348
291
  format?: AudioFormatValue;
349
292
  length?: AudioLengthValue;
@@ -440,6 +383,18 @@ declare class ChatAPI {
440
383
  private _buildHistory;
441
384
  }
442
385
 
386
+ declare class NotebooksAPI {
387
+ private readonly rpc;
388
+ constructor(rpc: RPCCore);
389
+ list(): Promise<Notebook[]>;
390
+ create(title: string): Promise<Notebook>;
391
+ get(notebookId: string): Promise<Notebook>;
392
+ delete(notebookId: string): Promise<boolean>;
393
+ rename(notebookId: string, newTitle: string): Promise<Notebook>;
394
+ getSummary(notebookId: string): Promise<string>;
395
+ getDescription(notebookId: string): Promise<NotebookDescription>;
396
+ }
397
+
443
398
  declare class NotesAPI {
444
399
  private readonly rpc;
445
400
  constructor(rpc: RPCCore);
@@ -538,6 +493,27 @@ declare class SharingAPI {
538
493
  removeUser(notebookId: string, email: string): Promise<ShareStatus>;
539
494
  }
540
495
 
496
+ interface AddSourceOptions {
497
+ waitUntilReady?: boolean;
498
+ waitTimeout?: number;
499
+ }
500
+ declare class SourcesAPI {
501
+ private readonly rpc;
502
+ private readonly auth;
503
+ constructor(rpc: RPCCore, auth: AuthTokens);
504
+ list(notebookId: string): Promise<Source[]>;
505
+ get(notebookId: string, sourceId: string): Promise<Source | null>;
506
+ addUrl(notebookId: string, url: string, opts?: AddSourceOptions): Promise<Source>;
507
+ addText(notebookId: string, text: string, title?: string, opts?: AddSourceOptions): Promise<Source>;
508
+ addFile(notebookId: string, filePath: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
509
+ addFileBuffer(notebookId: string, data: Buffer | Uint8Array, fileName: string, _mimeType: string, opts?: AddSourceOptions): Promise<Source>;
510
+ private startResumableUpload;
511
+ private uploadFile;
512
+ delete(notebookId: string, sourceId: string): Promise<boolean>;
513
+ refresh(notebookId: string, sourceId: string): Promise<boolean>;
514
+ waitUntilReady(notebookId: string, sourceId: string, timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source>;
515
+ }
516
+
541
517
  interface ClientOptions {
542
518
  /** HTTP request timeout in milliseconds. Default: 30000 */
543
519
  timeoutMs?: number;
@@ -575,4 +551,4 @@ declare class NotebookLMClient {
575
551
  refreshTokens(): Promise<void>;
576
552
  }
577
553
 
578
- export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, type AuthTokens, ChatAPI, type ChatReference, type ClientOptions, type ConnectOptions, type ConversationTurn, type CookieMap, 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, connect };
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 };