@pindownai/client-js 1.1.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;
187
+ }
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;
38
262
  }
39
- interface CreatePinRequest {
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,26 +407,6 @@ interface UpdatePinboardLayoutRequest {
107
407
  layout?: Record<string, any>;
108
408
  mobile_layout?: Record<string, any>;
109
409
  }
110
- type DatasetType = 'json' | 'markdown';
111
- interface Dataset {
112
- id: string;
113
- user_id: string;
114
- name: string;
115
- type: DatasetType;
116
- data: any;
117
- created_at: string;
118
- updated_at: string;
119
- }
120
- interface CreateDatasetRequest {
121
- name: string;
122
- type: DatasetType;
123
- data: any;
124
- }
125
- interface UpdateDatasetRequest {
126
- name?: string;
127
- type?: DatasetType;
128
- data?: any;
129
- }
130
410
  interface Page {
131
411
  id: string;
132
412
  owner_id: string;
@@ -174,6 +454,26 @@ interface ListPagesOptions {
174
454
  limit?: number;
175
455
  offset?: number;
176
456
  }
457
+ type DatasetType = 'json' | 'markdown';
458
+ interface Dataset {
459
+ id: string;
460
+ user_id: string;
461
+ name: string;
462
+ type: DatasetType;
463
+ data: any;
464
+ created_at: string;
465
+ updated_at: string;
466
+ }
467
+ interface CreateDatasetRequest {
468
+ name: string;
469
+ type: DatasetType;
470
+ data: any;
471
+ }
472
+ interface UpdateDatasetRequest {
473
+ name?: string;
474
+ type?: DatasetType;
475
+ data?: any;
476
+ }
177
477
  type BlockType = 'markdown' | 'mermaid' | 'conditional' | 'image' | 'stat-cards' | 'line-chart' | 'flexible-table' | 'embed';
178
478
  interface Block {
179
479
  id: string;
@@ -242,41 +542,18 @@ interface RateLimitInfo {
242
542
  declare class PinsMethods {
243
543
  private client;
244
544
  constructor(client: PindownClient);
245
- /**
246
- * Create a new pin
247
- */
248
- create(request: CreatePinRequest): Promise<Pin>;
249
- /**
250
- * Get a pin by ID
251
- */
252
- get(pinId: string): Promise<Pin>;
253
- /**
254
- * List all pins
255
- */
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>>;
256
548
  list(options?: ListPinsOptions): Promise<PaginatedResponse<Pin>>;
257
- /**
258
- * Update a pin
259
- */
260
- update(pinId: string, request: UpdatePinRequest): Promise<Pin>;
261
- /**
262
- * Delete a pin
263
- */
549
+ update<T extends PinTypeId = PinTypeId>(pinId: string, request: UpdatePinRequest<T>): Promise<Pin<T>>;
264
550
  delete(pinId: string): Promise<void>;
265
- /**
266
- * Update pin sharing settings
267
- */
268
551
  share(pinId: string, request: SharePinRequest): Promise<Pin>;
269
- /**
270
- * Get multiple pins by IDs in a single request (max 100 pins)
271
- */
272
552
  batchGet(pinIds: string[]): Promise<{
273
553
  found: Pin[];
274
554
  not_found: string[];
275
555
  permission_denied: string[];
276
556
  }>;
277
- /**
278
- * Create multiple pins in a single request (max 50 pins)
279
- */
280
557
  batchCreate(pins: CreatePinRequest[]): Promise<{
281
558
  created: Array<{
282
559
  id: string;
@@ -288,9 +565,6 @@ declare class PinsMethods {
288
565
  error: string;
289
566
  }>;
290
567
  }>;
291
- /**
292
- * Update multiple pins in a single request (max 50 pins)
293
- */
294
568
  batchUpdate(updates: Array<{
295
569
  id: string;
296
570
  } & UpdatePinRequest>): Promise<{
@@ -301,9 +575,6 @@ declare class PinsMethods {
301
575
  }>;
302
576
  updated_at: number;
303
577
  }>;
304
- /**
305
- * Delete multiple pins in a single request (max 50 pins)
306
- */
307
578
  batchDelete(pinIds: string[]): Promise<{
308
579
  deleted: string[];
309
580
  failed: Array<{
@@ -311,34 +582,15 @@ declare class PinsMethods {
311
582
  error: string;
312
583
  }>;
313
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'>>;
314
590
  /**
315
- * Create a markdown pin (content comes from blocks)
316
- */
317
- createMarkdown(title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
318
- /**
319
- * Create a stat card pin
320
- */
321
- createStatCard(data: {
322
- title: string;
323
- value: string | number;
324
- change?: string;
325
- icon?: string;
326
- }, title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
327
- /**
328
- * Create a flexible table pin
329
- */
330
- createTable(data: {
331
- columns: Array<{
332
- id: string;
333
- label: string;
334
- type?: string;
335
- }>;
336
- rows: Array<Record<string, any>>;
337
- }, title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
338
- /**
339
- * Create an embed pin (YouTube, Figma, etc.)
591
+ * @deprecated Use createMarkdown({ title, content, ... }) — old signature ignored content in title
340
592
  */
341
- createEmbed(url: string, title: string, additionalMetadata?: Partial<CreatePinRequest['metadata']>): Promise<Pin>;
593
+ createMarkdownLegacy(title: string, additionalMetadata?: Record<string, unknown>): Promise<Pin<'markdown'>>;
342
594
  }
343
595
 
344
596
  /**
@@ -559,195 +811,6 @@ declare class PagesMethods {
559
811
  }>;
560
812
  }
561
813
 
562
- /**
563
- * Datasets API Methods
564
- */
565
-
566
- declare class DatasetsMethods {
567
- private client;
568
- constructor(client: PindownClient);
569
- /**
570
- * Create a new dataset
571
- */
572
- create(request: CreateDatasetRequest): Promise<Dataset>;
573
- /**
574
- * Get a dataset by ID
575
- */
576
- get(datasetId: string): Promise<Dataset>;
577
- /**
578
- * List all datasets
579
- */
580
- list(): Promise<Dataset[]>;
581
- /**
582
- * Update a dataset
583
- */
584
- update(datasetId: string, request: UpdateDatasetRequest): Promise<Dataset>;
585
- /**
586
- * Delete a dataset
587
- */
588
- delete(datasetId: string): Promise<void>;
589
- /**
590
- * Invite a collaborator to a dataset
591
- */
592
- inviteCollaborator(datasetId: string, request: {
593
- email: string;
594
- role: 'editor' | 'viewer';
595
- }): Promise<{
596
- email: string;
597
- role: 'editor' | 'viewer';
598
- inviteToken: string;
599
- expiresAt: number;
600
- }>;
601
- /**
602
- * Get multiple datasets by IDs in a single request (max 100 datasets)
603
- */
604
- batchGet(datasetIds: string[]): Promise<{
605
- found: Dataset[];
606
- not_found: string[];
607
- permission_denied: string[];
608
- }>;
609
- /**
610
- * Create multiple datasets in a single request (max 50 datasets)
611
- */
612
- batchCreate(datasets: Array<{
613
- name: string;
614
- schema?: any;
615
- data?: any;
616
- is_public?: boolean;
617
- }>): Promise<{
618
- created: Dataset[];
619
- failed: Array<{
620
- index: number;
621
- error: string;
622
- }>;
623
- }>;
624
- /**
625
- * Update multiple datasets in a single request (max 50 datasets)
626
- */
627
- batchUpdate(updates: Array<{
628
- id: string;
629
- name?: string;
630
- schema?: any;
631
- data?: any;
632
- is_public?: boolean;
633
- }>): Promise<{
634
- updated: string[];
635
- failed: Array<{
636
- id: string;
637
- error: string;
638
- }>;
639
- }>;
640
- /**
641
- * Delete multiple datasets in a single request (max 50 datasets)
642
- */
643
- batchDelete(datasetIds: string[]): Promise<{
644
- deleted: string[];
645
- failed: Array<{
646
- id: string;
647
- error: string;
648
- }>;
649
- }>;
650
- }
651
-
652
- /**
653
- * Blocks API Methods
654
- */
655
-
656
- declare class BlocksMethods {
657
- private client;
658
- constructor(client: PindownClient);
659
- /**
660
- * Create a new block for a pin
661
- */
662
- create(pinId: string, request: CreateBlockRequest): Promise<Block>;
663
- /**
664
- * Get a block by ID
665
- */
666
- get(pinId: string, blockId: string): Promise<Block>;
667
- /**
668
- * List all blocks in a pin
669
- */
670
- list(pinId: string): Promise<Block[]>;
671
- /**
672
- * Update a block
673
- */
674
- update(pinId: string, blockId: string, request: UpdateBlockRequest): Promise<Block>;
675
- /**
676
- * Delete a block
677
- */
678
- delete(pinId: string, blockId: string): Promise<void>;
679
- /**
680
- * Get multiple blocks by IDs in a single request (max 100 blocks)
681
- */
682
- batchGet(blockIds: Array<{
683
- pin_id: string;
684
- block_id: string;
685
- }>): Promise<{
686
- found: Block[];
687
- not_found: Array<{
688
- pin_id: string;
689
- block_id: string;
690
- }>;
691
- permission_denied: Array<{
692
- pin_id: string;
693
- block_id: string;
694
- }>;
695
- }>;
696
- /**
697
- * Create multiple blocks for a pin in a single request (max 50 blocks)
698
- */
699
- batchCreate(pinId: string, blocks: Array<{
700
- title: string;
701
- type?: 'markdown' | 'code' | 'text' | 'image';
702
- template?: string;
703
- order?: number;
704
- }>): Promise<{
705
- created: Block[];
706
- failed: Array<{
707
- index: number;
708
- error: string;
709
- }>;
710
- }>;
711
- /**
712
- * Update multiple blocks in a single request (max 50 blocks)
713
- */
714
- batchUpdate(updates: Array<{
715
- pin_id: string;
716
- block_id: string;
717
- title?: string;
718
- type?: 'markdown' | 'code' | 'text' | 'image';
719
- template?: string;
720
- order?: number;
721
- }>): Promise<{
722
- updated: Array<{
723
- pin_id: string;
724
- block_id: string;
725
- }>;
726
- failed: Array<{
727
- pin_id: string;
728
- block_id: string;
729
- error: string;
730
- }>;
731
- }>;
732
- /**
733
- * Delete multiple blocks in a single request (max 50 blocks)
734
- */
735
- batchDelete(blockIds: Array<{
736
- pin_id: string;
737
- block_id: string;
738
- }>): Promise<{
739
- deleted: Array<{
740
- pin_id: string;
741
- block_id: string;
742
- }>;
743
- failed: Array<{
744
- pin_id: string;
745
- block_id: string;
746
- error: string;
747
- }>;
748
- }>;
749
- }
750
-
751
814
  /**
752
815
  * Collaborators API Methods
753
816
  */
@@ -860,8 +923,6 @@ declare class PindownClient {
860
923
  readonly pins: PinsMethods;
861
924
  readonly pinboards: PinboardsMethods;
862
925
  readonly pages: PagesMethods;
863
- readonly datasets: DatasetsMethods;
864
- readonly blocks: BlocksMethods;
865
926
  readonly collaborators: CollaboratorsMethods;
866
927
  constructor(config: PindownConfig);
867
928
  /**
@@ -934,4 +995,4 @@ declare class NetworkError extends PindownError {
934
995
  constructor(message?: string);
935
996
  }
936
997
 
937
- export { type AddPinToPageRequest, type AddPinToPinboardRequest, type ApiResponse, AuthenticationError, type Block, type BlockType, type Collaborator, type CollaboratorRole, type CreateBlockRequest, type CreateDatasetRequest, type CreatePageRequest, type CreatePinRequest, type CreatePinboardRequest, type Dataset, type DatasetType, ForbiddenError, type InviteCollaboratorRequest, type ListPagesOptions, type ListPinsOptions, NetworkError, NotFoundError, type Page, 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 UpdatePageRequest, 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 };