@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.mjs CHANGED
@@ -9393,7 +9393,7 @@ var DocsPublishInputSchemaInternal = z21.object({
9393
9393
  path: ["defaultLocale"]
9394
9394
  });
9395
9395
  var DocsPublishInputSchema = DocsPublishInputSchemaInternal;
9396
- var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.extend({
9396
+ var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.partial().extend({
9397
9397
  orgId: z21.string(),
9398
9398
  /**
9399
9399
  * Optional caller-supplied identifier for the preview hostname. Sanitized
@@ -9408,7 +9408,33 @@ var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.extend({
9408
9408
  * Mirrors V2's `basePath` — most preview publishes leave this empty,
9409
9409
  * but explicit subpath previews (`/v2`) are supported.
9410
9410
  */
9411
- basePath: z21.string().default("")
9411
+ basePath: z21.string().default(""),
9412
+ /** The primary/fallback locale for this preview deployment. */
9413
+ defaultLocale: z21.string().optional(),
9414
+ /**
9415
+ * All locales for this preview deployment. Preferred over the legacy
9416
+ * single-locale content fields above.
9417
+ */
9418
+ locales: z21.array(LocaleEntrySchema).min(1).optional()
9419
+ }).superRefine((data, ctx) => {
9420
+ if (data.locales == null) {
9421
+ if (data.root == null || data.pages == null) {
9422
+ ctx.addIssue({
9423
+ code: z21.ZodIssueCode.custom,
9424
+ message: "Either locales or legacy single-locale content fields must be provided",
9425
+ path: ["locales"]
9426
+ });
9427
+ }
9428
+ return;
9429
+ }
9430
+ const defaultLocale = data.defaultLocale ?? data.locales[0]?.locale;
9431
+ if (defaultLocale == null || !data.locales.some((locale) => locale.locale === defaultLocale)) {
9432
+ ctx.addIssue({
9433
+ code: z21.ZodIssueCode.custom,
9434
+ message: "defaultLocale must match one of the locales in the locales array",
9435
+ path: ["defaultLocale"]
9436
+ });
9437
+ }
9412
9438
  });
9413
9439
  var LedgerPreviewRegisterInputSchema = LedgerPreviewRegisterInputSchemaInternal;
9414
9440
  var LedgerPreviewRegisterResponseSchema = z21.object({