@neopress/cli 4.8.0 → 4.9.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/bin.cjs CHANGED
@@ -26229,7 +26229,7 @@ function shouldShowDeprecationWarning() {
26229
26229
  }
26230
26230
  if (shouldShowDeprecationWarning()) console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");
26231
26231
  //#endregion
26232
- //#region ../sdk/dist/errors.js
26232
+ //#region ../sdk/src/errors.ts
26233
26233
  /**
26234
26234
  * SDK error classes
26235
26235
  */
@@ -26246,13 +26246,7 @@ var NeopressApiError = class extends Error {
26246
26246
  }
26247
26247
  };
26248
26248
  //#endregion
26249
- //#region ../sdk/dist/serializers.js
26250
- /**
26251
- * SDK serializers — convert DB snake_case rows to SDK camelCase shapes.
26252
- *
26253
- * Ported 1:1 from apps/neopress/src/lib/api/v1/serializers.ts.
26254
- * Do NOT change field mappings without updating both files.
26255
- */
26249
+ //#region ../sdk/src/serializers.ts
26256
26250
  function serializePageFull(page) {
26257
26251
  return {
26258
26252
  id: page.id,
@@ -26413,6 +26407,7 @@ function serializeTemplate(t) {
26413
26407
  referenceUrl: t.reference_url,
26414
26408
  previewImgUrls: t.preview_img_urls,
26415
26409
  previewVideoUrl: t.preview_video_url ?? null,
26410
+ language: t.language ?? null,
26416
26411
  createdAt: t.created_at
26417
26412
  };
26418
26413
  }
@@ -26501,7 +26496,7 @@ function serializeSiteLayout(siteId, layout) {
26501
26496
  };
26502
26497
  }
26503
26498
  //#endregion
26504
- //#region ../sdk/dist/endpoints/pages.js
26499
+ //#region ../sdk/src/endpoints/pages.ts
26505
26500
  var PagesEndpoint = class {
26506
26501
  client;
26507
26502
  constructor(client) {
@@ -29898,7 +29893,7 @@ function getDefaultLogLevel() {
29898
29893
  }
29899
29894
  getDefaultLogLevel();
29900
29895
  //#endregion
29901
- //#region ../sdk/dist/endpoints/collections.js
29896
+ //#region ../sdk/src/endpoints/collections.ts
29902
29897
  var CollectionsEndpoint = class {
29903
29898
  client;
29904
29899
  constructor(client) {
@@ -29964,7 +29959,7 @@ var CollectionsEndpoint = class {
29964
29959
  }
29965
29960
  };
29966
29961
  //#endregion
29967
- //#region ../sdk/dist/endpoints/entries.js
29962
+ //#region ../sdk/src/endpoints/entries.ts
29968
29963
  var EntriesEndpoint = class {
29969
29964
  client;
29970
29965
  constructor(client) {
@@ -30037,7 +30032,7 @@ var EntriesEndpoint = class {
30037
30032
  }
30038
30033
  };
30039
30034
  //#endregion
30040
- //#region ../sdk/dist/endpoints/forms.js
30035
+ //#region ../sdk/src/endpoints/forms.ts
30041
30036
  var FormsEndpoint = class {
30042
30037
  client;
30043
30038
  constructor(client) {
@@ -30105,7 +30100,7 @@ var FormsEndpoint = class {
30105
30100
  }
30106
30101
  };
30107
30102
  //#endregion
30108
- //#region ../sdk/dist/endpoints/assets.js
30103
+ //#region ../sdk/src/endpoints/assets.ts
30109
30104
  var AssetsEndpoint = class {
30110
30105
  client;
30111
30106
  constructor(client) {
@@ -30166,7 +30161,7 @@ var AssetsEndpoint = class {
30166
30161
  }
30167
30162
  };
30168
30163
  //#endregion
30169
- //#region ../sdk/dist/endpoints/site.js
30164
+ //#region ../sdk/src/endpoints/site.ts
30170
30165
  var SiteEndpoint = class {
30171
30166
  client;
30172
30167
  constructor(client) {
@@ -30211,7 +30206,7 @@ var SiteEndpoint = class {
30211
30206
  }
30212
30207
  };
30213
30208
  //#endregion
30214
- //#region ../sdk/dist/endpoints/redirects.js
30209
+ //#region ../sdk/src/endpoints/redirects.ts
30215
30210
  const DASHBOARD_ONLY_REWRITE_MESSAGE = "Rewrite proxy rules can only be managed in the dashboard.";
30216
30211
  function rejectModeParam(data) {
30217
30212
  if (data && typeof data === "object" && Object.prototype.hasOwnProperty.call(data, "mode")) throw new NeopressApiError("REDIRECT_RULE_DASHBOARD_ONLY", DASHBOARD_ONLY_REWRITE_MESSAGE, 400);
@@ -30272,7 +30267,7 @@ var RedirectsEndpoint = class {
30272
30267
  }
30273
30268
  };
30274
30269
  //#endregion
30275
- //#region ../sdk/dist/endpoints/publish.js
30270
+ //#region ../sdk/src/endpoints/publish.ts
30276
30271
  var PublishEndpoint = class {
30277
30272
  client;
30278
30273
  constructor(client) {
@@ -30286,7 +30281,7 @@ var PublishEndpoint = class {
30286
30281
  }
30287
30282
  };
30288
30283
  //#endregion
30289
- //#region ../sdk/dist/endpoints/entry-references.js
30284
+ //#region ../sdk/src/endpoints/entry-references.ts
30290
30285
  var EntryReferencesEndpoint = class {
30291
30286
  client;
30292
30287
  constructor(client) {
@@ -30317,7 +30312,7 @@ var EntryReferencesEndpoint = class {
30317
30312
  }
30318
30313
  };
30319
30314
  //#endregion
30320
- //#region ../sdk/dist/endpoints/analytics.js
30315
+ //#region ../sdk/src/endpoints/analytics.ts
30321
30316
  const RESERVED_ANALYTICS_PARAMS = /* @__PURE__ */ new Set([
30322
30317
  "pipe",
30323
30318
  "site",
@@ -30402,7 +30397,7 @@ var AnalyticsEndpoint = class {
30402
30397
  }
30403
30398
  };
30404
30399
  //#endregion
30405
- //#region ../sdk/dist/endpoints/templates.js
30400
+ //#region ../sdk/src/endpoints/templates.ts
30406
30401
  var TemplatesEndpoint = class {
30407
30402
  client;
30408
30403
  constructor(client) {
@@ -30444,7 +30439,7 @@ var TemplatesEndpoint = class {
30444
30439
  if (siteIds.length === 0) return [];
30445
30440
  const namePrefix = params?.namePrefix?.trim();
30446
30441
  const limit = Math.min(Math.max(params?.limit ?? 100, 1), 500);
30447
- let query = this.client.db.from("templates").select("id, name, reference_url, preview_img_urls, description, created_at").in("id", siteIds);
30442
+ let query = this.client.db.from("templates").select("id, name, reference_url, preview_img_urls, description, language, created_at").in("id", siteIds);
30448
30443
  if (namePrefix) query = query.ilike("name", `${namePrefix}%`);
30449
30444
  if (params?.order) query = query.order("created_at", { ascending: params.order === "asc" });
30450
30445
  query = query.limit(limit);
@@ -30460,13 +30455,14 @@ var TemplatesEndpoint = class {
30460
30455
  referenceUrl: t.reference_url,
30461
30456
  previewImgUrls: t.preview_img_urls ?? null,
30462
30457
  description: t.description ?? null,
30458
+ language: t.language ?? null,
30463
30459
  createdAt: t.created_at
30464
30460
  };
30465
30461
  });
30466
30462
  }
30467
30463
  };
30468
30464
  //#endregion
30469
- //#region ../sdk/dist/endpoints/headshots.js
30465
+ //#region ../sdk/src/endpoints/headshots.ts
30470
30466
  /**
30471
30467
  * headshot_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to
30472
30468
  * the super-admin user, so these direct-DB calls return empty/forbidden for any
@@ -30550,7 +30546,7 @@ var HeadshotsEndpoint = class {
30550
30546
  }
30551
30547
  };
30552
30548
  //#endregion
30553
- //#region ../sdk/dist/endpoints/logos.js
30549
+ //#region ../sdk/src/endpoints/logos.ts
30554
30550
  /**
30555
30551
  * logo_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to the
30556
30552
  * super-admin user, so these direct-DB calls return empty/forbidden for any other
@@ -30640,7 +30636,7 @@ var LogosEndpoint = class {
30640
30636
  }
30641
30637
  };
30642
30638
  //#endregion
30643
- //#region ../sdk/dist/client.js
30639
+ //#region ../sdk/src/client.ts
30644
30640
  /**
30645
30641
  * @neopress/sdk — API Client
30646
30642
  *
@@ -30717,7 +30713,8 @@ var NeopressClient = class {
30717
30713
  * header so RLS applies. No session persistence/refresh — token freshness is the
30718
30714
  * caller's responsibility (CLI getClientAsync / MCP per-request).
30719
30715
  *
30720
- * `@internal` (with `stripInternal`) keeps this out of the emitted declarations:
30716
+ * `@internal` (with `stripInternal` in the cli/mcp dts configs — sdk itself no
30717
+ * longer emits) keeps this out of the published declarations:
30721
30718
  * it is plumbing for the endpoints in this package, and typing it publicly would
30722
30719
  * drag `SupabaseClient` + the generated `Database` into the published `.d.ts` of
30723
30720
  * `@neopress/cli` / `@neopress/mcp` — packages that declare no dependencies, so
@@ -31024,7 +31021,7 @@ Draft content fields (--tsx/--i18n/--draft-meta) need \`neopress publish\` to go
31024
31021
  pages.command("get <pageId>").description("Get page details").action(async (pageId) => {
31025
31022
  output(await (await getClientAsync()).pages.get(parseInt(pageId, 10)));
31026
31023
  });
31027
- pages.command("create").description("Create a new page").requiredOption("--path <path>", "Page path (e.g., /about)").option("--title <title>", "Page title").option("--tsx <file>", "TSX file path").option("--i18n <json>", "Page i18n JSON string or @file path").option("--public-locales <locales>", "Comma-separated locale list or JSON string array").option("--metadata <json>", "Page metadata JSON string or @file path").option("--draft-meta <json>", "Draft runtime metadata JSON string or @file path").option("--query-config <json>", "Query config JSON string or @file path; stored as draftMeta.queryConfig").option("--collection <id>", "Collection ID for dynamic pages").option("--type <type>", "Page type (static/dynamic)", "static").addHelpText("after", `
31024
+ pages.command("create").description("Create a new page").requiredOption("--path <path>", "Page path (e.g., /about)").option("--title <title>", "Page title").option("--tsx <file>", "TSX file path").option("--i18n <json>", "Page i18n JSON string or @file path").option("--public-locales <locales>", "Comma-separated locale list or JSON string array").option("--metadata <json>", "Page metadata JSON string or @file path").option("--draft-meta <json>", "Draft runtime metadata JSON string or @file path").option("--query-config <json>", "Query config JSON string or @file path (including collectionWindow bindings); stored as draftMeta.queryConfig").option("--collection <id>", "Collection ID for dynamic pages").option("--type <type>", "Page type (static/dynamic)", "static").addHelpText("after", `
31028
31025
  Examples:
31029
31026
  $ neopress pages create --path /about --title About --tsx ./about.tsx
31030
31027
  $ neopress pages create --path /blog --type dynamic --collection 12 --tsx ./blog.tsx
@@ -31057,7 +31054,7 @@ Examples:
31057
31054
  $ neopress pages update 12 --title About --path /about-us
31058
31055
  $ neopress pages update 12 --collection 12 --query-config @query.json
31059
31056
 
31060
- Pass at least one field flag. --tsx reads the component from a file; JSON options take inline JSON or @file. Draft content (--tsx/--i18n/--draft-meta/--query-config) needs \`neopress publish\` to go live; --title/--path/--collection apply immediately.`).option("--path <path>", "New page path").option("--title <title>", "New title").option("--tsx <file>", "TSX file path").option("--i18n <json>", "Page i18n JSON string or @file path").option("--public-locales <locales>", "Comma-separated locale list or JSON string array").option("--metadata <json>", "Page metadata JSON string or @file path").option("--draft-meta <json>", "Draft runtime metadata JSON string or @file path").option("--query-config <json>", "Query config JSON string or @file path; stored as draftMeta.queryConfig").option("--collection <id>", "Collection ID for dynamic pages").action(async (pageId, options) => {
31057
+ Pass at least one field flag. --tsx reads the component from a file; JSON options take inline JSON or @file. Draft content (--tsx/--i18n/--draft-meta/--query-config) needs \`neopress publish\` to go live; --title/--path/--collection apply immediately.`).option("--path <path>", "New page path").option("--title <title>", "New title").option("--tsx <file>", "TSX file path").option("--i18n <json>", "Page i18n JSON string or @file path").option("--public-locales <locales>", "Comma-separated locale list or JSON string array").option("--metadata <json>", "Page metadata JSON string or @file path").option("--draft-meta <json>", "Draft runtime metadata JSON string or @file path").option("--query-config <json>", "Query config JSON string or @file path (including collectionWindow bindings); stored as draftMeta.queryConfig").option("--collection <id>", "Collection ID for dynamic pages").action(async (pageId, options) => {
31061
31058
  const client = await getClientAsync();
31062
31059
  const data = {};
31063
31060
  if (options.path) data.path = options.path;
@@ -31532,13 +31529,21 @@ Examples:
31532
31529
  }
31533
31530
  //#endregion
31534
31531
  //#region src/commands/templates.ts
31532
+ /**
31533
+ * Template commands
31534
+ */
31535
31535
  function collectPreviewImgUrl(value, previous = []) {
31536
31536
  return previous.concat(value);
31537
31537
  }
31538
+ function parseLanguage(value) {
31539
+ const language = value.trim().toLowerCase();
31540
+ if (!/^[a-z]{2}$/.test(language)) throw new InvalidArgumentError("must be a two-letter ISO 639-1 language code (e.g. ko, en, es)");
31541
+ return language;
31542
+ }
31538
31543
  function registerTemplateCommands(program) {
31539
31544
  const templates = program.command("templates").description("Manage template metadata for the active site").addHelpText("after", `
31540
31545
  Examples:
31541
- $ neopress templates mark --name "SaaS Landing" --reference-url https://example.com --preview-img-url https://cdn.example.com/1.png
31546
+ $ neopress templates mark --name "SaaS Landing" --reference-url https://example.com --language en --preview-img-url https://cdn.example.com/1.png
31542
31547
  $ neopress templates list --limit 50
31543
31548
  $ neopress templates delete
31544
31549
  \`templates mark\` operates on the active site. \`templates delete\` permanently removes the template metadata AND the connected site — it is destructive and not recoverable.`);
@@ -31554,14 +31559,15 @@ Examples:
31554
31559
  });
31555
31560
  templates.command("mark").description("Mark or update the active site as a template").addHelpText("after", `
31556
31561
  Examples:
31557
- $ neopress templates mark --name "SaaS Landing" --reference-url https://example.com --preview-img-url https://cdn.example.com/1.png
31558
- $ neopress templates mark --name Portfolio --reference-url https://example.com --preview-img-url https://cdn.example.com/a.png --preview-img-url https://cdn.example.com/b.png --description "Minimal portfolio"
31559
- $ neopress templates mark --name "SaaS Landing" --reference-url https://example.com --preview-img-url https://cdn.example.com/poster.webp --preview-video-url https://cdn.example.com/preview.webm
31560
- --name and --reference-url are required, and at least one --preview-img-url must be given (repeat the flag for multiple images). --preview-video-url is the gallery hover video; pair it with the poster (its first frame) as the first --preview-img-url. Upserts the template metadata for the active site and sets the site status to active; running it again updates the existing template.`).requiredOption("--name <name>", "Template display name").option("--description <description>", "Template description, up to 150 characters").requiredOption("--reference-url <url>", "Reference URL for template provenance").option("--preview-img-url <url>", "Preview image URL (required — at least one). Repeat for multiple images.", collectPreviewImgUrl, []).option("--preview-video-url <url>", "Preview video URL played on gallery hover. The first --preview-img-url should be this video's first frame.").action(async (options) => {
31562
+ $ neopress templates mark --name "SaaS Landing" --reference-url https://example.com --language en --preview-img-url https://cdn.example.com/1.png
31563
+ $ neopress templates mark --name Portfolio --reference-url https://example.com --language ko --preview-img-url https://cdn.example.com/a.png --preview-img-url https://cdn.example.com/b.png --description "Minimal portfolio"
31564
+ $ neopress templates mark --name "SaaS Landing" --reference-url https://example.com --language es --preview-img-url https://cdn.example.com/poster.webp --preview-video-url https://cdn.example.com/preview.webm
31565
+ --name, --reference-url, and --language are required, and at least one --preview-img-url must be given (repeat the flag for multiple images). --language is the language the template's own content is written in, as a two-letter ISO 639-1 code (ko, en, es) — not a region locale like en-US. --preview-video-url is the gallery hover video; pair it with the poster (its first frame) as the first --preview-img-url. Upserts the template metadata for the active site and sets the site status to active; running it again updates the existing template.`).requiredOption("--name <name>", "Template display name").option("--description <description>", "Template description, up to 150 characters").requiredOption("--reference-url <url>", "Reference URL for template provenance").requiredOption("--language <code>", "Primary language of the template content, as a two-letter ISO 639-1 code (e.g. ko, en, es)", parseLanguage).option("--preview-img-url <url>", "Preview image URL (required — at least one). Repeat for multiple images.", collectPreviewImgUrl, []).option("--preview-video-url <url>", "Preview video URL played on gallery hover. The first --preview-img-url should be this video's first frame.").action(async (options) => {
31561
31566
  output(await (await getClientAsync()).templates.mark({
31562
31567
  name: options.name,
31563
31568
  description: options.description,
31564
31569
  referenceUrl: options.referenceUrl,
31570
+ language: options.language,
31565
31571
  previewImgUrls: options.previewImgUrl.length > 0 ? options.previewImgUrl : void 0,
31566
31572
  previewVideoUrl: options.previewVideoUrl
31567
31573
  }));
@@ -31918,7 +31924,7 @@ function registerGuideCommands(program) {
31918
31924
  * Designed for use with Claude Code and other AI tools via --json mode.
31919
31925
  */
31920
31926
  const program = new Command();
31921
- program.name("neopress").description("Neopress CLI — manage your site from the terminal").version("4.8.0").option("--json", "Output in JSON format (for AI tools and pipes)").option("--site <idOrHandle>", "Target a specific site (overrides active site; not persisted)").option("--no-input", "Non-interactive mode").hook("preAction", (thisCommand) => {
31927
+ program.name("neopress").description("Neopress CLI — manage your site from the terminal").version("4.9.0").option("--json", "Output in JSON format (for AI tools and pipes)").option("--site <idOrHandle>", "Target a specific site (overrides active site; not persisted)").option("--no-input", "Non-interactive mode").hook("preAction", (thisCommand) => {
31922
31928
  const opts = thisCommand.optsWithGlobals();
31923
31929
  if (opts.site) setSiteOverride(String(opts.site));
31924
31930
  if (opts.json || !process.stdout.isTTY) setJsonMode(true);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../sdk/dist/types.d.ts
1
+ //#region ../sdk/src/types.d.ts
2
2
  /**
3
3
  * @neopress/sdk — First-party API types
4
4
  *
@@ -44,6 +44,8 @@ interface Template {
44
44
  referenceUrl: string;
45
45
  previewImgUrls: string[] | null;
46
46
  previewVideoUrl: string | null;
47
+ /** Primary language of the template's content, as an ISO 639-1 code (ko/en/es). */
48
+ language: string | null;
47
49
  createdAt: string | null;
48
50
  }
49
51
  interface TemplateListItem {
@@ -54,6 +56,7 @@ interface TemplateListItem {
54
56
  referenceUrl: string;
55
57
  previewImgUrls: string[] | null;
56
58
  description: string | null;
59
+ language: string | null;
57
60
  createdAt: string;
58
61
  }
59
62
  interface Page {
@@ -280,7 +283,7 @@ interface SearchConsoleQueryResult {
280
283
  error?: string;
281
284
  }
282
285
  //#endregion
283
- //#region ../sdk/dist/endpoints/pages.d.ts
286
+ //#region ../sdk/src/endpoints/pages.d.ts
284
287
  interface PageListParams {
285
288
  page?: number;
286
289
  limit?: number;
@@ -330,7 +333,7 @@ declare class PagesEndpoint {
330
333
  }>;
331
334
  }
332
335
  //#endregion
333
- //#region ../sdk/dist/endpoints/collections.d.ts
336
+ //#region ../sdk/src/endpoints/collections.d.ts
334
337
  interface CollectionCreateParams {
335
338
  name: string;
336
339
  presetType?: string;
@@ -363,7 +366,7 @@ declare class CollectionsEndpoint {
363
366
  }>;
364
367
  }
365
368
  //#endregion
366
- //#region ../sdk/dist/endpoints/entries.d.ts
369
+ //#region ../sdk/src/endpoints/entries.d.ts
367
370
  interface EntryListParams {
368
371
  page?: number;
369
372
  limit?: number;
@@ -413,7 +416,7 @@ declare class EntriesEndpoint {
413
416
  }>;
414
417
  }
415
418
  //#endregion
416
- //#region ../sdk/dist/endpoints/forms.d.ts
419
+ //#region ../sdk/src/endpoints/forms.d.ts
417
420
  interface FormCreateParams {
418
421
  name: string;
419
422
  draftSchema?: unknown;
@@ -453,7 +456,7 @@ declare class FormsEndpoint {
453
456
  deleteResponse(formId: number, responseId: number): Promise<void>;
454
457
  }
455
458
  //#endregion
456
- //#region ../sdk/dist/endpoints/assets.d.ts
459
+ //#region ../sdk/src/endpoints/assets.d.ts
457
460
  interface AssetRegisterParams {
458
461
  assetUrl: string;
459
462
  displayName?: string;
@@ -490,7 +493,7 @@ declare class AssetsEndpoint {
490
493
  }>;
491
494
  }
492
495
  //#endregion
493
- //#region ../sdk/dist/endpoints/site.d.ts
496
+ //#region ../sdk/src/endpoints/site.d.ts
494
497
  interface SiteWithRole extends Site {
495
498
  role: string;
496
499
  }
@@ -525,7 +528,7 @@ declare class SiteEndpoint {
525
528
  }>;
526
529
  }
527
530
  //#endregion
528
- //#region ../sdk/dist/endpoints/redirects.d.ts
531
+ //#region ../sdk/src/endpoints/redirects.d.ts
529
532
  interface RedirectCreateParams {
530
533
  source: string;
531
534
  destination: string;
@@ -547,7 +550,7 @@ declare class RedirectsEndpoint {
547
550
  delete(ruleId: number): Promise<void>;
548
551
  }
549
552
  //#endregion
550
- //#region ../sdk/dist/endpoints/publish.d.ts
553
+ //#region ../sdk/src/endpoints/publish.d.ts
551
554
  declare class PublishEndpoint {
552
555
  private readonly client;
553
556
  constructor(client: NeopressClient);
@@ -555,7 +558,7 @@ declare class PublishEndpoint {
555
558
  site(): Promise<unknown>;
556
559
  }
557
560
  //#endregion
558
- //#region ../sdk/dist/endpoints/entry-references.d.ts
561
+ //#region ../sdk/src/endpoints/entry-references.d.ts
559
562
  interface EntryReferenceListParams {
560
563
  fromEntryId?: number;
561
564
  toEntryId?: number;
@@ -575,7 +578,7 @@ declare class EntryReferencesEndpoint {
575
578
  delete(referenceId: number): Promise<void>;
576
579
  }
577
580
  //#endregion
578
- //#region ../sdk/dist/endpoints/analytics.d.ts
581
+ //#region ../sdk/src/endpoints/analytics.d.ts
579
582
  declare class AnalyticsEndpoint {
580
583
  private readonly client;
581
584
  constructor(client: NeopressClient);
@@ -590,7 +593,7 @@ declare class AnalyticsEndpoint {
590
593
  searchConsole(params: SearchConsoleQueryParams): Promise<SearchConsoleQueryResult>;
591
594
  }
592
595
  //#endregion
593
- //#region ../sdk/dist/endpoints/templates.d.ts
596
+ //#region ../sdk/src/endpoints/templates.d.ts
594
597
  interface TemplateMarkParams {
595
598
  name: string;
596
599
  description?: string | null;
@@ -600,6 +603,11 @@ interface TemplateMarkParams {
600
603
  * card cross-fades from poster to video, so the poster must be the video's
601
604
  * first frame. Omit to leave an existing value untouched; `null` clears it. */
602
605
  previewVideoUrl?: string | null;
606
+ /** Primary language of the template's content — required, ISO 639-1 lowercase
607
+ * two-letter code (`ko`, `en`, `es`). Region-qualified locales (`en-US`) are
608
+ * rejected: the gallery filters on this key and must not see one language
609
+ * under two spellings. */
610
+ language: string;
603
611
  }
604
612
  interface TemplateDeleteResult {
605
613
  siteId: number;
@@ -626,7 +634,7 @@ declare class TemplatesEndpoint {
626
634
  }): Promise<TemplateListItem[]>;
627
635
  }
628
636
  //#endregion
629
- //#region ../sdk/dist/endpoints/headshots.d.ts
637
+ //#region ../sdk/src/endpoints/headshots.d.ts
630
638
  type HeadshotAgeBand = 'young' | 'middle';
631
639
  type HeadshotGender = 'male' | 'female';
632
640
  type HeadshotEthnicity = 'asian' | 'white' | 'black' | 'latino';
@@ -693,7 +701,7 @@ declare class HeadshotsEndpoint {
693
701
  delete(id: number): Promise<HeadshotDeleteResult>;
694
702
  }
695
703
  //#endregion
696
- //#region ../sdk/dist/endpoints/logos.d.ts
704
+ //#region ../sdk/src/endpoints/logos.d.ts
697
705
  type LogoType = 'wordmark' | 'lockup' | 'signature';
698
706
  type LogoTone = 'playful' | 'neutral' | 'serious';
699
707
  interface LogoListParams {
@@ -764,7 +772,7 @@ declare class LogosEndpoint {
764
772
  delete(id: number): Promise<LogoDeleteResult>;
765
773
  }
766
774
  //#endregion
767
- //#region ../sdk/dist/client.d.ts
775
+ //#region ../sdk/src/client.d.ts
768
776
  interface NeopressClientOptions {
769
777
  /** OAuth access token */
770
778
  accessToken?: string;
package/dist/index.js CHANGED
@@ -22804,7 +22804,7 @@ function shouldShowDeprecationWarning() {
22804
22804
  }
22805
22805
  if (shouldShowDeprecationWarning()) console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");
22806
22806
  //#endregion
22807
- //#region ../sdk/dist/errors.js
22807
+ //#region ../sdk/src/errors.ts
22808
22808
  /**
22809
22809
  * SDK error classes
22810
22810
  */
@@ -22821,13 +22821,7 @@ var NeopressApiError = class extends Error {
22821
22821
  }
22822
22822
  };
22823
22823
  //#endregion
22824
- //#region ../sdk/dist/serializers.js
22825
- /**
22826
- * SDK serializers — convert DB snake_case rows to SDK camelCase shapes.
22827
- *
22828
- * Ported 1:1 from apps/neopress/src/lib/api/v1/serializers.ts.
22829
- * Do NOT change field mappings without updating both files.
22830
- */
22824
+ //#region ../sdk/src/serializers.ts
22831
22825
  function serializePageFull(page) {
22832
22826
  return {
22833
22827
  id: page.id,
@@ -22988,6 +22982,7 @@ function serializeTemplate(t) {
22988
22982
  referenceUrl: t.reference_url,
22989
22983
  previewImgUrls: t.preview_img_urls,
22990
22984
  previewVideoUrl: t.preview_video_url ?? null,
22985
+ language: t.language ?? null,
22991
22986
  createdAt: t.created_at
22992
22987
  };
22993
22988
  }
@@ -23076,7 +23071,7 @@ function serializeSiteLayout(siteId, layout) {
23076
23071
  };
23077
23072
  }
23078
23073
  //#endregion
23079
- //#region ../sdk/dist/endpoints/pages.js
23074
+ //#region ../sdk/src/endpoints/pages.ts
23080
23075
  var PagesEndpoint = class {
23081
23076
  client;
23082
23077
  constructor(client) {
@@ -26473,7 +26468,7 @@ function getDefaultLogLevel() {
26473
26468
  }
26474
26469
  getDefaultLogLevel();
26475
26470
  //#endregion
26476
- //#region ../sdk/dist/endpoints/collections.js
26471
+ //#region ../sdk/src/endpoints/collections.ts
26477
26472
  var CollectionsEndpoint = class {
26478
26473
  client;
26479
26474
  constructor(client) {
@@ -26539,7 +26534,7 @@ var CollectionsEndpoint = class {
26539
26534
  }
26540
26535
  };
26541
26536
  //#endregion
26542
- //#region ../sdk/dist/endpoints/entries.js
26537
+ //#region ../sdk/src/endpoints/entries.ts
26543
26538
  var EntriesEndpoint = class {
26544
26539
  client;
26545
26540
  constructor(client) {
@@ -26612,7 +26607,7 @@ var EntriesEndpoint = class {
26612
26607
  }
26613
26608
  };
26614
26609
  //#endregion
26615
- //#region ../sdk/dist/endpoints/forms.js
26610
+ //#region ../sdk/src/endpoints/forms.ts
26616
26611
  var FormsEndpoint = class {
26617
26612
  client;
26618
26613
  constructor(client) {
@@ -26680,7 +26675,7 @@ var FormsEndpoint = class {
26680
26675
  }
26681
26676
  };
26682
26677
  //#endregion
26683
- //#region ../sdk/dist/endpoints/assets.js
26678
+ //#region ../sdk/src/endpoints/assets.ts
26684
26679
  var AssetsEndpoint = class {
26685
26680
  client;
26686
26681
  constructor(client) {
@@ -26741,7 +26736,7 @@ var AssetsEndpoint = class {
26741
26736
  }
26742
26737
  };
26743
26738
  //#endregion
26744
- //#region ../sdk/dist/endpoints/site.js
26739
+ //#region ../sdk/src/endpoints/site.ts
26745
26740
  var SiteEndpoint = class {
26746
26741
  client;
26747
26742
  constructor(client) {
@@ -26786,7 +26781,7 @@ var SiteEndpoint = class {
26786
26781
  }
26787
26782
  };
26788
26783
  //#endregion
26789
- //#region ../sdk/dist/endpoints/redirects.js
26784
+ //#region ../sdk/src/endpoints/redirects.ts
26790
26785
  const DASHBOARD_ONLY_REWRITE_MESSAGE = "Rewrite proxy rules can only be managed in the dashboard.";
26791
26786
  function rejectModeParam(data) {
26792
26787
  if (data && typeof data === "object" && Object.prototype.hasOwnProperty.call(data, "mode")) throw new NeopressApiError("REDIRECT_RULE_DASHBOARD_ONLY", DASHBOARD_ONLY_REWRITE_MESSAGE, 400);
@@ -26847,7 +26842,7 @@ var RedirectsEndpoint = class {
26847
26842
  }
26848
26843
  };
26849
26844
  //#endregion
26850
- //#region ../sdk/dist/endpoints/publish.js
26845
+ //#region ../sdk/src/endpoints/publish.ts
26851
26846
  var PublishEndpoint = class {
26852
26847
  client;
26853
26848
  constructor(client) {
@@ -26861,7 +26856,7 @@ var PublishEndpoint = class {
26861
26856
  }
26862
26857
  };
26863
26858
  //#endregion
26864
- //#region ../sdk/dist/endpoints/entry-references.js
26859
+ //#region ../sdk/src/endpoints/entry-references.ts
26865
26860
  var EntryReferencesEndpoint = class {
26866
26861
  client;
26867
26862
  constructor(client) {
@@ -26892,7 +26887,7 @@ var EntryReferencesEndpoint = class {
26892
26887
  }
26893
26888
  };
26894
26889
  //#endregion
26895
- //#region ../sdk/dist/endpoints/analytics.js
26890
+ //#region ../sdk/src/endpoints/analytics.ts
26896
26891
  const RESERVED_ANALYTICS_PARAMS = /* @__PURE__ */ new Set([
26897
26892
  "pipe",
26898
26893
  "site",
@@ -26977,7 +26972,7 @@ var AnalyticsEndpoint = class {
26977
26972
  }
26978
26973
  };
26979
26974
  //#endregion
26980
- //#region ../sdk/dist/endpoints/templates.js
26975
+ //#region ../sdk/src/endpoints/templates.ts
26981
26976
  var TemplatesEndpoint = class {
26982
26977
  client;
26983
26978
  constructor(client) {
@@ -27019,7 +27014,7 @@ var TemplatesEndpoint = class {
27019
27014
  if (siteIds.length === 0) return [];
27020
27015
  const namePrefix = params?.namePrefix?.trim();
27021
27016
  const limit = Math.min(Math.max(params?.limit ?? 100, 1), 500);
27022
- let query = this.client.db.from("templates").select("id, name, reference_url, preview_img_urls, description, created_at").in("id", siteIds);
27017
+ let query = this.client.db.from("templates").select("id, name, reference_url, preview_img_urls, description, language, created_at").in("id", siteIds);
27023
27018
  if (namePrefix) query = query.ilike("name", `${namePrefix}%`);
27024
27019
  if (params?.order) query = query.order("created_at", { ascending: params.order === "asc" });
27025
27020
  query = query.limit(limit);
@@ -27035,13 +27030,14 @@ var TemplatesEndpoint = class {
27035
27030
  referenceUrl: t.reference_url,
27036
27031
  previewImgUrls: t.preview_img_urls ?? null,
27037
27032
  description: t.description ?? null,
27033
+ language: t.language ?? null,
27038
27034
  createdAt: t.created_at
27039
27035
  };
27040
27036
  });
27041
27037
  }
27042
27038
  };
27043
27039
  //#endregion
27044
- //#region ../sdk/dist/endpoints/headshots.js
27040
+ //#region ../sdk/src/endpoints/headshots.ts
27045
27041
  /**
27046
27042
  * headshot_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to
27047
27043
  * the super-admin user, so these direct-DB calls return empty/forbidden for any
@@ -27125,7 +27121,7 @@ var HeadshotsEndpoint = class {
27125
27121
  }
27126
27122
  };
27127
27123
  //#endregion
27128
- //#region ../sdk/dist/endpoints/logos.js
27124
+ //#region ../sdk/src/endpoints/logos.ts
27129
27125
  /**
27130
27126
  * logo_pool is a GLOBAL (not site-scoped) admin table. RLS exposes it only to the
27131
27127
  * super-admin user, so these direct-DB calls return empty/forbidden for any other
@@ -27215,7 +27211,7 @@ var LogosEndpoint = class {
27215
27211
  }
27216
27212
  };
27217
27213
  //#endregion
27218
- //#region ../sdk/dist/client.js
27214
+ //#region ../sdk/src/client.ts
27219
27215
  /**
27220
27216
  * @neopress/sdk — API Client
27221
27217
  *
@@ -27292,7 +27288,8 @@ var NeopressClient = class {
27292
27288
  * header so RLS applies. No session persistence/refresh — token freshness is the
27293
27289
  * caller's responsibility (CLI getClientAsync / MCP per-request).
27294
27290
  *
27295
- * `@internal` (with `stripInternal`) keeps this out of the emitted declarations:
27291
+ * `@internal` (with `stripInternal` in the cli/mcp dts configs — sdk itself no
27292
+ * longer emits) keeps this out of the published declarations:
27296
27293
  * it is plumbing for the endpoints in this package, and typing it publicly would
27297
27294
  * drag `SupabaseClient` + the generated `Database` into the published `.d.ts` of
27298
27295
  * `@neopress/cli` / `@neopress/mcp` — packages that declare no dependencies, so
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neopress/cli",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "Neopress CLI — manage your Neopress site from the terminal",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -36,7 +36,7 @@
36
36
  "@neopress/sdk": "0.4.0"
37
37
  },
38
38
  "scripts": {
39
- "build": "tsdown && node ./scripts/check-dist-contract.mjs",
39
+ "build": "NODE_OPTIONS=--max-old-space-size=4096 tsdown && node ./scripts/check-dist-contract.mjs",
40
40
  "dev": "tsdown --watch",
41
41
  "lint": "tsc --noEmit",
42
42
  "test": "vitest run"