@wildo-ai/zod-decorators 1.1.5 → 1.1.6

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.
@@ -0,0 +1 @@
1
+ {"version":"7.0.2","root":[58,[139,143],[145,148],[151,152],[155,167]],"packageJsons":["../../../package.json","../../../../../node_modules/.pnpm/@types+big.js@6.2.2/node_modules/@types/big.js/package.json","../../../../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/package.json","../../../../../node_modules/.pnpm/big.js@6.2.2/node_modules/big.js/package.json","../../../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/package.json","../../../../../node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/package.json","../../../../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/package.json","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/package.json","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/package.json","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/package.json","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/package.json"],"missingPackageJsons":["../../../node_modules/react/package.json","../../../../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/package.json","../../../../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/src/package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../../src/commons.ts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ar.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/az.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/be.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/bg.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ca.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/cs.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/da.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/de.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/en.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/eo.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/es.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fa.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fi.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr-ca.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/he.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hu.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hy.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/id.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/is.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/it.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ja.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ka.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/kh.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/km.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ko.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/lt.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/mk.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ms.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/nl.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/no.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ota.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ps.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pl.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pt.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ru.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sl.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sv.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ta.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/th.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/tr.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ua.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uk.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ur.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uz.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/vi.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-cn.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-tw.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/yo.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/index.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-generator.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/index.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/checks.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/compat.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/coerce.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.d.cts","../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.d.cts","../../../../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/global.d.ts","../../../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/index.d.ts","../../../src/currencies.shared.schemas.ts","../../../src/zod-color.ts","../../../src/zod-decorators.types.ts","../../../src/zod.module-override.ts","../../../src/install-bigint-json-encoding.ts","../../../../../node_modules/.pnpm/@types+big.js@6.2.2/node_modules/@types/big.js/index.d.ts","../../../src/zod-bigdecimal.ts","../../../src/zod-money.ts","../../../src/zod-range.ts","../../../src/zod-duration.ts","../../../../../node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/types.d.ts","../../../../../node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/index.d.ts","../../../src/zod-phone.ts","../../../src/zod-code.ts","../../../../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/src/mime.d.ts","../../../../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/src/index.d.ts","../../../src/files/extension-nature-map.ts","../../../src/files/mime-registry.ts","../../../src/files/agent-file-formats.ts","../../../src/files/unified-registry.ts","../../../src/zod-file.ts","../../../src/zod-versioned.ts","../../../src/zod-utils.shared.ts","../../../src/files/file-extensions.enum.ts","../../../src/index.ts","../../../src/companion-exports.ts","../../../src/testing/decorated-test-schemas.ts","../../../src/testing.ts","../../../src/__mocks__/mime.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4198e3857da730698977b55f7ddbba51","signature":"ac146b1660215f2fb0c9f5c01d356326","impliedNodeFormat":1},"5f3c015bce4302b247acedb9ec20e302","a9fe29dcdd4288cacf574947747a4572","daada721cfdc43aa8e7c2e2d14d760de","c4d7f2ab9358166b1815281a9e767232","2af86ade36e4051944f46da0fd1df525","90eb781c9a8145090ce17290f0744bb6","a3ddf6412484d665d76145ba7fa319a8","b53e5eafe089103ad7be4f243fb517d4","344aa18a1a1f48b6d51fa564e2910864","ffd8c3d2e39447925561777d1ebcdc02","2b76267afeb2e83dff758e3fba2faa8a","662eae47724ed2ca873fb608034d0645","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","360c84ef5634445ed4b1111f041b6212","a21f1b172546b6a64cc7ddea394b54ea","937e86ab76f06c8dbd613be6555c03b6","8bdf05c98551836db89f23d60d176f56","5b3f18777c97e7ed444a39661c4462ba","cd3b63580b271a0e93649c0d92a1b098","1cc59f020b9d62d875bdb28a6e2f745b","a06c5977df8ff3f289f16a7505c8d539","652a1f711ddcd6149df9fc04c2d77ec7","f04158c558df8c51d46a1fb44c832c1c","d1ab6402ad42100de1cf3f5d15aa9d27","96b06af537c71de0a80e9ed880958afd","dec40354e62d8ca81f5996c1760bc6da","a9356de7c324c6f49c15587032b1f65f","9db07004a5d271a5a4c3f499ed8a033f","ec7a3f5e189221b1a18bed55a592c89d",{"version":"086b8ccc1aa2a8df8144951e6a412a39","affectsGlobalScope":true,"impliedNodeFormat":1},"8244c8f803a86fcac606483469eb85c3","efe6aa145e7328bfc4dd54be3ebcf52e",{"version":"c44f99b03ed546f887bd9d2943eec90d","signature":"5815f1171045a4391bed5a3c853547e6","impliedNodeFormat":1},{"version":"67f11ae89eccb2f5824d3a68f2c6988e","signature":"615ef87a7526c7a7a36749bc58ff4716","impliedNodeFormat":1},{"version":"1abefebcfbe82a0d6a0b32d5d400a4b3","signature":"d32ea4d58c26af638b5515b4a78aec46","impliedNodeFormat":1},{"version":"f2af348cfe507c29a4611416dc2c5de3","signature":"4516c4c520b37c37ad0caa0e40879e91","impliedNodeFormat":1},{"version":"b32652cd336580b381e809a4f8e1a914","signature":"13ee41ace368f41ecf457bfca0038632","affectsGlobalScope":true,"impliedNodeFormat":1},"7dc6efc60bb971bba59f623cda688213",{"version":"4bd1751cd74ee274edc7c947ab9b2530","signature":"2780262233e0896a27a7da2243b509aa","impliedNodeFormat":1},{"version":"91e93ad7e0949d71462d503567454938","signature":"0869061a44bcd468981513bf1fc7e901","impliedNodeFormat":1},{"version":"a11c8b005bb7c425fc6996b2eee1c6d1","signature":"41195c7ff1ade854a8f6dbc83769bf1c","impliedNodeFormat":1},{"version":"245437b3862d4ff8338a9a88850cce88","signature":"4121573c6bbdd24d8f2f2d937f107dfd","impliedNodeFormat":1},{"version":"bdaa75ac54a83722c18997f9befd01da","impliedNodeFormat":99},{"version":"09fc61a57daef719c687ec24c63f7c8e","impliedNodeFormat":99},{"version":"ffeaa5c1d80e64dab7daf991ef67c96a","signature":"81005fa8e4c1667fedd2473dcd6a85be","impliedNodeFormat":1},{"version":"ebe718b9fa9962e8d897c345f626c8d8","signature":"355aed4b368e8651fa925343b0e1bf01","impliedNodeFormat":1},{"version":"1947274af4905ae4769af4655871944e","impliedNodeFormat":99},{"version":"0718785ea4d71fa50c7fbaa0613105c1","impliedNodeFormat":99},{"version":"549f83cd27be46d9735976ed28483f17","signature":"06163da8f2a31ca766c0618e936e5774","impliedNodeFormat":1},{"version":"dcfcf65aa370b5167165d43ebd5bb661","signature":"e5b9d2003f2b150d664cd2fb8934486f","impliedNodeFormat":1},{"version":"587a36a708b897b2657bc908d274d52b","signature":"93103581cc81ac2008a0e0b9e537b2d3","impliedNodeFormat":1},{"version":"26ac0514f4fa35740b453fe86a54512b","signature":"b358d1d55bcd79637be28f1c41052e80","impliedNodeFormat":1},{"version":"5cd03d73f5b9afc676a599218171022e","signature":"ceed3dba89c9d0e5fe06dce5c134f6a9","impliedNodeFormat":1},{"version":"e646e4093fc2e322ffc395d9fa4547eb","signature":"64a9ecc726819b5a3b3c8b0fd9255191","impliedNodeFormat":1},{"version":"0bec7504765c6aa454aa8dda50bc8ead","signature":"7c73de82c6b8a231349233136a0ee33a","impliedNodeFormat":1},{"version":"e5bb38ddc85b15ff58e1e23b96903ce4","signature":"ccaf4c054a90098106e2f718e9d3fc00","impliedNodeFormat":1},{"version":"a5ee7075ccf5dfb855d586ad5245fe7a","signature":"a7808418ba0f28cdb32ab2db35ae5973","impliedNodeFormat":1},"226129d3e590c9d598a602a99243ca62",{"version":"1b4c05f6780438c54975736afcdd8f15","signature":"73156f94b72bc4d8f992ec39e4108585","impliedNodeFormat":1},"8e323cab1ca1f37efd17d3565a3b5a4c",{"version":"980ca7ea00bb6a98837d7e94a097607b","signature":"30ab182c4a613f022a19de7932c6aac5","impliedNodeFormat":1}],"fileIdsList":[[163],[135,142],[154],[141],[141,154,155],[141,156,157],[58,135,139,140,141,142,143,145,146,147,148,151,152,155,156,157,158,159,160,161,162],[165],[135,141,142,144],[135,141,142],[58,135,138,139,140,142],[135,141,142,158],[135,139,141,142],[135,141,142,150],[135,141,142,145,146],[135,141,142,147],[135,141],[136,137],[149],[153],[134],[125],[125,128],[120,123,125,126,127,128,129,130,131,132,133],[59,61,128],[125,126],[60,125,127],[61,63,65,66,67,68],[63,65,67,68],[63,65,67],[60,63,65,66,68],[59,61,62,63,64,65,66,67,68,69,70,120,121,122,123,124],[59,61,62,65],[61,62,65],[65,68],[59,60,62,63,64,66,67,68],[59,60,61,65,125],[65,66,67,68],[67],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119]],"options":{"composite":true,"emitDecoratorMetadata":true,"declaration":true,"declarationDir":"./","declarationMap":true,"experimentalDecorators":true,"module":200,"noImplicitAny":false,"noEmitOnError":true,"noUnusedLocals":false,"noUnusedParameters":false,"noUncheckedSideEffectImports":true,"outDir":"./","rootDir":"../../../src","skipLibCheck":true,"strict":false,"sourceMap":true,"target":9,"tsBuildInfoFile":"./.native.tsbuildinfo","verbatimModuleSyntax":false,"allowSyntheticDefaultImports":true,"esModuleInterop":true},"referencedMap":[[164,1],[139,2],[157,3],[155,4],[156,5],[158,6],[163,7],[166,8],[165,2],[145,9],[152,10],[140,2],[141,11],[148,10],[159,12],[146,13],[151,14],[147,15],[161,16],[160,10],[142,17],[138,18],[150,19],[154,20],[135,21],[129,22],[133,23],[130,23],[126,22],[134,24],[131,25],[132,23],[127,26],[128,27],[122,28],[66,29],[68,30],[67,31],[125,32],[124,33],[123,34],[69,29],[61,35],[65,36],[62,37],[63,38],[71,39],[72,39],[73,39],[74,39],[75,39],[76,39],[77,39],[78,39],[79,39],[80,39],[81,39],[82,39],[83,39],[85,39],[84,39],[86,39],[87,39],[88,39],[89,39],[120,40],[90,39],[91,39],[92,39],[93,39],[94,39],[95,39],[96,39],[97,39],[98,39],[99,39],[100,39],[101,39],[102,39],[104,39],[103,39],[105,39],[106,39],[107,39],[108,39],[109,39],[110,39],[111,39],[112,39],[113,39],[114,39],[115,39],[116,39],[119,39],[117,39],[118,39]],"latestChangedDtsFile":"./__mocks__/mime.d.ts"}
@@ -50,8 +50,8 @@ export function normalizeAddressCountry(value) {
50
50
  return value.trim().toUpperCase();
51
51
  }
52
52
  export const AddressCoordinatesSchema = z.object({
53
- latitude: z.number().min(-90).max(90),
54
- longitude: z.number().min(-180).max(180),
53
+ latitude: z.number().min(-90).max(90).describe('Latitude in decimal degrees, from -90 to 90.'),
54
+ longitude: z.number().min(-180).max(180).describe('Longitude in decimal degrees, from -180 to 180.'),
55
55
  });
56
56
  /**
57
57
  * A key under which two SPELLINGS of one address compare equal.
@@ -143,13 +143,13 @@ export function createAddressSchema(options = {}) {
143
143
  });
144
144
  }
145
145
  const addressSchema = z.object({
146
- line1: text().min(1, { error: 'Address line 1 is required' }).max(100),
147
- line2: text().max(100).optional(),
148
- city: text().min(1, { error: 'City is required' }).max(50),
149
- state: text().max(50).optional(),
150
- postalCode: text().max(20).optional(),
151
- country,
152
- coordinates: AddressCoordinatesSchema.optional(),
146
+ line1: text().min(1, { error: 'Address line 1 is required' }).max(100).describe("The first line of the street address."),
147
+ line2: text().max(100).optional().describe("The second line of the street address, when there is one."),
148
+ city: text().min(1, { error: 'City is required' }).max(50).describe("The city or locality."),
149
+ state: text().max(50).optional().describe("The region, state, province or county: whatever the country calls its first subdivision."),
150
+ postalCode: text().max(20).optional().describe("The postal code, when the country issues one."),
151
+ country: country.describe("The country, as an ISO 3166-1 alpha-2 code in upper case."),
152
+ coordinates: AddressCoordinatesSchema.optional().describe("An optional geocode. It does not take part in comparing two addresses."),
153
153
  });
154
154
  const addressMetadata = {
155
155
  isAddress: true,
@@ -1 +1 @@
1
- {"version":3,"file":"zod-address.js","sourceRoot":"","sources":["../../../src/zod-address.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E,OAAO,EAKL,eAAe,EAEf,YAAY,GAEb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA8B5D;;;GAGG;AACH,MA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UAAU,SAAS,CAAC,OAA8B;IACtD,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AACD,mDAAmD","sourcesContent":["// ============================================================================\n// ADDRESS SCHEMA HELPER (#561)\n// ============================================================================\n\nimport {\n AddressSchemaMetadata,\n AddressSchemaOptions,\n CustomFieldMetadata,\n DecoratorInput,\n SCHEMA_METADATA,\n SummaryFieldParams,\n ZodDecorator,\n ZodDecorator_ParamsType,\n} from './zod-decorators.types';\nimport { z } from 'zod';\nimport { addChainableMethods } from './zod.module-override';\n\n/** A point on the globe, in decimal degrees. */\nexport interface AddressCoordinates {\n /** -90 (south pole) to 90 (north pole). */\n latitude: number;\n /** -180 to 180. */\n longitude: number;\n}\n\n/**\n * A structured postal address.\n *\n * The part names are the ones the framework's existing `AddressSchema` already uses (organisation\n * profiles), so an application meets ONE address vocabulary rather than two. `postalCode` is optional\n * because not every country issues one.\n */\nexport interface AddressValue {\n line1: string;\n line2?: string;\n city: string;\n /** Region, state, province or county — whatever the country calls its first subdivision. */\n state?: string;\n postalCode?: string;\n /** ISO 3166-1 alpha-2, stored uppercase. */\n country: string;\n /** An optional geocode. It does NOT take part in identity — see {@link addressComparisonKey}. */\n coordinates?: AddressCoordinates;\n}\n\n/**\n * The parts of an address value, named once so the factory, the form control and the error routing\n * agree. Each member's value is the key it has in {@link AddressValue}.\n */\nexport enum AddressPart {\n /** Street and number. Required. */\n LINE1 = 'line1',\n /** Building, floor, apartment. Optional. */\n LINE2 = 'line2',\n /** Town or city. Required. */\n CITY = 'city',\n /** The country's first subdivision (state, province, region, county). Optional. */\n STATE = 'state',\n /** Optional because not every country issues one. */\n POSTAL_CODE = 'postalCode',\n /** ISO 3166-1 alpha-2. Required. */\n COUNTRY = 'country',\n}\n\n/** The two halves of the optional geocode. Each member's value is its key in {@link AddressCoordinates}. */\nexport enum AddressCoordinatePart {\n LATITUDE = 'latitude',\n LONGITUDE = 'longitude',\n}\n\n/**\n * The dotted path of every editable part inside an address value — the paths a validation issue is\n * reported at (`city`, `coordinates.longitude`). A form routes each part's error to its own control\n * by these, instead of summarising a nested error as one message for the whole field.\n */\nexport function listAddressPartPaths(): string[] {\n return [...Object.values(AddressPart), ...Object.values(AddressCoordinatePart).map((part) => `coordinates.${part}`)];\n}\n\nconst ISO_COUNTRY_CODE_PATTERN = /^[A-Z]{2}$/;\n\n/**\n * The canonical spelling of one free-text address part: trimmed, with inner whitespace collapsed to a\n * single space. Applied on parse, so a stored value never carries the typist's accidental spacing.\n */\nexport function normalizeAddressText(value: string): string {\n return value.trim().replace(/\\s+/g, ' ');\n}\n\n/** The canonical spelling of a country code: trimmed and uppercased. */\nexport function normalizeAddressCountry(value: string): string {\n return value.trim().toUpperCase();\n}\n\nexport const AddressCoordinatesSchema: z.ZodObject<{ latitude: z.ZodNumber; longitude: z.ZodNumber }> = z.object({\n latitude: z.number().min(-90).max(90),\n longitude: z.number().min(-180).max(180),\n});\n\n/**\n * A key under which two SPELLINGS of one address compare equal.\n *\n * Country and postal code are compared exactly after uppercasing (and, for the postal code, removing\n * spaces: `75 002` and `75002` are one code). Every free-text part is compared after case-folding,\n * stripping diacritics and treating any run of punctuation or whitespace as one separator — so\n * `12 Rue de La Paix` and `12 rue de la paix` agree, and `Saint-Étienne` matches `saint etienne`.\n *\n * Coordinates are deliberately NOT part of the key: a geocode describes where a place is, and two\n * geocoders returning slightly different points for one address must not make it two addresses.\n *\n * What it does NOT do, and cannot without a provider (#394): recognise an ABBREVIATION (`rue` vs `r.`),\n * a differently SPLIT value (postal code and city typed into `line1`), or two formats of one street\n * number (`12bis` vs `12 bis`). It recognises spelling, not meaning.\n */\nexport function addressComparisonKey(\n value: Pick<AddressValue, 'line1' | 'line2' | 'city' | 'state' | 'postalCode' | 'country'>,\n): string {\n const fold = (part: string | undefined): string => (part ?? '')\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^\\p{L}\\p{N}]+/gu, ' ')\n .trim();\n const postalCode = (value.postalCode ?? '').replace(/\\s+/g, '').toUpperCase();\n return [\n normalizeAddressCountry(value.country),\n postalCode,\n fold(value.city),\n fold(value.state),\n fold(value.line1),\n fold(value.line2),\n ].join('|');\n}\n\n/** Whether two addresses are the same place spelled differently (see {@link addressComparisonKey}). */\nexport function isSameAddress(\n left: Pick<AddressValue, 'line1' | 'line2' | 'city' | 'state' | 'postalCode' | 'country'>,\n right: Pick<AddressValue, 'line1' | 'line2' | 'city' | 'state' | 'postalCode' | 'country'>,\n): boolean {\n return addressComparisonKey(left) === addressComparisonKey(right);\n}\n\nexport type AddressSchemaShape = {\n line1: z.ZodString;\n line2: z.ZodOptional<z.ZodString>;\n city: z.ZodString;\n state: z.ZodOptional<z.ZodString>;\n postalCode: z.ZodOptional<z.ZodString>;\n country: z.ZodString;\n coordinates: z.ZodOptional<typeof AddressCoordinatesSchema>;\n};\n\n/**\n * @wildo_source:part:start zod.factories.address facet:layer:shared facet:family:schema-factory\n *\n * z_address() - Creates a structured postal address field.\n *\n * The value is `{ line1, line2?, city, state?, postalCode?, country, coordinates? }`: a parsed,\n * country-aware value the framework renders with its own form and display fields, instead of an\n * opaque `z.string()` nothing can validate, normalise or compare.\n *\n * - Free-text parts are normalised on parse (trimmed, inner whitespace collapsed).\n * - `country` is an ISO 3166-1 alpha-2 code, uppercased on parse; `countriesAllowed` restricts it.\n * - `coordinates` is an optional `{ latitude, longitude }` pair; `withCoordinates` offers it in the form.\n * - `addressComparisonKey` / `isSameAddress` (same package) tell whether two values are one place\n * spelled differently.\n *\n * An address is personal data. Declare its data category and erasure treatment on the field like any\n * other personal field: this factory does not decide either for you.\n *\n * @example\n * ```typescript\n * import { z_address } from '@wildo-ai/zod-decorators';\n *\n * const shippingAddress = z_address();\n * const siteAddress = z_address({ withCoordinates: true, countriesAllowed: ['FR', 'BE'], defaultCountry: 'FR' });\n * ```\n */\nexport function createAddressSchema(options: AddressSchemaOptions = {}): DecoratedAddressSchema {\n const countriesAllowed = options.countriesAllowed?.map(normalizeAddressCountry);\n for (const code of countriesAllowed ?? []) {\n if (!ISO_COUNTRY_CODE_PATTERN.test(code)) {\n throw new Error(`[z_address] countriesAllowed contains \"${code}\", which is not an ISO 3166-1 alpha-2 code.`);\n }\n }\n const defaultCountry = options.defaultCountry === undefined ? undefined : normalizeAddressCountry(options.defaultCountry);\n if (defaultCountry !== undefined) {\n // Refused at DECLARATION, not at first render: a form pre-selecting a country the value may not\n // name would be an error the author could only discover by filling the form.\n if (!ISO_COUNTRY_CODE_PATTERN.test(defaultCountry)) {\n throw new Error(`[z_address] defaultCountry \"${options.defaultCountry}\" is not an ISO 3166-1 alpha-2 code.`);\n }\n if (countriesAllowed && countriesAllowed.length > 0 && !countriesAllowed.includes(defaultCountry)) {\n throw new Error(`[z_address] defaultCountry \"${defaultCountry}\" is not among countriesAllowed (${countriesAllowed.join(', ')}).`);\n }\n }\n\n const text = (): z.ZodString => z.string().overwrite(normalizeAddressText);\n let country: z.ZodString = z.string()\n .overwrite(normalizeAddressCountry)\n .regex(ISO_COUNTRY_CODE_PATTERN, { error: 'Country must be an ISO 3166-1 alpha-2 code' });\n if (countriesAllowed && countriesAllowed.length > 0) {\n country = country.refine((code) => countriesAllowed.includes(code), {\n error: `Country must be one of: ${countriesAllowed.join(', ')}`,\n });\n }\n\n const addressSchema = z.object({\n line1: text().min(1, { error: 'Address line 1 is required' }).max(100),\n line2: text().max(100).optional(),\n city: text().min(1, { error: 'City is required' }).max(50),\n state: text().max(50).optional(),\n postalCode: text().max(20).optional(),\n country,\n coordinates: AddressCoordinatesSchema.optional(),\n });\n\n const addressMetadata: AddressSchemaMetadata = {\n isAddress: true,\n withCoordinates: options.withCoordinates === true,\n ...(countriesAllowed && countriesAllowed.length > 0 && { countriesAllowed }),\n ...(defaultCountry !== undefined && { defaultCountry }),\n };\n\n const existingMetadata: CustomFieldMetadata = (addressSchema as any)[SCHEMA_METADATA] || {};\n (addressSchema as any)[SCHEMA_METADATA] = {\n ...existingMetadata,\n addressConfig: addressMetadata,\n };\n\n addChainableMethods(addressSchema);\n\n return addressSchema as DecoratedAddressSchema;\n}\n\n/**\n * Return type for address schemas — includes the decorators applicable to a `ZodObject`.\n *\n * No address-specific UI or SPEC decorator exists yet: the form and display fields render from the\n * metadata alone. Adding one later is additive.\n */\nexport type DecoratedAddressSchema = z.ZodObject<AddressSchemaShape> & {\n [ZodDecorator.IS_DB_INDEXED](): DecoratedAddressSchema;\n [ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedAddressSchema;\n [ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedAddressSchema;\n [ZodDecorator.IS_SUMMARY_FIELD](params?: SummaryFieldParams): DecoratedAddressSchema;\n [ZodDecorator.IS_BACKEND_ONLY](params?: ZodDecorator_ParamsType[ZodDecorator.IS_BACKEND_ONLY]): DecoratedAddressSchema;\n [ZodDecorator.IS_WRITE_ONLY_SECRET](params?: ZodDecorator_ParamsType[ZodDecorator.IS_WRITE_ONLY_SECRET]): DecoratedAddressSchema;\n [ZodDecorator.EXCLUDE_FROM_CREATE](): DecoratedAddressSchema;\n [ZodDecorator.EXCLUDE_FROM_UPDATE](): DecoratedAddressSchema;\n addDecorators(decorators: DecoratorInput[]): DecoratedAddressSchema;\n};\n\n/**\n * Creates a structured postal address schema. Named z_address to indicate it is a Zod helper exported\n * standalone, like `z_money` and `z_phone`.\n */\nexport function z_address(options?: AddressSchemaOptions): DecoratedAddressSchema {\n return createAddressSchema(options);\n}\n/** @wildo_source:part:end zod.factories.address */\n"]}
1
+ {"version":3,"file":"zod-address.js","sourceRoot":"","sources":["../../../src/zod-address.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E,OAAO,EAKL,eAAe,EAEf,YAAY,GAEb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAA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gB,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,CAAC;QAC5E,GAAG,CAAC,cAAc,KAAK,SAAS,IAAI,EAAE,cAAc,EAAE,CAAC;KACxD,CAAC;IAEF,MAAM,gBAAgB,GAAyB,aAAqB,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IAC3F,aAAqB,CAAC,eAAe,CAAC,GAAG;QACxC,GAAG,gBAAgB;QACnB,aAAa,EAAE,eAAe;KAC/B,CAAC;IAEF,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAEnC,OAAO,aAAuC,CAAC;AACjD,CAAC;AAoBD;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,OAA8B;IACtD,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AACD,mDAAmD","sourcesContent":["// ============================================================================\n// ADDRESS SCHEMA HELPER (#561)\n// ============================================================================\n\nimport {\n AddressSchemaMetadata,\n AddressSchemaOptions,\n CustomFieldMetadata,\n DecoratorInput,\n SCHEMA_METADATA,\n SummaryFieldParams,\n ZodDecorator,\n ZodDecorator_ParamsType,\n} from './zod-decorators.types';\nimport { z } from 'zod';\nimport { addChainableMethods } from './zod.module-override';\n\n/** A point on the globe, in decimal degrees. */\nexport interface AddressCoordinates {\n /** -90 (south pole) to 90 (north pole). */\n latitude: number;\n /** -180 to 180. */\n longitude: number;\n}\n\n/**\n * A structured postal address.\n *\n * The part names are the ones the framework's existing `AddressSchema` already uses (organisation\n * profiles), so an application meets ONE address vocabulary rather than two. `postalCode` is optional\n * because not every country issues one.\n */\nexport interface AddressValue {\n line1: string;\n line2?: string;\n city: string;\n /** Region, state, province or county — whatever the country calls its first subdivision. */\n state?: string;\n postalCode?: string;\n /** ISO 3166-1 alpha-2, stored uppercase. */\n country: string;\n /** An optional geocode. It does NOT take part in identity — see {@link addressComparisonKey}. */\n coordinates?: AddressCoordinates;\n}\n\n/**\n * The parts of an address value, named once so the factory, the form control and the error routing\n * agree. Each member's value is the key it has in {@link AddressValue}.\n */\nexport enum AddressPart {\n /** Street and number. Required. */\n LINE1 = 'line1',\n /** Building, floor, apartment. Optional. */\n LINE2 = 'line2',\n /** Town or city. Required. */\n CITY = 'city',\n /** The country's first subdivision (state, province, region, county). Optional. */\n STATE = 'state',\n /** Optional because not every country issues one. */\n POSTAL_CODE = 'postalCode',\n /** ISO 3166-1 alpha-2. Required. */\n COUNTRY = 'country',\n}\n\n/** The two halves of the optional geocode. Each member's value is its key in {@link AddressCoordinates}. */\nexport enum AddressCoordinatePart {\n LATITUDE = 'latitude',\n LONGITUDE = 'longitude',\n}\n\n/**\n * The dotted path of every editable part inside an address value — the paths a validation issue is\n * reported at (`city`, `coordinates.longitude`). A form routes each part's error to its own control\n * by these, instead of summarising a nested error as one message for the whole field.\n */\nexport function listAddressPartPaths(): string[] {\n return [...Object.values(AddressPart), ...Object.values(AddressCoordinatePart).map((part) => `coordinates.${part}`)];\n}\n\nconst ISO_COUNTRY_CODE_PATTERN = /^[A-Z]{2}$/;\n\n/**\n * The canonical spelling of one free-text address part: trimmed, with inner whitespace collapsed to a\n * single space. Applied on parse, so a stored value never carries the typist's accidental spacing.\n */\nexport function normalizeAddressText(value: string): string {\n return value.trim().replace(/\\s+/g, ' ');\n}\n\n/** The canonical spelling of a country code: trimmed and uppercased. */\nexport function normalizeAddressCountry(value: string): string {\n return value.trim().toUpperCase();\n}\n\nexport const AddressCoordinatesSchema: z.ZodObject<{ latitude: z.ZodNumber; longitude: z.ZodNumber }> = z.object({\n latitude: z.number().min(-90).max(90).describe('Latitude in decimal degrees, from -90 to 90.'),\n longitude: z.number().min(-180).max(180).describe('Longitude in decimal degrees, from -180 to 180.'),\n});\n\n/**\n * A key under which two SPELLINGS of one address compare equal.\n *\n * Country and postal code are compared exactly after uppercasing (and, for the postal code, removing\n * spaces: `75 002` and `75002` are one code). Every free-text part is compared after case-folding,\n * stripping diacritics and treating any run of punctuation or whitespace as one separator — so\n * `12 Rue de La Paix` and `12 rue de la paix` agree, and `Saint-Étienne` matches `saint etienne`.\n *\n * Coordinates are deliberately NOT part of the key: a geocode describes where a place is, and two\n * geocoders returning slightly different points for one address must not make it two addresses.\n *\n * What it does NOT do, and cannot without a provider (#394): recognise an ABBREVIATION (`rue` vs `r.`),\n * a differently SPLIT value (postal code and city typed into `line1`), or two formats of one street\n * number (`12bis` vs `12 bis`). It recognises spelling, not meaning.\n */\nexport function addressComparisonKey(\n value: Pick<AddressValue, 'line1' | 'line2' | 'city' | 'state' | 'postalCode' | 'country'>,\n): string {\n const fold = (part: string | undefined): string => (part ?? '')\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^\\p{L}\\p{N}]+/gu, ' ')\n .trim();\n const postalCode = (value.postalCode ?? '').replace(/\\s+/g, '').toUpperCase();\n return [\n normalizeAddressCountry(value.country),\n postalCode,\n fold(value.city),\n fold(value.state),\n fold(value.line1),\n fold(value.line2),\n ].join('|');\n}\n\n/** Whether two addresses are the same place spelled differently (see {@link addressComparisonKey}). */\nexport function isSameAddress(\n left: Pick<AddressValue, 'line1' | 'line2' | 'city' | 'state' | 'postalCode' | 'country'>,\n right: Pick<AddressValue, 'line1' | 'line2' | 'city' | 'state' | 'postalCode' | 'country'>,\n): boolean {\n return addressComparisonKey(left) === addressComparisonKey(right);\n}\n\nexport type AddressSchemaShape = {\n line1: z.ZodString;\n line2: z.ZodOptional<z.ZodString>;\n city: z.ZodString;\n state: z.ZodOptional<z.ZodString>;\n postalCode: z.ZodOptional<z.ZodString>;\n country: z.ZodString;\n coordinates: z.ZodOptional<typeof AddressCoordinatesSchema>;\n};\n\n/**\n * @wildo_source:part:start zod.factories.address facet:layer:shared facet:family:schema-factory\n *\n * z_address() - Creates a structured postal address field.\n *\n * The value is `{ line1, line2?, city, state?, postalCode?, country, coordinates? }`: a parsed,\n * country-aware value the framework renders with its own form and display fields, instead of an\n * opaque `z.string()` nothing can validate, normalise or compare.\n *\n * - Free-text parts are normalised on parse (trimmed, inner whitespace collapsed).\n * - `country` is an ISO 3166-1 alpha-2 code, uppercased on parse; `countriesAllowed` restricts it.\n * - `coordinates` is an optional `{ latitude, longitude }` pair; `withCoordinates` offers it in the form.\n * - `addressComparisonKey` / `isSameAddress` (same package) tell whether two values are one place\n * spelled differently.\n *\n * An address is personal data. Declare its data category and erasure treatment on the field like any\n * other personal field: this factory does not decide either for you.\n *\n * @example\n * ```typescript\n * import { z_address } from '@wildo-ai/zod-decorators';\n *\n * const shippingAddress = z_address();\n * const siteAddress = z_address({ withCoordinates: true, countriesAllowed: ['FR', 'BE'], defaultCountry: 'FR' });\n * ```\n */\nexport function createAddressSchema(options: AddressSchemaOptions = {}): DecoratedAddressSchema {\n const countriesAllowed = options.countriesAllowed?.map(normalizeAddressCountry);\n for (const code of countriesAllowed ?? []) {\n if (!ISO_COUNTRY_CODE_PATTERN.test(code)) {\n throw new Error(`[z_address] countriesAllowed contains \"${code}\", which is not an ISO 3166-1 alpha-2 code.`);\n }\n }\n const defaultCountry = options.defaultCountry === undefined ? undefined : normalizeAddressCountry(options.defaultCountry);\n if (defaultCountry !== undefined) {\n // Refused at DECLARATION, not at first render: a form pre-selecting a country the value may not\n // name would be an error the author could only discover by filling the form.\n if (!ISO_COUNTRY_CODE_PATTERN.test(defaultCountry)) {\n throw new Error(`[z_address] defaultCountry \"${options.defaultCountry}\" is not an ISO 3166-1 alpha-2 code.`);\n }\n if (countriesAllowed && countriesAllowed.length > 0 && !countriesAllowed.includes(defaultCountry)) {\n throw new Error(`[z_address] defaultCountry \"${defaultCountry}\" is not among countriesAllowed (${countriesAllowed.join(', ')}).`);\n }\n }\n\n const text = (): z.ZodString => z.string().overwrite(normalizeAddressText);\n let country: z.ZodString = z.string()\n .overwrite(normalizeAddressCountry)\n .regex(ISO_COUNTRY_CODE_PATTERN, { error: 'Country must be an ISO 3166-1 alpha-2 code' });\n if (countriesAllowed && countriesAllowed.length > 0) {\n country = country.refine((code) => countriesAllowed.includes(code), {\n error: `Country must be one of: ${countriesAllowed.join(', ')}`,\n });\n }\n\n const addressSchema = z.object({\n line1: text().min(1, { error: 'Address line 1 is required' }).max(100).describe(\"The first line of the street address.\"),\n line2: text().max(100).optional().describe(\"The second line of the street address, when there is one.\"),\n city: text().min(1, { error: 'City is required' }).max(50).describe(\"The city or locality.\"),\n state: text().max(50).optional().describe(\"The region, state, province or county: whatever the country calls its first subdivision.\"),\n postalCode: text().max(20).optional().describe(\"The postal code, when the country issues one.\"),\n country: country.describe(\"The country, as an ISO 3166-1 alpha-2 code in upper case.\"),\n coordinates: AddressCoordinatesSchema.optional().describe(\"An optional geocode. It does not take part in comparing two addresses.\"),\n });\n\n const addressMetadata: AddressSchemaMetadata = {\n isAddress: true,\n withCoordinates: options.withCoordinates === true,\n ...(countriesAllowed && countriesAllowed.length > 0 && { countriesAllowed }),\n ...(defaultCountry !== undefined && { defaultCountry }),\n };\n\n const existingMetadata: CustomFieldMetadata = (addressSchema as any)[SCHEMA_METADATA] || {};\n (addressSchema as any)[SCHEMA_METADATA] = {\n ...existingMetadata,\n addressConfig: addressMetadata,\n };\n\n addChainableMethods(addressSchema);\n\n return addressSchema as DecoratedAddressSchema;\n}\n\n/**\n * Return type for address schemas — includes the decorators applicable to a `ZodObject`.\n *\n * No address-specific UI or SPEC decorator exists yet: the form and display fields render from the\n * metadata alone. Adding one later is additive.\n */\nexport type DecoratedAddressSchema = z.ZodObject<AddressSchemaShape> & {\n [ZodDecorator.IS_DB_INDEXED](): DecoratedAddressSchema;\n [ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedAddressSchema;\n [ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedAddressSchema;\n [ZodDecorator.IS_SUMMARY_FIELD](params?: SummaryFieldParams): DecoratedAddressSchema;\n [ZodDecorator.IS_BACKEND_ONLY](params?: ZodDecorator_ParamsType[ZodDecorator.IS_BACKEND_ONLY]): DecoratedAddressSchema;\n [ZodDecorator.IS_WRITE_ONLY_SECRET](params?: ZodDecorator_ParamsType[ZodDecorator.IS_WRITE_ONLY_SECRET]): DecoratedAddressSchema;\n [ZodDecorator.EXCLUDE_FROM_CREATE](): DecoratedAddressSchema;\n [ZodDecorator.EXCLUDE_FROM_UPDATE](): DecoratedAddressSchema;\n addDecorators(decorators: DecoratorInput[]): DecoratedAddressSchema;\n};\n\n/**\n * Creates a structured postal address schema. Named z_address to indicate it is a Zod helper exported\n * standalone, like `z_money` and `z_phone`.\n */\nexport function z_address(options?: AddressSchemaOptions): DecoratedAddressSchema {\n return createAddressSchema(options);\n}\n/** @wildo_source:part:end zod.factories.address */\n"]}
@@ -20,8 +20,8 @@ export const CommonCodeLanguages = [
20
20
  * Zod schema for CodeValue.
21
21
  */
22
22
  export const CodeValueSchema = z.object({
23
- content: z.string(),
24
- language: z.string(),
23
+ content: z.string().describe("The code itself."),
24
+ language: z.string().describe("The language the code is written in, for highlighting and validation."),
25
25
  });
26
26
  /**
27
27
  * @wildo_source:part:start zod.factories.code facet:layer:shared facet:family:schema-factory
@@ -65,8 +65,8 @@ export function createCodeSchema(options = {}) {
65
65
  const languageSchema = z.string();
66
66
  // Create the code object schema
67
67
  const codeSchema = z.object({
68
- content: contentSchema,
69
- language: languageSchema,
68
+ content: contentSchema.describe("The code itself."),
69
+ language: languageSchema.describe("The language the code is written in, for highlighting and validation."),
70
70
  });
71
71
  const codeMetadata = {
72
72
  isCode: true,
@@ -1 +1 @@
1
- {"version":3,"file":"zod-code.js","sourceRoot":"","sources":["../../../src/zod-code.ts"],"names":[],"mappings":"AACA,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,OAAO,EAAkB,eAAe,EAA4E,YAAY,EAA2B,MAAM,wBAAwB,CAAC;AAC1L,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CA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AAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,YAAY;QACxB,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,YAAY;KACxB,CAAC;IAEF,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,mBAAmB,CAAC,QAAQ,CAAC,QAAe,CAAC,CAAC;AACvD,CAAC","sourcesContent":["\n// ============================================================================\n// CODE SCHEMA HELPER\n// ============================================================================\n\nimport { DecoratorInput, SCHEMA_METADATA, CustomFieldMetadata, CodeSchemaMetadata, CodeSchemaOptions, CodeLanguage, ZodDecorator, ZodDecorator_ParamsType } from \"./zod-decorators.types\";\nimport { z } from \"zod\";\nimport { addChainableMethods } from \"./zod.module-override\";\n\n/**\n * Code value type - represents a code snippet with language information.\n */\nexport interface CodeValue {\n /** The code content */\n content: string;\n /** Programming language for syntax highlighting and validation */\n language: string;\n}\n\n/**\n * Common programming languages for code schema language field.\n * Can be extended with any string value.\n */\nexport const CommonCodeLanguages = [\n 'javascript', 'typescript', 'python', 'java', 'csharp', 'cpp', 'c',\n 'go', 'rust', 'ruby', 'php', 'swift', 'kotlin', 'scala',\n 'html', 'css', 'scss', 'less', 'json', 'yaml', 'xml', 'markdown',\n 'sql', 'graphql', 'bash', 'shell', 'powershell',\n 'dockerfile', 'nginx', 'apache',\n 'plaintext'\n] as const;\n\n/**\n * Zod schema for CodeValue.\n */\nexport const CodeValueSchema: z.ZodObject<{ content: z.ZodString; language: z.ZodString }> = z.object({\n content: z.string(),\n language: z.string(),\n});\n\n/**\n * @wildo_source:part:start zod.factories.code facet:layer:shared facet:family:schema-factory\n *\n * z_code() - Creates code schemas for code snippets with language.\n *\n * @example\n * ```typescript\n * import { z_code } from '@wildo-ai/zod-decorators';\n *\n * const snippet = z_code();\n * const restrictedCode = z_code({\n * allowedLanguages: ['javascript', 'typescript', 'python'],\n * maxLength: 10000\n * });\n *\n * // UI props are now set via .codeUI():\n * z_code().codeUI({ defaultLanguage: 'javascript', syntaxHighlighting: true })\n * z_code().codeUI({ display: { showLineNumbers: true }, edit: { showLineNumbers: false } })\n * ```\n */\n\n/**\n * Creates a code schema with metadata for detection and form component rendering.\n *\n * @param options - Configuration options for code field\n * @returns A Zod object schema with metadata for code detection\n */\nexport function createCodeSchema(\n options: CodeSchemaOptions = {}\n): DecoratedCodeSchema {\n const {\n allowedLanguages,\n maxLength,\n minLength,\n } = options;\n\n // Create the content schema with optional length constraints\n let contentSchema = z.string();\n if (minLength !== undefined) {\n contentSchema = contentSchema.min(minLength);\n }\n if (maxLength !== undefined) {\n contentSchema = contentSchema.max(maxLength);\n }\n\n // Language is stored as a string. Allowed languages restriction is enforced\n // through codeConfig.allowedLanguages metadata - UI components read this\n // to filter available options, same pattern as money currencies.\n const languageSchema = z.string();\n\n // Create the code object schema\n const codeSchema = z.object({\n content: contentSchema,\n language: languageSchema,\n });\n\n const codeMetadata: CodeSchemaMetadata = {\n isCode: true,\n ...(allowedLanguages !== undefined && { allowedLanguages }),\n ...(maxLength !== undefined && { maxLength }),\n ...(minLength !== undefined && { minLength }),\n };\n\n // Initialize or extend SCHEMA_METADATA with code config\n const existingMetadata: CustomFieldMetadata = (codeSchema as any)[SCHEMA_METADATA] || {};\n (codeSchema as any)[SCHEMA_METADATA] = {\n ...existingMetadata,\n codeConfig: codeMetadata,\n };\n\n // Add chainable decorator methods to the code schema instance\n addChainableMethods(codeSchema);\n\n return codeSchema as unknown as DecoratedCodeSchema;\n}\n\n/**\n * Return type for code schemas - includes decorator methods.\n * IS_DB_INDEXED will index internal fields (content, language) for query optimization.\n */\nexport type DecoratedCodeSchema = z.ZodObject<{\n content: z.ZodString;\n language: z.ZodString;\n}> & {\n [ZodDecorator.IS_DB_INDEXED](): DecoratedCodeSchema;\n /** Installed at runtime with the other chainable methods; declared here so an authored `.codeUI(…)` typechecks. */\n [ZodDecorator.CODE_UI](params?: ZodDecorator_ParamsType[ZodDecorator.CODE_UI]): DecoratedCodeSchema;\n [ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedCodeSchema;\n [ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedCodeSchema;\n addDecorators(decorators: DecoratorInput[]): DecoratedCodeSchema;\n};\n\n/**\n * Creates a code schema for code snippets with language information.\n * Named z_code to indicate it's a Zod helper function exported standalone.\n *\n * Code values are stored as: { content: string, language: string }\n * - content: The actual code text\n * - language: Programming language identifier for syntax highlighting\n *\n * @example\n * ```typescript\n * import { z_code } from '@wildo-ai/zod-decorators';\n *\n * // Simple usage\n * z_code() // All languages, default 'plaintext'\n *\n * // With options (structural only)\n * z_code({ allowedLanguages: ['javascript', 'typescript'] })\n * z_code({ maxLength: 5000 })\n *\n * // UI props via .codeUI()\n * z_code().codeUI({ defaultLanguage: 'typescript' })\n * z_code().codeUI({ display: { showLineNumbers: false } })\n * ```\n */\nexport function z_code(options?: CodeSchemaOptions): DecoratedCodeSchema {\n return createCodeSchema(options);\n}\n/** @wildo_source:part:end zod.factories.code */\n\n// ============================================================================\n// UTILITY FUNCTIONS\n// ============================================================================\n\n/**\n * Get the display name for a code language.\n */\nexport function getLanguageDisplayName(language: CodeLanguage): string {\n const displayNames: Record<string, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n python: 'Python',\n java: 'Java',\n csharp: 'C#',\n cpp: 'C++',\n c: 'C',\n go: 'Go',\n rust: 'Rust',\n ruby: 'Ruby',\n php: 'PHP',\n swift: 'Swift',\n kotlin: 'Kotlin',\n scala: 'Scala',\n html: 'HTML',\n css: 'CSS',\n scss: 'SCSS',\n less: 'Less',\n json: 'JSON',\n yaml: 'YAML',\n xml: 'XML',\n markdown: 'Markdown',\n sql: 'SQL',\n graphql: 'GraphQL',\n bash: 'Bash',\n shell: 'Shell',\n powershell: 'PowerShell',\n dockerfile: 'Dockerfile',\n nginx: 'Nginx',\n apache: 'Apache',\n plaintext: 'Plain Text',\n };\n\n return displayNames[language] || language;\n}\n\n/**\n * Check if a language is in the common languages list.\n */\nexport function isCommonLanguage(language: string): language is typeof CommonCodeLanguages[number] {\n return CommonCodeLanguages.includes(language as any);\n}\n\n"]}
1
+ {"version":3,"file":"zod-code.js","sourceRoot":"","sources":["../../../src/zod-code.ts"],"names":[],"mappings":"AACA,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,OAAO,EAAkB,eAAe,EAA4E,YAAY,EAA2B,MAAM,wBAAwB,CAAC;AAC1L,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAY5D;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG;IAClE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IACvD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU;IAChE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAC/C,YAAY,EAAE,OAAO,EAAE,QAAQ;IA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OAAO;QACd,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,YAAY;QACxB,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,YAAY;KACxB,CAAC;IAEF,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,mBAAmB,CAAC,QAAQ,CAAC,QAAe,CAAC,CAAC;AACvD,CAAC","sourcesContent":["\n// ============================================================================\n// CODE SCHEMA HELPER\n// ============================================================================\n\nimport { DecoratorInput, SCHEMA_METADATA, CustomFieldMetadata, CodeSchemaMetadata, CodeSchemaOptions, CodeLanguage, ZodDecorator, ZodDecorator_ParamsType } from \"./zod-decorators.types\";\nimport { z } from \"zod\";\nimport { addChainableMethods } from \"./zod.module-override\";\n\n/**\n * Code value type - represents a code snippet with language information.\n */\nexport interface CodeValue {\n /** The code content */\n content: string;\n /** Programming language for syntax highlighting and validation */\n language: string;\n}\n\n/**\n * Common programming languages for code schema language field.\n * Can be extended with any string value.\n */\nexport const CommonCodeLanguages = [\n 'javascript', 'typescript', 'python', 'java', 'csharp', 'cpp', 'c',\n 'go', 'rust', 'ruby', 'php', 'swift', 'kotlin', 'scala',\n 'html', 'css', 'scss', 'less', 'json', 'yaml', 'xml', 'markdown',\n 'sql', 'graphql', 'bash', 'shell', 'powershell',\n 'dockerfile', 'nginx', 'apache',\n 'plaintext'\n] as const;\n\n/**\n * Zod schema for CodeValue.\n */\nexport const CodeValueSchema: z.ZodObject<{ content: z.ZodString; language: z.ZodString }> = z.object({\n content: z.string().describe(\"The code itself.\"),\n language: z.string().describe(\"The language the code is written in, for highlighting and validation.\"),\n});\n\n/**\n * @wildo_source:part:start zod.factories.code facet:layer:shared facet:family:schema-factory\n *\n * z_code() - Creates code schemas for code snippets with language.\n *\n * @example\n * ```typescript\n * import { z_code } from '@wildo-ai/zod-decorators';\n *\n * const snippet = z_code();\n * const restrictedCode = z_code({\n * allowedLanguages: ['javascript', 'typescript', 'python'],\n * maxLength: 10000\n * });\n *\n * // UI props are now set via .codeUI():\n * z_code().codeUI({ defaultLanguage: 'javascript', syntaxHighlighting: true })\n * z_code().codeUI({ display: { showLineNumbers: true }, edit: { showLineNumbers: false } })\n * ```\n */\n\n/**\n * Creates a code schema with metadata for detection and form component rendering.\n *\n * @param options - Configuration options for code field\n * @returns A Zod object schema with metadata for code detection\n */\nexport function createCodeSchema(\n options: CodeSchemaOptions = {}\n): DecoratedCodeSchema {\n const {\n allowedLanguages,\n maxLength,\n minLength,\n } = options;\n\n // Create the content schema with optional length constraints\n let contentSchema = z.string();\n if (minLength !== undefined) {\n contentSchema = contentSchema.min(minLength);\n }\n if (maxLength !== undefined) {\n contentSchema = contentSchema.max(maxLength);\n }\n\n // Language is stored as a string. Allowed languages restriction is enforced\n // through codeConfig.allowedLanguages metadata - UI components read this\n // to filter available options, same pattern as money currencies.\n const languageSchema = z.string();\n\n // Create the code object schema\n const codeSchema = z.object({\n content: contentSchema.describe(\"The code itself.\"),\n language: languageSchema.describe(\"The language the code is written in, for highlighting and validation.\"),\n });\n\n const codeMetadata: CodeSchemaMetadata = {\n isCode: true,\n ...(allowedLanguages !== undefined && { allowedLanguages }),\n ...(maxLength !== undefined && { maxLength }),\n ...(minLength !== undefined && { minLength }),\n };\n\n // Initialize or extend SCHEMA_METADATA with code config\n const existingMetadata: CustomFieldMetadata = (codeSchema as any)[SCHEMA_METADATA] || {};\n (codeSchema as any)[SCHEMA_METADATA] = {\n ...existingMetadata,\n codeConfig: codeMetadata,\n };\n\n // Add chainable decorator methods to the code schema instance\n addChainableMethods(codeSchema);\n\n return codeSchema as unknown as DecoratedCodeSchema;\n}\n\n/**\n * Return type for code schemas - includes decorator methods.\n * IS_DB_INDEXED will index internal fields (content, language) for query optimization.\n */\nexport type DecoratedCodeSchema = z.ZodObject<{\n content: z.ZodString;\n language: z.ZodString;\n}> & {\n [ZodDecorator.IS_DB_INDEXED](): DecoratedCodeSchema;\n /** Installed at runtime with the other chainable methods; declared here so an authored `.codeUI(…)` typechecks. */\n [ZodDecorator.CODE_UI](params?: ZodDecorator_ParamsType[ZodDecorator.CODE_UI]): DecoratedCodeSchema;\n [ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedCodeSchema;\n [ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedCodeSchema;\n addDecorators(decorators: DecoratorInput[]): DecoratedCodeSchema;\n};\n\n/**\n * Creates a code schema for code snippets with language information.\n * Named z_code to indicate it's a Zod helper function exported standalone.\n *\n * Code values are stored as: { content: string, language: string }\n * - content: The actual code text\n * - language: Programming language identifier for syntax highlighting\n *\n * @example\n * ```typescript\n * import { z_code } from '@wildo-ai/zod-decorators';\n *\n * // Simple usage\n * z_code() // All languages, default 'plaintext'\n *\n * // With options (structural only)\n * z_code({ allowedLanguages: ['javascript', 'typescript'] })\n * z_code({ maxLength: 5000 })\n *\n * // UI props via .codeUI()\n * z_code().codeUI({ defaultLanguage: 'typescript' })\n * z_code().codeUI({ display: { showLineNumbers: false } })\n * ```\n */\nexport function z_code(options?: CodeSchemaOptions): DecoratedCodeSchema {\n return createCodeSchema(options);\n}\n/** @wildo_source:part:end zod.factories.code */\n\n// ============================================================================\n// UTILITY FUNCTIONS\n// ============================================================================\n\n/**\n * Get the display name for a code language.\n */\nexport function getLanguageDisplayName(language: CodeLanguage): string {\n const displayNames: Record<string, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n python: 'Python',\n java: 'Java',\n csharp: 'C#',\n cpp: 'C++',\n c: 'C',\n go: 'Go',\n rust: 'Rust',\n ruby: 'Ruby',\n php: 'PHP',\n swift: 'Swift',\n kotlin: 'Kotlin',\n scala: 'Scala',\n html: 'HTML',\n css: 'CSS',\n scss: 'SCSS',\n less: 'Less',\n json: 'JSON',\n yaml: 'YAML',\n xml: 'XML',\n markdown: 'Markdown',\n sql: 'SQL',\n graphql: 'GraphQL',\n bash: 'Bash',\n shell: 'Shell',\n powershell: 'PowerShell',\n dockerfile: 'Dockerfile',\n nginx: 'Nginx',\n apache: 'Apache',\n plaintext: 'Plain Text',\n };\n\n return displayNames[language] || language;\n}\n\n/**\n * Check if a language is in the common languages list.\n */\nexport function isCommonLanguage(language: string): language is typeof CommonCodeLanguages[number] {\n return CommonCodeLanguages.includes(language as any);\n}\n\n"]}
@@ -455,12 +455,24 @@ export declare const StringDisplayMode: {
455
455
  * it identifies. Use for values a reader needs to copy or trace, never to read as content.
456
456
  */
457
457
  readonly IDENTIFIER: "identifier";
458
+ /**
459
+ * HTML written by someone OUTSIDE the application — the HTML part of a received email. Rendered in a sandboxed
460
+ * frame that runs nothing and fetches nothing (no remote image, stylesheet or font: a remote image is a read
461
+ * receipt), with the message's own styles confined to the frame. Never use it for HTML the application authored.
462
+ */
463
+ readonly UNTRUSTED_HTML: "untrusted_html";
458
464
  readonly COLOR: "color";
459
465
  readonly LINK: "link";
460
466
  readonly EMAIL: "email";
461
467
  readonly BADGE: "badge";
462
468
  readonly COPY: "copy";
463
469
  readonly SECRET: "secret";
470
+ /**
471
+ * The value is a KEY of the organization role table (#1921) — render the role's WORD from the application's
472
+ * `roles` labels, never the key. A role with no authored word shows its key, visibly unlabelled. Pair with
473
+ * `edit.editMode: StringEditMode.ORGANIZATION_ROLE` so the field is picked the way it is read.
474
+ */
475
+ readonly ORGANIZATION_ROLE: "organization_role";
464
476
  };
465
477
  export type StringDisplayMode = typeof StringDisplayMode[keyof typeof StringDisplayMode];
466
478
  /**
@@ -480,6 +492,15 @@ export declare const StringEditMode: {
480
492
  * separate future edit mode/component.
481
493
  */
482
494
  readonly MARKDOWN: "markdown";
495
+ /**
496
+ * A SINGLE-ROLE picker (#1921): the field's value is one key of the organization role table — the core
497
+ * organization roles plus the application's custom organization roles, as the backend publishes them on
498
+ * `/application-config` (`organizationRoles`). Each option reads as the role's word from the `roles` labels. Use it
499
+ * for any string field that names ONE role a setting admits (a reader role, a routing role), so an administrator
500
+ * picks a role that exists instead of typing a key exactly. Falls back to a text input when the backend publishes no
501
+ * table. The server remains the control: it decides what holding the role grants.
502
+ */
503
+ readonly ORGANIZATION_ROLE: "organization_role";
483
504
  };
484
505
  export type StringEditMode = typeof StringEditMode[keyof typeof StringEditMode];
485
506
  /**
@@ -1267,10 +1288,13 @@ export interface FileMediaPreviewOptions {
1267
1288
  * EXPRESSES PREFERENCE: list several and the first CONFIGURED one is used. Omit the option entirely
1268
1289
  * and the field resolves to managed storage.
1269
1290
  *
1270
- * ⚠️ **`WILDO_MANAGED`, `LOCAL_DIRECTORY` and `GOOGLE_DRIVE` have a provider behind them.** `ONEDRIVE`
1271
- * and `DROPBOX` are declared vocabulary with no implementation — a field naming only those has no
1272
- * configured provider, and startup configuration validation refuses the application rather than
1273
- * letting it serve a field that could never accept an upload.
1291
+ * ⚠️ **The engine serves `WILDO_MANAGED`, `LOCAL_DIRECTORY` and `GOOGLE_DRIVE` itself.** Any other
1292
+ * member is served only when a loaded provider CONTRIBUTES a storage adapter for it:
1293
+ * `ONEDRIVE` is served by the engine's `microsoft-onedrive` provider (a person's own OneDrive,
1294
+ * commercial cloud only) once the application scopes that provider; nothing serves
1295
+ * `DROPBOX`. A field naming only storages nothing serves has no configured provider, and startup
1296
+ * configuration validation refuses the application rather than letting it serve a field that could
1297
+ * never accept an upload.
1274
1298
  *
1275
1299
  * `GOOGLE_DRIVE` is a VENDOR storage: the bytes live in a person's Drive and are reached through the
1276
1300
  * delegated grant of whoever linked (via the Drive picker) or uploaded them, never through an
@@ -2335,7 +2359,11 @@ export interface BusinessKeySetParams {
2335
2359
  * stays above its target until the rate changes; it reports when it stops early;
2336
2360
  * - a resource CANNOT declare both a lifetime and retrieval-source fields (`.ragSource()`). That
2337
2361
  * pair is refused at startup, because rows expiring under a native index leave with no
2338
- * application code running, so the derived search chunks could never be removed with them.
2362
+ * application code running, so the derived search chunks could never be removed with them;
2363
+ * - a resource scoped to an ORGANIZATION cannot declare a lifetime at all. For the same reason
2364
+ * no legal hold could suspend the deletion, and a hold on an organization covers every row of
2365
+ * it. A lifetime is for application-level plumbing; tenant data binds a retention class
2366
+ * (`retentionBinding`), whose sweep deletes through the service layer and skips held rows.
2339
2367
  *
2340
2368
  * This is unrelated to `retentionPolicy`, which decides what an ERASURE does to a row that must
2341
2369
  * SURVIVE. This one decides whether the row lives at all.
@@ -2607,9 +2635,11 @@ export interface BooleanLabellingCustomParams {
2607
2635
  * How a display field's LABEL is styled, independent of chrome mode (which decides layout).
2608
2636
  *
2609
2637
  * - `DEFAULT` — the chrome's ordinary label treatment.
2610
- * - `TITLE` — the label reads as a SMALL TITLE above its content (small, semibold, foreground):
2611
- * for a field that acts as a mini-section inside a prose flow — "Who suffers it" above its
2612
- * answer — where the ordinary muted label would not carry the structure.
2638
+ * - `TITLE` — the label reads as a SMALL TITLE above its content, in the theme's EYEBROW voice (small,
2639
+ * tracked, uppercase): for a field or a collection that acts as a mini-section inside a prose flow —
2640
+ * "Who suffers it" above its answer, "Rejected categories" above the entries it holds — where the
2641
+ * ordinary muted label would not carry the structure. It is NOT for the rows that qualify an entry's
2642
+ * headline: those keep the ordinary label, or an entry reads as a stack of sections.
2613
2643
  */
2614
2644
  export declare const DisplayLabelStyle: {
2615
2645
  readonly DEFAULT: "default";
@@ -2754,7 +2784,7 @@ export interface BooleanUIParams {
2754
2784
  edit?: BooleanUIEditParams;
2755
2785
  }
2756
2786
  export interface StringUIDisplayParams extends PrimitiveUIBaseDisplayParams {
2757
- /** Display renderer. TEXT | TRUNCATE | MULTILINE | MARKDOWN | COLOR | LINK | EMAIL | BADGE | COPY | SECRET. */
2787
+ /** Display renderer. TEXT | TRUNCATE | MULTILINE | MARKDOWN | IDENTIFIER | UNTRUSTED_HTML | COLOR | LINK | EMAIL | BADGE | COPY | SECRET | ORGANIZATION_ROLE. */
2758
2788
  displayMode?: StringDisplayMode;
2759
2789
  /**
2760
2790
  * Max characters of the value to show (TRUNCATE displayMode only). Beyond it the value is cut
@@ -2777,7 +2807,7 @@ export interface StringUIDisplayParams extends PrimitiveUIBaseDisplayParams {
2777
2807
  initiallyRevealed?: boolean;
2778
2808
  }
2779
2809
  export interface StringUIEditParams extends PrimitiveUIBaseEditParams {
2780
- /** Edit control. INPUT | TEXTAREA | COLOR | PASSWORD | OTP. */
2810
+ /** Edit control. INPUT | TEXTAREA | COLOR | PASSWORD | OTP | MARKDOWN | ORGANIZATION_ROLE. */
2781
2811
  editMode?: StringEditMode;
2782
2812
  /** Number of rows for TEXTAREA editMode. */
2783
2813
  textareaRows?: number;
@@ -2806,6 +2836,12 @@ export interface NumberUIParams {
2806
2836
  suffix?: string;
2807
2837
  /** How to interpret percentage values: NORMALIZED (0–1) or PERCENT (0–100). */
2808
2838
  percentageScale?: PercentageScale;
2839
+ /**
2840
+ * The value that means NO LIMIT rather than a quantity (#1851) — a feature limit stores `FEATURES_UNLIMITED` (`-1`).
2841
+ * Displayed as the word for unlimited instead of the number, which read as "minus one projects". Leave it unset for
2842
+ * any number whose every value is a real quantity.
2843
+ */
2844
+ unlimitedAt?: number;
2809
2845
  display?: NumberUIDisplayParams;
2810
2846
  summaryOverride?: NumberUIDisplayParams;
2811
2847
  edit?: NumberUIEditParams;