@pindownai/client-js 1.0.0 → 1.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.ts CHANGED
@@ -1,61 +1,315 @@
1
1
  /**
2
- * API Types for Pindown
2
+ * Pin types for the v1 Pins API.
3
+ * Aligned with backend-api/src/lib/pin-types.ts + pin-config-schemas.ts.
4
+ * Import per-type *PinConfig interfaces for typed CRUD payloads.
3
5
  */
4
- interface ApiResponse<T = any> {
5
- success: boolean;
6
- data: T;
7
- error?: {
8
- code: string;
9
- message: string;
10
- details?: any;
11
- };
6
+ declare const PRODUCT_PIN_TYPES: readonly ["markdown", "image", "gallery", "table", "charts", "mermaid", "embed", "pdf-viewer", "excel-viewer", "stat-cards", "timeline", "json-viewer", "json-list", "links", "steps", "csv-viewer", "user-story", "chat", "intro", "mastra", "text-media", "file-upload", "kanban-board", "checklist", "calendar", "roadmap", "realtime-canvas"];
7
+ declare const LEGACY_PIN_TYPES: readonly ["line-chart", "tree"];
8
+ declare const ALL_PIN_TYPES: readonly ["markdown", "image", "gallery", "table", "charts", "mermaid", "embed", "pdf-viewer", "excel-viewer", "stat-cards", "timeline", "json-viewer", "json-list", "links", "steps", "csv-viewer", "user-story", "chat", "intro", "mastra", "text-media", "file-upload", "kanban-board", "checklist", "calendar", "roadmap", "realtime-canvas", "line-chart", "tree"];
9
+ type ProductPinTypeId = (typeof PRODUCT_PIN_TYPES)[number];
10
+ type LegacyPinTypeId = (typeof LEGACY_PIN_TYPES)[number];
11
+ type PinTypeId = (typeof ALL_PIN_TYPES)[number];
12
+ type PinLayout = '1x1' | '1x2' | '2x1' | '2x2' | '3x1' | '3x2' | '3x3' | '4x4';
13
+ type PinDataType = 'markdown' | 'json' | 'text' | 'pin-card';
14
+ /** @deprecated Use PinTypeId */
15
+ type PinCardType = PinTypeId;
16
+ interface StatCardItem {
17
+ title: string;
18
+ value: string | number;
19
+ change?: string;
20
+ trend?: 'up' | 'down' | 'neutral' | string;
21
+ icon?: string;
22
+ [key: string]: unknown;
12
23
  }
13
- interface PaginatedResponse<T> {
14
- items: T[];
15
- total: number;
16
- limit: number;
17
- offset: number;
24
+ interface TableColumn {
25
+ id: string;
26
+ name: string;
27
+ type?: string;
28
+ [key: string]: unknown;
18
29
  }
19
- type PinDataType = 'markdown' | 'json' | 'text' | 'pin-card';
20
- type PinCardType = 'stat-cards' | 'line-chart' | 'flexible-table' | 'embed' | 'markdown' | 'image' | 'score-gauge' | 'indicator-table' | 'alert-action' | 'bottom-detector' | 'long-short-pie';
21
- interface Pin {
30
+ interface TableRow {
22
31
  id: string;
23
- user_id: string;
24
- owner_id: string;
25
- data_type: PinDataType;
26
- pin_card_type?: PinCardType;
27
- metadata?: {
28
- name?: string;
29
- tags?: string[];
30
- [key: string]: any;
32
+ cells: Record<string, unknown>;
33
+ [key: string]: unknown;
34
+ }
35
+ interface KanbanColumn {
36
+ id: string;
37
+ title: string;
38
+ cards?: Array<Record<string, unknown>>;
39
+ [key: string]: unknown;
40
+ }
41
+ interface ChecklistItem {
42
+ id: string;
43
+ name: string;
44
+ checked?: boolean;
45
+ [key: string]: unknown;
46
+ }
47
+ interface GalleryImage {
48
+ url: string;
49
+ alt?: string;
50
+ [key: string]: unknown;
51
+ }
52
+ interface LinkItem {
53
+ title: string;
54
+ url: string;
55
+ [key: string]: unknown;
56
+ }
57
+ interface StepItem {
58
+ title: string;
59
+ description?: string;
60
+ [key: string]: unknown;
61
+ }
62
+ interface TreeNode {
63
+ id: string;
64
+ label: string;
65
+ children?: TreeNode[];
66
+ [key: string]: unknown;
67
+ }
68
+ interface MarkdownPinConfig {
69
+ content?: string;
70
+ collaboration?: {
71
+ enabled?: boolean;
31
72
  };
32
- is_public: boolean;
33
- allow_edit: boolean;
34
- require_sign_in: boolean;
35
- allow_comments: boolean;
36
- created_at: string;
37
- updated_at: string;
73
+ [key: string]: unknown;
74
+ }
75
+ interface ImagePinConfig {
76
+ url?: string;
77
+ altText?: string;
78
+ fit?: 'cover' | 'contain' | string;
79
+ [key: string]: unknown;
80
+ }
81
+ interface GalleryPinConfig {
82
+ images?: GalleryImage[];
83
+ [key: string]: unknown;
84
+ }
85
+ interface TablePinConfig {
86
+ columns: TableColumn[];
87
+ rows?: TableRow[];
88
+ [key: string]: unknown;
89
+ }
90
+ interface ChartsPinConfig {
91
+ chartType?: string;
92
+ data?: Array<Record<string, unknown>>;
93
+ xAxis?: string;
94
+ yAxis?: string;
95
+ [key: string]: unknown;
96
+ }
97
+ interface MermaidPinConfig {
98
+ code?: string;
99
+ diagram?: string;
100
+ title?: string;
101
+ [key: string]: unknown;
102
+ }
103
+ interface EmbedPinConfig {
104
+ url?: string;
105
+ type?: string;
106
+ [key: string]: unknown;
107
+ }
108
+ interface PdfViewerPinConfig {
109
+ pdf: {
110
+ url: string;
111
+ fileName?: string;
112
+ title?: string;
113
+ [key: string]: unknown;
114
+ };
115
+ [key: string]: unknown;
116
+ }
117
+ interface ExcelViewerPinConfig {
118
+ excel: {
119
+ url: string;
120
+ fileName?: string;
121
+ title?: string;
122
+ [key: string]: unknown;
123
+ };
124
+ [key: string]: unknown;
125
+ }
126
+ interface StatCardsPinConfig {
127
+ cards: StatCardItem[];
128
+ [key: string]: unknown;
129
+ }
130
+ interface TimelinePinConfig {
131
+ mode?: string;
132
+ items?: Array<Record<string, unknown>>;
133
+ [key: string]: unknown;
134
+ }
135
+ interface JsonViewerPinConfig {
136
+ json?: unknown;
137
+ jsonString?: string;
138
+ title?: string;
139
+ [key: string]: unknown;
140
+ }
141
+ interface JsonListPinConfig {
142
+ json?: unknown[];
143
+ jsonString?: string;
144
+ [key: string]: unknown;
145
+ }
146
+ interface LinksPinConfig {
147
+ links?: LinkItem[];
148
+ [key: string]: unknown;
149
+ }
150
+ interface StepsPinConfig {
151
+ steps: StepItem[];
152
+ [key: string]: unknown;
153
+ }
154
+ interface CsvViewerPinConfig {
155
+ csvText?: string;
156
+ csvData?: Array<Record<string, unknown>>;
157
+ fileName?: string;
158
+ [key: string]: unknown;
159
+ }
160
+ interface UserStoryPinConfig {
161
+ title?: string;
162
+ userStory: string;
163
+ acceptanceCriteria?: string;
164
+ [key: string]: unknown;
165
+ }
166
+ interface ChatPinConfig {
167
+ title?: string;
168
+ placeholder?: string;
169
+ [key: string]: unknown;
170
+ }
171
+ interface IntroPinConfig {
172
+ heading: string;
173
+ subheading?: string;
174
+ [key: string]: unknown;
175
+ }
176
+ interface MastraPinConfig {
177
+ mode?: 'workflow' | 'agent' | string;
178
+ agentId?: string;
179
+ workflowId?: string;
180
+ [key: string]: unknown;
181
+ }
182
+ interface TextMediaPinConfig {
183
+ title?: string;
184
+ text?: string;
185
+ textPosition?: 'left' | 'right' | string;
186
+ [key: string]: unknown;
38
187
  }
39
- interface CreatePinRequest {
188
+ interface FileUploadPinConfig {
189
+ files?: Array<Record<string, unknown>>;
190
+ displayMode?: string;
191
+ [key: string]: unknown;
192
+ }
193
+ interface KanbanBoardPinConfig {
194
+ columns: KanbanColumn[];
195
+ [key: string]: unknown;
196
+ }
197
+ interface ChecklistPinConfig {
198
+ title?: string;
199
+ items: ChecklistItem[];
200
+ [key: string]: unknown;
201
+ }
202
+ interface CalendarPinConfig {
203
+ weekStartsOn?: number;
204
+ events?: Array<Record<string, unknown>>;
205
+ [key: string]: unknown;
206
+ }
207
+ interface RoadmapPinConfig {
208
+ title?: string;
209
+ months?: Array<Record<string, unknown>>;
210
+ [key: string]: unknown;
211
+ }
212
+ interface RealtimeCanvasPinConfig {
213
+ title?: string;
214
+ description?: string;
215
+ roomId?: string;
216
+ [key: string]: unknown;
217
+ }
218
+ interface LineChartPinConfig extends ChartsPinConfig {
219
+ }
220
+ interface TreePinConfig {
221
+ nodes?: TreeNode[];
222
+ [key: string]: unknown;
223
+ }
224
+ interface PinConfigByType {
225
+ markdown: MarkdownPinConfig;
226
+ image: ImagePinConfig;
227
+ gallery: GalleryPinConfig;
228
+ table: TablePinConfig;
229
+ charts: ChartsPinConfig;
230
+ mermaid: MermaidPinConfig;
231
+ embed: EmbedPinConfig;
232
+ 'pdf-viewer': PdfViewerPinConfig;
233
+ 'excel-viewer': ExcelViewerPinConfig;
234
+ 'stat-cards': StatCardsPinConfig;
235
+ timeline: TimelinePinConfig;
236
+ 'json-viewer': JsonViewerPinConfig;
237
+ 'json-list': JsonListPinConfig;
238
+ links: LinksPinConfig;
239
+ steps: StepsPinConfig;
240
+ 'csv-viewer': CsvViewerPinConfig;
241
+ 'user-story': UserStoryPinConfig;
242
+ chat: ChatPinConfig;
243
+ intro: IntroPinConfig;
244
+ mastra: MastraPinConfig;
245
+ 'text-media': TextMediaPinConfig;
246
+ 'file-upload': FileUploadPinConfig;
247
+ 'kanban-board': KanbanBoardPinConfig;
248
+ checklist: ChecklistPinConfig;
249
+ calendar: CalendarPinConfig;
250
+ roadmap: RoadmapPinConfig;
251
+ 'realtime-canvas': RealtimeCanvasPinConfig;
252
+ 'line-chart': LineChartPinConfig;
253
+ tree: TreePinConfig;
254
+ }
255
+ interface PinMetadataBase {
256
+ title: string;
257
+ tags?: string[];
258
+ description?: string;
259
+ allow_edit?: boolean;
260
+ require_sign_in?: boolean;
261
+ allow_comments?: boolean;
262
+ }
263
+ type PinMetadata<T extends PinTypeId = PinTypeId> = PinMetadataBase & {
264
+ pin_type?: T;
265
+ pin_config?: PinConfigByType[T];
266
+ pin_layout?: PinLayout;
267
+ };
268
+ interface CreateTypedPinRequest<T extends PinTypeId> {
269
+ pin_type: T;
270
+ pin_config: PinConfigByType[T];
271
+ pin_layout?: PinLayout;
272
+ is_public?: boolean;
273
+ allow_edit?: boolean;
274
+ require_sign_in?: boolean;
275
+ allow_comments?: boolean;
276
+ metadata: PinMetadataBase;
277
+ pending_invites?: Record<string, 'editor' | 'viewer'>;
278
+ /** @deprecated Inferred from pin_type */
40
279
  data_type?: PinDataType;
41
- pin_card_type?: PinCardType;
280
+ }
281
+ interface CreateNestedPinRequest<T extends PinTypeId> {
282
+ pin_layout?: PinLayout;
42
283
  is_public?: boolean;
43
- metadata: {
44
- title: string;
45
- tags?: string[];
46
- allow_edit?: boolean;
47
- require_sign_in?: boolean;
48
- allow_comments?: boolean;
49
- pin_card_type?: PinCardType;
50
- pin_card_layout?: string;
51
- pin_card_config?: any;
52
- [key: string]: any;
53
- };
284
+ allow_edit?: boolean;
285
+ require_sign_in?: boolean;
286
+ allow_comments?: boolean;
287
+ metadata: PinMetadata<T> & PinMetadataBase;
54
288
  pending_invites?: Record<string, 'editor' | 'viewer'>;
289
+ data_type?: PinDataType;
55
290
  }
56
- interface UpdatePinRequest {
291
+ type CreatePinRequest<T extends PinTypeId = PinTypeId> = CreateTypedPinRequest<T> | CreateNestedPinRequest<T>;
292
+ interface UpdatePinRequest<T extends PinTypeId = PinTypeId> {
293
+ pin_type?: T;
294
+ pin_config?: PinConfigByType[T];
295
+ pin_layout?: PinLayout;
57
296
  is_public?: boolean;
58
- metadata?: Pin['metadata'];
297
+ metadata?: Partial<PinMetadata<T>>;
298
+ }
299
+ interface Pin<T extends PinTypeId = PinTypeId> {
300
+ id: string;
301
+ owner_id: string;
302
+ user_id?: string;
303
+ title?: string;
304
+ description?: string;
305
+ data_type: PinDataType;
306
+ is_public: boolean;
307
+ allow_edit: boolean;
308
+ require_sign_in: boolean;
309
+ allow_comments: boolean;
310
+ metadata?: PinMetadata<T>;
311
+ created_at: string | number;
312
+ updated_at: string | number;
59
313
  }
60
314
  interface SharePinRequest {
61
315
  is_public?: boolean;
@@ -67,6 +321,52 @@ interface ListPinsOptions {
67
321
  limit?: number;
68
322
  offset?: number;
69
323
  }
324
+ interface CreateMarkdownPinInput extends PinMetadataBase {
325
+ content: string;
326
+ pin_layout?: PinLayout;
327
+ is_public?: boolean;
328
+ allow_edit?: boolean;
329
+ require_sign_in?: boolean;
330
+ allow_comments?: boolean;
331
+ pending_invites?: Record<string, 'editor' | 'viewer'>;
332
+ }
333
+ interface CreateStatCardsPinInput extends PinMetadataBase {
334
+ cards: StatCardItem[];
335
+ pin_layout?: PinLayout;
336
+ is_public?: boolean;
337
+ }
338
+ interface CreateTablePinInput extends PinMetadataBase {
339
+ columns: TableColumn[];
340
+ rows?: TableRow[];
341
+ pin_layout?: PinLayout;
342
+ is_public?: boolean;
343
+ }
344
+ interface CreateEmbedPinInput extends PinMetadataBase {
345
+ url: string;
346
+ type?: string;
347
+ pin_layout?: PinLayout;
348
+ is_public?: boolean;
349
+ }
350
+
351
+ /**
352
+ * API Types for Pindown
353
+ */
354
+
355
+ interface ApiResponse<T = any> {
356
+ success: boolean;
357
+ data: T;
358
+ error?: {
359
+ code: string;
360
+ message: string;
361
+ details?: any;
362
+ };
363
+ }
364
+ interface PaginatedResponse<T> {
365
+ items: T[];
366
+ total: number;
367
+ limit: number;
368
+ offset: number;
369
+ }
70
370
  interface Pinboard {
71
371
  id: string;
72
372
  user_id: string;
@@ -107,6 +407,53 @@ interface UpdatePinboardLayoutRequest {
107
407
  layout?: Record<string, any>;
108
408
  mobile_layout?: Record<string, any>;
109
409
  }
410
+ interface Page {
411
+ id: string;
412
+ owner_id: string;
413
+ is_public: boolean;
414
+ metadata: {
415
+ title: string;
416
+ description?: string;
417
+ tags: string[];
418
+ created_at: string;
419
+ updated_at?: string;
420
+ };
421
+ pins: string[];
422
+ layout?: Record<string, any>;
423
+ created_at: number;
424
+ updated_at: number;
425
+ }
426
+ interface CreatePageRequest {
427
+ metadata: {
428
+ title: string;
429
+ description?: string;
430
+ tags?: string[];
431
+ };
432
+ pins?: string[];
433
+ layout?: Record<string, any>;
434
+ is_public?: boolean;
435
+ allow_comments?: boolean;
436
+ require_sign_in?: boolean;
437
+ include_datasets?: boolean;
438
+ }
439
+ interface UpdatePageRequest {
440
+ metadata?: {
441
+ title?: string;
442
+ description?: string;
443
+ tags?: string[];
444
+ };
445
+ is_public?: boolean;
446
+ allow_comments?: boolean;
447
+ require_sign_in?: boolean;
448
+ include_datasets?: boolean;
449
+ }
450
+ interface AddPinToPageRequest {
451
+ pin_id: string;
452
+ }
453
+ interface ListPagesOptions {
454
+ limit?: number;
455
+ offset?: number;
456
+ }
110
457
  type DatasetType = 'json' | 'markdown';
111
458
  interface Dataset {
112
459
  id: string;
@@ -195,41 +542,18 @@ interface RateLimitInfo {
195
542
  declare class PinsMethods {
196
543
  private client;
197
544
  constructor(client: PindownClient);
198
- /**
199
- * Create a new pin
200
- */
201
- create(request: CreatePinRequest): Promise<Pin>;
202
- /**
203
- * Get a pin by ID
204
- */
205
- get(pinId: string): Promise<Pin>;
206
- /**
207
- * List all pins
208
- */
545
+ /** Create a pin (typed via CreatePinRequest&lt;T&gt;) */
546
+ create<T extends PinTypeId>(request: CreatePinRequest<T>): Promise<Pin<T>>;
547
+ get<T extends PinTypeId = PinTypeId>(pinId: string): Promise<Pin<T>>;
209
548
  list(options?: ListPinsOptions): Promise<PaginatedResponse<Pin>>;
210
- /**
211
- * Update a pin
212
- */
213
- update(pinId: string, request: UpdatePinRequest): Promise<Pin>;
214
- /**
215
- * Delete a pin
216
- */
549
+ update<T extends PinTypeId = PinTypeId>(pinId: string, request: UpdatePinRequest<T>): Promise<Pin<T>>;
217
550
  delete(pinId: string): Promise<void>;
218
- /**
219
- * Update pin sharing settings
220
- */
221
551
  share(pinId: string, request: SharePinRequest): Promise<Pin>;
222
- /**
223
- * Get multiple pins by IDs in a single request (max 100 pins)
224
- */
225
552
  batchGet(pinIds: string[]): Promise<{
226
553
  found: Pin[];
227
554
  not_found: string[];
228
555
  permission_denied: string[];
229
556
  }>;
230
- /**
231
- * Create multiple pins in a single request (max 50 pins)
232
- */
233
557
  batchCreate(pins: CreatePinRequest[]): Promise<{
234
558
  created: Array<{
235
559
  id: string;
@@ -241,9 +565,6 @@ declare class PinsMethods {
241
565
  error: string;
242
566
  }>;
243
567
  }>;
244
- /**
245
- * Update multiple pins in a single request (max 50 pins)
246
- */
247
568
  batchUpdate(updates: Array<{
248
569
  id: string;
249
570
  } & UpdatePinRequest>): Promise<{
@@ -254,9 +575,6 @@ declare class PinsMethods {
254
575
  }>;
255
576
  updated_at: number;
256
577
  }>;
257
- /**
258
- * Delete multiple pins in a single request (max 50 pins)
259
- */
260
578
  batchDelete(pinIds: string[]): Promise<{
261
579
  deleted: string[];
262
580
  failed: Array<{
@@ -264,34 +582,15 @@ declare class PinsMethods {
264
582
  error: string;
265
583
  }>;
266
584
  }>;
585
+ /** Create a markdown pin with pin_config.content (seeds Yjs on the server). */
586
+ createMarkdown(input: CreateMarkdownPinInput): Promise<Pin<'markdown'>>;
587
+ createStatCards(input: CreateStatCardsPinInput): Promise<Pin<'stat-cards'>>;
588
+ createTable(input: CreateTablePinInput): Promise<Pin<'table'>>;
589
+ createEmbed(input: CreateEmbedPinInput): Promise<Pin<'embed'>>;
267
590
  /**
268
- * Create a markdown pin (content comes from blocks)
269
- */
270
- createMarkdown(title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
271
- /**
272
- * Create a stat card pin
273
- */
274
- createStatCard(data: {
275
- title: string;
276
- value: string | number;
277
- change?: string;
278
- icon?: string;
279
- }, title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
280
- /**
281
- * Create a flexible table pin
591
+ * @deprecated Use createMarkdown({ title, content, ... }) — old signature ignored content in title
282
592
  */
283
- createTable(data: {
284
- columns: Array<{
285
- id: string;
286
- label: string;
287
- type?: string;
288
- }>;
289
- rows: Array<Record<string, any>>;
290
- }, title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
291
- /**
292
- * Create an embed pin (YouTube, Figma, etc.)
293
- */
294
- createEmbed(url: string, title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
593
+ createMarkdownLegacy(title: string, additionalMetadata?: Record<string, unknown>): Promise<Pin<'markdown'>>;
295
594
  }
296
595
 
297
596
  /**
@@ -414,189 +713,99 @@ declare class PinboardsMethods {
414
713
  }
415
714
 
416
715
  /**
417
- * Datasets API Methods
716
+ * Pages API Methods
418
717
  */
419
718
 
420
- declare class DatasetsMethods {
719
+ declare class PagesMethods {
421
720
  private client;
422
721
  constructor(client: PindownClient);
423
722
  /**
424
- * Create a new dataset
425
- */
426
- create(request: CreateDatasetRequest): Promise<Dataset>;
427
- /**
428
- * Get a dataset by ID
429
- */
430
- get(datasetId: string): Promise<Dataset>;
431
- /**
432
- * List all datasets
723
+ * Create a new page
433
724
  */
434
- list(): Promise<Dataset[]>;
725
+ create(request: CreatePageRequest): Promise<Page>;
435
726
  /**
436
- * Update a dataset
727
+ * Get a page by ID
437
728
  */
438
- update(datasetId: string, request: UpdateDatasetRequest): Promise<Dataset>;
729
+ get(pageId: string): Promise<Page>;
439
730
  /**
440
- * Delete a dataset
731
+ * List all pages
441
732
  */
442
- delete(datasetId: string): Promise<void>;
443
- /**
444
- * Invite a collaborator to a dataset
445
- */
446
- inviteCollaborator(datasetId: string, request: {
447
- email: string;
448
- role: 'editor' | 'viewer';
449
- }): Promise<{
450
- email: string;
451
- role: 'editor' | 'viewer';
452
- inviteToken: string;
453
- expiresAt: number;
733
+ list(options?: ListPagesOptions): Promise<{
734
+ pages: Page[];
735
+ total: number;
454
736
  }>;
455
737
  /**
456
- * Get multiple datasets by IDs in a single request (max 100 datasets)
738
+ * List pages shared with user
457
739
  */
458
- batchGet(datasetIds: string[]): Promise<{
459
- found: Dataset[];
460
- not_found: string[];
461
- permission_denied: string[];
740
+ listShared(options?: ListPagesOptions): Promise<{
741
+ pages: Page[];
742
+ total: number;
462
743
  }>;
463
744
  /**
464
- * Create multiple datasets in a single request (max 50 datasets)
745
+ * Update a page
465
746
  */
466
- batchCreate(datasets: Array<{
467
- name: string;
468
- schema?: any;
469
- data?: any;
470
- is_public?: boolean;
471
- }>): Promise<{
472
- created: Dataset[];
473
- failed: Array<{
474
- index: number;
475
- error: string;
476
- }>;
477
- }>;
747
+ update(pageId: string, request: UpdatePageRequest): Promise<Page>;
478
748
  /**
479
- * Update multiple datasets in a single request (max 50 datasets)
749
+ * Delete a page
480
750
  */
481
- batchUpdate(updates: Array<{
482
- id: string;
483
- name?: string;
484
- schema?: any;
485
- data?: any;
486
- is_public?: boolean;
487
- }>): Promise<{
488
- updated: string[];
489
- failed: Array<{
490
- id: string;
491
- error: string;
492
- }>;
493
- }>;
751
+ delete(pageId: string): Promise<void>;
494
752
  /**
495
- * Delete multiple datasets in a single request (max 50 datasets)
753
+ * Add a pin to a page
496
754
  */
497
- batchDelete(datasetIds: string[]): Promise<{
498
- deleted: string[];
499
- failed: Array<{
500
- id: string;
501
- error: string;
502
- }>;
503
- }>;
504
- }
505
-
506
- /**
507
- * Blocks API Methods
508
- */
509
-
510
- declare class BlocksMethods {
511
- private client;
512
- constructor(client: PindownClient);
513
- /**
514
- * Create a new block for a pin
515
- */
516
- create(pinId: string, request: CreateBlockRequest): Promise<Block>;
517
- /**
518
- * Get a block by ID
519
- */
520
- get(pinId: string, blockId: string): Promise<Block>;
521
- /**
522
- * List all blocks in a pin
523
- */
524
- list(pinId: string): Promise<Block[]>;
755
+ addPin(pageId: string, request: AddPinToPageRequest): Promise<void>;
525
756
  /**
526
- * Update a block
757
+ * Remove a pin from a page
527
758
  */
528
- update(pinId: string, blockId: string, request: UpdateBlockRequest): Promise<Block>;
759
+ removePin(pageId: string, pinId: string): Promise<void>;
529
760
  /**
530
- * Delete a block
761
+ * List pins in a page
531
762
  */
532
- delete(pinId: string, blockId: string): Promise<void>;
763
+ listPins(pageId: string): Promise<{
764
+ pins: string[];
765
+ total: number;
766
+ }>;
533
767
  /**
534
- * Get multiple blocks by IDs in a single request (max 100 blocks)
768
+ * Get multiple pages by IDs in a single request (max 100 pages)
535
769
  */
536
- batchGet(blockIds: Array<{
537
- pin_id: string;
538
- block_id: string;
539
- }>): Promise<{
540
- found: Block[];
541
- not_found: Array<{
542
- pin_id: string;
543
- block_id: string;
544
- }>;
545
- permission_denied: Array<{
546
- pin_id: string;
547
- block_id: string;
548
- }>;
770
+ batchGet(pageIds: string[]): Promise<{
771
+ found: Page[];
772
+ not_found: string[];
773
+ permission_denied: string[];
549
774
  }>;
550
775
  /**
551
- * Create multiple blocks for a pin in a single request (max 50 blocks)
776
+ * Create multiple pages in a single request (max 50 pages)
552
777
  */
553
- batchCreate(pinId: string, blocks: Array<{
554
- title: string;
555
- type?: 'markdown' | 'code' | 'text' | 'image';
556
- template?: string;
557
- order?: number;
558
- }>): Promise<{
559
- created: Block[];
778
+ batchCreate(pages: CreatePageRequest[]): Promise<{
779
+ created: Array<{
780
+ id: string;
781
+ index: number;
782
+ created_at: number;
783
+ }>;
560
784
  failed: Array<{
561
785
  index: number;
562
786
  error: string;
563
787
  }>;
564
788
  }>;
565
789
  /**
566
- * Update multiple blocks in a single request (max 50 blocks)
790
+ * Update multiple pages in a single request (max 50 pages)
567
791
  */
568
792
  batchUpdate(updates: Array<{
569
- pin_id: string;
570
- block_id: string;
571
- title?: string;
572
- type?: 'markdown' | 'code' | 'text' | 'image';
573
- template?: string;
574
- order?: number;
575
- }>): Promise<{
576
- updated: Array<{
577
- pin_id: string;
578
- block_id: string;
579
- }>;
793
+ id: string;
794
+ } & UpdatePageRequest>): Promise<{
795
+ updated: string[];
580
796
  failed: Array<{
581
- pin_id: string;
582
- block_id: string;
797
+ id: string;
583
798
  error: string;
584
799
  }>;
800
+ updated_at: number;
585
801
  }>;
586
802
  /**
587
- * Delete multiple blocks in a single request (max 50 blocks)
803
+ * Delete multiple pages in a single request (max 50 pages)
588
804
  */
589
- batchDelete(blockIds: Array<{
590
- pin_id: string;
591
- block_id: string;
592
- }>): Promise<{
593
- deleted: Array<{
594
- pin_id: string;
595
- block_id: string;
596
- }>;
805
+ batchDelete(pageIds: string[]): Promise<{
806
+ deleted: string[];
597
807
  failed: Array<{
598
- pin_id: string;
599
- block_id: string;
808
+ id: string;
600
809
  error: string;
601
810
  }>;
602
811
  }>;
@@ -713,8 +922,7 @@ declare class PindownClient {
713
922
  private tierDetected;
714
923
  readonly pins: PinsMethods;
715
924
  readonly pinboards: PinboardsMethods;
716
- readonly datasets: DatasetsMethods;
717
- readonly blocks: BlocksMethods;
925
+ readonly pages: PagesMethods;
718
926
  readonly collaborators: CollaboratorsMethods;
719
927
  constructor(config: PindownConfig);
720
928
  /**
@@ -787,4 +995,4 @@ declare class NetworkError extends PindownError {
787
995
  constructor(message?: string);
788
996
  }
789
997
 
790
- export { type AddPinToPinboardRequest, type ApiResponse, AuthenticationError, type Block, type BlockType, type Collaborator, type CollaboratorRole, type CreateBlockRequest, type CreateDatasetRequest, type CreatePinRequest, type CreatePinboardRequest, type Dataset, type DatasetType, ForbiddenError, type InviteCollaboratorRequest, type ListPinsOptions, NetworkError, NotFoundError, type PaginatedResponse, type Permissions, type Pin, type PinCardType, type PinDataType, type Pinboard, PindownClient, type PindownConfig, PindownError, RateLimitError, type RateLimitInfo, ServerError, type SharePinRequest, type Tier, type UpdateBlockRequest, type UpdateCollaboratorRoleRequest, type UpdateDatasetRequest, type UpdatePinRequest, type UpdatePinboardLayoutRequest, type UpdatePinboardRequest, ValidationError };
998
+ export { ALL_PIN_TYPES, type AddPinToPageRequest, type AddPinToPinboardRequest, type ApiResponse, AuthenticationError, type Block, type BlockType, type CalendarPinConfig, type ChartsPinConfig, type ChatPinConfig, type ChecklistItem, type ChecklistPinConfig, type Collaborator, type CollaboratorRole, type CreateBlockRequest, type CreateDatasetRequest, type CreateEmbedPinInput, type CreateMarkdownPinInput, type CreateNestedPinRequest, type CreatePageRequest, type CreatePinRequest, type CreatePinboardRequest, type CreateStatCardsPinInput, type CreateTablePinInput, type CreateTypedPinRequest, type CsvViewerPinConfig, type Dataset, type DatasetType, type EmbedPinConfig, type ExcelViewerPinConfig, type FileUploadPinConfig, ForbiddenError, type GalleryImage, type GalleryPinConfig, type ImagePinConfig, type IntroPinConfig, type InviteCollaboratorRequest, type JsonListPinConfig, type JsonViewerPinConfig, type KanbanBoardPinConfig, type KanbanColumn, LEGACY_PIN_TYPES, type LegacyPinTypeId, type LineChartPinConfig, type LinkItem, type LinksPinConfig, type ListPagesOptions, type ListPinsOptions, type MarkdownPinConfig, type MastraPinConfig, type MermaidPinConfig, NetworkError, NotFoundError, PRODUCT_PIN_TYPES, type Page, type PaginatedResponse, type PdfViewerPinConfig, type Permissions, type Pin, type PinCardType, type PinConfigByType, type PinDataType, type PinLayout, type PinMetadata, type PinMetadataBase, type PinTypeId, type Pinboard, PindownClient, type PindownConfig, PindownError, type ProductPinTypeId, RateLimitError, type RateLimitInfo, type RealtimeCanvasPinConfig, type RoadmapPinConfig, ServerError, type SharePinRequest, type StatCardItem, type StatCardsPinConfig, type StepItem, type StepsPinConfig, type TableColumn, type TablePinConfig, type TableRow, type TextMediaPinConfig, type Tier, type TimelinePinConfig, type TreeNode, type TreePinConfig, type UpdateBlockRequest, type UpdateCollaboratorRoleRequest, type UpdateDatasetRequest, type UpdatePageRequest, type UpdatePinRequest, type UpdatePinboardLayoutRequest, type UpdatePinboardRequest, type UserStoryPinConfig, ValidationError };