@neopress/mcp 1.1.3 → 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,77 +1,908 @@
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
+ }
606
+ interface TemplateDeleteResult {
607
+ siteId: number;
608
+ deleted: true;
609
+ }
610
+ declare class TemplatesEndpoint {
611
+ private readonly client;
612
+ constructor(client: NeopressClient);
613
+ private get basePath();
614
+ get(): Promise<Template>;
615
+ mark(data: TemplateMarkParams): Promise<Template>;
616
+ delete(): Promise<TemplateDeleteResult>;
617
+ /**
618
+ * List templates across the sites the caller can access.
619
+ *
620
+ * Direct-DB: `templates` is public-read and `sites` RLS scopes the visible set
621
+ * (own active memberships, or all sites for the super admin), so no server
622
+ * route is needed — the two RLS-scoped queries reproduce the old handler.
623
+ */
624
+ list(params?: {
625
+ namePrefix?: string;
626
+ limit?: number;
627
+ order?: SortOrder;
628
+ }): Promise<TemplateListItem[]>;
629
+ }
630
+ //#endregion
631
+ //#region ../sdk/dist/endpoints/headshots.d.ts
632
+ type HeadshotAgeBand = 'young' | 'middle';
633
+ type HeadshotGender = 'male' | 'female';
634
+ type HeadshotEthnicity = 'asian' | 'white' | 'black' | 'latino';
635
+ type HeadshotAttire = 'formal' | 'casual';
636
+ interface HeadshotListParams {
637
+ page?: number;
638
+ limit?: number;
639
+ ageBand?: HeadshotAgeBand;
640
+ gender?: HeadshotGender;
641
+ ethnicity?: HeadshotEthnicity;
642
+ attire?: HeadshotAttire;
643
+ isActive?: boolean;
644
+ /** When set, sort by created_at instead of the demographic key order. */
645
+ order?: SortOrder;
646
+ }
647
+ interface HeadshotCreateParams {
648
+ imageUrl: string;
649
+ ageBand: HeadshotAgeBand;
650
+ gender: HeadshotGender;
651
+ ethnicity: HeadshotEthnicity;
652
+ variationIndex: number;
653
+ attire?: HeadshotAttire;
654
+ width?: number;
655
+ height?: number;
656
+ aspectRatio?: string;
657
+ mimeType?: string;
658
+ byteSize?: number | null;
659
+ gptPrompt?: string | null;
660
+ tags?: string[];
661
+ isActive?: boolean;
662
+ }
663
+ interface HeadshotUpdateParams {
664
+ imageUrl?: string;
665
+ ageBand?: HeadshotAgeBand;
666
+ gender?: HeadshotGender;
667
+ ethnicity?: HeadshotEthnicity;
668
+ attire?: HeadshotAttire;
669
+ variationIndex?: number;
670
+ width?: number;
671
+ height?: number;
672
+ aspectRatio?: string;
673
+ mimeType?: string;
674
+ byteSize?: number | null;
675
+ gptPrompt?: string | null;
676
+ tags?: string[];
677
+ isActive?: boolean;
678
+ }
679
+ interface HeadshotDeleteResult {
680
+ id: number;
681
+ deleted: true;
682
+ }
683
+ /**
684
+ * headshot_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to
685
+ * the super-admin user, so these direct-DB calls return empty/forbidden for any
686
+ * other account. No site id is used.
687
+ */
688
+ declare class HeadshotsEndpoint {
689
+ private readonly client;
690
+ constructor(client: NeopressClient);
691
+ list(params?: HeadshotListParams): Promise<PaginatedResponse<Headshot>>;
692
+ get(id: number): Promise<Headshot>;
693
+ create(params: HeadshotCreateParams): Promise<Headshot>;
694
+ update(id: number, params: HeadshotUpdateParams): Promise<Headshot>;
695
+ delete(id: number): Promise<HeadshotDeleteResult>;
696
+ }
697
+ //#endregion
698
+ //#region ../sdk/dist/endpoints/logos.d.ts
699
+ type LogoType = 'wordmark' | 'lockup' | 'signature';
700
+ type LogoTone = 'playful' | 'neutral' | 'serious';
701
+ interface LogoListParams {
702
+ page?: number;
703
+ limit?: number;
704
+ type?: LogoType;
705
+ tone?: LogoTone;
706
+ font?: string;
707
+ hue?: number;
708
+ isActive?: boolean;
709
+ /** When set, sort by created_at instead of the diversity-axis key order. */
710
+ order?: SortOrder;
711
+ }
712
+ interface LogoCreateParams {
713
+ imageUrl: string;
714
+ type: LogoType;
715
+ font: string;
716
+ color: string;
717
+ hue: number;
718
+ tone: LogoTone;
719
+ name: string;
720
+ toneScore?: number | null;
721
+ variant?: string | null;
722
+ sha256?: string | null;
723
+ width?: number;
724
+ height?: number;
725
+ aspectRatio?: string;
726
+ mimeType?: string;
727
+ byteSize?: number | null;
728
+ tags?: string[];
729
+ isActive?: boolean;
730
+ }
731
+ interface LogoUpdateParams {
732
+ imageUrl?: string;
733
+ type?: LogoType;
734
+ font?: string;
735
+ color?: string;
736
+ hue?: number;
737
+ tone?: LogoTone;
738
+ name?: string;
739
+ toneScore?: number | null;
740
+ variant?: string | null;
741
+ sha256?: string | null;
742
+ width?: number;
743
+ height?: number;
744
+ aspectRatio?: string;
745
+ mimeType?: string;
746
+ byteSize?: number | null;
747
+ tags?: string[];
748
+ isActive?: boolean;
749
+ }
750
+ interface LogoDeleteResult {
751
+ id: number;
752
+ deleted: true;
753
+ }
754
+ /**
755
+ * logo_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to the
756
+ * super-admin user, so these direct-DB calls return empty/forbidden for any other
757
+ * account. No site id is used.
758
+ */
759
+ declare class LogosEndpoint {
760
+ private readonly client;
761
+ constructor(client: NeopressClient);
762
+ list(params?: LogoListParams): Promise<PaginatedResponse<Logo>>;
763
+ get(id: number): Promise<Logo>;
764
+ create(params: LogoCreateParams): Promise<Logo>;
765
+ update(id: number, params: LogoUpdateParams): Promise<Logo>;
766
+ delete(id: number): Promise<LogoDeleteResult>;
767
+ }
768
+ //#endregion
769
+ //#region ../sdk/dist/client.d.ts
770
+ interface NeopressClientOptions {
771
+ /** OAuth access token */
772
+ accessToken?: string;
773
+ /** Site ID to operate on */
774
+ siteId: number | string;
775
+ /** Base URL (default: https://app.neopress.ai) — used by orchestration/analytics (HTTP) routes */
776
+ baseUrl?: string;
777
+ /** Request timeout in ms (default: 30000) */
778
+ timeout?: number;
779
+ /** Supabase project URL — enables direct-DB reads/CRUD (transparent routing). */
780
+ supabaseUrl?: string;
781
+ /** Supabase anon key (paired with the user accessToken so RLS applies). */
782
+ supabaseAnonKey?: string;
783
+ }
784
+ declare class NeopressClient {
785
+ private readonly baseUrl;
786
+ private readonly accessToken;
787
+ private readonly siteId;
788
+ private readonly timeout;
789
+ private readonly supabaseUrl?;
790
+ private readonly supabaseAnonKey?;
791
+ private _db;
792
+ readonly pages: PagesEndpoint;
793
+ readonly collections: CollectionsEndpoint;
794
+ readonly entries: EntriesEndpoint;
795
+ readonly forms: FormsEndpoint;
796
+ readonly assets: AssetsEndpoint;
797
+ readonly site: SiteEndpoint;
798
+ readonly redirects: RedirectsEndpoint;
799
+ readonly publish: PublishEndpoint;
800
+ readonly entryReferences: EntryReferencesEndpoint;
801
+ readonly analytics: AnalyticsEndpoint;
802
+ readonly templates: TemplatesEndpoint;
803
+ readonly headshots: HeadshotsEndpoint;
804
+ readonly logos: LogosEndpoint;
805
+ constructor(options: NeopressClientOptions);
806
+ get siteBasePath(): string;
807
+ /** Numeric site id for direct DB queries. */
808
+ get siteIdNumber(): number;
809
+ /**
810
+ * Authenticated user's profile id, decoded locally from the access token's
811
+ * JWT `sub` claim (no network round-trip). Returns null if there is no token
812
+ * or it cannot be parsed. Subsequent DB queries are RLS-protected, so a local
813
+ * decode is sufficient — no server-side validation is required here.
814
+ */
815
+ get authUserId(): string | null;
816
+ /** Mirror of v1 parsePagination(defaultLimit=20, maxLimit=100). */
817
+ resolvePagination(params?: {
818
+ page?: number;
819
+ limit?: number;
820
+ }): {
821
+ page: number;
822
+ limit: number;
823
+ offset: number;
824
+ };
825
+ /** Build the paginated envelope matching the v1 API. */
826
+ paginationMeta(page: number, limit: number, offset: number, totalCount: number): PaginationMeta;
827
+ request<T>(method: string, path: string, body?: unknown): Promise<T>;
828
+ get<T>(path: string): Promise<ApiResponse<T>>;
829
+ getList<T>(path: string): Promise<PaginatedResponse<T>>;
830
+ post<T>(path: string, body?: unknown): Promise<ApiResponse<T>>;
831
+ patch<T>(path: string, body: unknown): Promise<ApiResponse<T>>;
832
+ delete<T>(path: string): Promise<ApiResponse<T>>;
833
+ }
834
+ //#endregion
835
+ //#region src/config.d.ts
9
836
  interface ClientOptions {
10
- siteId?: number;
11
- requireSite?: boolean;
837
+ siteId?: number;
838
+ requireSite?: boolean;
12
839
  }
13
-
840
+ //#endregion
841
+ //#region src/tools.d.ts
14
842
  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;
843
+ createClient(options?: ClientOptions, extra?: ToolRequestExtra): Promise<NeopressClient>;
844
+ readFile(filePath: string): Buffer;
845
+ stat(filePath: string): {
846
+ size: number;
847
+ };
848
+ fetch: typeof fetch;
849
+ setActiveSiteId(siteId: number, extra?: ToolRequestExtra): void;
850
+ getBaseUrl(): string;
23
851
  }
24
852
  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>;
853
+ name: string;
854
+ title: string;
855
+ description: string;
856
+ inputSchema: Record<string, z.ZodTypeAny>;
857
+ handler(input: Record<string, unknown>, context: ToolContext, extra?: ToolRequestExtra): Promise<unknown>;
30
858
  }
31
859
  type ToolRequestExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
32
860
  declare const toolDefinitions: NeopressToolDefinition[];
33
861
  declare function registerNeopressTools(server: McpServer, context?: ToolContext, options?: {
34
- disabledTools?: Iterable<string>;
862
+ disabledTools?: Iterable<string>;
35
863
  }): void;
36
-
864
+ //#endregion
865
+ //#region src/server.d.ts
37
866
  interface NeopressMcpServerOptions {
38
- toolContext?: ToolContext;
39
- disabledTools?: Iterable<string>;
867
+ toolContext?: ToolContext;
868
+ disabledTools?: Iterable<string>;
40
869
  }
41
870
  declare function createNeopressMcpServer(options?: NeopressMcpServerOptions): McpServer;
42
-
871
+ //#endregion
872
+ //#region src/remote/context.d.ts
43
873
  interface RemoteSiteSelectionStore {
44
- get(userKey: string): number | undefined;
45
- set(userKey: string, siteId: number): void;
874
+ get(userKey: string): number | undefined;
875
+ set(userKey: string, siteId: number): void;
46
876
  }
47
877
  interface RemoteToolContextOptions {
48
- baseUrl: string;
49
- siteSelectionStore?: RemoteSiteSelectionStore;
878
+ baseUrl: string;
879
+ siteSelectionStore?: RemoteSiteSelectionStore;
50
880
  }
51
881
  declare function createMemoryRemoteSiteSelectionStore(): RemoteSiteSelectionStore;
52
882
  declare function createRemoteToolContext(options: RemoteToolContextOptions): ToolContext;
53
-
883
+ //#endregion
884
+ //#region src/remote/http-server.d.ts
54
885
  type RemoteMcpAuthMode = 'oauth' | 'none';
55
886
  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;
887
+ authMode?: RemoteMcpAuthMode;
888
+ baseUrl?: string;
889
+ corsOrigins?: string[] | '*';
890
+ fetch?: typeof fetch;
891
+ host?: string;
892
+ oauthClientSecret?: string;
893
+ oauthProvider?: string;
894
+ port?: number;
895
+ publicUrl?: string;
896
+ siteSelectionStore?: RemoteSiteSelectionStore;
897
+ supabaseAnonKey?: string;
898
+ supabaseUrl?: string;
68
899
  }
69
900
  interface NeopressMcpHttpServer {
70
- address(): AddressInfo | string | null;
71
- close(): Promise<void>;
72
- listen(port?: number, host?: string): Promise<AddressInfo | string | null>;
73
- server: Server;
901
+ address(): AddressInfo | string | null;
902
+ close(): Promise<void>;
903
+ listen(port?: number, host?: string): Promise<AddressInfo | string | null>;
904
+ server: Server;
74
905
  }
75
906
  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 };
907
+ //#endregion
908
+ export { type NeopressMcpHttpServer, type NeopressMcpHttpServerOptions, type NeopressMcpServerOptions, type NeopressToolDefinition, type RemoteMcpAuthMode, type ToolContext, type ToolRequestExtra, createMemoryRemoteSiteSelectionStore, createNeopressMcpHttpServer, createNeopressMcpServer, createRemoteToolContext, registerNeopressTools, toolDefinitions };