@wildo-ai/zod-decorators 1.1.1 → 1.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"zod-money.js","sourceRoot":"","sources":["../../../src/zod-money.ts"],"names":[],"mappings":"AACA,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,OAAO,EAAkB,eAAe,EAAoF,YAAY,EAA2B,MAAM,wBAAwB,CAAC;AAClM,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAgC7D;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiG,CAAC,CAAC,MAAM,CAAC;IACrI,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA8B,EAAE;IAEhC,MAAM,EACJ,iBAAiB,EACjB,cAAc,GAAG,IAAI,EACrB,mBAAmB,GAAG,IAAI,EAC1B,SAAS,EACT,SAAS,GACV,GAAG,OAAO,CAAC;IAEZ,6DAA6D;IAC7D,iFAAiF;IACjF,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,SAAS,KAAK,SAAS,EA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,KAAK,QAAQ;QAChC,CAAC,CAAC,GAAG,MAAM,IAAI,eAAe,EAAE;QAChC,CAAC,CAAC,GAAG,eAAe,IAAI,MAAM,EAAE,CAAC;AACrC,CAAC","sourcesContent":["\n// ============================================================================\n// MONEY SCHEMA HELPER\n// ============================================================================\n\nimport { DecoratorInput, SCHEMA_METADATA, CustomFieldMetadata, MoneySchemaMetadata, MoneySchemaOptions, SummaryFieldParams, ZodDecorator, ZodDecorator_ParamsType } from \"./zod-decorators.types\";\nimport { z } from \"zod\";\nimport { addChainableMethods } from \"./zod.module-override\";\nimport { CurrencySchema } from \"./currencies.shared.schemas\";\n\n/**\n * Money value type - represents a monetary amount with bigint storage.\n *\n * The amount is stored as a bigint in the smallest unit (e.g., cents for USD).\n * Using bigint ensures no precision loss for arbitrarily large amounts.\n * The decimals field indicates how to convert to the display value:\n * - displayValue = Number(amount) / (10 ** decimals)\n *\n * Example: { amount: 1999n, currency: 'USD', decimals: 2 } = $19.99\n */\nexport interface MoneyValue {\n /**\n * Amount in smallest unit (e.g., cents). BigInt to avoid precision issues with\n * large amounts.\n *\n * WIRE CONTRACT: a `bigint` has no JSON form, so on the wire (and at rest in\n * Mongo) this amount is a decimal STRING (e.g. `\"1999\"`). Outbound it is encoded\n * by `BigInt.prototype.toJSON` (`installBigIntJsonEncoding`, same package);\n * inbound it is coerced back to `bigint` by `applyNetworkBoundaryCoercion`\n * (`@wildo-ai/saas-models`) on the shared request/response DTO — so both the\n * frontend and backend hold a real `bigint` at runtime. Full mechanism map:\n * `install-bigint-json-encoding.ts`.\n */\n amount: bigint;\n /** ISO 4217 currency code (e.g., 'USD', 'EUR', 'BTC') */\n currency: string;\n /** Number of decimal places for display (e.g., 2 for USD, 8 for BTC) */\n decimals: number;\n}\n\n/**\n * Zod schema for MoneyValue.\n */\nexport const MoneyValueSchema: z.ZodObject<{ amount: z.ZodBigInt; currency: typeof CurrencySchema; decimals: z.ZodNumber }> = z.object({\n amount: z.bigint(),\n currency: CurrencySchema,\n decimals: z.number().int().min(0).max(18),\n});\n\n/**\n * @wildo_source:part:start zod.factories.money facet:layer:shared facet:family:schema-factory\n *\n * z_money() - Creates money schemas for financial amounts.\n *\n * Money values are stored as integers to avoid floating-point precision issues.\n * The schema creates an object with: { amount, currency, decimals }\n *\n * @example\n * ```typescript\n * import { z_money } from '@wildo-ai/zod-decorators';\n *\n * const price = z_money();\n * const fiatPrice = z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] });\n * const usdPrice = z_money({ allowCurrencyChange: false }).moneyUI({ edit: { defaultCurrency: 'USD' } });\n *\n * // With decorators (chainable)\n * z_money().moneyUI({ edit: { defaultCurrency: 'EUR' } })\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT_MAJOR] }).isHidden({ edit: true })\n * ```\n */\n\n/**\n * Creates a money schema with metadata for detection and form component rendering.\n *\n * @param options - Configuration options for money field\n * @returns A Zod object schema with metadata for money detection\n *\n * @example\n * ```typescript\n * // Simple money (all currencies)\n * const price = z_money();\n * // Infers: { amount: bigint, currency: string, decimals: number }\n *\n * // Fiat only (no crypto)\n * const fiatPrice = z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] });\n *\n * // Fixed currency with amount constraints\n * const usdPrice = z_money({\n * allowCurrencyChange: false,\n * minAmount: 0n,\n * maxAmount: 100000000n // $1,000,000.00 in cents\n * }).moneyUI({ edit: { defaultCurrency: 'USD' } });\n * ```\n */\nexport function createMoneySchema(\n options: MoneySchemaOptions = {}\n): DecoratedMoneySchema {\n const {\n currenciesAllowed,\n appEnabledOnly = true,\n allowCurrencyChange = true,\n minAmount,\n maxAmount,\n } = options;\n\n // Create the amount schema with optional min/max constraints\n // Using bigint for amount to avoid precision issues with large financial amounts\n let amountSchema = z.bigint();\n if (minAmount !== undefined) {\n amountSchema = amountSchema.min(minAmount);\n }\n if (maxAmount !== undefined) {\n amountSchema = amountSchema.max(maxAmount);\n }\n\n // Create the money object schema\n const moneySchema = z.object({\n amount: amountSchema,\n currency: CurrencySchema,\n decimals: z.number().int().min(0).max(18),\n });\n\n const moneyMetadata: MoneySchemaMetadata = {\n isMoney: true,\n ...(currenciesAllowed && currenciesAllowed.length > 0 && { currenciesAllowed }),\n appEnabledOnly,\n allowCurrencyChange,\n ...(minAmount !== undefined && { minAmount }),\n ...(maxAmount !== undefined && { maxAmount }),\n };\n\n // Initialize or extend SCHEMA_METADATA with money config\n const existingMetadata: CustomFieldMetadata = (moneySchema as any)[SCHEMA_METADATA] || {};\n (moneySchema as any)[SCHEMA_METADATA] = {\n ...existingMetadata,\n moneyConfig: moneyMetadata,\n };\n\n // Add chainable decorator methods to the money schema instance\n // This allows: z_money().moneyUI({ edit: { defaultCurrency: 'EUR' } }).isHidden()\n addChainableMethods(moneySchema);\n\n return moneySchema as DecoratedMoneySchema;\n}\n\n/**\n * Return type for money schemas - includes decorator methods.\n * Note: IS_FOREIGN_KEY is not applicable to money objects.\n * IS_DB_INDEXED will index internal fields (amount, currency) for query optimization.\n *\n * This type must list all decorators applicable to ZodObject (per ApplyableTypeAllTypes).\n * Missing entries here cause TS errors when chaining decorators on z_money() fields.\n */\nexport type DecoratedMoneySchema = z.ZodObject<{\n amount: z.ZodBigInt;\n currency: typeof CurrencySchema;\n decimals: z.ZodNumber;\n}> & {\n [ZodDecorator.IS_DB_INDEXED](): DecoratedMoneySchema;\n [ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedMoneySchema;\n [ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedMoneySchema;\n // Resource-level decorators (applicable to all types including ZodObject)\n [ZodDecorator.IS_SUMMARY_FIELD](params?: SummaryFieldParams): DecoratedMoneySchema;\n [ZodDecorator.IS_BACKEND_ONLY](params?: ZodDecorator_ParamsType[ZodDecorator.IS_BACKEND_ONLY]): DecoratedMoneySchema;\n [ZodDecorator.IS_WRITE_ONLY_SECRET](params?: ZodDecorator_ParamsType[ZodDecorator.IS_WRITE_ONLY_SECRET]): DecoratedMoneySchema;\n [ZodDecorator.EXCLUDE_FROM_CREATE](): DecoratedMoneySchema;\n [ZodDecorator.EXCLUDE_FROM_UPDATE](): DecoratedMoneySchema;\n addDecorators(decorators: DecoratorInput[]): DecoratedMoneySchema;\n};\n\n/**\n * Creates a money schema for financial amounts with integer storage.\n * Named z_money to indicate it's a Zod helper function exported standalone.\n *\n * Money values are stored as: { amount: int, currency: string, decimals: int }\n * - amount: Value in smallest unit (e.g., cents for USD, satoshis for BTC)\n * - currency: ISO 4217 code (e.g., 'USD', 'EUR', 'BTC')\n * - decimals: Decimal places for display conversion (e.g., 2 for USD, 8 for BTC)\n *\n * @example\n * ```typescript\n * import { z_money } from '@wildo-ai/zod-decorators';\n *\n * // Simple usage\n * z_money() // All currencies\n *\n * // With options\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] })\n * z_money({ allowCurrencyChange: false }).moneyUI({ edit: { defaultCurrency: 'USD' } })\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT_MAJOR], minAmount: 0n })\n *\n * // With decorators (chainable)\n * z_money().moneyUI({ edit: { defaultCurrency: 'USD' } })\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] }).isHidden({ edit: true })\n *\n * // Usage example\n * const price: MoneyValue = { amount: 1999n, currency: 'USD', decimals: 2 };\n * // Represents $19.99\n * ```\n */\nexport function z_money(\n options?: MoneySchemaOptions\n): DecoratedMoneySchema {\n return createMoneySchema(options) as DecoratedMoneySchema;\n}\n/** @wildo_source:part:end zod.factories.money */\n\n// ============================================================================\n// MONEY UTILITY FUNCTIONS\n// ============================================================================\n\n/**\n * Convert a decimal amount to bigint representation.\n *\n * **Precision caveat:** This uses floating-point arithmetic internally\n * (`Math.round(decimalAmount * 10^decimals)`), which can produce rounding\n * errors for certain values. Prefer `parseDecimalStringToAmount` when working\n * with user input strings to avoid float precision issues entirely.\n *\n * @param decimalAmount - The decimal amount (e.g., 19.99)\n * @param decimals - Number of decimal places (e.g., 2)\n * @returns BigInt amount (e.g., 1999n)\n */\nexport function toMoneyAmount(decimalAmount: number, decimals: number): bigint {\n return BigInt(Math.round(decimalAmount * Math.pow(10, decimals)));\n}\n\n/**\n * Convert a bigint amount to decimal representation.\n * @param amount - The bigint amount (e.g., 1999n)\n * @param decimals - Number of decimal places (e.g., 2)\n * @returns Decimal amount (e.g., 19.99)\n */\nexport function fromMoneyAmount(amount: bigint, decimals: number): number {\n return Number(amount) / Math.pow(10, decimals);\n}\n\n/**\n * Convert a string or number to bigint safely.\n * Useful for parsing user input or JSON values.\n * @param value - String, number, or bigint to convert\n * @returns BigInt amount\n */\nexport function toBigIntAmount(value: string | number | bigint): bigint {\n if (typeof value === 'bigint') return value;\n if (typeof value === 'number') return BigInt(Math.round(value));\n return BigInt(value);\n}\n\n/**\n * Parse a decimal string directly to a bigint amount, avoiding floating-point\n * precision issues entirely.\n *\n * This is the preferred way to convert user input (e.g., from an HTML input\n * element) to a money amount. It works by splitting the string at the decimal\n * point and manipulating integer/fractional parts as strings, so no float\n * arithmetic is ever involved.\n *\n * - Extra fractional digits beyond `decimals` are **truncated** (not rounded).\n * - Missing fractional digits are **zero-padded**.\n *\n * @param input - A decimal string (e.g., \"19.99\", \"5\", \".50\", \"-12.345\")\n * @param decimals - Number of decimal places for the target currency\n * @returns BigInt amount, or `null` if the input is not a valid decimal string\n *\n * **Note:** Scientific notation strings (e.g., `\"1e+10\"`) are rejected (returns\n * `null`) since they are not valid monetary input. This is correct behavior when\n * reading from `<input type=\"number\">`, which may produce such strings for very\n * large values — those inputs should be constrained via `min`/`max` attributes.\n *\n * @example\n * ```typescript\n * parseDecimalStringToAmount(\"19.99\", 2) // → 1999n\n * parseDecimalStringToAmount(\"19.999\", 2) // → 1999n (truncates, not rounds)\n * parseDecimalStringToAmount(\"19.9\", 2) // → 1990n (pads missing decimals)\n * parseDecimalStringToAmount(\"5\", 2) // → 500n\n * parseDecimalStringToAmount(\".50\", 2) // → 50n\n * parseDecimalStringToAmount(\"-12.34\", 2) // → -1234n\n * parseDecimalStringToAmount(\"abc\", 2) // → null\n * parseDecimalStringToAmount(\"1e+10\", 2) // → null (scientific notation rejected)\n * ```\n */\nexport function parseDecimalStringToAmount(input: string, decimals: number): bigint | null {\n const trimmed = input.trim();\n if (trimmed === '' || trimmed === '.' || trimmed === '-' || trimmed === '-.') return null;\n\n // Handle sign\n const isNegative = trimmed.startsWith('-');\n const unsigned = isNegative ? trimmed.slice(1) : trimmed;\n\n // Validate: only digits and at most one decimal point\n if (!/^\\d*\\.?\\d*$/.test(unsigned)) return null;\n\n const dotIndex = unsigned.indexOf('.');\n const integerPart = dotIndex === -1 ? unsigned : (unsigned.slice(0, dotIndex) || '0');\n const fractionalRaw = dotIndex === -1 ? '' : unsigned.slice(dotIndex + 1);\n\n // Pad or truncate fractional part to exactly `decimals` digits\n const fractionalPart = decimals === 0\n ? ''\n : fractionalRaw.padEnd(decimals, '0').slice(0, decimals);\n\n // Build the combined string and convert to bigint\n const combined = integerPart + fractionalPart;\n // Guard against empty combined (shouldn't happen after validation, but be safe)\n if (combined === '') return 0n;\n\n try {\n const result = BigInt(combined);\n return isNegative ? -result : result;\n } catch {\n return null;\n }\n}\n\n/**\n * Convert a money amount from one decimal precision to another using pure\n * bigint arithmetic (no floating-point involved).\n *\n * Use this when changing a currency (which may have different decimal places)\n * instead of the float roundtrip `fromMoneyAmount` → `toMoneyAmount`.\n *\n * - When increasing decimals (e.g., 2 → 8): multiplies by 10^(diff)\n * - When decreasing decimals (e.g., 8 → 2): divides with half-away-from-zero rounding\n *\n * @param amount - The bigint amount in the source precision\n * @param fromDecimals - Source decimal places\n * @param toDecimals - Target decimal places\n * @returns BigInt amount in the target precision\n *\n * @example\n * ```typescript\n * convertMoneyDecimals(1999n, 2, 2) // → 1999n (same decimals, no-op)\n * convertMoneyDecimals(1999n, 2, 4) // → 199900n (scale up)\n * convertMoneyDecimals(199900n, 4, 2) // → 1999n (scale down)\n * convertMoneyDecimals(12345678n, 8, 2) // → 12n (BTC satoshis to 2-decimal)\n * ```\n */\nexport function convertMoneyDecimals(amount: bigint, fromDecimals: number, toDecimals: number): bigint {\n if (fromDecimals === toDecimals) return amount;\n\n const diff = toDecimals - fromDecimals;\n\n if (diff > 0) {\n // Scale up: multiply\n return amount * (10n ** BigInt(diff));\n }\n\n // Scale down: divide with rounding (half-away-from-zero)\n const divisor = 10n ** BigInt(-diff);\n const isNegative = amount < 0n;\n const absAmount = isNegative ? -amount : amount;\n const rounded = (absAmount + divisor / 2n) / divisor;\n return isNegative ? -rounded : rounded;\n}\n\n/**\n * Format a money value for display.\n * @param money - The money value\n * @param options - Formatting options\n * @returns Formatted string (e.g., \"$19.99\" or \"19.99 USD\")\n */\nexport function formatMoney(\n money: MoneyValue,\n options: {\n showSymbol?: boolean;\n symbolPosition?: 'before' | 'after';\n thousandsSeparator?: string;\n decimalSeparator?: string;\n } = {}\n): string {\n const {\n showSymbol = true,\n symbolPosition = 'before',\n thousandsSeparator = ',',\n decimalSeparator = '.',\n } = options;\n\n const decimalValue = fromMoneyAmount(money.amount, money.decimals);\n\n // Format with proper decimal places\n const [integerPart, decimalPart] = decimalValue.toFixed(money.decimals).split('.');\n\n // Add thousands separator\n const formattedInteger = integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n\n const formattedNumber = decimalPart\n ? `${formattedInteger}${decimalSeparator}${decimalPart}`\n : formattedInteger;\n\n if (!showSymbol) {\n return formattedNumber;\n }\n\n // For now, use currency code as symbol (can be enhanced with CURRENCY_INFO_MAP)\n const symbol = money.currency;\n\n return symbolPosition === 'before'\n ? `${symbol} ${formattedNumber}`\n : `${formattedNumber} ${symbol}`;\n}\n\n"]}
1
+ {"version":3,"file":"zod-money.js","sourceRoot":"","sources":["../../../src/zod-money.ts"],"names":[],"mappings":"AACA,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,OAAO,EAAkB,eAAe,EAAoF,YAAY,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gBAAgB,GAAG,WAAW,CAAC,OAAO,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;IAE1F,MAAM,eAAe,GAAG,WAAW;QACjC,CAAC,CAAC,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,WAAW,EAAE;QACxD,CAAC,CAAC,gBAAgB,CAAC;IAErB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,gFAAgF;IAChF,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC;IAE9B,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,GAAG,MAAM,IAAI,eAAe,EAAE;QAChC,CAAC,CAAC,GAAG,eAAe,IAAI,MAAM,EAAE,CAAC;AACrC,CAAC","sourcesContent":["\n// ============================================================================\n// MONEY SCHEMA HELPER\n// ============================================================================\n\nimport { DecoratorInput, SCHEMA_METADATA, CustomFieldMetadata, MoneySchemaMetadata, MoneySchemaOptions, SummaryFieldParams, ZodDecorator, ZodDecorator_ParamsType } from \"./zod-decorators.types\";\nimport { z } from \"zod\";\nimport { addChainableMethods } from \"./zod.module-override\";\nimport { CurrencySchema, currencyMinorUnitDecimals } from \"./currencies.shared.schemas\";\n\n/**\n * Money value type - represents a monetary amount with bigint storage.\n *\n * The amount is stored as a bigint in the smallest unit (e.g., cents for USD).\n * Using bigint ensures no precision loss for arbitrarily large amounts.\n * The decimals field indicates how to convert to the display value:\n * - displayValue = Number(amount) / (10 ** decimals)\n *\n * Example: { amount: 1999n, currency: 'USD', decimals: 2 } = $19.99\n */\nexport interface MoneyValue {\n /**\n * Amount in smallest unit (e.g., cents). BigInt to avoid precision issues with\n * large amounts.\n *\n * WIRE CONTRACT: a `bigint` has no JSON form, so on the wire (and at rest in\n * Mongo) this amount is a decimal STRING (e.g. `\"1999\"`). Outbound it is encoded\n * by `BigInt.prototype.toJSON` (`installBigIntJsonEncoding`, same package);\n * inbound it is coerced back to `bigint` by `applyNetworkBoundaryCoercion`\n * (`@wildo-ai/saas-models`) on the shared request/response DTO — so both the\n * frontend and backend hold a real `bigint` at runtime. Full mechanism map:\n * `install-bigint-json-encoding.ts`.\n */\n amount: bigint;\n /** ISO 4217 currency code (e.g., 'USD', 'EUR', 'BTC') */\n currency: string;\n /** Number of decimal places for display (e.g., 2 for USD, 8 for BTC) */\n decimals: number;\n}\n\n/**\n * Zod schema for MoneyValue.\n */\nexport const MoneyValueSchema: z.ZodObject<{ amount: z.ZodBigInt; currency: typeof CurrencySchema; decimals: z.ZodNumber }> = z.object({\n amount: z.bigint(),\n currency: CurrencySchema,\n decimals: z.number().int().min(0).max(18),\n});\n\n/**\n * @wildo_source:part:start zod.factories.money facet:layer:shared facet:family:schema-factory\n *\n * z_money() - Creates money schemas for financial amounts.\n *\n * Money values are stored as integers to avoid floating-point precision issues.\n * The schema creates an object with: { amount, currency, decimals }\n *\n * @example\n * ```typescript\n * import { z_money } from '@wildo-ai/zod-decorators';\n *\n * const price = z_money();\n * const fiatPrice = z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] });\n * const usdPrice = z_money({ allowCurrencyChange: false }).moneyUI({ edit: { defaultCurrency: 'USD' } });\n *\n * // With decorators (chainable)\n * z_money().moneyUI({ edit: { defaultCurrency: 'EUR' } })\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT_MAJOR] }).isHidden({ edit: true })\n * ```\n */\n\n/**\n * Creates a money schema with metadata for detection and form component rendering.\n *\n * @param options - Configuration options for money field\n * @returns A Zod object schema with metadata for money detection\n *\n * @example\n * ```typescript\n * // Simple money (all currencies)\n * const price = z_money();\n * // Infers: { amount: bigint, currency: string, decimals: number }\n *\n * // Fiat only (no crypto)\n * const fiatPrice = z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] });\n *\n * // Fixed currency with amount constraints\n * const usdPrice = z_money({\n * allowCurrencyChange: false,\n * minAmount: 0n,\n * maxAmount: 100000000n // $1,000,000.00 in cents\n * }).moneyUI({ edit: { defaultCurrency: 'USD' } });\n * ```\n */\nexport function createMoneySchema(\n options: MoneySchemaOptions = {}\n): DecoratedMoneySchema {\n const {\n currenciesAllowed,\n appEnabledOnly = true,\n allowCurrencyChange = true,\n minAmount,\n maxAmount,\n } = options;\n\n // Create the amount schema with optional min/max constraints\n // Using bigint for amount to avoid precision issues with large financial amounts\n let amountSchema = z.bigint();\n if (minAmount !== undefined) {\n amountSchema = amountSchema.min(minAmount);\n }\n if (maxAmount !== undefined) {\n amountSchema = amountSchema.max(maxAmount);\n }\n\n // Create the money object schema\n const moneySchema = z.object({\n amount: amountSchema,\n currency: CurrencySchema,\n decimals: z.number().int().min(0).max(18),\n });\n\n const moneyMetadata: MoneySchemaMetadata = {\n isMoney: true,\n ...(currenciesAllowed && currenciesAllowed.length > 0 && { currenciesAllowed }),\n appEnabledOnly,\n allowCurrencyChange,\n ...(minAmount !== undefined && { minAmount }),\n ...(maxAmount !== undefined && { maxAmount }),\n };\n\n // Initialize or extend SCHEMA_METADATA with money config\n const existingMetadata: CustomFieldMetadata = (moneySchema as any)[SCHEMA_METADATA] || {};\n (moneySchema as any)[SCHEMA_METADATA] = {\n ...existingMetadata,\n moneyConfig: moneyMetadata,\n };\n\n // Add chainable decorator methods to the money schema instance\n // This allows: z_money().moneyUI({ edit: { defaultCurrency: 'EUR' } }).isHidden()\n addChainableMethods(moneySchema);\n\n return moneySchema as DecoratedMoneySchema;\n}\n\n/**\n * Return type for money schemas - includes decorator methods.\n * Note: IS_FOREIGN_KEY is not applicable to money objects.\n * IS_DB_INDEXED will index internal fields (amount, currency) for query optimization.\n *\n * This type must list all decorators applicable to ZodObject (per ApplyableTypeAllTypes).\n * Missing entries here cause TS errors when chaining decorators on z_money() fields.\n */\nexport type DecoratedMoneySchema = z.ZodObject<{\n amount: z.ZodBigInt;\n currency: typeof CurrencySchema;\n decimals: z.ZodNumber;\n}> & {\n [ZodDecorator.IS_DB_INDEXED](): DecoratedMoneySchema;\n [ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedMoneySchema;\n [ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedMoneySchema;\n // Resource-level decorators (applicable to all types including ZodObject)\n [ZodDecorator.IS_SUMMARY_FIELD](params?: SummaryFieldParams): DecoratedMoneySchema;\n [ZodDecorator.IS_BACKEND_ONLY](params?: ZodDecorator_ParamsType[ZodDecorator.IS_BACKEND_ONLY]): DecoratedMoneySchema;\n [ZodDecorator.IS_WRITE_ONLY_SECRET](params?: ZodDecorator_ParamsType[ZodDecorator.IS_WRITE_ONLY_SECRET]): DecoratedMoneySchema;\n [ZodDecorator.EXCLUDE_FROM_CREATE](): DecoratedMoneySchema;\n [ZodDecorator.EXCLUDE_FROM_UPDATE](): DecoratedMoneySchema;\n addDecorators(decorators: DecoratorInput[]): DecoratedMoneySchema;\n};\n\n/**\n * Creates a money schema for financial amounts with integer storage.\n * Named z_money to indicate it's a Zod helper function exported standalone.\n *\n * Money values are stored as: { amount: int, currency: string, decimals: int }\n * - amount: Value in smallest unit (e.g., cents for USD, satoshis for BTC)\n * - currency: ISO 4217 code (e.g., 'USD', 'EUR', 'BTC')\n * - decimals: Decimal places for display conversion (e.g., 2 for USD, 8 for BTC)\n *\n * @example\n * ```typescript\n * import { z_money } from '@wildo-ai/zod-decorators';\n *\n * // Simple usage\n * z_money() // All currencies\n *\n * // With options\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] })\n * z_money({ allowCurrencyChange: false }).moneyUI({ edit: { defaultCurrency: 'USD' } })\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT_MAJOR], minAmount: 0n })\n *\n * // With decorators (chainable)\n * z_money().moneyUI({ edit: { defaultCurrency: 'USD' } })\n * z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] }).isHidden({ edit: true })\n *\n * // Usage example\n * const price: MoneyValue = { amount: 1999n, currency: 'USD', decimals: 2 };\n * // Represents $19.99\n * ```\n */\nexport function z_money(\n options?: MoneySchemaOptions\n): DecoratedMoneySchema {\n return createMoneySchema(options) as DecoratedMoneySchema;\n}\n/** @wildo_source:part:end zod.factories.money */\n\n// ============================================================================\n// MONEY UTILITY FUNCTIONS\n// ============================================================================\n\n/**\n * Why an amount could not be expressed in its currency's smallest unit.\n *\n * A named vocabulary rather than three bare strings, because each member has a DIFFERENT remedy and\n * an operator reading a sync log needs to know which one they are looking at: an unknown minor unit\n * is a catalogue problem, a precision loss is an authoring problem, and an unsafe magnitude is a\n * limit of the provider's own number type.\n */\nexport enum MoneyMinorUnitConversionFailure {\n /** The currency has no minor unit (`XDR`, `XXX`) or is not one this vocabulary knows. */\n UNKNOWN_MINOR_UNIT = 'unknown_minor_unit',\n /** Converting down would discard a fraction of the provider's smallest unit. */\n PRECISION_LOSS = 'precision_loss',\n /** The converted amount cannot be represented exactly as a JavaScript number. */\n UNSAFE_MAGNITUDE = 'unsafe_magnitude',\n}\n\n/** Thrown by {@link toCurrencyMinorUnitAmountOrThrow}; carries the reason so a caller can branch. */\nexport class MoneyMinorUnitConversionError extends Error {\n constructor(\n public readonly reason: MoneyMinorUnitConversionFailure,\n message: string,\n ) {\n super(message);\n this.name = 'MoneyMinorUnitConversionError';\n }\n}\n\n/**\n * Convert a {@link MoneyValue} to the amount a payment provider expects: an integer in the CURRENCY's\n * smallest unit.\n *\n * Wildo stores money at an AUTHORED scale (`decimals` on the value); a provider reads it at the\n * currency's own scale. Those are two different numbers whenever they disagree, and until 2026-09-08\n * the billing boundary sent the stored amount straight through — so a price authored at any scale\n * other than the currency's was charged at the wrong magnitude, by a factor of 10 per decimal place\n * of disagreement.\n *\n * **All arithmetic is `bigint`.** The stored amount already is one, and the whole reason it is a\n * bigint rather than a number is that money must not round; converting through a float to save a cast\n * would give that back at exactly the boundary where it costs money.\n *\n * **Scaling UP is always exact. Scaling DOWN refuses on a remainder rather than rounding** — a price\n * of 1.005 in a currency whose smallest unit is a cent is not 1.00 and not 1.01, it is a price the\n * provider cannot express, and silently picking one is how a catalogue and an invoice come to\n * disagree by a cent per unit forever.\n *\n * **Throws rather than returning a result union**, and the reason is the compiler rather than taste:\n * this repository compiles with `strict: false` (`engine/tsconfig.common.json`), which disables the\n * discriminant narrowing a `{ ok: true } | { ok: false }` result depends on — so every caller would\n * need a cast to read the failure, at every boundary. A typed error narrows by `instanceof`, which\n * works regardless. Callers that must not throw resolve the scale directly with\n * `currencyMinorUnitDecimals` and decide for themselves.\n *\n * @param subject what the message names (\"price p_1 tier 2 flat amount\"), so an operator reading a\n * sync log knows which amount could not be expressed without opening the catalogue.\n */\nexport function toCurrencyMinorUnitAmountOrThrow(value: MoneyValue, subject: string): number {\n const target = currencyMinorUnitDecimals(value.currency);\n if (target === undefined) {\n throw new MoneyMinorUnitConversionError(\n MoneyMinorUnitConversionFailure.UNKNOWN_MINOR_UNIT,\n `Cannot express ${subject} for a payment provider: currency '${value.currency}' has no minor unit this framework can resolve. Cryptocurrencies are in this position deliberately — their decimals are protocol conventions, not a fiat provider's minor unit.`,\n );\n }\n\n let converted: bigint;\n if (value.decimals === target) {\n converted = value.amount;\n } else if (value.decimals < target) {\n converted = value.amount * 10n ** BigInt(target - value.decimals);\n } else {\n const divisor = 10n ** BigInt(value.decimals - target);\n if (value.amount % divisor !== 0n) {\n throw new MoneyMinorUnitConversionError(\n MoneyMinorUnitConversionFailure.PRECISION_LOSS,\n `Cannot express ${subject} for a payment provider: amount ${value.amount} at scale ${value.decimals} cannot be written in ${value.currency}'s smallest unit (scale ${target}) without discarding a fraction of it. Author the amount at scale ${target}, or at a scale whose extra digits are zero.`,\n );\n }\n converted = value.amount / divisor;\n }\n\n const asNumber = Number(converted);\n if (!Number.isSafeInteger(asNumber)) {\n throw new MoneyMinorUnitConversionError(\n MoneyMinorUnitConversionFailure.UNSAFE_MAGNITUDE,\n `Cannot express ${subject} for a payment provider: amount ${converted} in ${value.currency}'s smallest unit exceeds the range a JavaScript number represents exactly, so handing it over would silently change its value.`,\n );\n }\n\n return asNumber;\n}\n\n/**\n * Convert a decimal amount to bigint representation.\n *\n * **Precision caveat:** This uses floating-point arithmetic internally\n * (`Math.round(decimalAmount * 10^decimals)`), which can produce rounding\n * errors for certain values. Prefer `parseDecimalStringToAmount` when working\n * with user input strings to avoid float precision issues entirely.\n *\n * @param decimalAmount - The decimal amount (e.g., 19.99)\n * @param decimals - Number of decimal places (e.g., 2)\n * @returns BigInt amount (e.g., 1999n)\n */\nexport function toMoneyAmount(decimalAmount: number, decimals: number): bigint {\n return BigInt(Math.round(decimalAmount * Math.pow(10, decimals)));\n}\n\n/**\n * Convert a bigint amount to decimal representation.\n * @param amount - The bigint amount (e.g., 1999n)\n * @param decimals - Number of decimal places (e.g., 2)\n * @returns Decimal amount (e.g., 19.99)\n */\nexport function fromMoneyAmount(amount: bigint, decimals: number): number {\n return Number(amount) / Math.pow(10, decimals);\n}\n\n/**\n * Convert a string or number to bigint safely.\n * Useful for parsing user input or JSON values.\n * @param value - String, number, or bigint to convert\n * @returns BigInt amount\n */\nexport function toBigIntAmount(value: string | number | bigint): bigint {\n if (typeof value === 'bigint') return value;\n if (typeof value === 'number') return BigInt(Math.round(value));\n return BigInt(value);\n}\n\n/**\n * Parse a decimal string directly to a bigint amount, avoiding floating-point\n * precision issues entirely.\n *\n * This is the preferred way to convert user input (e.g., from an HTML input\n * element) to a money amount. It works by splitting the string at the decimal\n * point and manipulating integer/fractional parts as strings, so no float\n * arithmetic is ever involved.\n *\n * - Extra fractional digits beyond `decimals` are **truncated** (not rounded).\n * - Missing fractional digits are **zero-padded**.\n *\n * @param input - A decimal string (e.g., \"19.99\", \"5\", \".50\", \"-12.345\")\n * @param decimals - Number of decimal places for the target currency\n * @returns BigInt amount, or `null` if the input is not a valid decimal string\n *\n * **Note:** Scientific notation strings (e.g., `\"1e+10\"`) are rejected (returns\n * `null`) since they are not valid monetary input. This is correct behavior when\n * reading from `<input type=\"number\">`, which may produce such strings for very\n * large values — those inputs should be constrained via `min`/`max` attributes.\n *\n * @example\n * ```typescript\n * parseDecimalStringToAmount(\"19.99\", 2) // → 1999n\n * parseDecimalStringToAmount(\"19.999\", 2) // → 1999n (truncates, not rounds)\n * parseDecimalStringToAmount(\"19.9\", 2) // → 1990n (pads missing decimals)\n * parseDecimalStringToAmount(\"5\", 2) // → 500n\n * parseDecimalStringToAmount(\".50\", 2) // → 50n\n * parseDecimalStringToAmount(\"-12.34\", 2) // → -1234n\n * parseDecimalStringToAmount(\"abc\", 2) // → null\n * parseDecimalStringToAmount(\"1e+10\", 2) // → null (scientific notation rejected)\n * ```\n */\nexport function parseDecimalStringToAmount(input: string, decimals: number): bigint | null {\n const trimmed = input.trim();\n if (trimmed === '' || trimmed === '.' || trimmed === '-' || trimmed === '-.') return null;\n\n // Handle sign\n const isNegative = trimmed.startsWith('-');\n const unsigned = isNegative ? trimmed.slice(1) : trimmed;\n\n // Validate: only digits and at most one decimal point\n if (!/^\\d*\\.?\\d*$/.test(unsigned)) return null;\n\n const dotIndex = unsigned.indexOf('.');\n const integerPart = dotIndex === -1 ? unsigned : (unsigned.slice(0, dotIndex) || '0');\n const fractionalRaw = dotIndex === -1 ? '' : unsigned.slice(dotIndex + 1);\n\n // Pad or truncate fractional part to exactly `decimals` digits\n const fractionalPart = decimals === 0\n ? ''\n : fractionalRaw.padEnd(decimals, '0').slice(0, decimals);\n\n // Build the combined string and convert to bigint\n const combined = integerPart + fractionalPart;\n // Guard against empty combined (shouldn't happen after validation, but be safe)\n if (combined === '') return 0n;\n\n try {\n const result = BigInt(combined);\n return isNegative ? -result : result;\n } catch {\n return null;\n }\n}\n\n/**\n * Convert a money amount from one decimal precision to another using pure\n * bigint arithmetic (no floating-point involved).\n *\n * Use this when changing a currency (which may have different decimal places)\n * instead of the float roundtrip `fromMoneyAmount` → `toMoneyAmount`.\n *\n * - When increasing decimals (e.g., 2 → 8): multiplies by 10^(diff)\n * - When decreasing decimals (e.g., 8 → 2): divides with half-away-from-zero rounding\n *\n * @param amount - The bigint amount in the source precision\n * @param fromDecimals - Source decimal places\n * @param toDecimals - Target decimal places\n * @returns BigInt amount in the target precision\n *\n * @example\n * ```typescript\n * convertMoneyDecimals(1999n, 2, 2) // → 1999n (same decimals, no-op)\n * convertMoneyDecimals(1999n, 2, 4) // → 199900n (scale up)\n * convertMoneyDecimals(199900n, 4, 2) // → 1999n (scale down)\n * convertMoneyDecimals(12345678n, 8, 2) // → 12n (BTC satoshis to 2-decimal)\n * ```\n */\nexport function convertMoneyDecimals(amount: bigint, fromDecimals: number, toDecimals: number): bigint {\n if (fromDecimals === toDecimals) return amount;\n\n const diff = toDecimals - fromDecimals;\n\n if (diff > 0) {\n // Scale up: multiply\n return amount * (10n ** BigInt(diff));\n }\n\n // Scale down: divide with rounding (half-away-from-zero)\n const divisor = 10n ** BigInt(-diff);\n const isNegative = amount < 0n;\n const absAmount = isNegative ? -amount : amount;\n const rounded = (absAmount + divisor / 2n) / divisor;\n return isNegative ? -rounded : rounded;\n}\n\n/**\n * Format a money value for display.\n * @param money - The money value\n * @param options - Formatting options\n * @returns Formatted string (e.g., \"$19.99\" or \"19.99 USD\")\n */\nexport function formatMoney(\n money: MoneyValue,\n options: {\n showSymbol?: boolean;\n symbolPosition?: 'before' | 'after';\n thousandsSeparator?: string;\n decimalSeparator?: string;\n } = {}\n): string {\n const {\n showSymbol = true,\n symbolPosition = 'before',\n thousandsSeparator = ',',\n decimalSeparator = '.',\n } = options;\n\n const decimalValue = fromMoneyAmount(money.amount, money.decimals);\n\n // Format with proper decimal places\n const [integerPart, decimalPart] = decimalValue.toFixed(money.decimals).split('.');\n\n // Add thousands separator\n const formattedInteger = integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n\n const formattedNumber = decimalPart\n ? `${formattedInteger}${decimalSeparator}${decimalPart}`\n : formattedInteger;\n\n if (!showSymbol) {\n return formattedNumber;\n }\n\n // For now, use currency code as symbol (can be enhanced with CURRENCY_INFO_MAP)\n const symbol = money.currency;\n\n return symbolPosition === 'before'\n ? `${symbol} ${formattedNumber}`\n : `${formattedNumber} ${symbol}`;\n}\n\n"]}
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { ArrayUIParams, BigDecimalUIParams, BooleanUIParams, CodeUIParams, DateUIParams, DateTimeUIParams, DurationUIParams, EnumUIParams, FileUIParams, ForeignKeyUIParams, MoneyUIParams, NumberUIParams, ObjectUIParams, PhoneUIParams, StringUIParams, TimeUIParams, PrimitiveUIBaseEditParams, PrimitiveUIBaseDisplayParams } from './zod-decorators.types';
3
+ import { BooleanEditMode, EnumEditMode, NumberEditMode, StringEditMode } from './zod-decorators.types';
3
4
  import { BackendOnlyFieldParams, BusinessKeySetParams, WriteOnlySecretFieldParams, BigDecimalSchemaMetadata, DurationSchemaMetadata, CodeSchemaMetadata, DiscriminatorFieldParams, FileSchemaMetadata, ForeignKeyStructuralParams, ForeignKeyUIDisplayParams, MoneySchemaMetadata, CustomFieldMetadata, FieldSchemaType, FormFieldComponent, HiddenFieldParams, NotEditableFieldParams, OtpFieldParams, PhoneSchemaMetadata, PolymorphicFkVariant, RagSourceConfiguration, RangeConstraintValue, RangeSchemaMetadata, RangeType, SerializableZodSchema, SummaryFieldParams, VersionedForeignKeySchemaMetadata, VersionedSchemaMetadata, ZodDecorator, UniqueFieldParams, VirtualFieldParams, TtlFieldParams, ShowWhenParams } from './zod-decorators.types';
4
5
  export declare function hasZodInternals(schema: unknown): schema is {
5
6
  def: {
@@ -265,6 +266,20 @@ export declare function getZodObjectShape(schema: z.ZodTypeAny): Record<string,
265
266
  * Returns `{}` for non-object, non-union schemas.
266
267
  */
267
268
  export declare function getMergedObjectOrUnionShape(schema: z.ZodTypeAny): Record<string, z.ZodTypeAny>;
269
+ /**
270
+ * Resolve the ONE variant of a discriminated union that a given value belongs to.
271
+ *
272
+ * Distinct from {@link getMergedObjectOrUnionShape}, and the difference is the point: merging every
273
+ * variant answers "what fields COULD this union carry", which is what a schema-only caller (a
274
+ * validator, a drift check) needs. A caller holding a VALUE can do better — the discriminator says
275
+ * which variant this is, so the shape can be exactly that variant's, with no fields belonging to
276
+ * the alternatives the value did not choose.
277
+ *
278
+ * Returns `null` when the schema is not a discriminated union, when the value carries no
279
+ * discriminator, or when no variant matches it — all three are "this caller cannot narrow", and a
280
+ * caller that renders should say nothing rather than guess a variant.
281
+ */
282
+ export declare function resolveDiscriminatedUnionVariant(schema: z.ZodTypeAny, value: unknown): z.ZodTypeAny | null;
268
283
  export declare function getZodDef(schema: z.ZodTypeAny): {
269
284
  type: string;
270
285
  [key: string]: unknown;
@@ -911,6 +926,18 @@ export declare function shouldHideField(schema: z.ZodTypeAny, context?: {
911
926
  operation?: string;
912
927
  }): boolean;
913
928
  export declare function isFormInput(schema: z.ZodTypeAny): boolean;
929
+ /**
930
+ * Does the author declare TEXTAREA on the CROSS-CUTTING `edit.component` axis?
931
+ *
932
+ * This is a question about the DECLARATION, not about what the field renders
933
+ * as, and the distinction is load-bearing: a field declaring the per-type
934
+ * `edit.editMode: TEXTAREA` edits as a textarea and this predicate answers
935
+ * `false` for it. Asking this when you meant the rendering question is exactly
936
+ * how the inline editor came to bind Enter as "save" inside a textarea.
937
+ *
938
+ * For "does this field edit into a multi-line control", ask
939
+ * `isMultilineEditField`, which resolves both axes.
940
+ */
914
941
  export declare function isFormTextarea(schema: z.ZodTypeAny): boolean;
915
942
  export declare function isFormSelect(schema: z.ZodTypeAny): boolean;
916
943
  export declare function isFormRadioGroup(schema: z.ZodTypeAny): boolean;
@@ -919,6 +946,22 @@ export declare function isFormCheckboxGroup(schema: z.ZodTypeAny): boolean;
919
946
  export declare function isFormSwitch(schema: z.ZodTypeAny): boolean;
920
947
  export declare function isFormSlider(schema: z.ZodTypeAny): boolean;
921
948
  export declare function isFormDate(schema: z.ZodTypeAny): boolean;
949
+ /** Resolve the shape a string field edits as, honoring both edit axes. */
950
+ export declare function resolveStringEditMode(schema: z.ZodTypeAny): StringEditMode;
951
+ /** Resolve the shape a boolean field edits as, honoring both edit axes. */
952
+ export declare function resolveBooleanEditMode(schema: z.ZodTypeAny): BooleanEditMode;
953
+ /** Resolve the shape an enum field edits as, honoring both edit axes. */
954
+ export declare function resolveEnumEditMode(schema: z.ZodTypeAny): EnumEditMode;
955
+ /** Resolve the shape a number field edits as, honoring both edit axes. */
956
+ export declare function resolveNumberEditMode(schema: z.ZodTypeAny): NumberEditMode;
957
+ /**
958
+ * Does this field edit into a control where Enter inserts a newline rather than
959
+ * submitting? Asked by the inline editor to decide its Enter binding, and the
960
+ * reason it must go through the resolver: the answer is true whether the author
961
+ * declared `editMode: TEXTAREA` or `component: TEXTAREA`, and `isFormTextarea`
962
+ * only ever saw the second.
963
+ */
964
+ export declare function isMultilineEditField(schema: z.ZodTypeAny): boolean;
922
965
  /**
923
966
  * Get the hidden field metadata from schema decorator.
924
967
  * Returns undefined if no hidden decorator is set.
@@ -1 +1 @@
1
- {"version":3,"file":"zod-utils.shared.d.ts","sourceRoot":"","sources":["../../../src/zod-utils.shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAChE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAC9D,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAC/D,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EACpC,yBAAyB,EAAE,4BAA4B,EAC/E,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAuB,sBAAsB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,wBAAwB,EAC9H,sBAAsB,EAAE,kBAAkB,EAAoC,wBAAwB,EAAwB,kBAAkB,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,mBAAmB,EAAkB,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAA4B,sBAAsB,EAAE,cAAc,EAAE,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,GAAG,OAAO,CAE7D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,aAAa,GAAG,SAAS,CAE1E;AACD,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,OAAO,CAExD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,cAAc,GAAG,SAAS,CAE5E;AACD,wBAAgB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,OAAO,CAEzD"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { StringEditMode } from './zod-decorators.types.js';
2
+ import { BooleanEditMode, EnumEditMode, NumberEditMode, StringEditMode } from './zod-decorators.types.js';
3
3
  import { DEFAULT_FOREIGN_KEY_DISPLAY_MODE, FileGenerationSource, FieldSchemaType, FormFieldComponent, RangeType, SCHEMA_METADATA, ZodDecorator } from './zod-decorators.types.js';
4
4
  import { z_range } from './zod-range.js';
5
5
  import { addDecorators, getMetadataRecursive } from './zod.module-override.js';
@@ -720,6 +720,49 @@ export function getMergedObjectOrUnionShape(schema) {
720
720
  }
721
721
  return {};
722
722
  }
723
+ /**
724
+ * Resolve the ONE variant of a discriminated union that a given value belongs to.
725
+ *
726
+ * Distinct from {@link getMergedObjectOrUnionShape}, and the difference is the point: merging every
727
+ * variant answers "what fields COULD this union carry", which is what a schema-only caller (a
728
+ * validator, a drift check) needs. A caller holding a VALUE can do better — the discriminator says
729
+ * which variant this is, so the shape can be exactly that variant's, with no fields belonging to
730
+ * the alternatives the value did not choose.
731
+ *
732
+ * Returns `null` when the schema is not a discriminated union, when the value carries no
733
+ * discriminator, or when no variant matches it — all three are "this caller cannot narrow", and a
734
+ * caller that renders should say nothing rather than guess a variant.
735
+ */
736
+ export function resolveDiscriminatedUnionVariant(schema, value) {
737
+ if (!isDiscriminatedUnion(schema))
738
+ return null;
739
+ if (typeof value !== 'object' || value === null)
740
+ return null;
741
+ const discriminator = getZodDefStringProperty(schema, 'discriminator');
742
+ if (!discriminator)
743
+ return null;
744
+ const discriminatorValue = value[discriminator];
745
+ if (discriminatorValue === undefined)
746
+ return null;
747
+ const options = (getZodDefArrayProperty(schema, 'options') ?? []);
748
+ for (const option of options) {
749
+ if (!isZodObject(option))
750
+ continue;
751
+ const optionShape = getZodObjectShape(option);
752
+ const discriminatorSchema = optionShape[discriminator];
753
+ if (!discriminatorSchema)
754
+ continue;
755
+ /*
756
+ * A variant's discriminator is a LITERAL (`z.literal(ICPArchetype.LEGAL_ENTITY)`), whose value
757
+ * Zod 4 stores as an array under `values` — the same shape `getEnumValues` reads for the
758
+ * literal case. Comparing against that is what makes the match exact rather than structural.
759
+ */
760
+ const literalValues = getZodDefArrayProperty(discriminatorSchema, 'values') ?? [];
761
+ if (literalValues.includes(discriminatorValue))
762
+ return option;
763
+ }
764
+ return null;
765
+ }
723
766
  export function getZodDef(schema) {
724
767
  if (!hasZodInternals(schema))
725
768
  return undefined;
@@ -2365,6 +2408,18 @@ export function shouldHideField(schema, context) {
2365
2408
  export function isFormInput(schema) {
2366
2409
  return getFormFieldComponent(schema) === FormFieldComponent.INPUT;
2367
2410
  }
2411
+ /**
2412
+ * Does the author declare TEXTAREA on the CROSS-CUTTING `edit.component` axis?
2413
+ *
2414
+ * This is a question about the DECLARATION, not about what the field renders
2415
+ * as, and the distinction is load-bearing: a field declaring the per-type
2416
+ * `edit.editMode: TEXTAREA` edits as a textarea and this predicate answers
2417
+ * `false` for it. Asking this when you meant the rendering question is exactly
2418
+ * how the inline editor came to bind Enter as "save" inside a textarea.
2419
+ *
2420
+ * For "does this field edit into a multi-line control", ask
2421
+ * `isMultilineEditField`, which resolves both axes.
2422
+ */
2368
2423
  export function isFormTextarea(schema) {
2369
2424
  return getFormFieldComponent(schema) === FormFieldComponent.TEXTAREA;
2370
2425
  }
@@ -2389,6 +2444,97 @@ export function isFormSlider(schema) {
2389
2444
  export function isFormDate(schema) {
2390
2445
  return getFormFieldComponent(schema) === FormFieldComponent.DATE;
2391
2446
  }
2447
+ // -----------------------------------------------------------------------------
2448
+ // EDIT-MODE RESOLUTION — the ONE reconciliation of the two edit axes
2449
+ // -----------------------------------------------------------------------------
2450
+ //
2451
+ // A field's editing shape is declared on TWO axes and they overlap:
2452
+ //
2453
+ // `{primitive}UI.edit.editMode` — per-type, closed per type (`StringEditMode`
2454
+ // cannot name a slider), read by every
2455
+ // `FormField{Type}` component;
2456
+ // `{primitive}UI.edit.component` — cross-cutting `FormFieldComponent`, one
2457
+ // vocabulary spanning every type.
2458
+ //
2459
+ // Neither half of the system used to read both, so whichever axis an author
2460
+ // picked, something was wrong: the RENDER path (`FormFieldString` and its
2461
+ // siblings) read only `editMode`, so an authored `component: TEXTAREA` rendered
2462
+ // a single-line input — live on six declarations, including the engine's own
2463
+ // billing presets. The INLINE-EDIT keyboard path (`DisplayFieldEditable`) read
2464
+ // only `component` through `isFormTextarea`, so a field that correctly declares
2465
+ // `editMode: TEXTAREA` was treated as single-line and Enter saved instead of
2466
+ // inserting a newline.
2467
+ //
2468
+ // These resolvers are that one source. Precedence is the contract already
2469
+ // written on `PrimitiveUIBaseEditParams.component` — "Type-specific `editMode`
2470
+ // takes precedence" — so the per-type axis wins and the cross-cutting one is
2471
+ // the fallback rather than a competitor.
2472
+ //
2473
+ // Only members that name the SAME control on both sides are mapped. A
2474
+ // `FormFieldComponent` member with no counterpart (`TOGGLE`-less booleans,
2475
+ // `COLOR`/`PASSWORD`/`OTP`/`MARKDOWN` strings) simply has no mapping, and
2476
+ // `CHECKBOX_GROUP` is deliberately absent: it is an ARRAY-of-enum control
2477
+ // reached through `AutomatedArrayField`, never through `FormFieldEnum`, so
2478
+ // mapping it to an enum edit mode would claim a route that does not exist.
2479
+ const STRING_EDIT_MODE_BY_FORM_COMPONENT = {
2480
+ [FormFieldComponent.INPUT]: StringEditMode.INPUT,
2481
+ [FormFieldComponent.TEXTAREA]: StringEditMode.TEXTAREA,
2482
+ };
2483
+ const BOOLEAN_EDIT_MODE_BY_FORM_COMPONENT = {
2484
+ [FormFieldComponent.CHECKBOX]: BooleanEditMode.CHECKBOX,
2485
+ [FormFieldComponent.SWITCH]: BooleanEditMode.SWITCH,
2486
+ [FormFieldComponent.RADIO_GROUP]: BooleanEditMode.RADIO,
2487
+ };
2488
+ const ENUM_EDIT_MODE_BY_FORM_COMPONENT = {
2489
+ [FormFieldComponent.SELECT]: EnumEditMode.SELECT,
2490
+ [FormFieldComponent.RADIO_GROUP]: EnumEditMode.RADIO,
2491
+ };
2492
+ const NUMBER_EDIT_MODE_BY_FORM_COMPONENT = {
2493
+ [FormFieldComponent.INPUT]: NumberEditMode.INPUT,
2494
+ [FormFieldComponent.SLIDER]: NumberEditMode.SLIDER,
2495
+ };
2496
+ /** Resolve the shape a string field edits as, honoring both edit axes. */
2497
+ export function resolveStringEditMode(schema) {
2498
+ const declared = getStringUI(schema)?.edit?.editMode;
2499
+ if (declared !== undefined)
2500
+ return declared;
2501
+ const component = getFormFieldComponent(schema);
2502
+ return (component !== undefined ? STRING_EDIT_MODE_BY_FORM_COMPONENT[component] : undefined) ?? StringEditMode.INPUT;
2503
+ }
2504
+ /** Resolve the shape a boolean field edits as, honoring both edit axes. */
2505
+ export function resolveBooleanEditMode(schema) {
2506
+ const declared = getBooleanUI(schema)?.edit?.editMode;
2507
+ if (declared !== undefined)
2508
+ return declared;
2509
+ const component = getFormFieldComponent(schema);
2510
+ return (component !== undefined ? BOOLEAN_EDIT_MODE_BY_FORM_COMPONENT[component] : undefined) ?? BooleanEditMode.SWITCH;
2511
+ }
2512
+ /** Resolve the shape an enum field edits as, honoring both edit axes. */
2513
+ export function resolveEnumEditMode(schema) {
2514
+ const declared = getEnumUI(schema)?.edit?.editMode;
2515
+ if (declared !== undefined)
2516
+ return declared;
2517
+ const component = getFormFieldComponent(schema);
2518
+ return (component !== undefined ? ENUM_EDIT_MODE_BY_FORM_COMPONENT[component] : undefined) ?? EnumEditMode.SELECT;
2519
+ }
2520
+ /** Resolve the shape a number field edits as, honoring both edit axes. */
2521
+ export function resolveNumberEditMode(schema) {
2522
+ const declared = getNumberUI(schema)?.edit?.editMode;
2523
+ if (declared !== undefined)
2524
+ return declared;
2525
+ const component = getFormFieldComponent(schema);
2526
+ return (component !== undefined ? NUMBER_EDIT_MODE_BY_FORM_COMPONENT[component] : undefined) ?? NumberEditMode.INPUT;
2527
+ }
2528
+ /**
2529
+ * Does this field edit into a control where Enter inserts a newline rather than
2530
+ * submitting? Asked by the inline editor to decide its Enter binding, and the
2531
+ * reason it must go through the resolver: the answer is true whether the author
2532
+ * declared `editMode: TEXTAREA` or `component: TEXTAREA`, and `isFormTextarea`
2533
+ * only ever saw the second.
2534
+ */
2535
+ export function isMultilineEditField(schema) {
2536
+ return resolveStringEditMode(schema) === StringEditMode.TEXTAREA;
2537
+ }
2392
2538
  // =============================================================================
2393
2539
  // HIDDEN FIELD DECORATOR UTILITIES
2394
2540
  // =============================================================================