@neopress/mcp 1.1.3 → 1.3.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,77 +1,912 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { ServerRequest, ServerNotification } from '@modelcontextprotocol/sdk/types.js';
3
- import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
4
- import { NeopressClient } from './client.js';
5
- import { z } from 'zod';
6
- import { Server } from 'node:http';
7
- import { AddressInfo } from 'node:net';
8
-
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { Server } from "node:http";
4
+ import { ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types.js";
5
+ import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
6
+ import { AddressInfo } from "node:net";
7
+ //#region ../sdk/dist/types.d.ts
8
+ /**
9
+ * @neopress/sdk — First-party API types
10
+ *
11
+ * These types mirror the API response format (camelCase).
12
+ * They are separate from the DB types used internally.
13
+ */
14
+ interface PaginationMeta {
15
+ page: number;
16
+ limit: number;
17
+ totalCount: number;
18
+ hasMore: boolean;
19
+ }
20
+ interface ApiResponse<T> {
21
+ data: T;
22
+ }
23
+ interface PaginatedResponse<T> {
24
+ data: T[];
25
+ pagination: PaginationMeta;
26
+ }
27
+ /** Sort direction for list endpoints that support opt-in created_at ordering. */
28
+ type SortOrder = 'asc' | 'desc';
29
+ interface Site {
30
+ id: number;
31
+ name: string | null;
32
+ handle: string;
33
+ status: string | null;
34
+ customDomain: string | null;
35
+ customDomainVerified: boolean | null;
36
+ plan: string | null;
37
+ metadata: unknown;
38
+ localeConfig: {
39
+ defaultLocale: string;
40
+ locales: string[];
41
+ localePrefix?: 'as-needed';
42
+ } | null;
43
+ createdAt: string | null;
44
+ updatedAt: string | null;
45
+ }
46
+ interface Template {
47
+ id: number;
48
+ name: string;
49
+ description: string | null;
50
+ referenceUrl: string;
51
+ previewImgUrls: string[] | null;
52
+ previewVideoUrl: string | null;
53
+ createdAt: string | null;
54
+ }
55
+ interface TemplateListItem {
56
+ siteId: number;
57
+ handle: string | null;
58
+ siteName: string | null;
59
+ name: string;
60
+ referenceUrl: string;
61
+ previewImgUrls: string[] | null;
62
+ description: string | null;
63
+ createdAt: string;
64
+ }
65
+ interface Page {
66
+ id: number;
67
+ siteId: number;
68
+ path: string;
69
+ title: string | null;
70
+ type: string | null;
71
+ status: string;
72
+ visibility: string;
73
+ collectionId: number | null;
74
+ metadata: unknown;
75
+ draftTsx: string | null;
76
+ draftJs: string | null;
77
+ draftI18n: unknown;
78
+ draftPublicLocales: string[] | null;
79
+ draftMeta: unknown;
80
+ prodPath: string | null;
81
+ prodTsx: string | null;
82
+ prodJs: string | null;
83
+ prodI18n: unknown;
84
+ prodPublicLocales: string[] | null;
85
+ prodMeta: unknown;
86
+ publishedAt: string | null;
87
+ createdAt: string | null;
88
+ updatedAt: string | null;
89
+ }
90
+ interface Collection {
91
+ id: number;
92
+ siteId: number;
93
+ name: string;
94
+ presetType: string | null;
95
+ draftSchema: unknown;
96
+ prodSchema: unknown;
97
+ createdAt: string | null;
98
+ updatedAt: string | null;
99
+ }
100
+ interface Entry {
101
+ id: number;
102
+ siteId: number;
103
+ collectionId: number;
104
+ locale: string | null;
105
+ translationGroupId: string | null;
106
+ slug: string;
107
+ title: string | null;
108
+ data: unknown;
109
+ metadata: unknown;
110
+ status: string;
111
+ publishedAt: string | null;
112
+ publishedVersionId: number | null;
113
+ createdAt: string | null;
114
+ updatedAt: string | null;
115
+ }
116
+ interface EntryVersion {
117
+ id: number;
118
+ entryId: number | null;
119
+ locale: string | null;
120
+ translationGroupId: string | null;
121
+ slug: string | null;
122
+ title: string | null;
123
+ data: unknown;
124
+ status: string | null;
125
+ pinned: boolean;
126
+ source: string;
127
+ comment: string | null;
128
+ createdAt: string;
129
+ updatedAt: string | null;
130
+ }
131
+ interface Form {
132
+ id: number;
133
+ siteId: number;
134
+ name: string;
135
+ draftSchema: unknown;
136
+ draftLayout?: unknown;
137
+ draftStyle?: unknown;
138
+ draftI18n?: unknown;
139
+ prodSchema: unknown;
140
+ prodLayout?: unknown;
141
+ prodStyle?: unknown;
142
+ prodI18n?: unknown;
143
+ settings: unknown;
144
+ createdAt: string | null;
145
+ updatedAt: string | null;
146
+ }
147
+ interface FormResponse {
148
+ id: number;
149
+ formId: number;
150
+ data: unknown;
151
+ metadata: unknown;
152
+ readAt: string | null;
153
+ deletedAt: string | null;
154
+ createdAt: string | null;
155
+ }
156
+ interface Asset {
157
+ id: number;
158
+ siteId: number | null;
159
+ displayName: string | null;
160
+ assetUrl: string | null;
161
+ mimeType: string | null;
162
+ size: number | null;
163
+ altText: string | null;
164
+ description: string | null;
165
+ tags: string[] | null;
166
+ folderPath: string | null;
167
+ metadata: unknown;
168
+ createdAt: string;
169
+ }
170
+ interface RedirectRule {
171
+ id: number;
172
+ siteId: number;
173
+ source: string;
174
+ destination: string;
175
+ mode: 'redirect' | 'proxy';
176
+ redirectType: number;
177
+ includeChildren: boolean;
178
+ preservePath: boolean;
179
+ enabled: boolean;
180
+ priority: number;
181
+ createdAt: string;
182
+ updatedAt: string;
183
+ }
184
+ interface EntryReference {
185
+ id: number;
186
+ siteId: number;
187
+ fromEntryId: number;
188
+ toEntryId: number;
189
+ fieldKey: string;
190
+ createdAt: string;
191
+ }
192
+ interface SiteLayout {
193
+ siteId: number;
194
+ draftTsx: string | null;
195
+ draftGlobalCss: string | null;
196
+ draftNotFoundTsx: string | null;
197
+ prodTsx: string | null;
198
+ prodJs: string | null;
199
+ prodGlobalCss: string | null;
200
+ prodNotFoundTsx: string | null;
201
+ prodNotFoundJs: string | null;
202
+ }
203
+ interface Headshot {
204
+ id: number;
205
+ imageUrl: string;
206
+ width: number;
207
+ height: number;
208
+ aspectRatio: string;
209
+ mimeType: string;
210
+ byteSize: number | null;
211
+ ageBand: string;
212
+ gender: string;
213
+ ethnicity: string;
214
+ attire: string;
215
+ variationIndex: number;
216
+ gptPrompt: string | null;
217
+ tags: string[];
218
+ isActive: boolean;
219
+ createdAt: string | null;
220
+ updatedAt: string | null;
221
+ }
222
+ interface Logo {
223
+ id: number;
224
+ imageUrl: string;
225
+ width: number;
226
+ height: number;
227
+ aspectRatio: string;
228
+ mimeType: string;
229
+ byteSize: number | null;
230
+ type: string;
231
+ font: string;
232
+ color: string;
233
+ hue: number;
234
+ tone: string;
235
+ toneScore: number | null;
236
+ name: string;
237
+ variant: string | null;
238
+ sha256: string | null;
239
+ tags: string[];
240
+ isActive: boolean;
241
+ createdAt: string | null;
242
+ updatedAt: string | null;
243
+ }
244
+ type AnalyticsQueryValue = string | number | boolean;
245
+ interface AnalyticsQueryParams {
246
+ pipe: string;
247
+ dateFrom?: string;
248
+ dateTo?: string;
249
+ timezone?: string;
250
+ limit?: number;
251
+ params?: Record<string, AnalyticsQueryValue>;
252
+ }
253
+ type AnalyticsQueryResult = Record<string, unknown>;
254
+ interface AnalyticsDateRangeParams {
255
+ dateFrom?: string;
256
+ dateTo?: string;
257
+ timezone?: string;
258
+ limit?: number;
259
+ params?: Record<string, AnalyticsQueryValue>;
260
+ }
261
+ type SearchConsoleDimension = 'query' | 'page' | 'country' | 'device';
262
+ interface SearchConsoleQueryParams {
263
+ dateFrom: string;
264
+ dateTo: string;
265
+ dimensions?: SearchConsoleDimension[];
266
+ queryFilter?: string;
267
+ pageFilter?: string;
268
+ rowLimit?: number;
269
+ }
270
+ interface SearchConsoleRow {
271
+ keys: string[];
272
+ clicks: number;
273
+ impressions: number;
274
+ ctr: number;
275
+ position: number;
276
+ }
277
+ interface SearchConsoleQueryResult {
278
+ connected: boolean;
279
+ rows: SearchConsoleRow[];
280
+ totals: {
281
+ clicks: number;
282
+ impressions: number;
283
+ ctr: number;
284
+ position: number;
285
+ };
286
+ error?: string;
287
+ }
288
+ //#endregion
289
+ //#region ../sdk/dist/endpoints/pages.d.ts
290
+ interface PageListParams {
291
+ page?: number;
292
+ limit?: number;
293
+ status?: 'draft' | 'published';
294
+ fields?: string[];
295
+ /** When set, sort by created_at instead of path. */
296
+ order?: SortOrder;
297
+ }
298
+ interface PageCreateParams {
299
+ path: string;
300
+ title?: string;
301
+ type?: 'static' | 'dynamic';
302
+ status?: 'draft' | 'published';
303
+ visibility?: 'public' | 'hidden';
304
+ draftTsx?: string;
305
+ draftI18n?: unknown;
306
+ draftPublicLocales?: string[] | null;
307
+ draftMeta?: unknown;
308
+ collectionId?: number;
309
+ metadata?: unknown;
310
+ }
311
+ interface PageUpdateParams {
312
+ path?: string;
313
+ title?: string;
314
+ type?: string;
315
+ status?: string;
316
+ visibility?: 'public' | 'hidden';
317
+ draftTsx?: string;
318
+ draftI18n?: unknown;
319
+ draftPublicLocales?: string[] | null;
320
+ draftMeta?: unknown;
321
+ metadata?: unknown;
322
+ collectionId?: number;
323
+ }
324
+ declare class PagesEndpoint {
325
+ private readonly client;
326
+ constructor(client: NeopressClient);
327
+ private get basePath();
328
+ list(params?: PageListParams): Promise<PaginatedResponse<Page>>;
329
+ get(pageId: number): Promise<Page>;
330
+ create(data: PageCreateParams): Promise<Page>;
331
+ update(pageId: number, data: PageUpdateParams): Promise<Page>;
332
+ delete(pageId: number): Promise<void>;
333
+ compile(pageId: number): Promise<{
334
+ compiled: boolean;
335
+ jsLength: number;
336
+ }>;
337
+ }
338
+ //#endregion
339
+ //#region ../sdk/dist/endpoints/collections.d.ts
340
+ interface CollectionCreateParams {
341
+ name: string;
342
+ presetType?: string;
343
+ draftSchema?: unknown;
344
+ }
345
+ declare class CollectionsEndpoint {
346
+ private readonly client;
347
+ constructor(client: NeopressClient);
348
+ private get basePath();
349
+ list(params?: {
350
+ order?: SortOrder;
351
+ }): Promise<Collection[]>;
352
+ get(collectionId: number): Promise<Collection>;
353
+ create(data: CollectionCreateParams): Promise<Collection>;
354
+ update(collectionId: number, data: Partial<CollectionCreateParams>): Promise<Collection>;
355
+ delete(collectionId: number): Promise<void>;
356
+ getSchema(collectionId: number): Promise<{
357
+ collectionId: number;
358
+ draftSchema: unknown;
359
+ prodSchema: unknown;
360
+ }>;
361
+ /**
362
+ * Updates the collection's draft_schema directly in Supabase.
363
+ * validateApiCollectionSchema (app-local) is skipped — CLI/MCP callers are trusted.
364
+ */
365
+ updateSchema(collectionId: number, schema: unknown): Promise<{
366
+ collectionId: number;
367
+ draftSchema: unknown;
368
+ prodSchema: unknown;
369
+ }>;
370
+ }
371
+ //#endregion
372
+ //#region ../sdk/dist/endpoints/entries.d.ts
373
+ interface EntryListParams {
374
+ page?: number;
375
+ limit?: number;
376
+ status?: 'draft' | 'published' | 'archived';
377
+ locale?: string;
378
+ /** created_at sort direction. Defaults to 'desc' (newest first). */
379
+ order?: SortOrder;
380
+ }
381
+ interface EntryCreateParams {
382
+ slug?: string;
383
+ title?: string;
384
+ locale?: string;
385
+ data: unknown;
386
+ metadata?: unknown;
387
+ status?: string;
388
+ }
389
+ interface EntryUpdateParams {
390
+ slug?: string;
391
+ title?: string;
392
+ locale?: string;
393
+ data?: unknown;
394
+ metadata?: unknown;
395
+ status?: string;
396
+ }
397
+ declare class EntriesEndpoint {
398
+ private readonly client;
399
+ constructor(client: NeopressClient);
400
+ list(collectionId: number, params?: EntryListParams): Promise<PaginatedResponse<Entry>>;
401
+ get(entryId: number): Promise<Entry>;
402
+ create(collectionId: number, data: EntryCreateParams): Promise<Entry>;
403
+ update(entryId: number, data: EntryUpdateParams): Promise<Entry>;
404
+ delete(entryId: number): Promise<void>;
405
+ revalidateReaderCache(entryId: number): Promise<void>;
406
+ publish(entryId: number): Promise<{
407
+ id: number;
408
+ status: string;
409
+ publishedAt: string | null;
410
+ }>;
411
+ unpublish(entryId: number): Promise<{
412
+ id: number;
413
+ status: string;
414
+ }>;
415
+ listVersions(entryId: number): Promise<EntryVersion[]>;
416
+ pinVersion(entryId: number, versionId: number): Promise<{
417
+ id: number;
418
+ pinned: boolean;
419
+ }>;
420
+ }
421
+ //#endregion
422
+ //#region ../sdk/dist/endpoints/forms.d.ts
423
+ interface FormCreateParams {
424
+ name: string;
425
+ draftSchema?: unknown;
426
+ draftLayout?: unknown;
427
+ draftStyle?: unknown;
428
+ draftI18n?: unknown;
429
+ settings?: unknown;
430
+ }
431
+ interface FormUpdateParams {
432
+ name?: string;
433
+ draftSchema?: unknown;
434
+ draftLayout?: unknown;
435
+ draftStyle?: unknown;
436
+ draftI18n?: unknown;
437
+ settings?: unknown;
438
+ }
439
+ declare class FormsEndpoint {
440
+ private readonly client;
441
+ constructor(client: NeopressClient);
442
+ private get basePath();
443
+ list(params?: {
444
+ order?: SortOrder;
445
+ }): Promise<Form[]>;
446
+ get(formId: number): Promise<Form>;
447
+ create(data: FormCreateParams): Promise<Form>;
448
+ update(formId: number, data: FormUpdateParams): Promise<Form>;
449
+ delete(formId: number): Promise<void>;
450
+ publish(formId: number): Promise<{
451
+ id: number;
452
+ draftSchema: unknown;
453
+ prodSchema: unknown;
454
+ }>;
455
+ listResponses(formId: number, params?: {
456
+ page?: number;
457
+ limit?: number;
458
+ }): Promise<PaginatedResponse<FormResponse>>;
459
+ deleteResponse(formId: number, responseId: number): Promise<void>;
460
+ }
461
+ //#endregion
462
+ //#region ../sdk/dist/endpoints/assets.d.ts
463
+ interface AssetRegisterParams {
464
+ assetUrl: string;
465
+ displayName?: string;
466
+ mimeType?: string;
467
+ size?: number;
468
+ altText?: string;
469
+ description?: string;
470
+ tags?: string[];
471
+ folderPath?: string;
472
+ metadata?: unknown;
473
+ }
474
+ interface AssetPresignParams {
475
+ fileKey: string;
476
+ contentType: string;
477
+ contentLength: number;
478
+ }
479
+ declare class AssetsEndpoint {
480
+ private readonly client;
481
+ constructor(client: NeopressClient);
482
+ private get basePath();
483
+ list(params?: {
484
+ page?: number;
485
+ limit?: number;
486
+ order?: SortOrder;
487
+ }): Promise<PaginatedResponse<Asset>>;
488
+ get(assetId: number): Promise<Asset>;
489
+ register(data: AssetRegisterParams): Promise<Asset>;
490
+ update(assetId: number, data: Partial<Omit<AssetRegisterParams, 'assetUrl'>>): Promise<Asset>;
491
+ delete(assetId: number): Promise<void>;
492
+ presign(data: AssetPresignParams): Promise<{
493
+ presignedUrl: string;
494
+ publicUrl: string;
495
+ fileKey: string;
496
+ }>;
497
+ }
498
+ //#endregion
499
+ //#region ../sdk/dist/endpoints/site.d.ts
500
+ interface SiteWithRole extends Site {
501
+ role: string;
502
+ }
503
+ interface SiteCreateParams {
504
+ siteName?: string;
505
+ siteHandle?: string;
506
+ prompt?: string;
507
+ language?: string;
508
+ placeholder?: boolean;
509
+ }
510
+ declare class SiteEndpoint {
511
+ private readonly client;
512
+ constructor(client: NeopressClient);
513
+ list(params?: {
514
+ order?: SortOrder;
515
+ }): Promise<SiteWithRole[]>;
516
+ get(): Promise<Site>;
517
+ create(data: SiteCreateParams): Promise<Site>;
518
+ update(data: Partial<Pick<Site, 'name' | 'metadata' | 'localeConfig'>> & {
519
+ globalCss?: string;
520
+ instructions?: unknown;
521
+ }): Promise<Site>;
522
+ getLayout(): Promise<SiteLayout>;
523
+ updateLayout(data: {
524
+ draftTsx?: string;
525
+ draftNotFoundTsx?: string;
526
+ draftGlobalCss?: string;
527
+ }): Promise<SiteLayout>;
528
+ delete(): Promise<{
529
+ siteId: number;
530
+ deleted: true;
531
+ }>;
532
+ }
533
+ //#endregion
534
+ //#region ../sdk/dist/endpoints/redirects.d.ts
535
+ interface RedirectCreateParams {
536
+ source: string;
537
+ destination: string;
538
+ redirectType?: 307 | 308;
539
+ includeChildren?: boolean;
540
+ preservePath?: boolean;
541
+ enabled?: boolean;
542
+ priority?: number;
543
+ }
544
+ declare class RedirectsEndpoint {
545
+ private readonly client;
546
+ constructor(client: NeopressClient);
547
+ list(params?: {
548
+ order?: SortOrder;
549
+ }): Promise<RedirectRule[]>;
550
+ create(data: RedirectCreateParams): Promise<RedirectRule>;
551
+ private assertRedirectRuleWritable;
552
+ update(ruleId: number, data: Partial<RedirectCreateParams>): Promise<RedirectRule>;
553
+ delete(ruleId: number): Promise<void>;
554
+ }
555
+ //#endregion
556
+ //#region ../sdk/dist/endpoints/publish.d.ts
557
+ declare class PublishEndpoint {
558
+ private readonly client;
559
+ constructor(client: NeopressClient);
560
+ preview(): Promise<unknown>;
561
+ site(): Promise<unknown>;
562
+ }
563
+ //#endregion
564
+ //#region ../sdk/dist/endpoints/entry-references.d.ts
565
+ interface EntryReferenceListParams {
566
+ fromEntryId?: number;
567
+ toEntryId?: number;
568
+ /** created_at sort direction. Defaults to 'desc' (newest first). */
569
+ order?: SortOrder;
570
+ }
571
+ interface EntryReferenceCreateParams {
572
+ fromEntryId: number;
573
+ toEntryId: number;
574
+ fieldKey: string;
575
+ }
576
+ declare class EntryReferencesEndpoint {
577
+ private readonly client;
578
+ constructor(client: NeopressClient);
579
+ list(params?: EntryReferenceListParams): Promise<EntryReference[]>;
580
+ create(data: EntryReferenceCreateParams): Promise<EntryReference>;
581
+ delete(referenceId: number): Promise<void>;
582
+ }
583
+ //#endregion
584
+ //#region ../sdk/dist/endpoints/analytics.d.ts
585
+ declare class AnalyticsEndpoint {
586
+ private readonly client;
587
+ constructor(client: NeopressClient);
588
+ private get basePath();
589
+ query(params: AnalyticsQueryParams): Promise<AnalyticsQueryResult>;
590
+ pageviews(params?: AnalyticsDateRangeParams): Promise<AnalyticsQueryResult>;
591
+ summary(params?: AnalyticsDateRangeParams): Promise<AnalyticsQueryResult>;
592
+ topPages(params?: AnalyticsDateRangeParams): Promise<AnalyticsQueryResult>;
593
+ trafficSources(params?: AnalyticsDateRangeParams): Promise<AnalyticsQueryResult>;
594
+ formAnalytics(params?: AnalyticsDateRangeParams): Promise<AnalyticsQueryResult>;
595
+ crawlerSummary(params?: AnalyticsDateRangeParams): Promise<AnalyticsQueryResult>;
596
+ searchConsole(params: SearchConsoleQueryParams): Promise<SearchConsoleQueryResult>;
597
+ }
598
+ //#endregion
599
+ //#region ../sdk/dist/endpoints/templates.d.ts
600
+ interface TemplateMarkParams {
601
+ name: string;
602
+ description?: string | null;
603
+ referenceUrl: string;
604
+ previewImgUrls?: string[] | null;
605
+ /** Gallery hover video. Pair it with the poster in `previewImgUrls[0]` — the
606
+ * card cross-fades from poster to video, so the poster must be the video's
607
+ * first frame. Omit to leave an existing value untouched; `null` clears it. */
608
+ previewVideoUrl?: string | null;
609
+ }
610
+ interface TemplateDeleteResult {
611
+ siteId: number;
612
+ deleted: true;
613
+ }
614
+ declare class TemplatesEndpoint {
615
+ private readonly client;
616
+ constructor(client: NeopressClient);
617
+ private get basePath();
618
+ get(): Promise<Template>;
619
+ mark(data: TemplateMarkParams): Promise<Template>;
620
+ delete(): Promise<TemplateDeleteResult>;
621
+ /**
622
+ * List templates across the sites the caller can access.
623
+ *
624
+ * Direct-DB: `templates` is public-read and `sites` RLS scopes the visible set
625
+ * (own active memberships, or all sites for the super admin), so no server
626
+ * route is needed — the two RLS-scoped queries reproduce the old handler.
627
+ */
628
+ list(params?: {
629
+ namePrefix?: string;
630
+ limit?: number;
631
+ order?: SortOrder;
632
+ }): Promise<TemplateListItem[]>;
633
+ }
634
+ //#endregion
635
+ //#region ../sdk/dist/endpoints/headshots.d.ts
636
+ type HeadshotAgeBand = 'young' | 'middle';
637
+ type HeadshotGender = 'male' | 'female';
638
+ type HeadshotEthnicity = 'asian' | 'white' | 'black' | 'latino';
639
+ type HeadshotAttire = 'formal' | 'casual';
640
+ interface HeadshotListParams {
641
+ page?: number;
642
+ limit?: number;
643
+ ageBand?: HeadshotAgeBand;
644
+ gender?: HeadshotGender;
645
+ ethnicity?: HeadshotEthnicity;
646
+ attire?: HeadshotAttire;
647
+ isActive?: boolean;
648
+ /** When set, sort by created_at instead of the demographic key order. */
649
+ order?: SortOrder;
650
+ }
651
+ interface HeadshotCreateParams {
652
+ imageUrl: string;
653
+ ageBand: HeadshotAgeBand;
654
+ gender: HeadshotGender;
655
+ ethnicity: HeadshotEthnicity;
656
+ variationIndex: number;
657
+ attire?: HeadshotAttire;
658
+ width?: number;
659
+ height?: number;
660
+ aspectRatio?: string;
661
+ mimeType?: string;
662
+ byteSize?: number | null;
663
+ gptPrompt?: string | null;
664
+ tags?: string[];
665
+ isActive?: boolean;
666
+ }
667
+ interface HeadshotUpdateParams {
668
+ imageUrl?: string;
669
+ ageBand?: HeadshotAgeBand;
670
+ gender?: HeadshotGender;
671
+ ethnicity?: HeadshotEthnicity;
672
+ attire?: HeadshotAttire;
673
+ variationIndex?: number;
674
+ width?: number;
675
+ height?: number;
676
+ aspectRatio?: string;
677
+ mimeType?: string;
678
+ byteSize?: number | null;
679
+ gptPrompt?: string | null;
680
+ tags?: string[];
681
+ isActive?: boolean;
682
+ }
683
+ interface HeadshotDeleteResult {
684
+ id: number;
685
+ deleted: true;
686
+ }
687
+ /**
688
+ * headshot_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to
689
+ * the super-admin user, so these direct-DB calls return empty/forbidden for any
690
+ * other account. No site id is used.
691
+ */
692
+ declare class HeadshotsEndpoint {
693
+ private readonly client;
694
+ constructor(client: NeopressClient);
695
+ list(params?: HeadshotListParams): Promise<PaginatedResponse<Headshot>>;
696
+ get(id: number): Promise<Headshot>;
697
+ create(params: HeadshotCreateParams): Promise<Headshot>;
698
+ update(id: number, params: HeadshotUpdateParams): Promise<Headshot>;
699
+ delete(id: number): Promise<HeadshotDeleteResult>;
700
+ }
701
+ //#endregion
702
+ //#region ../sdk/dist/endpoints/logos.d.ts
703
+ type LogoType = 'wordmark' | 'lockup' | 'signature';
704
+ type LogoTone = 'playful' | 'neutral' | 'serious';
705
+ interface LogoListParams {
706
+ page?: number;
707
+ limit?: number;
708
+ type?: LogoType;
709
+ tone?: LogoTone;
710
+ font?: string;
711
+ hue?: number;
712
+ isActive?: boolean;
713
+ /** When set, sort by created_at instead of the diversity-axis key order. */
714
+ order?: SortOrder;
715
+ }
716
+ interface LogoCreateParams {
717
+ imageUrl: string;
718
+ type: LogoType;
719
+ font: string;
720
+ color: string;
721
+ hue: number;
722
+ tone: LogoTone;
723
+ name: string;
724
+ toneScore?: number | null;
725
+ variant?: string | null;
726
+ sha256?: string | null;
727
+ width?: number;
728
+ height?: number;
729
+ aspectRatio?: string;
730
+ mimeType?: string;
731
+ byteSize?: number | null;
732
+ tags?: string[];
733
+ isActive?: boolean;
734
+ }
735
+ interface LogoUpdateParams {
736
+ imageUrl?: string;
737
+ type?: LogoType;
738
+ font?: string;
739
+ color?: string;
740
+ hue?: number;
741
+ tone?: LogoTone;
742
+ name?: string;
743
+ toneScore?: number | null;
744
+ variant?: string | null;
745
+ sha256?: string | null;
746
+ width?: number;
747
+ height?: number;
748
+ aspectRatio?: string;
749
+ mimeType?: string;
750
+ byteSize?: number | null;
751
+ tags?: string[];
752
+ isActive?: boolean;
753
+ }
754
+ interface LogoDeleteResult {
755
+ id: number;
756
+ deleted: true;
757
+ }
758
+ /**
759
+ * logo_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to the
760
+ * super-admin user, so these direct-DB calls return empty/forbidden for any other
761
+ * account. No site id is used.
762
+ */
763
+ declare class LogosEndpoint {
764
+ private readonly client;
765
+ constructor(client: NeopressClient);
766
+ list(params?: LogoListParams): Promise<PaginatedResponse<Logo>>;
767
+ get(id: number): Promise<Logo>;
768
+ create(params: LogoCreateParams): Promise<Logo>;
769
+ update(id: number, params: LogoUpdateParams): Promise<Logo>;
770
+ delete(id: number): Promise<LogoDeleteResult>;
771
+ }
772
+ //#endregion
773
+ //#region ../sdk/dist/client.d.ts
774
+ interface NeopressClientOptions {
775
+ /** OAuth access token */
776
+ accessToken?: string;
777
+ /** Site ID to operate on */
778
+ siteId: number | string;
779
+ /** Base URL (default: https://app.neopress.ai) — used by orchestration/analytics (HTTP) routes */
780
+ baseUrl?: string;
781
+ /** Request timeout in ms (default: 30000) */
782
+ timeout?: number;
783
+ /** Supabase project URL — enables direct-DB reads/CRUD (transparent routing). */
784
+ supabaseUrl?: string;
785
+ /** Supabase anon key (paired with the user accessToken so RLS applies). */
786
+ supabaseAnonKey?: string;
787
+ }
788
+ declare class NeopressClient {
789
+ private readonly baseUrl;
790
+ private readonly accessToken;
791
+ private readonly siteId;
792
+ private readonly timeout;
793
+ private readonly supabaseUrl?;
794
+ private readonly supabaseAnonKey?;
795
+ private _db;
796
+ readonly pages: PagesEndpoint;
797
+ readonly collections: CollectionsEndpoint;
798
+ readonly entries: EntriesEndpoint;
799
+ readonly forms: FormsEndpoint;
800
+ readonly assets: AssetsEndpoint;
801
+ readonly site: SiteEndpoint;
802
+ readonly redirects: RedirectsEndpoint;
803
+ readonly publish: PublishEndpoint;
804
+ readonly entryReferences: EntryReferencesEndpoint;
805
+ readonly analytics: AnalyticsEndpoint;
806
+ readonly templates: TemplatesEndpoint;
807
+ readonly headshots: HeadshotsEndpoint;
808
+ readonly logos: LogosEndpoint;
809
+ constructor(options: NeopressClientOptions);
810
+ get siteBasePath(): string;
811
+ /** Numeric site id for direct DB queries. */
812
+ get siteIdNumber(): number;
813
+ /**
814
+ * Authenticated user's profile id, decoded locally from the access token's
815
+ * JWT `sub` claim (no network round-trip). Returns null if there is no token
816
+ * or it cannot be parsed. Subsequent DB queries are RLS-protected, so a local
817
+ * decode is sufficient — no server-side validation is required here.
818
+ */
819
+ get authUserId(): string | null;
820
+ /** Mirror of v1 parsePagination(defaultLimit=20, maxLimit=100). */
821
+ resolvePagination(params?: {
822
+ page?: number;
823
+ limit?: number;
824
+ }): {
825
+ page: number;
826
+ limit: number;
827
+ offset: number;
828
+ };
829
+ /** Build the paginated envelope matching the v1 API. */
830
+ paginationMeta(page: number, limit: number, offset: number, totalCount: number): PaginationMeta;
831
+ request<T>(method: string, path: string, body?: unknown): Promise<T>;
832
+ get<T>(path: string): Promise<ApiResponse<T>>;
833
+ getList<T>(path: string): Promise<PaginatedResponse<T>>;
834
+ post<T>(path: string, body?: unknown): Promise<ApiResponse<T>>;
835
+ patch<T>(path: string, body: unknown): Promise<ApiResponse<T>>;
836
+ delete<T>(path: string): Promise<ApiResponse<T>>;
837
+ }
838
+ //#endregion
839
+ //#region src/config.d.ts
9
840
  interface ClientOptions {
10
- siteId?: number;
11
- requireSite?: boolean;
841
+ siteId?: number;
842
+ requireSite?: boolean;
12
843
  }
13
-
844
+ //#endregion
845
+ //#region src/tools.d.ts
14
846
  interface ToolContext {
15
- createClient(options?: ClientOptions, extra?: ToolRequestExtra): Promise<NeopressClient>;
16
- readFile(filePath: string): Buffer;
17
- stat(filePath: string): {
18
- size: number;
19
- };
20
- fetch: typeof fetch;
21
- setActiveSiteId(siteId: number, extra?: ToolRequestExtra): void;
22
- getBaseUrl(): string;
847
+ createClient(options?: ClientOptions, extra?: ToolRequestExtra): Promise<NeopressClient>;
848
+ readFile(filePath: string): Buffer;
849
+ stat(filePath: string): {
850
+ size: number;
851
+ };
852
+ fetch: typeof fetch;
853
+ setActiveSiteId(siteId: number, extra?: ToolRequestExtra): void;
854
+ getBaseUrl(): string;
23
855
  }
24
856
  interface NeopressToolDefinition {
25
- name: string;
26
- title: string;
27
- description: string;
28
- inputSchema: Record<string, z.ZodTypeAny>;
29
- handler(input: Record<string, unknown>, context: ToolContext, extra?: ToolRequestExtra): Promise<unknown>;
857
+ name: string;
858
+ title: string;
859
+ description: string;
860
+ inputSchema: Record<string, z.ZodTypeAny>;
861
+ handler(input: Record<string, unknown>, context: ToolContext, extra?: ToolRequestExtra): Promise<unknown>;
30
862
  }
31
863
  type ToolRequestExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
32
864
  declare const toolDefinitions: NeopressToolDefinition[];
33
865
  declare function registerNeopressTools(server: McpServer, context?: ToolContext, options?: {
34
- disabledTools?: Iterable<string>;
866
+ disabledTools?: Iterable<string>;
35
867
  }): void;
36
-
868
+ //#endregion
869
+ //#region src/server.d.ts
37
870
  interface NeopressMcpServerOptions {
38
- toolContext?: ToolContext;
39
- disabledTools?: Iterable<string>;
871
+ toolContext?: ToolContext;
872
+ disabledTools?: Iterable<string>;
40
873
  }
41
874
  declare function createNeopressMcpServer(options?: NeopressMcpServerOptions): McpServer;
42
-
875
+ //#endregion
876
+ //#region src/remote/context.d.ts
43
877
  interface RemoteSiteSelectionStore {
44
- get(userKey: string): number | undefined;
45
- set(userKey: string, siteId: number): void;
878
+ get(userKey: string): number | undefined;
879
+ set(userKey: string, siteId: number): void;
46
880
  }
47
881
  interface RemoteToolContextOptions {
48
- baseUrl: string;
49
- siteSelectionStore?: RemoteSiteSelectionStore;
882
+ baseUrl: string;
883
+ siteSelectionStore?: RemoteSiteSelectionStore;
50
884
  }
51
885
  declare function createMemoryRemoteSiteSelectionStore(): RemoteSiteSelectionStore;
52
886
  declare function createRemoteToolContext(options: RemoteToolContextOptions): ToolContext;
53
-
887
+ //#endregion
888
+ //#region src/remote/http-server.d.ts
54
889
  type RemoteMcpAuthMode = 'oauth' | 'none';
55
890
  interface NeopressMcpHttpServerOptions {
56
- authMode?: RemoteMcpAuthMode;
57
- baseUrl?: string;
58
- corsOrigins?: string[] | '*';
59
- fetch?: typeof fetch;
60
- host?: string;
61
- oauthClientSecret?: string;
62
- oauthProvider?: string;
63
- port?: number;
64
- publicUrl?: string;
65
- siteSelectionStore?: RemoteSiteSelectionStore;
66
- supabaseAnonKey?: string;
67
- supabaseUrl?: string;
891
+ authMode?: RemoteMcpAuthMode;
892
+ baseUrl?: string;
893
+ corsOrigins?: string[] | '*';
894
+ fetch?: typeof fetch;
895
+ host?: string;
896
+ oauthClientSecret?: string;
897
+ oauthProvider?: string;
898
+ port?: number;
899
+ publicUrl?: string;
900
+ siteSelectionStore?: RemoteSiteSelectionStore;
901
+ supabaseAnonKey?: string;
902
+ supabaseUrl?: string;
68
903
  }
69
904
  interface NeopressMcpHttpServer {
70
- address(): AddressInfo | string | null;
71
- close(): Promise<void>;
72
- listen(port?: number, host?: string): Promise<AddressInfo | string | null>;
73
- server: Server;
905
+ address(): AddressInfo | string | null;
906
+ close(): Promise<void>;
907
+ listen(port?: number, host?: string): Promise<AddressInfo | string | null>;
908
+ server: Server;
74
909
  }
75
910
  declare function createNeopressMcpHttpServer(rawOptions?: NeopressMcpHttpServerOptions): NeopressMcpHttpServer;
76
-
77
- export { type NeopressMcpHttpServer, type NeopressMcpHttpServerOptions, type NeopressMcpServerOptions, type NeopressToolDefinition, type RemoteMcpAuthMode, type ToolContext, type ToolRequestExtra, createMemoryRemoteSiteSelectionStore, createNeopressMcpHttpServer, createNeopressMcpServer, createRemoteToolContext, registerNeopressTools, toolDefinitions };
911
+ //#endregion
912
+ export { type NeopressMcpHttpServer, type NeopressMcpHttpServerOptions, type NeopressMcpServerOptions, type NeopressToolDefinition, type RemoteMcpAuthMode, type ToolContext, type ToolRequestExtra, createMemoryRemoteSiteSelectionStore, createNeopressMcpHttpServer, createNeopressMcpServer, createRemoteToolContext, registerNeopressTools, toolDefinitions };