@fern-api/fdr-sdk 1.2.37-9bb7abe0bd → 1.2.37-cc77d6a840

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/js/index.js CHANGED
@@ -9456,7 +9456,7 @@ var DocsPublishInputSchemaInternal = z21.object({
9456
9456
  path: ["defaultLocale"]
9457
9457
  });
9458
9458
  var DocsPublishInputSchema = DocsPublishInputSchemaInternal;
9459
- var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.extend({
9459
+ var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.partial().extend({
9460
9460
  orgId: z21.string(),
9461
9461
  /**
9462
9462
  * Optional caller-supplied identifier for the preview hostname. Sanitized
@@ -9471,7 +9471,33 @@ var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.extend({
9471
9471
  * Mirrors V2's `basePath` — most preview publishes leave this empty,
9472
9472
  * but explicit subpath previews (`/v2`) are supported.
9473
9473
  */
9474
- basePath: z21.string().default("")
9474
+ basePath: z21.string().default(""),
9475
+ /** The primary/fallback locale for this preview deployment. */
9476
+ defaultLocale: z21.string().optional(),
9477
+ /**
9478
+ * All locales for this preview deployment. Preferred over the legacy
9479
+ * single-locale content fields above.
9480
+ */
9481
+ locales: z21.array(LocaleEntrySchema).min(1).optional()
9482
+ }).superRefine((data, ctx) => {
9483
+ if (data.locales == null) {
9484
+ if (data.root == null || data.pages == null) {
9485
+ ctx.addIssue({
9486
+ code: z21.ZodIssueCode.custom,
9487
+ message: "Either locales or legacy single-locale content fields must be provided",
9488
+ path: ["locales"]
9489
+ });
9490
+ }
9491
+ return;
9492
+ }
9493
+ const defaultLocale = data.defaultLocale ?? data.locales[0]?.locale;
9494
+ if (defaultLocale == null || !data.locales.some((locale) => locale.locale === defaultLocale)) {
9495
+ ctx.addIssue({
9496
+ code: z21.ZodIssueCode.custom,
9497
+ message: "defaultLocale must match one of the locales in the locales array",
9498
+ path: ["defaultLocale"]
9499
+ });
9500
+ }
9475
9501
  });
9476
9502
  var LedgerPreviewRegisterInputSchema = LedgerPreviewRegisterInputSchemaInternal;
9477
9503
  var LedgerPreviewRegisterResponseSchema = z21.object({