diff --git a/.changeset/seo-ai-compliance-release.md b/.changeset/seo-ai-compliance-release.md new file mode 100644 index 00000000..68c961e2 --- /dev/null +++ b/.changeset/seo-ai-compliance-release.md @@ -0,0 +1,24 @@ +--- +"@cleverbrush/schema": patch +"@cleverbrush/schema-json": patch +"@cleverbrush/deep": patch +"@cleverbrush/async": patch +"@cleverbrush/scheduler": patch +"@cleverbrush/mapper": patch +"@cleverbrush/knex-clickhouse": patch +"@cleverbrush/react-form": patch +"@cleverbrush/env": patch +"@cleverbrush/auth": patch +"@cleverbrush/client": patch +"@cleverbrush/di": patch +"@cleverbrush/knex-schema": patch +"@cleverbrush/log": patch +"@cleverbrush/otel": patch +"@cleverbrush/server": patch +"@cleverbrush/server-openapi": patch +"@cleverbrush/orm": patch +"@cleverbrush/orm-cli": patch +--- + +Prepare a patch release with website SEO, AI-readiness, accessibility, and +privacy compliance updates. diff --git a/README.md b/README.md index 635fa6bf..df3d2d2a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](./LICENSE) [![Standard Schema v1](https://img.shields.io/badge/Standard%20Schema-v1-blue)](https://standardschema.dev/) -![Coverage](https://img.shields.io/badge/coverage-87%25-green) +![Coverage](https://img.shields.io/badge/coverage-86.6%25-green) A monorepo of production-quality TypeScript libraries. Written with zero runtime dependencies, strict types, and a strong focus on correctness — every package ships with unit tests, full TypeScript type coverage, and automated CI on every pull request. diff --git a/bench-results.json b/bench-results.json index 12670e36..d26e676b 100644 --- a/bench-results.json +++ b/bench-results.json @@ -10,101 +10,101 @@ "id": "-486116013_0_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.977694337097833, + "rme": 0.45314937178055237, "samples": [], - "totalTime": 500.00549900000044, - "min": 0.020163000000025022, - "max": 1.5903220000000147, - "hz": 32137.646550163212, - "period": 0.03111615526790718, - "mean": 0.03111615526790718, - "variance": 0.0015840427855876808, - "sd": 0.03980003499480472, - "sem": 0.0003139706329877395, - "df": 16068, + "totalTime": 500.0040910000203, + "min": 0.011638000000061766, + "max": 0.21225000000004002, + "hz": 74629.38938233304, + "period": 0.013399546857832515, + "mean": 0.013399546857832515, + "variance": 0.00003581247129980269, + "sd": 0.0059843522038565454, + "sem": 0.00003097957265699428, + "df": 37314, "critical": 1.96, - "moe": 0.0006153824406559693, - "p75": 0.02840600000001814, - "p99": 0.13170800000000327, - "p995": 0.23016899999993257, - "p999": 0.6249139999999898, - "sampleCount": 16069, - "median": 0.02375199999994493 + "moe": 0.00006071996240770879, + "p75": 0.01303100000006907, + "p99": 0.022351000000014665, + "p995": 0.02560300000004645, + "p999": 0.12215499999999224, + "sampleCount": 37315, + "median": 0.012715999999954875 }, { "id": "-486116013_0_1", "name": "zod", "rank": 2, - "rme": 5.761968978221168, + "rme": 0.4298409687541644, "samples": [], - "totalTime": 500.3752379999937, - "min": 0.04329700000016601, - "max": 9.4601889999999, - "hz": 11063.696960959665, - "period": 0.09038570050577921, - "mean": 0.09038570050577921, - "variance": 0.039086359909882185, - "sd": 0.19770270587395153, - "sem": 0.002657140828515761, - "df": 5535, + "totalTime": 500.01446200001385, + "min": 0.02093000000002121, + "max": 0.37319000000002234, + "hz": 43654.73733037625, + "period": 0.02290702134872704, + "mean": 0.02290702134872704, + "variance": 0.00005508770202932471, + "sd": 0.007422109001444584, + "sem": 0.00005023661350923038, + "df": 21827, "critical": 1.96, - "moe": 0.005207996023890891, - "p75": 0.09719799999993484, - "p99": 0.4814659999999549, - "p995": 0.7245649999999841, - "p999": 1.9928449999999884, - "sampleCount": 5536, - "median": 0.054362000000082844 + "moe": 0.00009846376247809155, + "p75": 0.02219399999989946, + "p99": 0.041247999999995955, + "p995": 0.08852600000000166, + "p999": 0.10789499999998498, + "sampleCount": 21828, + "median": 0.021911000000045533 }, { "id": "-486116013_0_2", "name": "yup", "rank": 4, - "rme": 5.173766143432338, + "rme": 0.43041348300563453, "samples": [], - "totalTime": 500.402162999997, - "min": 0.47695699999985663, - "max": 6.72983400000021, - "hz": 1278.971290138096, - "period": 0.7818783796874953, - "mean": 0.7818783796874953, - "variance": 0.27262132791953725, - "sd": 0.5221315235834141, - "sem": 0.02063906065871887, - "df": 639, + "totalTime": 500.1989290000056, + "min": 0.27469399999995403, + "max": 0.5184380000000601, + "hz": 3352.6661149647953, + "period": 0.29827008288610946, + "mean": 0.29827008288610946, + "variance": 0.000719468931271771, + "sd": 0.026822918023059514, + "sem": 0.0006549972716907636, + "df": 1676, "critical": 1.96, - "moe": 0.04045255889108898, - "p75": 0.8181989999998223, - "p99": 2.7188699999999244, - "p995": 3.6092979999998533, - "p999": 6.72983400000021, - "sampleCount": 640, - "median": 0.6081764999998995 + "moe": 0.0012837946525138966, + "p75": 0.29567100000008395, + "p99": 0.39837900000020454, + "p995": 0.4022509999999784, + "p999": 0.46722699999986617, + "sampleCount": 1677, + "median": 0.2901249999999891 }, { "id": "-486116013_0_3", "name": "joi", "rank": 3, - "rme": 2.845919678281029, + "rme": 0.3685187801981134, "samples": [], - "totalTime": 500.11884400000645, - "min": 0.10810099999980594, - "max": 2.58366100000012, - "hz": 5568.67639244556, - "period": 0.1795758865350113, - "mean": 0.1795758865350113, - "variance": 0.01893452315382673, - "sd": 0.13760277306009036, - "sem": 0.002607441577728316, - "df": 2784, + "totalTime": 500.0036919999975, + "min": 0.06524100000024191, + "max": 0.22031599999991158, + "hz": 14397.893685953095, + "period": 0.06945460369495729, + "mean": 0.06945460369495729, + "variance": 0.0001227669187736016, + "sd": 0.011080023410336351, + "sem": 0.0001305883971061686, + "df": 7198, "critical": 1.96, - "moe": 0.0051105854923474995, - "p75": 0.17350600000008853, - "p99": 0.7735539999998764, - "p995": 1.046809000000394, - "p999": 1.5633250000000771, - "sampleCount": 2785, - "median": 0.13489299999992 + "moe": 0.0002559532583280904, + "p75": 0.06791699999985212, + "p99": 0.13756000000012136, + "p995": 0.1435820000001513, + "p999": 0.16266399999994974, + "sampleCount": 7199, + "median": 0.06720899999982066 } ] }, @@ -115,101 +115,101 @@ "id": "-486116013_1_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.9305441989113394, + "rme": 1.2639404853391243, "samples": [], - "totalTime": 500.0000009999512, - "min": 0.0004210000001876324, - "max": 2.4226739999999154, - "hz": 1271389.997457344, - "period": 0.0007865407168531312, - "mean": 0.0007865407168531312, - "variance": 0.00003815386777082296, - "sd": 0.006176881719024815, - "sem": 0.000007747202133308056, - "df": 635694, + "totalTime": 500.00006399984704, + "min": 0.0002459999996062834, + "max": 2.2358859999999368, + "hz": 3331459.5735741938, + "period": 0.00030016873322798236, + "mean": 0.00030016873322798236, + "variance": 0.00000624132243780557, + "sd": 0.0024982638847418762, + "sem": 0.0000019356908895908477, + "df": 1665729, "critical": 1.96, - "moe": 0.00001518451618128379, - "p75": 0.0007480000003852183, - "p99": 0.002510000000256696, - "p995": 0.0033049999997274426, - "p999": 0.021802000000207045, - "sampleCount": 635695, - "median": 0.000503000000207976 + "moe": 0.0000037939541435980614, + "p75": 0.00027699999964170274, + "p99": 0.0010729999999057327, + "p995": 0.0011730000001080043, + "p999": 0.0016630000000077416, + "sampleCount": 1665730, + "median": 0.00027199999976801337 }, { "id": "-486116013_1_1", "name": "zod", "rank": 3, - "rme": 15.507031665168642, + "rme": 7.178641077691121, "samples": [], - "totalTime": 504.1512930000017, - "min": 0.07069400000000314, - "max": 18.86757299999954, - "hz": 5694.719104885823, - "period": 0.17560128631139035, - "mean": 0.17560128631139035, - "variance": 0.5541582242120983, - "sd": 0.7444180439861048, - "sem": 0.013893136261607526, - "df": 2870, + "totalTime": 500.0378560000163, + "min": 0.04147800000009738, + "max": 4.5761170000000675, + "hz": 17148.70163750106, + "period": 0.05831345259475409, + "mean": 0.05831345259475409, + "variance": 0.0391150578458794, + "sd": 0.19777527106764234, + "sem": 0.0021357721743811, + "df": 8574, "critical": 1.96, - "moe": 0.02723054707275075, - "p75": 0.14850899999964895, - "p99": 0.7937060000003839, - "p995": 1.9598049999995055, - "p999": 14.185859999999593, - "sampleCount": 2871, - "median": 0.08953000000019529 + "moe": 0.004186113461786956, + "p75": 0.04477099999985512, + "p99": 0.07395200000064506, + "p995": 0.2155800000000454, + "p999": 3.3653589999998985, + "sampleCount": 8575, + "median": 0.043919000000187225 }, { "id": "-486116013_1_2", "name": "yup", "rank": 4, - "rme": 6.133141390853133, + "rme": 2.1110047463112744, "samples": [], - "totalTime": 500.02340999998887, - "min": 0.14883000000008906, - "max": 14.349395000000186, - "hz": 4449.791660754542, - "period": 0.22472962247190512, - "mean": 0.22472962247190512, - "variance": 0.11002831717733241, - "sd": 0.3317051660395605, - "sem": 0.007032135455781835, - "df": 2224, + "totalTime": 500.07777300001453, + "min": 0.09459599999991042, + "max": 5.229916999999659, + "hz": 9498.52254281228, + "period": 0.1052795311578978, + "mean": 0.1052795311578978, + "variance": 0.006107279147414839, + "sd": 0.0781490828315652, + "sem": 0.0011339060712436122, + "df": 4749, "critical": 1.96, - "moe": 0.013782985493332397, - "p75": 0.22023100000023987, - "p99": 0.9773709999999483, - "p995": 1.2797639999998864, - "p999": 1.7311829999998736, - "sampleCount": 2225, - "median": 0.1766410000000178 + "moe": 0.00222245589963748, + "p75": 0.09964800000034302, + "p99": 0.19429200000013225, + "p995": 0.2577759999994669, + "p999": 0.392533999999614, + "sampleCount": 4750, + "median": 0.09768399999984467 }, { "id": "-486116013_1_3", "name": "joi", "rank": 2, - "rme": 2.139353418957897, + "rme": 0.3824721635756824, "samples": [], - "totalTime": 500.0073679999459, - "min": 0.002668000000085158, - "max": 1.7704389999998966, - "hz": 210306.90091753082, - "period": 0.004754955712994589, - "mean": 0.004754955712994589, - "variance": 0.00028325384160891946, - "sd": 0.016830146808893838, - "sem": 0.000051900667150961016, - "df": 105154, + "totalTime": 500.0004820001395, + "min": 0.0016429999996034894, + "max": 0.22770700000000943, + "hz": 536201.4831016207, + "period": 0.0018649705969024342, + "mean": 0.0018649705969024342, + "variance": 0.0000035508304422325483, + "sd": 0.0018843647317418537, + "sem": 0.000003639282342868908, + "df": 268100, "critical": 1.96, - "moe": 0.00010172530761588359, - "p75": 0.004184999999779393, - "p99": 0.01576199999999517, - "p995": 0.0344359999999142, - "p999": 0.16518300000007002, - "sampleCount": 105155, - "median": 0.003163999999742373 + "moe": 0.0000071329933920230595, + "p75": 0.0018360000003667665, + "p99": 0.0025049999994735117, + "p995": 0.0030730000007679337, + "p999": 0.0076280000002952875, + "sampleCount": 268101, + "median": 0.0017790000001696171 } ] } @@ -225,101 +225,101 @@ "id": "-196749604_0_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.63968270246331, + "rme": 0.3099933237539028, "samples": [], - "totalTime": 500.0032480000307, - "min": 0.0032400000000052387, - "max": 1.2412930000000415, - "hz": 204838.6693679912, - "period": 0.004881890724468177, - "mean": 0.004881890724468177, - "variance": 0.00017083166241456144, - "sd": 0.01307025869730823, - "sem": 0.00004084057028687014, - "df": 102419, + "totalTime": 500.00107199998376, + "min": 0.0020050000000537693, + "max": 0.1490349999999694, + "hz": 460069.0136120498, + "period": 0.0021735869411175853, + "mean": 0.0021735869411175853, + "variance": 0.000002718569813261854, + "sd": 0.0016488086041932988, + "sem": 0.0000034377420425771373, + "df": 230034, "critical": 1.96, - "moe": 0.00008004751776226546, - "p75": 0.004245999999966443, - "p99": 0.015897999999992862, - "p995": 0.034492999999997664, - "p999": 0.17111399999998866, - "sampleCount": 102420, - "median": 0.0035950000001321314 + "moe": 0.000006737974403451189, + "p75": 0.002132999999957974, + "p99": 0.002669000000082633, + "p995": 0.003291999999987638, + "p999": 0.00823600000001079, + "sampleCount": 230035, + "median": 0.002100999999981923 }, { "id": "-196749604_0_1", "name": "zod", "rank": 2, - "rme": 2.619262554782962, + "rme": 0.3663485095839867, "samples": [], - "totalTime": 500.00149699999065, - "min": 0.0038789999998698477, - "max": 3.247039000000086, - "hz": 129859.61120032649, - "period": 0.007700623702448647, - "mean": 0.007700623702448647, - "variance": 0.0006876115011374184, - "sd": 0.026222347361314135, - "sem": 0.00010290793526682591, - "df": 64929, + "totalTime": 500.0019159999513, + "min": 0.002484999999978754, + "max": 0.23529599999994844, + "hz": 348134.665947994, + "period": 0.0028724516625683715, + "mean": 0.0028724516625683715, + "variance": 0.000005017658650120345, + "sd": 0.0022400130915064638, + "sem": 0.000005368971354254936, + "df": 174067, "critical": 1.96, - "moe": 0.00020169955312297877, - "p75": 0.007601000000022395, - "p99": 0.0276339999998072, - "p995": 0.058826999999837426, - "p999": 0.2562909999999192, - "sampleCount": 64930, - "median": 0.0051590000000487635 + "moe": 0.000010523183854339675, + "p75": 0.002881999999999607, + "p99": 0.0036290000000462896, + "p995": 0.0051680000001397275, + "p999": 0.009507999999868844, + "sampleCount": 174068, + "median": 0.0027420000001256994 }, { "id": "-196749604_0_2", "name": "yup", "rank": 4, - "rme": 2.7000763621542396, + "rme": 0.8958158262499574, "samples": [], - "totalTime": 500.04177399998366, - "min": 0.04301899999973102, - "max": 1.9743419999999787, - "hz": 14012.829256141766, - "period": 0.07136317596688792, - "mean": 0.07136317596688792, - "variance": 0.006772053929195933, - "sd": 0.08229249011420138, - "sem": 0.0009830919620226917, - "df": 7006, + "totalTime": 500.0269569999971, + "min": 0.028414000000111628, + "max": 2.0260589999998047, + "hz": 31662.292959137587, + "period": 0.031583309562910375, + "mean": 0.031583309562910375, + "variance": 0.0003298954868444732, + "sd": 0.018163025266856654, + "sem": 0.0001443511660806466, + "df": 15831, "critical": 1.96, - "moe": 0.0019268602455644757, - "p75": 0.06512000000020635, - "p99": 0.3956439999997201, - "p995": 0.5680349999997816, - "p999": 1.1782709999997678, - "sampleCount": 7007, - "median": 0.05252699999982724 + "moe": 0.00028292828551806736, + "p75": 0.031057000000146218, + "p99": 0.04702100000008613, + "p995": 0.07940400000006775, + "p999": 0.19059599999991406, + "sampleCount": 15832, + "median": 0.030344500000069274 }, { "id": "-196749604_0_3", "name": "joi", "rank": 3, - "rme": 3.134622691857939, + "rme": 0.3825162281715389, "samples": [], - "totalTime": 500.14839499998106, - "min": 0.01361399999996138, - "max": 2.6730459999998857, - "hz": 33983.91391419069, - "period": 0.02942568659175037, - "mean": 0.02942568659175037, - "variance": 0.003764297056939181, - "sd": 0.06135386749781289, - "sem": 0.0004706042087449011, - "df": 16996, + "totalTime": 500.00288500006627, + "min": 0.00884700000005978, + "max": 0.18466999999964173, + "hz": 102783.40693972833, + "period": 0.009729196859434665, + "mean": 0.009729196859434665, + "variance": 0.000018528364589623282, + "sd": 0.004304458687178131, + "sem": 0.000018987631050047605, + "df": 51391, "critical": 1.96, - "moe": 0.0009223842491400061, - "p75": 0.027422999999998865, - "p99": 0.17884800000001633, - "p995": 0.3272740000002159, - "p999": 0.9264579999999114, - "sampleCount": 16997, - "median": 0.01846400000022186 + "moe": 0.000037215756858093304, + "p75": 0.009634000000005472, + "p99": 0.014913999999862426, + "p995": 0.01661999999987529, + "p999": 0.08730800000012096, + "sampleCount": 51392, + "median": 0.009407999999893946 } ] }, @@ -330,101 +330,101 @@ "id": "-196749604_1_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.560735124134935, + "rme": 0.7517085708743978, "samples": [], - "totalTime": 500.00007100004905, - "min": 0.0005479999999806751, - "max": 1.3829039999995985, - "hz": 1274437.8190297047, - "period": 0.0007846597025513191, - "mean": 0.0007846597025513191, - "variance": 0.000024876981376325582, - "sd": 0.004987682966701631, - "sem": 0.00000624819366461793, - "df": 637218, + "totalTime": 500.0001100000568, + "min": 0.0003780000001825101, + "max": 1.7537909999996373, + "hz": 2377735.476897925, + "period": 0.00042056822961006335, + "mean": 0.00042056822961006335, + "variance": 0.000003093096172284511, + "sd": 0.0017587200380630543, + "sem": 0.0000016129833818130424, + "df": 1188867, "critical": 1.96, - "moe": 0.000012246459582651142, - "p75": 0.0006439999997382984, - "p99": 0.00220900000022084, - "p995": 0.00302800000008574, - "p999": 0.016016000000036, - "sampleCount": 637219, - "median": 0.0006039999998392886 + "moe": 0.000003161447428353563, + "p75": 0.00040200000012191595, + "p99": 0.00107300000036048, + "p995": 0.001303999999890948, + "p999": 0.002013999999689986, + "sampleCount": 1188868, + "median": 0.0003969999997934792 }, { "id": "-196749604_1_1", "name": "zod", "rank": 3, - "rme": 12.855133321141382, + "rme": 8.843570172194335, "samples": [], - "totalTime": 500.0148389999931, - "min": 0.012083000000529864, - "max": 13.534990999999536, - "hz": 39612.82437059887, - "period": 0.02524434992679321, - "mean": 0.02524434992679321, - "variance": 0.05429853498496379, - "sd": 0.23302046044277697, - "sem": 0.0016557116526248596, - "df": 19806, + "totalTime": 500.00304100000903, + "min": 0.007532000000537664, + "max": 7.5019359999996595, + "hz": 87647.46692810456, + "period": 0.011409342848667603, + "mean": 0.011409342848667603, + "variance": 0.011613854644464756, + "sd": 0.10776759552140316, + "sem": 0.0005147924699021201, + "df": 43823, "critical": 1.96, - "moe": 0.0032451948391447245, - "p75": 0.01848399999926187, - "p99": 0.0916799999995419, - "p995": 0.16750499999943713, - "p999": 0.5773869999993622, - "sampleCount": 19807, - "median": 0.01432699999986653 + "moe": 0.0010089932410081554, + "p75": 0.008708999999726075, + "p99": 0.017036000000189233, + "p995": 0.01959900000019843, + "p999": 0.04553399999986141, + "sampleCount": 43824, + "median": 0.008392999999159656 }, { "id": "-196749604_1_2", "name": "yup", "rank": 4, - "rme": 4.333530814986146, + "rme": 0.3667410274771108, "samples": [], - "totalTime": 500.0213360000307, - "min": 0.04379200000039418, - "max": 6.804798999999548, - "hz": 13279.4333400197, - "period": 0.07530441807229378, - "mean": 0.07530441807229378, - "variance": 0.018406898962633835, - "sd": 0.13567202719291047, - "sem": 0.001664969470514718, - "df": 6639, + "totalTime": 500.00612700004694, + "min": 0.02443299999958981, + "max": 0.33657099999982165, + "hz": 36669.550651322876, + "period": 0.027270582328881753, + "mean": 0.027270582328881753, + "variance": 0.00004773935973218932, + "sd": 0.006909367534889813, + "sem": 0.00005102674175098589, + "df": 18334, "critical": 1.96, - "moe": 0.003263340162208847, - "p75": 0.06797299999925599, - "p99": 0.4024390000004132, - "p995": 0.6329849999992803, - "p999": 1.6662370000003648, - "sampleCount": 6640, - "median": 0.05106049999994866 + "moe": 0.00010001241383193235, + "p75": 0.027274000000033993, + "p99": 0.038523000000168395, + "p995": 0.042567000000417465, + "p999": 0.06393599999955768, + "sampleCount": 18335, + "median": 0.02653100000043196 }, { "id": "-196749604_1_3", "name": "joi", "rank": 2, - "rme": 2.294145876983529, + "rme": 0.20246866376032394, "samples": [], - "totalTime": 500.0028059999113, - "min": 0.002628000000186148, - "max": 2.980390000000625, - "hz": 248418.60587482792, - "period": 0.004025463376539017, - "mean": 0.004025463376539017, - "variance": 0.0002757517251919657, - "sd": 0.016605773851042466, - "sem": 0.000047117348001199895, - "df": 124209, + "totalTime": 500.001728000163, + "min": 0.0017690000004222384, + "max": 0.31801999999970576, + "hz": 512970.2271747277, + "period": 0.0019494308773194754, + "mean": 0.0019494308773194754, + "variance": 0.000001040118537043052, + "sd": 0.0010198620186295066, + "sem": 0.0000020137686980815822, + "df": 256485, "critical": 1.96, - "moe": 0.0000923500020823518, - "p75": 0.0034619999996721162, - "p99": 0.011279999999715073, - "p995": 0.024298999999700754, - "p999": 0.11071600000013859, - "sampleCount": 124210, - "median": 0.002931999999418622 + "moe": 0.000003946986648239901, + "p75": 0.0019199999996999395, + "p99": 0.003208000000086031, + "p995": 0.003515000000334112, + "p999": 0.008397000000513799, + "sampleCount": 256486, + "median": 0.0018979999995281105 } ] } @@ -440,101 +440,101 @@ "id": "-405503131_0_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 4.16948042984297, + "rme": 0.49829705071866476, "samples": [], - "totalTime": 500.00551400000336, - "min": 0.0008350000000518776, - "max": 4.176439000000073, - "hz": 534092.110032207, - "period": 0.0018723362154511095, - "mean": 0.0018723362154511095, - "variance": 0.00042365308003715184, - "sd": 0.02058283459674959, - "sem": 0.000039829944940865566, - "df": 267048, + "totalTime": 500.0001230000258, + "min": 0.00040300000000570435, + "max": 0.9758219999999937, + "hz": 2127077.476738831, + "period": 0.0004701286205771728, + "mean": 0.0004701286205771728, + "variance": 0.000001519327130025158, + "sd": 0.0012326098855782223, + "sem": 0.0000011952229851634662, + "df": 1063538, "critical": 1.96, - "moe": 0.00007806669208409651, - "p75": 0.001694000000043161, - "p99": 0.0052390000000741566, - "p995": 0.01072199999998702, - "p999": 0.0927679999999782, - "sampleCount": 267049, - "median": 0.0012420000002748566 + "moe": 0.000002342637050920394, + "p75": 0.00044900000000325235, + "p99": 0.0009040000000481996, + "p995": 0.0013229999999566644, + "p999": 0.0023219999999923857, + "sampleCount": 1063539, + "median": 0.0004430000000184009 }, { "id": "-405503131_0_1", "name": "zod", "rank": 2, - "rme": 7.033693814157711, + "rme": 0.30532652474509314, "samples": [], - "totalTime": 500.14934399999765, - "min": 0.0011779999999816937, - "max": 11.200180999999702, - "hz": 312510.65681693814, - "period": 0.0031998908779158146, - "mean": 0.0031998908779158146, - "variance": 0.0020610553126730077, - "sd": 0.04539884704123011, - "sem": 0.00011483190139783751, - "df": 156301, + "totalTime": 500.0004420000005, + "min": 0.0005289999999149586, + "max": 0.39149399999996604, + "hz": 1733886.4672443613, + "period": 0.0005767390304333388, + "mean": 0.0005767390304333388, + "variance": 6.997882687013967e-7, + "sd": 0.0008365334833115748, + "sem": 8.984373665666626e-7, + "df": 866943, "critical": 1.96, - "moe": 0.00022507052673976152, - "p75": 0.0025040000000444707, - "p99": 0.01121899999998277, - "p995": 0.026869999999689753, - "p999": 0.17154100000016115, - "sampleCount": 156302, - "median": 0.002187000000049011 + "moe": 0.0000017609372384706587, + "p75": 0.0005659999999352294, + "p99": 0.0008759999998346757, + "p995": 0.0011569999999210268, + "p999": 0.001912000000174885, + "sampleCount": 866944, + "median": 0.0005560000001878507 }, { "id": "-405503131_0_2", "name": "yup", "rank": 4, - "rme": 5.4673564827520185, + "rme": 0.431741572570367, "samples": [], - "totalTime": 500.0007080000614, - "min": 0.008641000000352506, - "max": 3.7751650000000154, - "hz": 33663.95233183936, - "period": 0.02970536525665764, - "mean": 0.02970536525665764, - "variance": 0.01155708099144025, - "sd": 0.10750386500698592, - "sem": 0.0008286215372882844, - "df": 16831, + "totalTime": 500.00281000006817, + "min": 0.0038300000001072476, + "max": 0.29880999999977575, + "hz": 219130.76848505123, + "period": 0.00456348511399584, + "mean": 0.00456348511399584, + "variance": 0.000011071454477061627, + "sd": 0.0033273795210437937, + "sem": 0.000010052276732234817, + "df": 109565, "critical": 1.96, - "moe": 0.0016240982130850373, - "p75": 0.022038999999949738, - "p99": 0.25215900000057445, - "p995": 0.5212299999998322, - "p999": 1.7510270000002492, - "sampleCount": 16832, - "median": 0.01799299999993309 + "moe": 0.000019702462395180243, + "p75": 0.004580999999689084, + "p99": 0.008483999999953085, + "p995": 0.009332000000085827, + "p999": 0.014948999999887747, + "sampleCount": 109566, + "median": 0.004350000000158616 }, { "id": "-405503131_0_3", "name": "joi", "rank": 3, - "rme": 2.3333093176301745, + "rme": 0.428829301273739, "samples": [], - "totalTime": 500.0041419999234, - "min": 0.004003000000011525, - "max": 2.8615499999996246, - "hz": 110079.088104851, - "period": 0.009084377579940468, - "mean": 0.009084377579940468, - "variance": 0.0006437263203966357, - "sd": 0.025371762264309424, - "sem": 0.00010814623904155995, - "df": 55039, + "totalTime": 500.0002809999655, + "min": 0.0020039999999426072, + "max": 0.4077029999998558, + "hz": 436035.75494793575, + "period": 0.0022933899081725617, + "mean": 0.0022933899081725617, + "variance": 0.000005489147584056681, + "sd": 0.0023428929945809905, + "sem": 0.000005017718325866757, + "df": 218017, "critical": 1.96, - "moe": 0.0002119666285214575, - "p75": 0.008716000000276836, - "p99": 0.047355000000607106, - "p995": 0.07978800000000774, - "p999": 0.24217499999940628, - "sampleCount": 55040, - "median": 0.005498999999872467 + "moe": 0.000009834727918698843, + "p75": 0.002247999999781314, + "p99": 0.005515999999715859, + "p995": 0.005788999999822408, + "p999": 0.009019999999964057, + "sampleCount": 218018, + "median": 0.0021430000001601 } ] }, @@ -545,101 +545,101 @@ "id": "-405503131_1_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 0.962797290728081, + "rme": 0.08144957724692985, "samples": [], - "totalTime": 500.0005740002034, - "min": 0.0003210000004401081, - "max": 0.5241580000001704, - "hz": 1659946.0943812083, - "period": 0.0006024292013969153, - "mean": 0.0006024292013969153, - "variance": 0.0000072683209167296515, - "sd": 0.0026959823658046526, - "sem": 0.0000029592714436756715, - "df": 829973, + "totalTime": 500.000152000639, + "min": 0.00015799999982846202, + "max": 0.05326599999989412, + "hz": 5495482.329366349, + "period": 0.00018196764907354437, + "mean": 0.00018196764907354437, + "variance": 1.5711941263848103e-8, + "sd": 0.00012534728263447956, + "sem": 7.561830657988711e-8, + "df": 2747741, "critical": 1.96, - "moe": 0.000005800172029604316, - "p75": 0.0006330000005618786, - "p99": 0.002532000000428525, - "p995": 0.0033970000004046597, - "p999": 0.01565500000015163, - "sampleCount": 829974, - "median": 0.00038500000027852366 + "moe": 1.4821188089657873e-7, + "p75": 0.00017700000034892582, + "p99": 0.0003519999995660328, + "p995": 0.0003839999999399879, + "p999": 0.0005880000003344321, + "sampleCount": 2747742, + "median": 0.0001749999996718543 }, { "id": "-405503131_1_1", "name": "zod", "rank": 3, - "rme": 19.597984541988918, + "rme": 8.67260107303575, "samples": [], - "totalTime": 515.4910049999762, - "min": 0.002868000000489701, - "max": 20.897453000000496, - "hz": 136293.3578249406, - "period": 0.007337114705798289, - "mean": 0.007337114705798289, - "variance": 0.03781438826667143, - "sd": 0.19445922006084318, - "sem": 0.0007336360234032369, - "df": 70257, + "totalTime": 500.00159899993196, + "min": 0.0013550000003306195, + "max": 7.22219799999948, + "hz": 456536.5399962072, + "period": 0.0021904051754724992, + "mean": 0.0021904051754724992, + "variance": 0.0021442847025235326, + "sd": 0.046306421828117235, + "sem": 0.00009692097079176458, + "df": 228268, "critical": 1.96, - "moe": 0.0014379266058703443, - "p75": 0.005153000000063912, - "p99": 0.019256000000495987, - "p995": 0.031563000000460306, - "p999": 0.09671799999978248, - "sampleCount": 70258, - "median": 0.0035120000002279994 + "moe": 0.00018996510275185856, + "p75": 0.0015800000001036096, + "p99": 0.0037439999996422557, + "p995": 0.004150000000663567, + "p999": 0.009108999999625667, + "sampleCount": 228269, + "median": 0.0015009999997346313 }, { "id": "-405503131_1_2", "name": "yup", "rank": 4, - "rme": 3.712603008567371, + "rme": 0.34380107585994096, "samples": [], - "totalTime": 500.02576799998496, - "min": 0.030247000000599655, - "max": 8.553248999999596, - "hz": 22808.824524419997, - "period": 0.04384268022796887, - "mean": 0.04384268022796887, - "variance": 0.007865645395342092, - "sd": 0.08868847385845632, - "sem": 0.0008304615638674204, - "df": 11404, + "totalTime": 500.0070209999867, + "min": 0.014415999999982887, + "max": 0.28315699999984645, + "hz": 62771.11856795474, + "period": 0.015930893423819113, + "mean": 0.015930893423819113, + "variance": 0.000024508602885837946, + "sd": 0.004950616414734426, + "sem": 0.000027944174992444237, + "df": 31385, "critical": 1.96, - "moe": 0.001627704665180144, - "p75": 0.03889199999957782, - "p99": 0.17775999999958003, - "p995": 0.28226400000039575, - "p999": 0.6062040000006164, - "sampleCount": 11405, - "median": 0.03537599999981467 + "moe": 0.0000547705829851907, + "p75": 0.015583999999762455, + "p99": 0.03158199999961653, + "p995": 0.032581999999820255, + "p999": 0.04485099999965314, + "sampleCount": 31386, + "median": 0.0152909999997064 }, { "id": "-405503131_1_3", "name": "joi", "rank": 2, - "rme": 1.80221790440434, + "rme": 0.2629528255246551, "samples": [], - "totalTime": 500.1410259999175, - "min": 0.0022449999996752013, - "max": 2.116135999999642, - "hz": 275752.22353389335, - "period": 0.0036264440126158684, - "mean": 0.0036264440126158684, - "variance": 0.00015334722269487835, - "sd": 0.012383344568204438, - "sem": 0.0000333451139227359, - "df": 137914, + "totalTime": 500.00001200003226, + "min": 0.0010849999998754356, + "max": 0.21957299999940005, + "hz": 821543.9802828914, + "period": 0.00121722028765357, + "mean": 0.00121722028765357, + "variance": 0.0000010954252261599312, + "sd": 0.0010466256380195983, + "sem": 0.0000016330179281859166, + "df": 410771, "critical": 1.96, - "moe": 0.00006535642328856237, - "p75": 0.003473999999187072, - "p99": 0.01101599999856262, - "p995": 0.02430999999978667, - "p999": 0.11602200000015728, - "sampleCount": 137915, - "median": 0.0025509999995847465 + "moe": 0.0000032007151392443966, + "p75": 0.0011970000005021575, + "p99": 0.0016310000000885339, + "p995": 0.0017880000004879548, + "p999": 0.00591800000074727, + "sampleCount": 410772, + "median": 0.001172000000224216 } ] } @@ -655,101 +655,101 @@ "id": "1256241639_0_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.6417386505344898, + "rme": 0.5480384200420244, "samples": [], - "totalTime": 500.0019939999579, - "min": 0.0010990000000674627, - "max": 1.3460439999998925, - "hz": 561609.7603003233, - "period": 0.0017805958348466838, - "mean": 0.0017805958348466838, - "variance": 0.00006246446031052803, - "sd": 0.007903446103474612, - "sem": 0.000014914658178819021, - "df": 280805, + "totalTime": 500.0005729999997, + "min": 0.0006240000000161672, + "max": 1.0705070000000205, + "hz": 1381014.4173574785, + "period": 0.0007241054021097506, + "mean": 0.0007241054021097506, + "variance": 0.000002830623826973177, + "sd": 0.001682445787231546, + "sem": 0.000002024681533245523, + "df": 690507, "critical": 1.96, - "moe": 0.00002923273003048528, - "p75": 0.0016580000001340522, - "p99": 0.005357000000003609, - "p995": 0.006427999999914391, - "p999": 0.043128999999908046, - "sampleCount": 280806, - "median": 0.00128400000005513 + "moe": 0.000003968375805161225, + "p75": 0.0006930000000124892, + "p99": 0.0015430000000833388, + "p995": 0.0016130000000202926, + "p999": 0.004592000000002372, + "sampleCount": 690508, + "median": 0.0006770000000528853 }, { "id": "1256241639_0_1", "name": "zod", "rank": 2, - "rme": 3.4938928167632146, + "rme": 1.203019552748297, "samples": [], - "totalTime": 500.0020229999577, - "min": 0.001563999999916632, - "max": 8.091660999999931, - "hz": 347470.59413400554, - "period": 0.002877941376571106, - "mean": 0.002877941376571106, - "variance": 0.0004572573737468873, - "sd": 0.02138357719715968, - "sem": 0.00005130213623809911, - "df": 173735, + "totalTime": 500.0005090000943, + "min": 0.0009260000001631852, + "max": 2.9141970000000583, + "hz": 935195.0479712647, + "period": 0.001069295653531654, + "mean": 0.001069295653531654, + "variance": 0.000020141948317269417, + "sd": 0.004487978199286335, + "sem": 0.00000656318152483341, + "df": 467597, "critical": 1.96, - "moe": 0.00010055218702667425, - "p75": 0.002936000000090644, - "p99": 0.008315999999922496, - "p995": 0.011412999999947715, - "p999": 0.07300000000009277, - "sampleCount": 173736, - "median": 0.0019179999999323627 + "moe": 0.000012863835788673483, + "p75": 0.001030000000127984, + "p99": 0.001778000000058455, + "p995": 0.0020570000001498556, + "p999": 0.0057769999998527055, + "sampleCount": 467598, + "median": 0.0009919999999965512 }, { "id": "1256241639_0_2", "name": "yup", "rank": 4, - "rme": 2.2286534790563626, + "rme": 0.35420162012375206, "samples": [], - "totalTime": 500.00795099999686, - "min": 0.011957000000165863, - "max": 1.8477069999999003, - "hz": 39337.37445707163, - "period": 0.025421117036961555, - "mean": 0.025421117036961555, - "variance": 0.0016434045808905399, - "sd": 0.04053892673579975, - "sem": 0.000289055412887364, - "df": 19668, + "totalTime": 500.00592399993184, + "min": 0.007448000000067623, + "max": 0.22029499999985092, + "hz": 119000.59008102494, + "period": 0.00840331967529843, + "mean": 0.00840331967529843, + "variance": 0.000013721923028145764, + "sd": 0.0037043114107949623, + "sem": 0.000015186068588818907, + "df": 59500, "critical": 1.96, - "moe": 0.0005665486092592334, - "p75": 0.026710999999977503, - "p99": 0.13644699999986187, - "p995": 0.21451400000023568, - "p999": 0.5794449999998506, - "sampleCount": 19669, - "median": 0.016485999999986234 + "moe": 0.000029764694434085056, + "p75": 0.008446999999932814, + "p99": 0.012463000000025204, + "p995": 0.013355999999930646, + "p999": 0.022685000000137734, + "sampleCount": 59501, + "median": 0.00818899999990208 }, { "id": "1256241639_0_3", "name": "joi", "rank": 3, - "rme": 2.1648826278369833, + "rme": 0.24656813669452524, "samples": [], - "totalTime": 500.00196699995195, - "min": 0.005683999999746447, - "max": 2.0965530000003127, - "hz": 97653.6158306847, - "period": 0.010240276220123128, - "mean": 0.010240276220123128, - "variance": 0.00062465461427901, - "sd": 0.02499309133098605, - "sem": 0.0001131071229244731, - "df": 48826, + "totalTime": 500.0030919999658, + "min": 0.003121000000191998, + "max": 0.21409099999982573, + "hz": 283316.2479723419, + "period": 0.0035296246055666483, + "mean": 0.0035296246055666483, + "variance": 0.0000027929487853673245, + "sd": 0.0016712117715500104, + "sem": 0.000004440270215437332, + "df": 141658, "critical": 1.96, - "moe": 0.00022168996093196728, - "p75": 0.009943999999904918, - "p99": 0.044206000000031054, - "p995": 0.07887699999992037, - "p999": 0.29618699999991804, - "sampleCount": 48827, - "median": 0.00746900000012829 + "moe": 0.000008702929622257171, + "p75": 0.003568000000086613, + "p99": 0.004523999999946682, + "p995": 0.007145000000036816, + "p999": 0.009703000000172324, + "sampleCount": 141659, + "median": 0.0034270000001015433 } ] }, @@ -760,101 +760,101 @@ "id": "1256241639_1_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 4.377763602283172, + "rme": 0.32003734328257694, "samples": [], - "totalTime": 500.00017000001753, - "min": 0.00025600000026315683, - "max": 10.459092999999939, - "hz": 2238661.2388551002, - "period": 0.0004466955440348007, - "mean": 0.0004466955440348007, - "variance": 0.00011142284461011305, - "sd": 0.01055570199513576, - "sem": 0.000009977181091722604, - "df": 1119330, + "totalTime": 500.000165000612, + "min": 0.00014699999974254752, + "max": 0.3389089999996031, + "hz": 5697232.119906427, + "period": 0.00017552382963403364, + "mean": 0.00017552382963403364, + "variance": 2.3398897983944856e-7, + "sd": 0.00048372407407472345, + "sem": 2.866029597901009e-7, + "df": 2848616, "critical": 1.96, - "moe": 0.000019555274939776304, - "p75": 0.0003830000000561995, - "p99": 0.0017840000000433065, - "p995": 0.002187000000049011, - "p999": 0.0061480000003939494, - "sampleCount": 1119331, - "median": 0.00029200000017226557 + "moe": 5.617418011885978e-7, + "p75": 0.0001720000000204891, + "p99": 0.00024500000017724233, + "p995": 0.00040399999988949276, + "p999": 0.0009419999996680417, + "sampleCount": 2848617, + "median": 0.00016899999991437653 }, { "id": "1256241639_1_1", "name": "zod", "rank": 3, - "rme": 19.51564316279704, + "rme": 9.767373063495018, "samples": [], - "totalTime": 500.00116199995955, - "min": 0.003862999999910244, - "max": 20.87316700000065, - "hz": 85367.80160523597, - "period": 0.011714018414393205, - "mean": 0.011714018414393205, - "variance": 0.058067149943818924, - "sd": 0.24097126373038533, - "sem": 0.001166360221314956, - "df": 42683, + "totalTime": 500.00089700007084, + "min": 0.0022050000006856862, + "max": 4.713353000000097, + "hz": 263361.5275293823, + "period": 0.0037970618160560053, + "mean": 0.0037970618160560053, + "variance": 0.004714784639498874, + "sd": 0.06866428940503844, + "sem": 0.00018922101684985153, + "df": 131680, "critical": 1.96, - "moe": 0.0022860660337773136, - "p75": 0.008668000000398024, - "p99": 0.03445599999940896, - "p995": 0.06292600000051607, - "p999": 0.23566099999970902, - "sampleCount": 42684, - "median": 0.005724999999983993 + "moe": 0.000370873193025709, + "p75": 0.00274000000081287, + "p99": 0.004770999999891501, + "p995": 0.0062750000006417395, + "p999": 0.012651999999434338, + "sampleCount": 131681, + "median": 0.0025289999994129175 }, { "id": "1256241639_1_2", "name": "yup", "rank": 4, - "rme": 3.2038700676034146, + "rme": 2.1603058474821957, "samples": [], - "totalTime": 500.01094199998533, - "min": 0.0315519999994649, - "max": 5.714480999999978, - "hz": 21509.529285461747, - "period": 0.04649102203626084, - "mean": 0.04649102203626084, - "variance": 0.0062113535402452584, - "sd": 0.07881214081754954, - "sem": 0.0007599550709911575, - "df": 10754, + "totalTime": 500.00792799994906, + "min": 0.01703599999927974, + "max": 5.422594000000572, + "hz": 48645.22868125899, + "period": 0.020557000698924847, + "mean": 0.020557000698924847, + "variance": 0.0012486909977758242, + "sd": 0.03533682212332943, + "sem": 0.00022657861641113742, + "df": 24322, "critical": 1.96, - "moe": 0.0014895119391426686, - "p75": 0.04386499999964144, - "p99": 0.18772200000057637, - "p995": 0.2816450000000259, - "p999": 0.8502250000001368, - "sampleCount": 10755, - "median": 0.03656200000023091 + "moe": 0.0004440940881658293, + "p75": 0.019373000000086904, + "p99": 0.040922999999565945, + "p995": 0.04297300000052928, + "p999": 0.06407300000046234, + "sampleCount": 24323, + "median": 0.01892799999950512 }, { "id": "1256241639_1_3", "name": "joi", "rank": 2, - "rme": 1.6892876506203482, + "rme": 0.44430018149816336, "samples": [], - "totalTime": 500.000805000147, - "min": 0.0017629999993005185, - "max": 2.0543539999998757, - "hz": 376909.39317576616, - "period": 0.0026531575442421108, - "mean": 0.0026531575442421108, - "variance": 0.00009854368859694025, - "sd": 0.009926917376353057, - "sem": 0.000022867072829787794, - "df": 188454, + "totalTime": 500.00071299987576, + "min": 0.0010919999995167018, + "max": 0.29843499999969936, + "hz": 806668.8496904208, + "period": 0.001239666066668838, + "mean": 0.001239666066668838, + "variance": 0.0000031850494224101087, + "sd": 0.0017846706761781314, + "sem": 0.0000028101217266228515, + "df": 403334, "critical": 1.96, - "moe": 0.00004481946274638408, - "p75": 0.002246000000013737, - "p99": 0.008085000000392029, - "p995": 0.011977000000115368, - "p999": 0.07248799999979383, - "sampleCount": 188455, - "median": 0.0019119999997201376 + "moe": 0.000005507838584180789, + "p75": 0.0011999999996987754, + "p99": 0.0019879999999830034, + "p995": 0.002779000000373344, + "p999": 0.006137000000308035, + "sampleCount": 403335, + "median": 0.0011719999993147212 } ] } @@ -870,101 +870,101 @@ "id": "516466309_0_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 0.9996873601490474, + "rme": 0.07440653691892243, "samples": [], - "totalTime": 500.0000579999589, - "min": 0.000091999999995096, - "max": 0.7801970000000438, - "hz": 6405937.256911804, - "period": 0.00015610518178601134, - "mean": 0.00015610518178601134, - "variance": 0.000002030502990155665, - "sd": 0.0014249571888852188, - "sem": 7.962060055369634e-7, - "df": 3202968, + "totalTime": 500.00008599995243, + "min": 0.00008700000012140663, + "max": 0.06556799999998475, + "hz": 9560518.355591753, + "period": 0.0001045968390840566, + "mean": 0.0001045968390840566, + "variance": 7.537002862522322e-9, + "sd": 0.0000868159136479155, + "sem": 3.970759473933901e-8, + "df": 4780259, "critical": 1.96, - "moe": 0.0000015605637708524483, - "p75": 0.00012599999990925426, - "p99": 0.0005120000000715663, - "p995": 0.0006999999998242856, - "p999": 0.0013609999998607236, - "sampleCount": 3202969, - "median": 0.00011800000015682599 + "moe": 7.782688568910447e-8, + "p75": 0.00010499999984858732, + "p99": 0.0001560000000608852, + "p995": 0.0001830000001064036, + "p999": 0.00024300000001176159, + "sampleCount": 4780260, + "median": 0.00010199999996984843 }, { "id": "516466309_0_1", "name": "zod", "rank": 2, - "rme": 2.068289599036346, + "rme": 0.32853325423722035, "samples": [], - "totalTime": 500.00052999985746, - "min": 0.0001560000000608852, - "max": 2.9195529999997234, - "hz": 3828537.9417508733, - "period": 0.00026119631441935725, - "mean": 0.00026119631441935725, - "variance": 0.00001454280103861, - "sd": 0.003813502463433058, - "sem": 0.000002756273573572366, - "df": 1914270, + "totalTime": 500.0000129992254, + "min": 0.00010199999996984843, + "max": 0.23725599999988845, + "hz": 8128125.788681321, + "period": 0.00012302959206075926, + "mean": 0.00012302959206075926, + "variance": 1.7283278493125678e-7, + "sd": 0.00041573162608978496, + "sem": 2.0622098085305576e-7, + "df": 4064062, "critical": 1.96, - "moe": 0.000005402296204201837, - "p75": 0.00020499999936873792, - "p99": 0.0007560000003650202, - "p995": 0.0010300000003553578, - "p999": 0.003303000000414613, - "sampleCount": 1914271, - "median": 0.00018799999998009298 + "moe": 4.041931224719893e-7, + "p75": 0.00012100000003556488, + "p99": 0.00018499999987398041, + "p995": 0.00022400000034394907, + "p999": 0.0006520000001728476, + "sampleCount": 4064063, + "median": 0.00011899999981324072 }, { "id": "516466309_0_2", "name": "yup", "rank": 4, - "rme": 1.439812719948624, + "rme": 0.49664617261447347, "samples": [], - "totalTime": 500.0000990001472, - "min": 0.0008589999997639097, - "max": 1.8078800000002957, - "hz": 538523.8933721106, - "period": 0.001856927821230427, - "mean": 0.001856927821230427, - "variance": 0.000050103144427987024, - "sd": 0.007078357466812977, - "sem": 0.000013640960699153333, - "df": 269261, + "totalTime": 500.00060199991094, + "min": 0.000630999999884807, + "max": 0.31312700000034965, + "hz": 1218766.5326053118, + "period": 0.0008205016902313007, + "mean": 0.0008205016902313007, + "variance": 0.0000026340987390788724, + "sd": 0.001622990677446692, + "sem": 0.000002079076653454499, + "df": 609383, "critical": 1.96, - "moe": 0.000026736282970340532, - "p75": 0.0018460000001141452, - "p99": 0.006335000000035507, - "p995": 0.008136999999805994, - "p999": 0.04818399999930989, - "sampleCount": 269262, - "median": 0.0012539999997898121 + "moe": 0.000004074990240770818, + "p75": 0.0008050000005823676, + "p99": 0.0014540000001943554, + "p995": 0.0016630000000077416, + "p999": 0.005280999999740743, + "sampleCount": 609384, + "median": 0.0007530000002589077 }, { "id": "516466309_0_3", "name": "joi", "rank": 3, - "rme": 2.0401251319025624, + "rme": 0.49226497823270565, "samples": [], - "totalTime": 500.00066500021967, - "min": 0.00032000000010157237, - "max": 2.6019820000001346, - "hz": 1603937.8667619326, - "period": 0.00062346554733995, - "mean": 0.00062346554733995, - "variance": 0.000033774156416447034, - "sd": 0.005811553700728148, - "sem": 0.000006489529244916422, - "df": 801969, + "totalTime": 500.0001659997861, + "min": 0.00021999999989930075, + "max": 0.35650900000018737, + "hz": 3891718.7079510535, + "period": 0.0002569558786345298, + "mean": 0.0002569558786345298, + "variance": 8.104280095698021e-7, + "sd": 0.0009002377516910753, + "sem": 6.453590816469008e-7, + "df": 1945859, "critical": 1.96, - "moe": 0.000012719477320036188, - "p75": 0.000586000000112108, - "p99": 0.001900999999634223, - "p995": 0.0025420000001759036, - "p999": 0.01065900000048714, - "sampleCount": 801970, - "median": 0.0004109999999855063 + "moe": 0.0000012649038000279256, + "p75": 0.0002479999993738602, + "p99": 0.0004060000001118169, + "p995": 0.0007720000003246241, + "p999": 0.0012640000004466856, + "sampleCount": 1945860, + "median": 0.00024399999983870657 } ] }, @@ -975,101 +975,101 @@ "id": "516466309_1_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 3.1867247923947635, + "rme": 0.5188392152545876, "samples": [], - "totalTime": 500.00012199917273, - "min": 0.00010300000030838419, - "max": 6.803437000000486, - "hz": 5736502.600302856, - "period": 0.00017432224295465417, - "mean": 0.00017432224295465417, - "variance": 0.0000230409239825764, - "sd": 0.004800096247220091, - "sem": 0.00000283427047698704, - "df": 2868251, + "totalTime": 500.0000120000768, + "min": 0.00008199999956559623, + "max": 0.33030300000064017, + "hz": 10755775.741859728, + "period": 0.00009297330327445957, + "mean": 0.00009297330327445957, + "variance": 3.257479723088075e-7, + "sd": 0.0005707433506479138, + "sem": 2.4611324342116017e-7, + "df": 5377887, "critical": 1.96, - "moe": 0.000005555170134894598, - "p75": 0.00013000000035390258, - "p99": 0.0005430000001069857, - "p995": 0.0007459999997081468, - "p999": 0.0020480000002862653, - "sampleCount": 2868252, - "median": 0.00012199999946460593 + "moe": 4.823819571054739e-7, + "p75": 0.00009099999988393392, + "p99": 0.00011199999971722718, + "p995": 0.00012900000001536682, + "p999": 0.0005369999998947605, + "sampleCount": 5377888, + "median": 0.00008900000011635711 }, { "id": "516466309_1_1", "name": "zod", "rank": 2, - "rme": 19.150178917474175, + "rme": 11.598622602445086, "samples": [], - "totalTime": 503.0635210010587, - "min": 0.0006119999998190906, - "max": 22.231927000000724, - "hz": 637967.1484852599, - "period": 0.0015674788308055096, - "mean": 0.0015674788308055096, - "variance": 0.007527626101869438, - "sd": 0.08676189314364595, - "sem": 0.0001531505105065242, - "df": 320937, + "totalTime": 500.000368999692, + "min": 0.0004019999996671686, + "max": 7.141714999999749, + "hz": 1467040.9173247067, + "period": 0.0006816442460402524, + "mean": 0.0006816442460402524, + "variance": 0.0011935174972461556, + "sd": 0.03454732257709931, + "sem": 0.00004033742019871995, + "df": 733520, "critical": 1.96, - "moe": 0.0003001750005927874, - "p75": 0.0009620000000722939, - "p99": 0.0038110000004962785, - "p995": 0.005294000000503729, - "p999": 0.032257999999274034, - "sampleCount": 320938, - "median": 0.0007189999996626284 + "moe": 0.00007906134358949111, + "p75": 0.00044799999886890873, + "p99": 0.001134000000092783, + "p995": 0.0015899999998509884, + "p999": 0.003215999999156338, + "sampleCount": 733521, + "median": 0.000420000000303844 }, { "id": "516466309_1_2", "name": "yup", "rank": 4, - "rme": 1.733904097288979, + "rme": 0.26517313836686923, "samples": [], - "totalTime": 500.00380499992025, - "min": 0.01738599999953294, - "max": 1.7977289999998902, - "hz": 41151.686835669745, - "period": 0.024300340445174973, - "mean": 0.024300340445174973, - "variance": 0.0009508755278898482, - "sd": 0.030836269681818653, - "sem": 0.00021497173399696924, - "df": 20575, + "totalTime": 500.0055680000023, + "min": 0.01174399999945308, + "max": 0.38403199999993376, + "hz": 77347.1386622635, + "period": 0.012928726482908473, + "mean": 0.012928726482908473, + "variance": 0.000011832526963874715, + "sd": 0.003439844031911144, + "sem": 0.000017491586615100485, + "df": 38673, "critical": 1.96, - "moe": 0.00042134459863405973, - "p75": 0.021789000000353553, - "p99": 0.09252700000070035, - "p995": 0.14097599999877275, - "p999": 0.44515599999976985, - "sampleCount": 20576, - "median": 0.019790999998804182 + "moe": 0.00003428350976559695, + "p75": 0.012957999999343883, + "p99": 0.017367999998896266, + "p995": 0.0189250000003085, + "p999": 0.023757999999361346, + "sampleCount": 38674, + "median": 0.012733500000649656 }, { "id": "516466309_1_3", "name": "joi", "rank": 3, - "rme": 2.1930785467875618, + "rme": 0.28848048286682154, "samples": [], - "totalTime": 500.001623999844, - "min": 0.0015630000016244594, - "max": 2.5164260000001377, - "hz": 454386.5241527113, - "period": 0.0022007694921513947, - "mean": 0.0022007694921513947, - "variance": 0.0001377660486664879, - "sd": 0.011737378270571665, - "sem": 0.000024624797753376433, - "df": 227193, + "totalTime": 500.0009389999723, + "min": 0.0011450000001786975, + "max": 0.3069759999998496, + "hz": 821704.4568390755, + "period": 0.0012169825679743662, + "mean": 0.0012169825679743662, + "variance": 0.0000013181836096625927, + "sd": 0.0011481217747532674, + "sem": 0.0000017912026471926001, + "df": 410852, "critical": 1.96, - "moe": 0.00004826460359661781, - "p75": 0.0018870000003516907, - "p99": 0.005309999998644344, - "p995": 0.00784399999974994, - "p999": 0.05157900000085647, - "sampleCount": 227194, - "median": 0.0017459999999118736 + "moe": 0.0000035107571884974964, + "p75": 0.001194000000396045, + "p99": 0.001833000000260654, + "p995": 0.0020769999991898658, + "p999": 0.00596399999994901, + "sampleCount": 410853, + "median": 0.001178000000436441 } ] }, @@ -1080,101 +1080,101 @@ "id": "516466309_2_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.1362966416175342, + "rme": 0.0862683477332421, "samples": [], - "totalTime": 500.0001030001422, - "min": 0.00009499999941908754, - "max": 1.4107999999996537, - "hz": 7894342.373763226, - "period": 0.0001266729960083174, - "mean": 0.0001266729960083174, - "variance": 0.0000021287538169545037, - "sd": 0.001459024954191841, - "sem": 7.343780609585835e-7, - "df": 3947171, + "totalTime": 500.00005799851897, + "min": 0.00007299999924725853, + "max": 0.14881700000114506, + "hz": 11882362.621681131, + "period": 0.00008415834727812058, + "mean": 0.00008415834727812058, + "variance": 8.151885491759204e-9, + "sd": 0.00009028779259545116, + "sem": 3.704184473287681e-8, + "df": 5941181, "critical": 1.96, - "moe": 0.0000014393809994788236, - "p75": 0.00011300000005576294, - "p99": 0.00028300000121816993, - "p995": 0.0004149999986111652, - "p999": 0.0009059999993041856, - "sampleCount": 3947172, - "median": 0.00010900000052060932 + "moe": 7.260201567643856e-8, + "p75": 0.00008399999933317304, + "p99": 0.00010900000052060932, + "p995": 0.00012599999899975955, + "p999": 0.0002299999996466795, + "sampleCount": 5941182, + "median": 0.00008299999899463728 }, { "id": "516466309_2_1", "name": "zod", "rank": 2, - "rme": 1.1166227924603924, + "rme": 1.107282208268079, "samples": [], - "totalTime": 500.00029500282653, - "min": 0.00012799999967683107, - "max": 0.9053969999986293, - "hz": 4799311.16837928, - "period": 0.00020836323483015552, - "mean": 0.00020836323483015552, - "variance": 0.0000033813660344333456, - "sd": 0.0018388491059446246, - "sem": 0.0000011870568220516774, - "df": 2399656, + "totalTime": 500.0000519979985, + "min": 0.00009199999840348028, + "max": 2.655285000000731, + "hz": 9269495.03600962, + "period": 0.00010788074173568844, + "mean": 0.00010788074173568844, + "variance": 0.0000017215453755767855, + "sd": 0.0013120767414967714, + "sem": 6.094613568300582e-7, + "df": 4634747, "critical": 1.96, - "moe": 0.0000023266313712212876, - "p75": 0.0001649999976507388, - "p99": 0.0007100000002537854, - "p995": 0.0009609999997337582, - "p999": 0.0025960000020859297, - "sampleCount": 2399657, - "median": 0.00015100000018719584 + "moe": 0.0000011945442593869142, + "p75": 0.00010400000064691994, + "p99": 0.00013699999908567406, + "p995": 0.00016399999913119245, + "p999": 0.0005960000016784761, + "sampleCount": 4634748, + "median": 0.00010199999996984843 }, { "id": "516466309_2_2", "name": "yup", "rank": 4, - "rme": 1.685822786629397, + "rme": 0.4955835771592797, "samples": [], - "totalTime": 500.0489069995565, - "min": 0.0007609999993292149, - "max": 1.8234420000007958, - "hz": 613969.9451443303, - "period": 0.0016287442209649578, - "mean": 0.0016287442209649578, - "variance": 0.00006025277684711708, - "sd": 0.007762266218516154, - "sem": 0.000014009051639253426, - "df": 307014, + "totalTime": 500.0003099995738, + "min": 0.0005729999993491219, + "max": 0.30831299999954354, + "hz": 1330379.1751660453, + "period": 0.0007516654038689304, + "mean": 0.0007516654038689304, + "variance": 0.0000024027938130500935, + "sd": 0.0015500947755057088, + "sem": 0.0000019005766820216285, + "df": 665189, "critical": 1.96, - "moe": 0.000027457741212936716, - "p75": 0.0015039999998407438, - "p99": 0.005919999999605352, - "p995": 0.007569999997940613, - "p999": 0.04486399999950663, - "sampleCount": 307015, - "median": 0.0010529999999562278 + "moe": 0.000003725130296762392, + "p75": 0.0007339999992836965, + "p99": 0.0013689999996131519, + "p995": 0.0015750000002299203, + "p999": 0.005181000000447966, + "sampleCount": 665190, + "median": 0.0006869999997434206 }, { "id": "516466309_2_3", "name": "joi", "rank": 3, - "rme": 2.476172351062834, + "rme": 0.49919452923461066, "samples": [], - "totalTime": 500.0000210010512, - "min": 0.0002859999985957984, - "max": 3.130064000000857, - "hz": 2127137.9106557355, - "period": 0.0004701152637967553, - "mean": 0.0004701152637967553, - "variance": 0.00003751664311269069, - "sd": 0.006125083110676189, - "sem": 0.000005939216418500693, - "df": 1063568, + "totalTime": 500.000079001773, + "min": 0.0001899999988381751, + "max": 0.533491000001959, + "hz": 4484943.291363057, + "period": 0.00022296825958218117, + "mean": 0.00022296825958218117, + "variance": 7.231703446218116e-7, + "sd": 0.0008503942289443241, + "sem": 5.678802825325888e-7, + "df": 2242471, "critical": 1.96, - "moe": 0.000011640864180261358, - "p75": 0.00038099999801488593, - "p99": 0.0015660000026400667, - "p995": 0.00210499999957392, - "p999": 0.0072619999991729856, - "sampleCount": 1063569, - "median": 0.0003219999998691492 + "moe": 0.000001113045353763874, + "p75": 0.00021500000002561137, + "p99": 0.0003799999976763502, + "p995": 0.0005960000016784761, + "p999": 0.0011220000014873222, + "sampleCount": 2242472, + "median": 0.0002119999990100041 } ] }, @@ -1185,101 +1185,101 @@ "id": "516466309_3_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.593212263525081, + "rme": 0.38879829983389486, "samples": [], - "totalTime": 500.0100179992769, - "min": 0.00011100000119768083, - "max": 1.7255420000001322, - "hz": 5579198.215192629, - "period": 0.00017923722395754202, - "mean": 0.00017923722395754202, - "variance": 0.000005921640708071618, - "sd": 0.0024334421521933942, - "sem": 0.000001456953792292589, - "df": 2789654, + "totalTime": 500.00005800504005, + "min": 0.00008800000068731606, + "max": 0.2625350000016624, + "hz": 9474232.900893483, + "period": 0.00010554944241508918, + "mean": 0.00010554944241508918, + "variance": 2.0766464772697528e-7, + "sd": 0.00045570236748010786, + "sem": 2.0937471305817483e-7, + "df": 4737116, "critical": 1.96, - "moe": 0.0000028556294328934743, - "p75": 0.00014599999849451706, - "p99": 0.0005369999998947605, - "p995": 0.0007569999979750719, - "p999": 0.0023499999988416675, - "sampleCount": 2789655, - "median": 0.00013300000136950985 + "moe": 4.1037443759402266e-7, + "p75": 0.00010400000246590935, + "p99": 0.00012600000263773836, + "p995": 0.00018700000146054663, + "p999": 0.0005469999996421393, + "sampleCount": 4737117, + "median": 0.00010199999815085903 }, { "id": "516466309_3_1", "name": "zod", "rank": 2, - "rme": 17.225954335078885, + "rme": 10.665169616991053, "samples": [], - "totalTime": 500.000305001111, - "min": 0.000521999998454703, - "max": 21.244978000002448, - "hz": 740245.5484485707, - "period": 0.0013509030916779314, - "mean": 0.0013509030916779314, - "variance": 0.0052173371876236265, - "sd": 0.07223113724442962, - "sem": 0.00011872752534878027, - "df": 370122, + "totalTime": 500.0008620008448, + "min": 0.00038700000004610047, + "max": 7.829130999998597, + "hz": 1463059.4776829886, + "period": 0.0006834992119279221, + "mean": 0.0006834992119279221, + "variance": 0.0010118873393316426, + "sd": 0.03181017666300586, + "sem": 0.000037192015450464305, + "df": 731530, "critical": 1.96, - "moe": 0.00023270594968360933, - "p75": 0.0008950000010372605, - "p99": 0.0035119999993185047, - "p995": 0.004615000001649605, - "p999": 0.024890000000596046, - "sampleCount": 370123, - "median": 0.0006319999993138481 + "moe": 0.00007289635028291003, + "p75": 0.0004350000017439015, + "p99": 0.0012310000020079315, + "p995": 0.0014220000011846423, + "p999": 0.0033320000002277084, + "sampleCount": 731531, + "median": 0.0004079999998793937 }, { "id": "516466309_3_2", "name": "yup", "rank": 4, - "rme": 1.987615370271398, + "rme": 0.7268511641273288, "samples": [], - "totalTime": 500.01040700017256, - "min": 0.016762999999627937, - "max": 3.171661000000313, - "hz": 45403.054980797955, - "period": 0.02202494965202064, - "mean": 0.02202494965202064, - "variance": 0.0011325216636145123, - "sd": 0.033652959210365326, - "sem": 0.00022335269621331585, - "df": 22701, + "totalTime": 500.01017799984766, + "min": 0.011769000000640517, + "max": 1.7550530000007711, + "hz": 78094.41031020752, + "period": 0.01280501377791046, + "mean": 0.01280501377791046, + "variance": 0.00008805169748065372, + "sd": 0.009383586600050842, + "sem": 0.000047486424342554604, + "df": 39047, "critical": 1.96, - "moe": 0.00043777128457809903, - "p75": 0.020307999999204185, - "p99": 0.06996100000105798, - "p995": 0.11414700000023004, - "p999": 0.42146599999978207, - "sampleCount": 22702, - "median": 0.01892549999865878 + "moe": 0.00009307339171140703, + "p75": 0.012738999997964129, + "p99": 0.019066000000748318, + "p995": 0.021868999996513594, + "p999": 0.02785099999891827, + "sampleCount": 39048, + "median": 0.012500000000727596 }, { "id": "516466309_3_3", "name": "joi", "rank": 3, - "rme": 2.2039965210382344, + "rme": 0.25349683468055934, "samples": [], - "totalTime": 500.0983100007761, - "min": 0.0015449999991687946, - "max": 3.696743000000424, - "hz": 442812.93412020593, - "period": 0.0022582899525887385, - "mean": 0.0022582899525887385, - "variance": 0.00014280544136426257, - "sd": 0.011950123069000694, - "sem": 0.000025394199994903977, - "df": 221449, + "totalTime": 500.000937998826, + "min": 0.0011119999981019646, + "max": 0.34321099999942817, + "hz": 791810.514565334, + "period": 0.001262928417348628, + "mean": 0.001262928417348628, + "variance": 0.0000010562883587705392, + "sd": 0.0010277589010903965, + "sem": 0.0000016334099807449266, + "df": 395905, "critical": 1.96, - "moe": 0.000049772631990011794, - "p75": 0.001944999999977881, - "p99": 0.005808000001707114, - "p995": 0.008839000001898967, - "p999": 0.06124499999714317, - "sampleCount": 221450, - "median": 0.0017750000006344635 + "moe": 0.000003201483562260056, + "p75": 0.0011960000010731164, + "p99": 0.0034110000015061814, + "p995": 0.003488000002107583, + "p999": 0.007459999997081468, + "sampleCount": 395906, + "median": 0.0011840000006486662 } ] } @@ -1295,101 +1295,101 @@ "id": "1813307677_0_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.7496617066540414, + "rme": 0.5052670865061201, "samples": [], - "totalTime": 500.0003170001298, - "min": 0.0003239999999777865, - "max": 2.035441999999989, - "hz": 1702486.92062285, - "period": 0.0005873760249706663, - "mean": 0.0005873760249706663, - "variance": 0.000023403592446038838, - "sd": 0.004837725958137649, - "sem": 0.000005243414991315524, - "df": 851243, + "totalTime": 500.0000280001112, + "min": 0.00018800000009377982, + "max": 0.969475999999986, + "hz": 4338455.757045513, + "period": 0.0002304967610597462, + "mean": 0.0002304967610597462, + "variance": 7.658870578331478e-7, + "sd": 0.0008751497345215548, + "sem": 5.941960556620166e-7, + "df": 2169227, "critical": 1.96, - "moe": 0.000010277093382978428, - "p75": 0.0005110000000740911, - "p99": 0.0019429999999829306, - "p995": 0.002759999999966567, - "p999": 0.014118999999936932, - "sampleCount": 851244, - "median": 0.00040300000000570435 + "moe": 0.0000011646242690975527, + "p75": 0.00021700000002056186, + "p99": 0.00048399999991488585, + "p995": 0.0010549999999511783, + "p999": 0.001297000000022308, + "sampleCount": 2169228, + "median": 0.00021300000003066089 }, { "id": "1813307677_0_1", "name": "zod", "rank": 2, - "rme": 1.1572909341367423, + "rme": 0.9450564160160231, "samples": [], - "totalTime": 500.0001809998719, - "min": 0.0004109999999855063, - "max": 1.2862789999999222, - "hz": 1490617.4603968614, - "period": 0.0006708629320186283, - "mean": 0.0006708629320186283, - "variance": 0.000011694372325804448, - "sd": 0.003419703543555267, - "sem": 0.000003961140761599756, - "df": 745308, + "totalTime": 500.00015000018607, + "min": 0.00027499999987412593, + "max": 2.203954000000067, + "hz": 3178233.046528903, + "period": 0.0003146402373142985, + "mean": 0.0003146402373142985, + "variance": 0.000003657528531714166, + "sd": 0.0019124666093069877, + "sem": 0.0000015171059949524587, + "df": 1589116, "critical": 1.96, - "moe": 0.000007763835892735522, - "p75": 0.0005889999997634732, - "p99": 0.0021769999998468847, - "p995": 0.002715000000080181, - "p999": 0.010367999999743915, - "sampleCount": 745309, - "median": 0.0004840000001422595 + "moe": 0.000002973527750106819, + "p75": 0.00029500000005100446, + "p99": 0.0006379999999808206, + "p995": 0.0008129999998800486, + "p999": 0.0013450000001284934, + "sampleCount": 1589117, + "median": 0.0002899999999499414 }, { "id": "1813307677_0_2", "name": "yup", "rank": 4, - "rme": 1.767199636375204, + "rme": 0.8376829816384801, "samples": [], - "totalTime": 500.00047499992525, - "min": 0.003616999999849213, - "max": 1.853172000000086, - "hz": 134493.8722308415, - "period": 0.007435282986600521, - "mean": 0.007435282986600521, - "variance": 0.0003022226460317642, - "sd": 0.017384551936468314, - "sem": 0.00006703892546054685, - "df": 67246, + "totalTime": 500.0011120000763, + "min": 0.0023789999995642575, + "max": 1.8161310000000412, + "hz": 340949.24172883434, + "period": 0.002932987898519292, + "mean": 0.002932987898519292, + "variance": 0.000026787271742986433, + "sd": 0.005175642157547837, + "sem": 0.000012535275754802145, + "df": 170474, "critical": 1.96, - "moe": 0.00013139629390267183, - "p75": 0.00731099999984508, - "p99": 0.037748000000192405, - "p995": 0.06296800000018266, - "p999": 0.1939620000002833, - "sampleCount": 67247, - "median": 0.004801000000043132 + "moe": 0.000024569140479412206, + "p75": 0.0029540000000451982, + "p99": 0.004495000000133587, + "p995": 0.006041999999979453, + "p999": 0.011684000000059314, + "sampleCount": 170475, + "median": 0.0027620000000752043 }, { "id": "1813307677_0_3", "name": "joi", "rank": 3, - "rme": 1.6199165007601448, + "rme": 0.3171307704657572, "samples": [], - "totalTime": 500.00036100014404, - "min": 0.001119999999900756, - "max": 1.3747650000004796, - "hz": 514617.628445924, - "period": 0.0019431903314697271, - "mean": 0.0019431903314697271, - "variance": 0.0000663680067568522, - "sd": 0.008146656170285585, - "sem": 0.000016060235112578503, - "df": 257308, + "totalTime": 500.0007160000032, + "min": 0.0006379999999808206, + "max": 0.16310100000009697, + "hz": 1319842.10998609, + "period": 0.00075766638481518, + "mean": 0.00075766638481518, + "variance": 9.91775254888302e-7, + "sd": 0.0009958791366869286, + "sem": 0.000001225914920267566, + "df": 659921, "critical": 1.96, - "moe": 0.000031478060820653865, - "p75": 0.001886000000013155, - "p99": 0.00572199999987788, - "p995": 0.007448000000294996, - "p999": 0.05754299999989598, - "sampleCount": 257309, - "median": 0.0013359999993554084 + "moe": 0.0000024027932437244294, + "p75": 0.000747999999930471, + "p99": 0.0012409999999363208, + "p995": 0.0013679999997293635, + "p999": 0.005208000000038737, + "sampleCount": 659922, + "median": 0.000709999999799038 } ] }, @@ -1400,101 +1400,101 @@ "id": "1813307677_1_0", "name": "@cleverbrush/schema", "rank": 2, - "rme": 4.564463086423617, + "rme": 0.3933596895264192, "samples": [], - "totalTime": 500.00023899991265, - "min": 0.0010700000002543675, - "max": 11.285268999999971, - "hz": 597253.7145128287, - "period": 0.0016743303150750356, - "mean": 0.0016743303150750356, - "variance": 0.0004540237884589624, - "sd": 0.02130783396919927, - "sem": 0.00003899193325326543, - "df": 298626, + "totalTime": 500.000007999869, + "min": 0.0005909999999857973, + "max": 0.39206500000000233, + "hz": 1452669.976757661, + "period": 0.0006883876007625531, + "mean": 0.0006883876007625531, + "variance": 0.0000013863427410761054, + "sd": 0.0011774305674119834, + "sem": 0.0000013815506781111964, + "df": 726334, "critical": 1.96, - "moe": 0.00007642418917640024, - "p75": 0.0014639999999417341, - "p99": 0.004614000000401575, - "p995": 0.0060960000000704895, - "p999": 0.04324799999994866, - "sampleCount": 298627, - "median": 0.0012070000002495362 + "moe": 0.000002707839329097945, + "p75": 0.000669999999445281, + "p99": 0.0010910000000876607, + "p995": 0.0013710000002902234, + "p999": 0.004523999999946682, + "sampleCount": 726335, + "median": 0.0006510000002890592 }, { "id": "1813307677_1_1", "name": "zod", "rank": 1, - "rme": 1.3405720708318245, + "rme": 0.29261588095063557, "samples": [], - "totalTime": 500.00069799992707, - "min": 0.0008879999995770049, - "max": 1.0765799999999217, - "hz": 700713.0218047238, - "period": 0.0014271177627389407, - "mean": 0.0014271177627389407, - "variance": 0.000033380943975484174, - "sd": 0.005777624423193686, - "sem": 0.000009760990890386848, - "df": 350356, + "totalTime": 500.0004790000803, + "min": 0.0005870000004506437, + "max": 0.2076520000000528, + "hz": 1508044.5552930739, + "period": 0.0006631103812484238, + "mean": 0.0006631103812484238, + "variance": 7.389922602901137e-7, + "sd": 0.0008596465903440284, + "sem": 9.899827978393845e-7, + "df": 754022, "critical": 1.96, - "moe": 0.00001913154214515822, - "p75": 0.0012230000002091401, - "p99": 0.00426800000059302, - "p995": 0.005740999999943597, - "p999": 0.04336700000021665, - "sampleCount": 350357, - "median": 0.0010179999999309075 + "moe": 0.0000019403662837651933, + "p75": 0.0006279999997786945, + "p99": 0.0012739999992845696, + "p995": 0.0017590000006748596, + "p999": 0.012160999999650812, + "sampleCount": 754023, + "median": 0.0006069999999454012 }, { "id": "1813307677_1_2", "name": "yup", "rank": 4, - "rme": 2.7006242413320223, + "rme": 0.3425708139212965, "samples": [], - "totalTime": 500.0080009999647, - "min": 0.05828699999983655, - "max": 3.0512280000002647, - "hz": 10723.828397298745, - "period": 0.09325027993285429, - "mean": 0.09325027993285429, - "variance": 0.008852038184834328, - "sd": 0.09408527081767011, - "sem": 0.001284867176008486, - "df": 5361, + "totalTime": 500.0211250000193, + "min": 0.03173100000003615, + "max": 0.3653569999996762, + "hz": 28304.80412202475, + "period": 0.03532969158482437, + "mean": 0.03532969158482437, + "variance": 0.00005396557085552083, + "sd": 0.007346126248269956, + "sem": 0.00006174959796837585, + "df": 14152, "critical": 1.96, - "moe": 0.002518339664976633, - "p75": 0.09237900000061927, - "p99": 0.3783770000000004, - "p995": 0.5251459999999497, - "p999": 1.6196399999998903, - "sampleCount": 5362, - "median": 0.07114599999977145 + "moe": 0.00012102921201801665, + "p75": 0.03537300000061805, + "p99": 0.0428170000004684, + "p995": 0.04589399999986199, + "p999": 0.07549799999924289, + "sampleCount": 14153, + "median": 0.03471200000058161 }, { "id": "1813307677_1_3", "name": "joi", "rank": 3, - "rme": 1.997780037322263, + "rme": 0.4524353273439968, "samples": [], - "totalTime": 500.00001800012797, - "min": 0.0030539999997927225, - "max": 2.6342219999996814, - "hz": 194495.99299809444, - "period": 0.005141494097566305, - "mean": 0.005141494097566305, - "variance": 0.0002670807315633178, - "sd": 0.016342604797379083, - "sem": 0.00005240599117412351, - "df": 97247, + "totalTime": 500.00168000010035, + "min": 0.001795000000129221, + "max": 0.30804900000021007, + "hz": 472812.411350203, + "period": 0.0021150037012444656, + "mean": 0.0021150037012444656, + "variance": 0.000005634864400053765, + "sd": 0.0023737869323201197, + "sem": 0.000004882155060746452, + "df": 236406, "critical": 1.96, - "moe": 0.00010271574270128208, - "p75": 0.004675000000133878, - "p99": 0.017154000000118685, - "p995": 0.030889000000570377, - "p999": 0.1295829999999114, - "sampleCount": 97248, - "median": 0.0037069999998493586 + "moe": 0.000009569023919063046, + "p75": 0.002126000000316708, + "p99": 0.0029540000004999456, + "p995": 0.0034500000001571607, + "p999": 0.008216000000174972, + "sampleCount": 236407, + "median": 0.002005000000281143 } ] }, @@ -1505,101 +1505,101 @@ "id": "1813307677_2_0", "name": "@cleverbrush/schema", "rank": 1, - "rme": 1.4747510194279816, + "rme": 0.14533435594332775, "samples": [], - "totalTime": 500.0001270000739, - "min": 0.00011999999969702912, - "max": 2.4623320000000604, - "hz": 5450292.61562487, - "period": 0.0001834763875123338, - "mean": 0.0001834763875123338, - "variance": 0.000005193684483639716, - "sd": 0.002278965660917188, - "sem": 0.0000013805203547182533, - "df": 2725146, + "totalTime": 500.00002500203664, + "min": 0.00007199999890872277, + "max": 0.22514400000000023, + "hz": 11742309.412836699, + "period": 0.0000851621231260351, + "mean": 0.0000851621231260351, + "variance": 2.3412130925419146e-8, + "sd": 0.00015301023144031627, + "sem": 6.314786895555455e-8, + "df": 5871154, "critical": 1.96, - "moe": 0.0000027058198952477765, - "p75": 0.00015099999836820643, - "p99": 0.0004820000012841774, - "p995": 0.0006720000001223525, - "p999": 0.001808000000892207, - "sampleCount": 2725147, - "median": 0.0001429999992978992 + "moe": 1.237698231528869e-7, + "p75": 0.00008400000024266774, + "p99": 0.00015000000166764949, + "p995": 0.0001720000000204891, + "p999": 0.00043199999981879955, + "sampleCount": 5871155, + "median": 0.00008200000047509093 }, { "id": "1813307677_2_1", "name": "zod", "rank": 2, - "rme": 24.430724341304273, + "rme": 9.665329302678611, "samples": [], - "totalTime": 500.00074299992957, - "min": 0.0009570000001986045, - "max": 29.51669199999924, - "hz": 437729.3495342483, - "period": 0.0022845166792311677, - "mean": 0.0022845166792311677, - "variance": 0.01774702361122068, - "sd": 0.1332179552883945, - "sem": 0.0002847571287929005, - "df": 218864, + "totalTime": 501.4708379993408, + "min": 0.0005049999999755528, + "max": 5.568160999999236, + "hz": 1249354.8029622883, + "period": 0.0008004131393491629, + "mean": 0.0008004131393491629, + "variance": 0.0009760702133644303, + "sd": 0.031242122420930853, + "sem": 0.00003947069678571655, + "df": 626514, "critical": 1.96, - "moe": 0.000558123972434085, - "p75": 0.0012480000004870817, - "p99": 0.004096999999092077, - "p995": 0.005720999999539345, - "p999": 0.03275899999971443, - "sampleCount": 218865, - "median": 0.0010619999993650708 + "moe": 0.00007736256570000443, + "p75": 0.0005689999998139683, + "p99": 0.001226999998834799, + "p995": 0.0015110000003915047, + "p999": 0.004175000000032014, + "sampleCount": 626515, + "median": 0.0005499999988387572 }, { "id": "1813307677_2_2", "name": "yup", "rank": 4, - "rme": 2.8848649765669383, + "rme": 2.2414494850596536, "samples": [], - "totalTime": 500.0076999999874, - "min": 0.10154099999999744, - "max": 5.507089000000633, - "hz": 7383.88628815135, - "period": 0.13543003791982322, - "mean": 0.13543003791982322, - "variance": 0.014670014131821209, - "sd": 0.12111983376731165, - "sem": 0.001993353944745053, - "df": 3691, + "totalTime": 500.0205529999712, + "min": 0.05022399999870686, + "max": 5.703075999999783, + "hz": 17139.29547212131, + "period": 0.05834545542590096, + "mean": 0.05834545542590096, + "variance": 0.003815405127292733, + "sd": 0.06176896572950476, + "sem": 0.0006672366888773299, + "df": 8569, "critical": 1.96, - "moe": 0.003906973731700304, - "p75": 0.1281699999999546, - "p99": 0.4916129999983241, - "p995": 0.7738499999995838, - "p999": 1.379624999999578, - "sampleCount": 3692, - "median": 0.11354899999969348 + "moe": 0.0013077839101995666, + "p75": 0.056537000000389526, + "p99": 0.08329500000036205, + "p995": 0.09098000000085449, + "p999": 0.10343899999861605, + "sampleCount": 8570, + "median": 0.055258499999581545 }, { "id": "1813307677_2_3", "name": "joi", "rank": 3, - "rme": 6.568967853745293, + "rme": 0.5123613241925463, "samples": [], - "totalTime": 500.012598000023, - "min": 0.01022000000011758, - "max": 9.23464199999944, - "hz": 47588.800952569014, - "period": 0.02101334725782824, - "mean": 0.02101334725782824, - "variance": 0.011802073492197696, - "sd": 0.10863734851420893, - "sem": 0.0007042653195727577, - "df": 23794, + "totalTime": 500.00109800020255, + "min": 0.005236999999397085, + "max": 0.6323579999989306, + "hz": 163063.6419121763, + "period": 0.006132574915373137, + "mean": 0.006132574915373137, + "variance": 0.000020953392890885195, + "sd": 0.004577487617775191, + "sem": 0.00001603109287933966, + "df": 81531, "critical": 1.96, - "moe": 0.0013803600263626052, - "p75": 0.016394999998738058, - "p99": 0.12333399999988615, - "p995": 0.24921999999969557, - "p999": 1.0239710000005289, - "sampleCount": 23795, - "median": 0.011719000000084634 + "moe": 0.00003142094204350573, + "p75": 0.005927000000156113, + "p99": 0.013004000000364613, + "p995": 0.01413700000011886, + "p999": 0.019122000001516426, + "sampleCount": 81532, + "median": 0.005729000000428641 } ] } diff --git a/bundle-sizes.json b/bundle-sizes.json index ade2b1ec..29d53b2f 100644 --- a/bundle-sizes.json +++ b/bundle-sizes.json @@ -1,47 +1,47 @@ { - "generatedAt": "2026-04-26T13:36:37.612Z", + "generatedAt": "2026-06-11T07:47:18.474Z", "entries": [ { "label": "@cleverbrush/schema", "description": "full", "import": "@cleverbrush/schema", - "gzip": 17851, - "brotli": 15491 + "gzip": 18172, + "brotli": 15789 }, { "label": "@cleverbrush/schema/core", "description": "no built-in extensions", "import": "@cleverbrush/schema/core", - "gzip": 17098, - "brotli": 14333 + "gzip": 17463, + "brotli": 14632 }, { "label": "@cleverbrush/schema/string", "description": "single builder", "import": "@cleverbrush/schema/string", - "gzip": 4198, + "gzip": 4206, "brotli": 3780 }, { "label": "@cleverbrush/schema/number", "description": "", "import": "@cleverbrush/schema/number", - "gzip": 4196, - "brotli": 3804 + "gzip": 4203, + "brotli": 3810 }, { "label": "@cleverbrush/schema/object", "description": "", "import": "@cleverbrush/schema/object", - "gzip": 6806, - "brotli": 6178 + "gzip": 6815, + "brotli": 6171 }, { "label": "@cleverbrush/schema/array", "description": "", "import": "@cleverbrush/schema/array", - "gzip": 4376, - "brotli": 3981 + "gzip": 4380, + "brotli": 3986 } ] } diff --git a/libs/schema-json/README.md b/libs/schema-json/README.md index 6e81b819..97bb3743 100644 --- a/libs/schema-json/README.md +++ b/libs/schema-json/README.md @@ -1,6 +1,6 @@ # @cleverbrush/schema-json -![Coverage](https://img.shields.io/badge/coverage-96.7%25-brightgreen) +![Coverage](https://img.shields.io/badge/coverage-96.8%25-brightgreen) Bidirectional JSON Schema (Draft 7 / 2020-12) interop for diff --git a/libs/schema/README.md b/libs/schema/README.md index 8de68f59..0fc779c0 100644 --- a/libs/schema/README.md +++ b/libs/schema/README.md @@ -3,11 +3,11 @@ [![CI](https://github.com/cleverbrush/framework/actions/workflows/ci.yml/badge.svg)](https://github.com/cleverbrush/framework/actions/workflows/ci.yml) [![Standard Schema v1](https://img.shields.io/badge/Standard%20Schema-v1-blue)](https://standardschema.dev/) -[![Bundle size](https://img.shields.io/badge/bundle-20.2%20KB%20gzip-green)](https://github.com/cleverbrush/framework/blob/master/libs/schema) +[![Bundle size](https://img.shields.io/badge/bundle-20.3%20KB%20gzip-green)](https://github.com/cleverbrush/framework/blob/master/libs/schema) [![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](../../LICENSE) -![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen) +![Coverage](https://img.shields.io/badge/coverage-97.7%25-brightgreen) A schema definition and validation library for TypeScript — faster than Zod in 14/15 benchmarks (up to 204× faster on invalid input), 3× smaller than Zod v4, and compatible with 50+ ecosystem tools via [Standard Schema v1](https://standardschema.dev/). diff --git a/websites/docs/app/auth/page.tsx b/websites/docs/app/auth/page.tsx index 00fed664..005e5d5c 100644 --- a/websites/docs/app/auth/page.tsx +++ b/websites/docs/app/auth/page.tsx @@ -1,6 +1,9 @@ /** biome-ignore-all lint/security/noDangerouslySetInnerHtml: it is intentional */ import { InstallBanner } from '@cleverbrush/website-shared/components/InstallBanner'; import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; +import { docsMetadata } from '../site'; + +export const metadata = docsMetadata('/auth'); export default function AuthPage() { return ( diff --git a/websites/docs/app/client/[[...slug]]/ClientDocLayout.tsx b/websites/docs/app/client/[[...slug]]/ClientDocLayout.tsx index 20e89228..192e83a1 100644 --- a/websites/docs/app/client/[[...slug]]/ClientDocLayout.tsx +++ b/websites/docs/app/client/[[...slug]]/ClientDocLayout.tsx @@ -18,9 +18,9 @@ export function ClientDocLayout({ currentSlug, children }: Props) { collapsed={navCollapsed} onToggle={() => setNavCollapsed(c => !c)} /> -
+
{children}
-
+ ); } diff --git a/websites/docs/app/client/[[...slug]]/page.tsx b/websites/docs/app/client/[[...slug]]/page.tsx index 9e3e48ad..ee96d95e 100644 --- a/websites/docs/app/client/[[...slug]]/page.tsx +++ b/websites/docs/app/client/[[...slug]]/page.tsx @@ -1,4 +1,7 @@ -import { redirect } from 'next/navigation'; +import { breadcrumbJsonLd, JsonLd } from '@cleverbrush/website-shared/lib/seo'; +import type { Metadata } from 'next'; +import { notFound, permanentRedirect } from 'next/navigation'; +import { clientSectionMetadata, DOCS_SITE } from '../../site'; import BatchingSection from '../sections/batching'; import CacheSection from '../sections/cache'; import CacheTagsSection from '../sections/cacheTags'; @@ -37,6 +40,31 @@ const SECTION_COMPONENTS: Record = { subscriptions: SubscriptionsSection }; +export async function generateMetadata({ + params +}: { + params: Promise<{ slug?: string[] }>; +}): Promise { + const { slug } = await params; + const currentSlug = slug?.[0] ?? null; + + if (!currentSlug) { + return clientSectionMetadata('getting-started'); + } + + if (!SECTION_COMPONENTS[currentSlug]) { + return { + title: 'Not Found', + robots: { + index: false, + follow: false + } + }; + } + + return clientSectionMetadata(currentSlug); +} + export default async function ClientDocPage({ params }: { @@ -46,17 +74,34 @@ export default async function ClientDocPage({ const currentSlug = slug?.[0] ?? null; if (!currentSlug) { - redirect('/client/getting-started'); + permanentRedirect('/client/getting-started'); } const SectionComponent = SECTION_COMPONENTS[currentSlug]; if (!SectionComponent) { - redirect('/client/getting-started'); + notFound(); } + const section = CLIENT_SECTIONS.find(entry => entry.slug === currentSlug); + return ( - - - + <> + + + + + ); } diff --git a/websites/docs/app/client/sections/batching.tsx b/websites/docs/app/client/sections/batching.tsx index f0f0bfc3..f85a3a3b 100644 --- a/websites/docs/app/client/sections/batching.tsx +++ b/websites/docs/app/client/sections/batching.tsx @@ -100,12 +100,15 @@ const [todos, user, stats] = await Promise.all([
+ - - - - + + + + @@ -175,12 +178,15 @@ const [todos, user, stats] = await Promise.all([
+ API reference table +
OptionTypeDefaultDescriptionOptionTypeDefaultDescription
+ - - - - + + + + diff --git a/websites/docs/app/client/sections/cache.tsx b/websites/docs/app/client/sections/cache.tsx index a6da703d..a595288c 100644 --- a/websites/docs/app/client/sections/cache.tsx +++ b/websites/docs/app/client/sections/cache.tsx @@ -37,11 +37,14 @@ await client.todos.list();`)

Options

+ API reference table +
OptionTypeDefaultDescriptionOptionTypeDefaultDescription
+ - - - + + + diff --git a/websites/docs/app/client/sections/cacheTags.tsx b/websites/docs/app/client/sections/cacheTags.tsx index 846e81a6..8a8b783f 100644 --- a/websites/docs/app/client/sections/cacheTags.tsx +++ b/websites/docs/app/client/sections/cacheTags.tsx @@ -100,11 +100,14 @@ const UpdateTodo = todosResource

Options

+ API reference table +
OptionTypeDefaultOptionTypeDefault
+ - - - + + + diff --git a/websites/docs/app/client/sections/dedupe.tsx b/websites/docs/app/client/sections/dedupe.tsx index 05a65577..362f26ba 100644 --- a/websites/docs/app/client/sections/dedupe.tsx +++ b/websites/docs/app/client/sections/dedupe.tsx @@ -36,11 +36,14 @@ const [a, b] = await Promise.all([

Options

+ API reference table +
OptionTypeDefaultOptionTypeDefault
+ - - - + + + diff --git a/websites/docs/app/client/sections/error-handling.tsx b/websites/docs/app/client/sections/error-handling.tsx index e40d1614..bf1e0298 100644 --- a/websites/docs/app/client/sections/error-handling.tsx +++ b/websites/docs/app/client/sections/error-handling.tsx @@ -15,11 +15,14 @@ export default function ErrorHandlingSection() {

Error Types

+ API reference table +
OptionTypeDefaultOptionTypeDefault
+ - - - + + + diff --git a/websites/docs/app/client/sections/hooks.tsx b/websites/docs/app/client/sections/hooks.tsx index 9a0ab494..f3084b8c 100644 --- a/websites/docs/app/client/sections/hooks.tsx +++ b/websites/docs/app/client/sections/hooks.tsx @@ -53,11 +53,14 @@ export default function HooksSection() {

Hook Reference

+ API reference table +
ClassThrown WhenKey PropertiesClassThrown WhenKey Properties
+ - - - + + + diff --git a/websites/docs/app/client/sections/idempotency.tsx b/websites/docs/app/client/sections/idempotency.tsx index b99987f4..60da6038 100644 --- a/websites/docs/app/client/sections/idempotency.tsx +++ b/websites/docs/app/client/sections/idempotency.tsx @@ -81,11 +81,14 @@ server.handle(CreateTodo, createHandler, {

Options (Client)

+ API reference table +
HookWhenCan ModifyHookWhenCan Modify
+ - - - + + + @@ -131,11 +134,14 @@ server.handle(CreateTodo, createHandler, {

Options (Server)

+ API reference table +
OptionTypeDefaultOptionTypeDefault
+ - - - + + + diff --git a/websites/docs/app/client/sections/per-call-overrides.tsx b/websites/docs/app/client/sections/per-call-overrides.tsx index ca13ba83..c3d848ea 100644 --- a/websites/docs/app/client/sections/per-call-overrides.tsx +++ b/websites/docs/app/client/sections/per-call-overrides.tsx @@ -49,11 +49,14 @@ const data = await client.analytics.realtime({

Supported Overrides

+ API reference table +
OptionTypeDefaultOptionTypeDefault
+ - - - + + + diff --git a/websites/docs/app/client/sections/react-integration.tsx b/websites/docs/app/client/sections/react-integration.tsx index 083bae7f..06150134 100644 --- a/websites/docs/app/client/sections/react-integration.tsx +++ b/websites/docs/app/client/sections/react-integration.tsx @@ -99,10 +99,13 @@ function TodoList() { provides these methods:

+ API reference table +
KeyTypeAffectsKeyTypeAffects
+ - - + + diff --git a/websites/docs/app/client/sections/retry.tsx b/websites/docs/app/client/sections/retry.tsx index 5baf6dd9..7788f710 100644 --- a/websites/docs/app/client/sections/retry.tsx +++ b/websites/docs/app/client/sections/retry.tsx @@ -31,12 +31,15 @@ const client = createClient(api, {

Options

+ API reference table +
MethodDescriptionMethodDescription
+ - - - - + + + + diff --git a/websites/docs/app/client/sections/subscriptions.tsx b/websites/docs/app/client/sections/subscriptions.tsx index 8bbe957d..027d5681 100644 --- a/websites/docs/app/client/sections/subscriptions.tsx +++ b/websites/docs/app/client/sections/subscriptions.tsx @@ -77,10 +77,13 @@ for await (const msg of chat) { WebSocket connection status:

+ API reference table +
OptionTypeDefaultDescriptionOptionTypeDefaultDescription
+ - - + + @@ -186,11 +189,14 @@ function LiveFeed() {

Return Value

+ API reference table +
StateDescriptionStateDescription
+ - - - + + + @@ -253,12 +259,15 @@ function LiveFeed() {

Options

+ API reference table +
PropertyTypeDescriptionPropertyTypeDescription
+ - - - - + + + + diff --git a/websites/docs/app/comparisons/page.tsx b/websites/docs/app/comparisons/page.tsx index 4c4d0d9f..68f6017f 100644 --- a/websites/docs/app/comparisons/page.tsx +++ b/websites/docs/app/comparisons/page.tsx @@ -1,12 +1,9 @@ /** biome-ignore-all lint/security/noDangerouslySetInnerHtml: needed for code examples */ import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; +import { docsMetadata } from '../site'; -export const metadata = { - title: 'Comparisons — Cleverbrush vs tRPC, ts-rest, Hono', - description: - 'Feature-by-feature comparison of Cleverbrush with tRPC, ts-rest, and Hono — with honest assessments and code examples.' -}; +export const metadata = docsMetadata('/comparisons'); export default function ComparisonsPage() { return ( @@ -26,13 +23,16 @@ export default function ComparisonsPage() {

Feature matrix

+ API reference table +
OptionTypeDefaultDescriptionOptionTypeDefaultDescription
+ - - - - - + + + + + diff --git a/websites/docs/app/demo/page.tsx b/websites/docs/app/demo/page.tsx index 9cbb4c1f..c49ae37a 100644 --- a/websites/docs/app/demo/page.tsx +++ b/websites/docs/app/demo/page.tsx @@ -1,10 +1,7 @@ import Link from 'next/link'; +import { docsMetadata } from '../site'; -export const metadata = { - title: 'Demo App — Cleverbrush', - description: - 'Run a production-style full-stack Todo app built entirely with the Cleverbrush framework — backend, frontend, auth, ORM, OpenAPI, tracing, and more.' -}; +export const metadata = docsMetadata('/demo'); export default function DemoPage() { return ( @@ -97,11 +94,14 @@ docker compose -f demos/docker-compose.yml up`}

+ Comparison table +
FeatureCleverbrushtRPCts-restHonoFeatureCleverbrushtRPCts-restHono
+ - - - + + + @@ -185,10 +185,13 @@ docker compose -f demos/docker-compose.yml up`}

Framework packages in use

+ API reference table +
ServiceURLNotesServiceURLNotes
+ - - + + diff --git a/websites/docs/app/di/page.tsx b/websites/docs/app/di/page.tsx index d472dc5c..392e9c5f 100644 --- a/websites/docs/app/di/page.tsx +++ b/websites/docs/app/di/page.tsx @@ -1,6 +1,9 @@ /** biome-ignore-all lint/security/noDangerouslySetInnerHtml: it is intentional */ import { InstallBanner } from '@cleverbrush/website-shared/components/InstallBanner'; import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; +import { docsMetadata } from '../site'; + +export const metadata = docsMetadata('/di'); export default function DiPage() { return ( diff --git a/websites/docs/app/env/page.tsx b/websites/docs/app/env/page.tsx index 01910500..80bfa91a 100644 --- a/websites/docs/app/env/page.tsx +++ b/websites/docs/app/env/page.tsx @@ -1,6 +1,9 @@ /** biome-ignore-all lint/security/noDangerouslySetInnerHtml: needed to show examples */ import { InstallBanner } from '@cleverbrush/website-shared/components/InstallBanner'; import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; +import { docsMetadata } from '../site'; + +export const metadata = docsMetadata('/env'); export default function EnvPage() { return ( @@ -304,12 +307,15 @@ config.db.connectionString // "postgres://localhost:5432/mydb"`)

Comparison

+ API reference table +
PackageDemonstrated byPackageDemonstrated by
+ - - - - + + + + @@ -363,11 +369,14 @@ config.db.connectionString // "postgres://localhost:5432/mydb"`)

API Reference

+ Comparison table +
Feature@cleverbrush/envt3-envenvalidFeature@cleverbrush/envt3-envenvalid
+ - - - + + + diff --git a/websites/docs/app/examples/page.tsx b/websites/docs/app/examples/page.tsx index 77571215..09a1b6ac 100644 --- a/websites/docs/app/examples/page.tsx +++ b/websites/docs/app/examples/page.tsx @@ -1,12 +1,9 @@ /** biome-ignore-all lint/security/noDangerouslySetInnerHtml: needed for code examples */ import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; +import { docsMetadata } from '../site'; -export const metadata = { - title: 'Examples — Cleverbrush', - description: - 'Full-stack Todo app demonstrating Cleverbrush server, client, auth, DI, schema-driven forms, and more.' -}; +export const metadata = docsMetadata('/examples'); export default function ExamplesPage() { return ( @@ -35,10 +32,15 @@ export default function ExamplesPage() {

Backend packages used

+ API reference table +
ExportTypeDescriptionExportTypeDescription
+ - - + + @@ -127,10 +129,15 @@ export default function ExamplesPage() {

Frontend packages used

+ API reference table +
PackageWhat it does in the demoPackage + What it does in the demo +
+ - - + + @@ -314,10 +321,13 @@ docker compose up`}

Demo features

+ API reference table +
PackageWhat it does in the demoPackage + What it does in the demo +
+ - - + + diff --git a/websites/docs/app/getting-started/page.tsx b/websites/docs/app/getting-started/page.tsx index 325c3f51..510b2c52 100644 --- a/websites/docs/app/getting-started/page.tsx +++ b/websites/docs/app/getting-started/page.tsx @@ -3,12 +3,9 @@ import { InstallBanner } from '@cleverbrush/website-shared/components/InstallBanner'; import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; import Link from 'next/link'; +import { docsMetadata } from '../site'; -export const metadata = { - title: 'Getting Started — Cleverbrush Framework', - description: - 'Build a fully typed REST API with server, client, auth, and OpenAPI in 10 minutes.' -}; +export const metadata = docsMetadata('/getting-started'); export default function GettingStartedPage() { return ( @@ -385,10 +382,13 @@ server.use(openapi({
+ API reference table +
FeatureWhat it demonstratesFeatureWhat it demonstrates
+ - - + + diff --git a/websites/docs/app/knex-schema/page.tsx b/websites/docs/app/knex-schema/page.tsx index fe24f7e8..848e31b4 100644 --- a/websites/docs/app/knex-schema/page.tsx +++ b/websites/docs/app/knex-schema/page.tsx @@ -1,6 +1,9 @@ /** biome-ignore-all lint/security/noDangerouslySetInnerHtml: it is intentional */ import { InstallBanner } from '@cleverbrush/website-shared/components/InstallBanner'; import { highlightTS } from '@cleverbrush/website-shared/lib/highlight'; +import { docsMetadata } from '../site'; + +export const metadata = docsMetadata('/knex-schema'); export default function KnexSchemaPage() { return ( @@ -259,10 +262,13 @@ const activeUsers = await query(db, UserSchema, base)

API Reference

+ API reference table +
TopicWhat you'll learnTopicWhat you'll learn
+ - - + + diff --git a/websites/docs/app/layout.tsx b/websites/docs/app/layout.tsx index e48ef709..5e59e845 100644 --- a/websites/docs/app/layout.tsx +++ b/websites/docs/app/layout.tsx @@ -1,11 +1,19 @@ import type { Metadata } from 'next'; -import Script from 'next/script'; import '@cleverbrush/website-shared/styles/globals.css'; +import { ConsentManager } from '@cleverbrush/website-shared/components/ConsentManager'; import type { FooterSection } from '@cleverbrush/website-shared/components/Footer'; import { Footer } from '@cleverbrush/website-shared/components/Footer'; import type { NavItem } from '@cleverbrush/website-shared/components/Navbar'; import { Navbar } from '@cleverbrush/website-shared/components/Navbar'; import { ThemeProvider } from '@cleverbrush/website-shared/components/ThemeProvider'; +import { + createBaseMetadata, + JsonLd, + organizationJsonLd, + softwareSourceCodeJsonLd, + websiteJsonLd +} from '@cleverbrush/website-shared/lib/seo'; +import { DOCS_SITE } from './site'; const GTM_ID = 'GTM-WRLXDMG'; @@ -103,6 +111,10 @@ const FOOTER_SECTIONS: FooterSection[] = [ label: 'GitHub Repository', href: 'https://github.com/cleverbrush/framework', external: true + }, + { + label: 'Privacy Policy', + href: '/privacy' } ] }, @@ -153,14 +165,7 @@ const FOOTER_SECTIONS: FooterSection[] = [ } ]; -export const metadata: Metadata = { - title: 'Cleverbrush — Schema-first Web Framework for TypeScript', - description: - 'Type-safe HTTP server, auto-typed client, OpenAPI generation, auth, and DI — all derived from one schema definition. Zero duplication, zero type drift.', - icons: { - icon: '/favicon.ico' - } -}; +export const metadata: Metadata = createBaseMetadata(DOCS_SITE); export default function RootLayout({ children @@ -176,35 +181,22 @@ export default function RootLayout({ href="https://fonts.gstatic.com" crossOrigin="anonymous" /> - + + + @@ -55,6 +59,8 @@

Previous Versions

+ API reference table +
CategoryMethodsCategoryMethods
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeywordBuilder equivalent
type: 'string'string()
type: 'number'number()
type: 'integer'number() (integer flag)
type: 'boolean'boolean()
type: 'null'SchemaBuilder<null>
type: 'array' + itemsarray(itemBuilder)
type: 'object' + propertiesobject({ … })
required: […]required / optional per-prop
additionalProperties: true.acceptUnknownProps()
conststring/number/boolean eq
enumunion(…)
anyOfunion(…)
minLength / maxLength.minLength() / .maxLength()
pattern.matches(regex) (invalid patterns silently ignored)
minimum / maximum.min() / .max()
exclusiveMinimum / exclusiveMaximumcustom validator (not round-trippable via toJsonSchema)
multipleOf.multipleOf()
minItems / maxItems.minLength() / .maxLength()
format: 'email'.email() extension
format: 'uuid'.uuid() extension
format: 'uri' / 'url'.url() extension
format: 'ipv4'.ip({ version: 'v4' })
format: 'ipv6'.ip({ version: 'v6' })
format: 'date-time'.matches(iso8601 regex)
+

Keywords not supported: $ref, $defs, if/then/else, not, +contains, unevaluatedProperties, contentEncoding.

+
import { fromJsonSchema } from '@cleverbrush/schema-json';

const schema = fromJsonSchema({
type: 'object',
properties: {
name: { type: 'string', minLength: 1 },
score: { type: 'number', minimum: 0, maximum: 100 },
},
required: ['name'],
} as const);

schema.parse({ name: 'Alice', score: 95 });
// TypeScript infers: { name: string; score?: number } +
+ +
// Union types via `enum`
const statusSchema = fromJsonSchema({
enum: ['active', 'inactive', 'pending']
} as const);

statusSchema.parse('active'); // valid — 'active' | 'inactive' | 'pending' +
+ +
// Use InferFromJsonSchema to derive the TypeScript type statically
import type { InferFromJsonSchema } from '@cleverbrush/schema-json';

const S = { type: 'object', properties: { id: { type: 'integer' } }, required: ['id'] } as const;
type Payload = InferFromJsonSchema<typeof S>; // { id: number }
const payloadSchema = fromJsonSchema(S); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema-json.toJsonSchema.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema-json.toJsonSchema.html new file mode 100644 index 00000000..e0be6ae7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema-json.toJsonSchema.html @@ -0,0 +1,29 @@ +toJsonSchema | Libraries
  • Converts a @cleverbrush/schema builder to a JSON Schema object.

    +

    Parameters

    Returns Record<string, unknown>

    A plain JSON-serialisable object representing the schema.

    +

    What round-trips cleanly: all declarative constraints — type, format, +minLength/maxLength, minimum/maximum, multipleOf, pattern, required/optional +per property, additionalProperties, items, enum/const literals, anyOf/union.

    +

    What is silently omitted:

    +
      +
    • Custom validators added via addValidator (no JSON Schema equivalent)
    • +
    • Preprocessors added via addPreprocessor
    • +
    • JSDoc comments on schema properties
    • +
    • exclusiveMinimum/exclusiveMaximum constraints from fromJsonSchema +(stored as custom validators — not introspectable; only positive()/ +negative() extension-based exclusives are emitted)
    • +
    • IP format with both v4 and v6 allowed simultaneously (no single +standard JSON Schema format covers both; the format keyword is omitted +in that case)
    • +
    +

    By default the output includes a $schema header for JSON Schema Draft +2020-12. Pass { $schema: false } when embedding the result in an OpenAPI +specification, or { draft: '07' } for Draft 07 compatibility.

    +
    import { toJsonSchema } from '@cleverbrush/schema-json';
    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(1),
    email: string().email(),
    age: number().optional(),
    });

    const spec = toJsonSchema(UserSchema);
    // {
    // "$schema": "https://json-schema.org/draft/2020-12/schema",
    // "type": "object",
    // "properties": {
    // "name": { "type": "string", "minLength": 1 },
    // "email": { "type": "string", "format": "email" },
    // "age": { "type": "number" }
    // },
    // "required": ["name", "email"]
    // } +
    + +
    // Embed in an OpenAPI spec (strip the $schema header)
    toJsonSchema(schema, { $schema: false });

    // Use JSON Schema Draft 07
    toJsonSchema(schema, { draft: '07' }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema-json.withStandardJsonSchema.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema-json.withStandardJsonSchema.html new file mode 100644 index 00000000..7b776af1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema-json.withStandardJsonSchema.html @@ -0,0 +1,14 @@ +withStandardJsonSchema | Libraries

Function withStandardJsonSchema

  • Wraps a @cleverbrush/schema builder with the +Standard JSON Schema v1 interface.

    +

    The returned schema object's ~standard property is enriched with a +jsonSchema converter. Because @cleverbrush/schema does not +distinguish between input and output types, both input() and output() +produce the same JSON Schema document.

    +

    Note: this mutates the schema instance by overriding the ~standard +property. The returned reference is the same schema object.

    +

    Type Parameters

    Parameters

    • schema: T

      Any @cleverbrush/schema builder instance.

      +

    Returns T & StandardJSONSchemaV1<unknown, unknown>

    The same schema instance, now also conforming to StandardJSONSchemaV1.

    +
    import { object, string, number } from '@cleverbrush/schema';
    import { withStandardJsonSchema } from '@cleverbrush/schema-json';

    const schema = object({ name: string(), age: number().optional() });
    const wrapped = withStandardJsonSchema(schema);

    // Access standard JSON Schema properties
    wrapped['~standard'].jsonSchema.input({ target: 'draft-2020-12' });
    wrapped['~standard'].jsonSchema.output({ target: 'draft-07' }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.defineExtension.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.defineExtension.html new file mode 100644 index 00000000..07e92f4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.defineExtension.html @@ -0,0 +1,49 @@ +defineExtension | Libraries

Function defineExtension

  • Defines an extension targeting one or more schema builder types.

    +

    Each extension is a plain object keyed by builder type name ("string", +"number", "date", …) whose values are method implementations. +Methods receive this bound to the builder instance and must return a +builder to support fluent chaining.

    + +

    Extension methods do not have to call this.withExtension(). The +system wraps each method and automatically attaches +withExtension(methodName, args) to the returned builder when the key +is not already present. This eliminates the most common source of +duplication in extension code.

    +
      +
    • Zero-arg methods → metadata value is true
    • +
    • Single-arg methods → metadata value is the argument itself
    • +
    • Multi-arg methods → metadata value is the arguments array
    • +
    +

    If you need custom metadata (e.g. a different key, a transformed +value, or a structured object), call this.withExtension(key, value) +explicitly inside the method — the auto-infer logic detects the existing +key and skips automatic attachment.

    + +

    defineExtension validates the configuration eagerly:

    +
      +
    • Unknown builder type names throw immediately.
    • +
    • RESERVED_METHODS | Reserved method names (e.g. validate, +introspect) cannot be overridden.
    • +
    • Non-function values in the method record are rejected.
    • +
    +

    Type Parameters

    Parameters

    • config: T

      An ExtensionConfig object mapping builder type +names to method records.

      +

    Returns ExtensionDescriptor<T>

    A branded ExtensionDescriptor ready to pass to +withExtensions.

    +
    const slugExt = defineExtension({
    string: {
    slug(this: StringSchemaBuilder) {
    return this.addValidator((val) => {
    const valid = /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(val);
    return { valid, errors: valid ? [] : [{ message: 'invalid slug' }] };
    });
    }
    }
    });

    // Usage:
    const s = withExtensions(slugExt);
    const schema = s.string().slug();
    schema.introspect().extensions.slug; // true +
    + +
    const currencyExt = defineExtension({
    number: {
    currency(this: NumberSchemaBuilder, opts?: { maxDecimals?: number }) {
    const maxDec = opts?.maxDecimals ?? 2;
    return this.withExtension('currency', { maxDecimals: maxDec })
    .min(0)
    .addValidator((val) => {
    const decimals = (String(val).split('.')[1] ?? '').length;
    const valid = decimals <= maxDec;
    return { valid, errors: valid ? [] : [{ message: `max ${maxDec} decimals` }] };
    });
    }
    }
    }); +
    + +
    const myExt = defineExtension({
    string: {
    email(this: StringSchemaBuilder) { return this.addValidator(...); }
    },
    number: {
    port(this: NumberSchemaBuilder) { return this.isInteger().min(1).max(65535); }
    }
    }); +
    + +

    If a builder type name is unknown.

    +

    If a method name is reserved.

    +

    If a method value is not a function.

    +
    +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.enumOf.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.enumOf.html new file mode 100644 index 00000000..4a4ddf1b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.enumOf.html @@ -0,0 +1,33 @@ +enumOf | Libraries
  • Creates a string schema constrained to the given literal values.

    +

    Convenience factory equivalent to string().oneOf(...values). +Mirrors Zod's z.enum(['admin', 'user', 'guest']) API.

    +

    Rest-params form (no custom error message):

    +
    const Role = enumOf('admin', 'user', 'guest');
    +
    + +

    Array form (with optional custom error message):

    +
    const Role = enumOf(['admin', 'user', 'guest'], 'Invalid role');
    const Role2 = enumOf(['admin', 'user'], (val) => `"${val}" is not a valid role`); +
    + +

    Type Parameters

    • const T extends string

    Parameters

    • ...values: [T, ...T[]]

      the allowed string literals (at least one required)

      +

    Returns ExtendedString<T>

    a typed StringSchemaBuilder that only accepts the given values

    +
    import { enumOf, InferType } from '@cleverbrush/schema';

    const Role = enumOf('admin', 'user', 'guest');
    type Role = InferType<typeof Role>; // 'admin' | 'user' | 'guest'

    Role.validate('admin'); // valid
    Role.validate('other'); // invalid +
    + +
  • Creates a string schema constrained to the given literal values.

    +

    Convenience factory equivalent to string().oneOf(...values). +Mirrors Zod's z.enum(['admin', 'user', 'guest']) API.

    +

    Rest-params form (no custom error message):

    +
    const Role = enumOf('admin', 'user', 'guest');
    +
    + +

    Array form (with optional custom error message):

    +
    const Role = enumOf(['admin', 'user', 'guest'], 'Invalid role');
    const Role2 = enumOf(['admin', 'user'], (val) => `"${val}" is not a valid role`); +
    + +

    Type Parameters

    • const T extends string

    Parameters

    Returns ExtendedString<T>

    a typed StringSchemaBuilder that only accepts the given values

    +
    import { enumOf, InferType } from '@cleverbrush/schema';

    const Role = enumOf('admin', 'user', 'guest');
    type Role = InferType<typeof Role>; // 'admin' | 'user' | 'guest'

    Role.validate('admin'); // valid
    Role.validate('other'); // invalid +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.extern.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.extern.html new file mode 100644 index 00000000..c8ad3ef5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.extern.html @@ -0,0 +1,19 @@ +extern | Libraries
  • Wraps an external Standard Schema v1 +compatible schema into a @cleverbrush/schema builder.

    +

    This enables cross-library schema composition — use schemas from Zod, +Valibot, ArkType, or any Standard Schema v1 compliant library as +properties inside @cleverbrush/schema object schemas with full type +inference.

    +

    Type Parameters

    Parameters

    • standardSchema: T

      A Standard Schema v1 compliant schema instance +(any object that exposes a ['~standard'] property with version: 1 +and a validate function).

      +

    Returns ExternSchemaBuilder<
        T,
        true,
        false,
        undefined,
        false,
        {},
        StandardSchemaV1.InferOutput<T>,
    >

    import { z } from 'zod';
    import { object, date, extern, InferType } from '@cleverbrush/schema';

    const zodUser = z.object({ first: z.string(), last: z.string() });

    const order = object({
    user: extern(zodUser),
    date: date(),
    });

    type Order = InferType<typeof order>;
    // { user: { first: string; last: string }; date: Date }

    order.validate({
    user: { first: 'Alice', last: 'Smith' },
    date: new Date(),
    }); // { valid: true, object: { user: …, date: … } } +
    + +
    // Optional external schema
    const schema = extern(zodUser).optional();
    schema.validate(undefined); // valid +
    + +
    // Inside an array
    import { array, extern } from '@cleverbrush/schema';
    const users = array(extern(zodUser)); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.generic.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.generic.html new file mode 100644 index 00000000..241b3b14 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.generic.html @@ -0,0 +1,57 @@ +generic | Libraries
  • Creates a generic schema template — a reusable, parameterized schema factory +whose TypeScript type is inferred from the template function's generic +signature.

    +

    Call .apply() on the returned builder +to instantiate the template with concrete schema arguments and receive a +fully typed concrete schema.

    +

    There are two overloads:

    +
      +
    1. generic(templateFn) — Provide only the template function. The +template must be called via .apply() before validation.
    2. +
    3. generic(defaults, templateFn) — Provide positional default arguments +followed by the template function. The template can be validated directly +using those defaults (without calling .apply() first).
    4. +
    +

    Type Parameters

    • TFn extends (...args: any[]) => SchemaBuilder<any, any, any, any, any>

    Parameters

    • templateFn: TFn

      A (generic) function that accepts schema arguments and +returns a concrete schema. TypeScript infers the result type from this +function's generic signature when .apply() is called.

      +

    Returns GenericSchemaBuilder<TFn, true, false, undefined, false, {}>

    A new GenericSchemaBuilder with isRequired set to true.

    +
    import { generic, object, array, number, string, any, InferType } from '@cleverbrush/schema';

    const PaginatedList = generic(
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number(), page: number() })
    );

    const UserList = PaginatedList.apply(object({ name: string() }));
    type UserListType = InferType<typeof UserList>;
    // → { items: { name: string }[]; total: number; page: number }

    UserList.validate({ items: [{ name: 'Alice' }], total: 1, page: 1 }); // valid +
    + +
    const Result = generic(
    <T extends SchemaBuilder<any, any, any, any, any>,
    E extends SchemaBuilder<any, any, any, any, any>>(
    valueSchema: T,
    errorSchema: E
    ) =>
    union(
    object({ ok: boolean().equalsTo(true), value: valueSchema }),
    object({ ok: boolean().equalsTo(false), error: errorSchema })
    )
    );

    const StringResult = Result.apply(string(), number()); +
    + +
    const AnyList = generic(
    [any()], // default args — positional, one per template parameter
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number() })
    );

    // Validate directly — uses the default any() schema:
    AnyList.validate({ items: [1, 'two'], total: 2 }); // valid

    // Or apply concrete schemas first:
    AnyList.apply(string()).validate({ items: ['x'], total: 1 }); // valid +
    + +
  • Creates a generic schema template — a reusable, parameterized schema factory +whose TypeScript type is inferred from the template function's generic +signature.

    +

    Call .apply() on the returned builder +to instantiate the template with concrete schema arguments and receive a +fully typed concrete schema.

    +

    There are two overloads:

    +
      +
    1. generic(templateFn) — Provide only the template function. The +template must be called via .apply() before validation.
    2. +
    3. generic(defaults, templateFn) — Provide positional default arguments +followed by the template function. The template can be validated directly +using those defaults (without calling .apply() first).
    4. +
    +

    Type Parameters

    • TFn extends (...args: any[]) => SchemaBuilder<any, any, any, any, any>

    Parameters

    • defaults: readonly any[]
    • templateFn: TFn

      A (generic) function that accepts schema arguments and +returns a concrete schema. TypeScript infers the result type from this +function's generic signature when .apply() is called.

      +

    Returns GenericSchemaBuilder<TFn, true, false, undefined, false, {}>

    A new GenericSchemaBuilder with isRequired set to true.

    +
    import { generic, object, array, number, string, any, InferType } from '@cleverbrush/schema';

    const PaginatedList = generic(
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number(), page: number() })
    );

    const UserList = PaginatedList.apply(object({ name: string() }));
    type UserListType = InferType<typeof UserList>;
    // → { items: { name: string }[]; total: number; page: number }

    UserList.validate({ items: [{ name: 'Alice' }], total: 1, page: 1 }); // valid +
    + +
    const Result = generic(
    <T extends SchemaBuilder<any, any, any, any, any>,
    E extends SchemaBuilder<any, any, any, any, any>>(
    valueSchema: T,
    errorSchema: E
    ) =>
    union(
    object({ ok: boolean().equalsTo(true), value: valueSchema }),
    object({ ok: boolean().equalsTo(false), error: errorSchema })
    )
    );

    const StringResult = Result.apply(string(), number()); +
    + +
    const AnyList = generic(
    [any()], // default args — positional, one per template parameter
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number() })
    );

    // Validate directly — uses the default any() schema:
    AnyList.validate({ items: [1, 'two'], total: 2 }); // valid

    // Or apply concrete schemas first:
    AnyList.apply(string()).validate({ items: ['x'], total: 1 }); // valid +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.intersection.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.intersection.html new file mode 100644 index 00000000..e9d5a41f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.intersection.html @@ -0,0 +1,8 @@ +intersection | Libraries

Function intersection

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.lazy.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.lazy.html new file mode 100644 index 00000000..3cf4e0e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.lazy.html @@ -0,0 +1,13 @@ +lazy | Libraries
  • Creates a lazy schema that defers the schema definition until first validation. +Use this to define recursive/self-referential schemas.

    +

    The getter function is called once on first use and the result is cached. +You must provide an explicit TypeScript type annotation on the variable +holding the outer schema — TypeScript cannot infer recursive types automatically.

    +

    Type Parameters

    • TResult

    Parameters

    • getter: () => SchemaBuilder<TResult, any, any>

      A function that returns the schema to use for validation.

      +

    Returns LazySchemaBuilder<TResult, true, false, false, {}>

    // Tree structure
    type TreeNode = { value: number; children: TreeNode[] };

    const treeNode: SchemaBuilder<TreeNode, true> = object({
    value: number(),
    children: array(lazy(() => treeNode))
    }); +
    + +
    // Optional recursive field (submenu)
    type MenuItem = { label: string; submenu?: MenuItem[] };

    const menuItem: SchemaBuilder<MenuItem, true> = object({
    label: string(),
    submenu: array(lazy(() => menuItem)).optional()
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.nul.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.nul.html new file mode 100644 index 00000000..ce3abdc9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.nul.html @@ -0,0 +1,13 @@ +nul | Libraries
  • Creates a schema that validates the value is exactly null.

    +

    By default the schema is required — only null is accepted. +Call .optional() to also allow undefined.

    +

    Returns NullSchemaBuilder<true, false, undefined, false, {}>

    import { nul } from '@cleverbrush/schema';

    nul().validate(null); // { valid: true, object: null }
    nul().validate(undefined); // { valid: false }
    nul().validate(0); // { valid: false } +
    + +
    nul().optional().validate(null);       // { valid: true, object: null }
    nul().optional().validate(undefined); // { valid: true, object: undefined }
    nul().optional().validate(false); // { valid: false } +
    + +
    // Nullable field in an object schema
    import { object, string, nul, union, InferType } from '@cleverbrush/schema';

    const Schema = object({
    name: string(),
    deleted: union(nul()).or(string()), // null | string
    });

    type T = InferType<typeof Schema>;
    // { name: string; deleted: null | string } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.parseString.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.parseString.html new file mode 100644 index 00000000..8555ba0b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.parseString.html @@ -0,0 +1,18 @@ +parseString | Libraries

Function parseString

  • Creates a parse-string schema that validates a string against a +template pattern and parses it into a strongly-typed object.

    +

    The first argument defines the result shape via object(...), and the +second argument is a callback receiving a typed $template tagged-template +function whose template expressions are type-safe property selectors.

    +

    Type Parameters

    Parameters

    • objectSchema: TSchema

      An ObjectSchemaBuilder defining the result type and +per-property validation schemas.

      +
    • templateBuilder: ($template: ParseStringTemplateTag<TSchema>) => ParseStringTemplateDefinition

      Callback receiving the typed $template +tagged-template function. Must return the result of invoking $template.

      +

    Returns ParseStringSchemaBuilder<InferType<TSchema>>

    A ParseStringSchemaBuilder whose validate() accepts a +string and whose InferType is the object schema's inferred type.

    +
    const RouteSchema = parseString(
    object({
    userId: string().uuid(),
    id: number()
    }),
    $t => $t`/orders/${t => t.id}/${t => t.userId}`
    );

    const result = RouteSchema.validate('/orders/42/550e8400-e29b-41d4-a716-446655440000');
    // result.valid === true
    // result.object === { id: 42, userId: '550e8400-e29b-41d4-a716-446655440000' }

    type Route = InferType<typeof RouteSchema>;
    // { id: number; userId: string } +
    + +
    const schema = parseString(
    object({
    order: object({ id: number() }),
    user: object({ name: string() })
    }),
    $t => $t`/orders/${t => t.order.id}/by/${t => t.user.name}`
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.withExtensions.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.withExtensions.html new file mode 100644 index 00000000..9a970dcb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_schema.withExtensions.html @@ -0,0 +1,40 @@ +withExtensions | Libraries

Function withExtensions

  • Creates a set of schema factory functions with the provided extensions +applied.

    +

    Each factory function (string(), number(), date(), …) returned by +withExtensions produces builder instances whose prototypes include the +extension methods. All built-in builder methods remain available and +fully chainable alongside the new ones.

    + +

    Pass any number of ExtensionDescriptors — their methods are +merged per builder type. If two extensions define the same method +name on the same builder type, a runtime error is thrown to prevent +silent conflicts.

    + +

    The return type is fully inferred: TypeScript knows exactly which +extension methods are available on each builder factory. Extension +methods return the full extended builder type, so chaining like +s.string().email().slug().minLength(3) is fully typed.

    + +

    Builders that have no methods from any of the provided extensions +use the standard (unextended) factory, so there is zero overhead.

    +

    Type Parameters

    Parameters

    Returns WithExtensionsResult<TExts>

    An object with factory functions for all builder types +(string, number, boolean, date, object, array, union, +func, any), each returning augmented builders.

    +
    const s = withExtensions(emailExt, rangeExt);

    // string() now has .email()
    const emailSchema = s.string().email().minLength(5);

    // number() now has .range()
    const rangeSchema = s.number().range(0, 100);

    // builders without targeted extensions work as normal
    const dateSchema = s.date(); +
    + +
    const s = withExtensions(emailExt, slugExt, trimmedExt);
    const schema = s.string().email().slug().trimmed(); +
    + +
    const s = withExtensions(emailExt, portExt);
    const ServerConfig = s.object({
    host: s.string().email(),
    port: s.number().port()
    }); +
    + +

    If two extensions define the same method name on the +same builder type.

    +
    +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.convertSchema.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.convertSchema.html new file mode 100644 index 00000000..2bf861a9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.convertSchema.html @@ -0,0 +1,9 @@ +convertSchema | Libraries
  • Converts a @cleverbrush/schema builder to a JSON Schema object suitable +for embedding in an OpenAPI 3.1 spec (no $schema header, Draft 2020-12).

    +

    Returns an empty schema {} when the input is null or undefined.

    +

    When a SchemaRegistry or a custom resolver function is provided, any +schema instance that resolves to a name will be emitted as a +$ref: '#/components/schemas/<name>' pointer instead of being inlined.

    +

    Parameters

    • schema: SchemaBuilder<any, any, any, any, any> | null | undefined

      The schema to convert, or null/undefined.

      +
    • Optionalregistry: SchemaRegistry | NameResolver

      Optional registry or resolver function for $ref deduplication.

      +

    Returns Record<string, unknown>

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.createOpenApiEndpoint.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.createOpenApiEndpoint.html new file mode 100644 index 00000000..a174dfa0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.createOpenApiEndpoint.html @@ -0,0 +1,7 @@ +createOpenApiEndpoint | Libraries
  • Creates an endpoint definition and handler that serves the OpenAPI spec +as JSON. Register it with builder.handle(ep, handler).

    +

    The spec is lazily generated on first request and cached.

    +

    Parameters

    Returns { endpoint: EndpointBuilder<unknown>; handler: () => OpenApiDocument }

    const { endpoint: openApiEp, handler } = createOpenApiEndpoint({
    server,
    info: { title: 'My API', version: '1.0.0' }
    });
    server.handle(openApiEp, handler); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.generateAsyncApiSpec.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.generateAsyncApiSpec.html new file mode 100644 index 00000000..80c0ddc7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.generateAsyncApiSpec.html @@ -0,0 +1,17 @@ +generateAsyncApiSpec | Libraries
  • Generates an AsyncAPI 3.0 document from a set of WebSocket subscription +registrations.

    +

    Each subscription becomes:

    +
      +
    • A channel with its address and optional messages (for outgoing +server→client events and/or incoming client→server messages).
    • +
    • One or two operations: a send operation for server→client events +and/or a receive operation for client→server messages.
    • +
    +

    Named schemas (those with .schemaName() set) are automatically collected +and emitted as components.schemas entries with $ref pointers.

    +

    Parameters

    • options: AsyncApiOptions

      Configuration including subscription registrations and API info.

      +

    Returns AsyncApiDocument

    A plain AsyncAPI 3.0 document object suitable for JSON.stringify.

    +
    import { generateAsyncApiSpec } from '@cleverbrush/server-openapi';
    import { server } from './server.js';

    const spec = generateAsyncApiSpec({
    server,
    info: { title: 'My API', version: '1.0.0' },
    servers: {
    production: { host: 'api.example.com', protocol: 'wss' },
    },
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.generateOpenApiSpec.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.generateOpenApiSpec.html new file mode 100644 index 00000000..040b0bb5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.generateOpenApiSpec.html @@ -0,0 +1,2 @@ +generateOpenApiSpec | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.mapOperationSecurity.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.mapOperationSecurity.html new file mode 100644 index 00000000..8e1b30ee --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.mapOperationSecurity.html @@ -0,0 +1,7 @@ +mapOperationSecurity | Libraries
  • Map endpoint authRoles to an OpenAPI operation-level security array.

    +
      +
    • null → empty array (public endpoint, no security)
    • +
    • [][{ <schemeName>: [] }] (any authenticated user)
    • +
    • ['admin'][{ <schemeName>: ['admin'] }] (require specific roles)
    • +
    +

    Parameters

    • authRoles: readonly string[] | null
    • securitySchemeNames: string[]

    Returns Record<string, string[]>[]

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.mapSecuritySchemes.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.mapSecuritySchemes.html new file mode 100644 index 00000000..33871810 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.mapSecuritySchemes.html @@ -0,0 +1,2 @@ +mapSecuritySchemes | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.resolvePath.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.resolvePath.html new file mode 100644 index 00000000..65253cf8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.resolvePath.html @@ -0,0 +1,3 @@ +resolvePath | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.serveAsyncApi.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.serveAsyncApi.html new file mode 100644 index 00000000..8d9b7d19 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.serveAsyncApi.html @@ -0,0 +1,8 @@ +serveAsyncApi | Libraries
  • Returns a server middleware that serves the AsyncAPI 3.0 spec as JSON at +the configured path (default: /asyncapi.json).

    +

    The spec is lazily generated on the first request and cached for subsequent +requests.

    +

    Parameters

    Returns (context: RequestContext, next: () => Promise<void>) => Promise<void>

    import { serveAsyncApi } from '@cleverbrush/server-openapi';

    server.use(
    serveAsyncApi({
    server,
    info: { title: 'My API', version: '1.0.0' },
    servers: {
    production: { host: 'api.example.com', protocol: 'wss' },
    },
    })
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.serveOpenApi.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.serveOpenApi.html new file mode 100644 index 00000000..fb5b23d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.serveOpenApi.html @@ -0,0 +1,4 @@ +serveOpenApi | Libraries
  • Returns a server middleware that serves the OpenAPI spec as JSON at +the configured path (default: /openapi.json).

    +

    The spec is lazily generated on first request and cached.

    +

    Parameters

    Returns (context: RequestContext, next: () => Promise<void>) => Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.walkSchemas.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.walkSchemas.html new file mode 100644 index 00000000..d64f3fd5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.walkSchemas.html @@ -0,0 +1,15 @@ +walkSchemas | Libraries
  • Recursively visits every SchemaBuilder reachable from schema and +calls SchemaRegistry.register on each node.

    +

    Cycle detection is performed via a visited Set of object references, so +schemas may safely be shared across multiple branches without causing +infinite recursion.

    +

    Excluded schema types

    +
      +
    • lazy — deferred resolution would require calling the getter, which may +itself reference the parent schema; lazy schemas are handled separately.
    • +
    +

    Parameters

    • schema: SchemaBuilder<any, any, any>

      Root schema to start the walk from.

      +
    • registry: SchemaRegistry

      Registry to register named schemas into.

      +
    • visited: Set<SchemaBuilder<any, any, any, false, {}>> = ...

      Shared set for cycle detection; pass a new Set() for the +top-level call.

      +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.writeOpenApiSpec.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.writeOpenApiSpec.html new file mode 100644 index 00000000..2a7b6363 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server-openapi.writeOpenApiSpec.html @@ -0,0 +1,8 @@ +writeOpenApiSpec | Libraries
  • Generate an OpenAPI spec and write it to a file.

    +

    Parameters

    • options: OpenApiOptions

      Same options as generateOpenApiSpec().

      +
    • outputPath: string

      File path to write the JSON spec to.

      +

    Returns OpenApiDocument

    The generated spec document.

    +
    import { writeOpenApiSpec } from '@cleverbrush/server-openapi';
    import { createServer, endpoint } from '@cleverbrush/server';

    const builder = createServer()
    .handle(endpoint.get('/api/health'), () => ({ ok: true }));

    writeOpenApiSpec(
    {
    registrations: builder.getRegistrations(),
    info: { title: 'My API', version: '1.0.0' }
    },
    './openapi.json'
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..cacheResponse.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..cacheResponse.html new file mode 100644 index 00000000..61c2cde1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..cacheResponse.html @@ -0,0 +1,18 @@ +cacheResponse | Libraries

Function cacheResponse

  • Server-side cache response middleware.

    +

    Uses cache-tag definitions from the matched endpoint (already available +on ctx.items.__endpoint_meta.cacheTags) to compute deterministic cache +keys from request data (params, query, body, headers).

    +
      +
    • GET: Computes cache key → serves cached response if valid → +handler never executes. On cache miss, runs the handler and caches +the response.
    • +
    • Mutation (POST/PUT/PATCH/DELETE): Lets the handler run, then +invalidates all cache entries whose key starts with any of the +endpoint's cache tag names.
    • +
    +

    Parameters

    Returns Middleware

    A server-side Middleware.

    +
    server.handle(ListTodos, listHandler, {
    middlewares: [cacheResponse({ defaultTtl: 30_000 })]
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..computeCacheKey.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..computeCacheKey.html new file mode 100644 index 00000000..224d401c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..computeCacheKey.html @@ -0,0 +1,10 @@ +computeCacheKey | Libraries

Function computeCacheKey

  • Computes a deterministic cache key from a tag definition and live +request data.

    +
      +
    • Simple tags (no properties) produce just the tag name.
    • +
    • Tags with properties produce name:key1=val1,key2=val2 where +keys are sorted alphabetically for determinism.
    • +
    +

    Properties whose getValue returns success: false are skipped +(their value is not included in the key).

    +

    Parameters

    • tag: CacheTagDefinition
    • root: {
          body: unknown;
          headers: Record<string, string>;
          params: Record<string, unknown>;
          query: Record<string, unknown>;
      }

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createCacheTagTree.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createCacheTagTree.html new file mode 100644 index 00000000..8b7ea1ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createCacheTagTree.html @@ -0,0 +1,8 @@ +createCacheTagTree | Libraries

Function createCacheTagTree

  • Builds a synthetic object({ params, body, query, headers }) schema +from the endpoint's schema definitions and returns its +PropertyDescriptorTree so callers can write type-safe selectors like:

    +
    endpoint.cacheTag('todo', p => ({
    id: p.query.id,
    fromBodyId: p.body.id
    })) +
    + +

    Only non-null schemas are included in the synthetic schema.

    +

    Parameters

    • schemas: {
          bodySchema?: SchemaBuilder<any, any, any, any, any> | null;
          headerSchema?:
              | ObjectSchemaBuilder<any, any, any, any, any, any, any>
              | null;
          paramsSchema?: SchemaBuilder<any, any, any, any, any> | null;
          querySchema?: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
      }

    Returns any

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createEndpoints.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createEndpoints.html new file mode 100644 index 00000000..1cf2a1ef --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createEndpoints.html @@ -0,0 +1,7 @@ +createEndpoints | Libraries

Function createEndpoints

  • Create a role-constrained endpoint factory. Roles are defined as a plain +as const object whose values become the string-literal union accepted +by authorize().

    +

    Type Parameters

    • const T extends Record<string, string>

    Parameters

    • _roles: T

    Returns EndpointFactory<T[keyof T]>

    const Roles = { admin: 'admin', editor: 'editor' } as const;
    const ep = createEndpoints(Roles);
    ep.get('/api/admin').authorize(IPrincipal, 'admin'); // ✓
    ep.get('/api/admin').authorize(IPrincipal, 'typo'); // ✗ type error +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createProblemDetails.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createProblemDetails.html new file mode 100644 index 00000000..1c427f28 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createProblemDetails.html @@ -0,0 +1,7 @@ +createProblemDetails | Libraries

Function createProblemDetails

  • Create a ProblemDetails object for the given HTTP status code.

    +

    Parameters

    • status: number

      HTTP status code (e.g. 400, 404, 500).

      +
    • Optionaltitle: string

      Short, human-readable summary. Defaults to a standard phrase +for common status codes.

      +
    • Optionaldetail: string

      Longer explanation specific to this occurrence.

      +
    • Optionalextensions: Record<string, unknown>

      Extra fields merged into the object (RFC 9457 §3.1).

      +

    Returns ProblemDetails

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createServer.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createServer.html new file mode 100644 index 00000000..0690a250 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createServer.html @@ -0,0 +1 @@ +createServer | Libraries

Function createServer

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createValidationProblemDetails.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createValidationProblemDetails.html new file mode 100644 index 00000000..ae54e590 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..createValidationProblemDetails.html @@ -0,0 +1,4 @@ +createValidationProblemDetails | Libraries

Function createValidationProblemDetails

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..defineWebhook.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..defineWebhook.html new file mode 100644 index 00000000..be08b8d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..defineWebhook.html @@ -0,0 +1,4 @@ +defineWebhook | Libraries

Function defineWebhook

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..idempotency.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..idempotency.html new file mode 100644 index 00000000..8b0a7a7b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..idempotency.html @@ -0,0 +1,12 @@ +idempotency | Libraries

Function idempotency

  • Server-side idempotency middleware.

    +

    Reads the x-idempotency-key header from mutating requests. If a +response has already been stored for that key, it is returned +immediately — the handler is never called. Otherwise the handler +executes and its response is stored for future replays.

    +

    GET, HEAD, and OPTIONS requests pass through without checking.

    +

    Parameters

    Returns Middleware

    A server-side Middleware.

    +
    server.handle(CreateTodo, createHandler, {
    middlewares: [idempotency({ ttl: 86_400_000 })]
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..mapHandlers.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..mapHandlers.html new file mode 100644 index 00000000..b95168b4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..mapHandlers.html @@ -0,0 +1,15 @@ +mapHandlers | Libraries

Function mapHandlers

  • Binds a complete set of endpoint builders to their handlers with +compile-time exhaustiveness checking.

    +

    TypeScript will report an error if any endpoint in endpoints is +missing from handlers, or if a handler's signature does not match +its endpoint. This is analogous to how @cleverbrush/mapper tracks +unmapped properties at the type level.

    +

    Type Parameters

    • TEndpoints extends Record<string, Record<string, AnyEndpoint | AnySubscriptionBuilder>>

    Parameters

    • endpoints: TEndpoints

      A grouped object of extended endpoint builders +(e.g. after .authorize() / .inject()).

      +
    • handlers: HandlerMap<TEndpoints>

      A matching grouped object of handler functions or +{ handler, middlewares } entries.

      +

    Returns HandlerMapping

    A HandlerMapping to pass to ServerBuilder.handleAll().

    +
    const mapping = mapHandlers(endpoints, {
    auth: {
    register: registerHandler,
    login: loginHandler,
    },
    todos: {
    list: listTodosHandler,
    create: createTodoHandler,
    export: { handler: exportHandler, middlewares: [auditLog] },
    },
    });

    server.handleAll(mapping); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..route.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..route.html new file mode 100644 index 00000000..39aa202e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..route.html @@ -0,0 +1,12 @@ +route | Libraries

Concise shorthand for defining a typed path template.

+
const TodoById = route({ id: number().coerce() })`/${t => t.id}`;
+
+ +
const Path = route`/some/path`;
// or
const Path = route()`/some/path`; +
+ +

Either a property map for typed path segments, +or a TemplateStringsArray when used directly as a tagged template.

+

A ParseStringSchemaBuilder, or a tagged-template function +that produces one.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..serializeTag.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..serializeTag.html new file mode 100644 index 00000000..cbfc63c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..serializeTag.html @@ -0,0 +1,7 @@ +serializeTag | Libraries

Function serializeTag

diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..tracked.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..tracked.html new file mode 100644 index 00000000..1abd67ae --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server..tracked.html @@ -0,0 +1,11 @@ +tracked | Libraries
  • Wrap a server-sent event with a unique ID for resumable subscriptions.

    +

    When a handler yields a TrackedEvent, the server sends the event with its +ID. If the client disconnects and reconnects with the last received ID, +the handler can skip already-delivered events.

    +

    Type Parameters

    • T

    Parameters

    • id: string

      A unique, monotonically increasing identifier for this event.

      +
    • data: T

      The event payload to send to the client.

      +

    Returns TrackedEvent<T>

    A TrackedEvent wrapper.

    +
    async function* handler({ incoming }) {
    yield tracked('evt-1', { message: 'Hello' });
    yield tracked('evt-2', { message: 'World' });
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.defineApi.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.defineApi.html new file mode 100644 index 00000000..571b3d3f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.defineApi.html @@ -0,0 +1,17 @@ +defineApi | Libraries
  • Defines a typed API contract with one level of grouping.

    +

    The returned object is the single source of truth for both server and +client. The server imports it and extends each endpoint with +.authorize(), .inject(), and OpenAPI metadata. The client passes it +to createClient() from @cleverbrush/client to obtain a fully typed HTTP +client.

    +

    At runtime the contract (and each group within it) is frozen with +Object.freeze to prevent accidental mutation — endpoint builders are +immutable by design, so every .body() / .query() / etc. call already +returns a new builder.

    +

    Type Parameters

    • T extends ApiContract

      The exact shape of the contract, inferred from the argument.

      +

    Parameters

    • contract: T

      A record of named groups, each containing named endpoints.

      +

    Returns Readonly<T>

    The same object, frozen and typed as Readonly<T>.

    +
    import { defineApi, endpoint, route } from '@cleverbrush/server/contract';
    import { array, number, object, string } from '@cleverbrush/schema';

    const TodoSchema = object({ id: number(), title: string(), completed: boolean() });
    const todosResource = endpoint.resource('/api/todos');
    const ById = route({ id: number().coerce() })`/${t => t.id}`;

    export const api = defineApi({
    todos: {
    list: todosResource.get()
    .query(object({ page: number().optional(), limit: number().optional() }))
    .responses({ 200: array(TodoSchema) }),
    get: todosResource.get(ById)
    .responses({ 200: TodoSchema }),
    create: todosResource.post()
    .body(object({ title: string() }))
    .responses({ 201: TodoSchema }),
    },
    auth: {
    login: endpoint.post('/api/auth/login')
    .body(object({ email: string(), password: string() }))
    .responses({ 200: object({ token: string() }) }),
    },
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.mergeContracts.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.mergeContracts.html new file mode 100644 index 00000000..f09d4bda --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.mergeContracts.html @@ -0,0 +1,22 @@ +mergeContracts | Libraries
  • Merges two API contracts into one.

    +

    This is the primary building block for audience-scoped bundles: define +a publicApi that is safe to ship to every client, and a separate +adminApi that is only imported by the admin application. Combine them +at the admin entry point with mergeContracts.

    +
      +
    • Groups that exist in only one contract are passed through unchanged.
    • +
    • Groups that share a key have their endpoint maps shallowly merged +(later endpoints with the same name override earlier ones, same semantics +as Object.assign).
    • +
    • The returned contract is frozen, matching the invariant of +defineApi.
    • +
    +

    Type Parameters

    • A extends ApiContract

      The shape of the first contract.

      +
    • B extends ApiContract

      The shape of the second contract.

      +

    Parameters

    • a: A

      The base contract (e.g. the public API).

      +
    • b: B

      The contract to merge in (e.g. admin-only groups).

      +

    Returns Readonly<MergedContracts<A, B>>

    A new frozen contract whose type is MergedContracts<A, B>.

    +
    // shared/public-api.ts  — safe to import in the client bundle
    export const publicApi = defineApi({
    todos: { list: ..., get: ..., create: ... },
    auth: { login: ..., register: ... },
    });

    // shared/admin-api.ts — only imported by the admin application
    const adminApi = defineApi({
    admin: { activityLog: ..., banUser: ... },
    });

    // admin-app/contract.ts
    import { mergeContracts } from '@cleverbrush/server/contract';
    export const fullApi = mergeContracts(publicApi, adminApi);
    // TypeScript sees: { todos, auth, admin } — fully typed

    // client-app/contract.ts
    import { publicApi } from 'shared/public-api';
    // TypeScript sees: { todos, auth } — admin groups are absent +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.omitGroups.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.omitGroups.html new file mode 100644 index 00000000..6dd70985 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.omitGroups.html @@ -0,0 +1,13 @@ +omitGroups | Libraries
  • Returns a new contract with the specified groups removed.

    +

    The TypeScript return type is Omit<T, K> — the listed groups are absent +at both runtime and compile time. Useful for stripping debug, internal, or +admin groups before sharing a contract with less-privileged consumers.

    +

    Type Parameters

    • T extends ApiContract

      The shape of the source contract.

      +
    • K extends string | number | symbol

      The union of group keys to remove.

      +

    Parameters

    • contract: T

      The contract to omit from.

      +
    • ...groups: K[]

      The group keys to exclude.

      +

    Returns Readonly<Omit<T, K>>

    A new frozen contract without the listed groups.

    +
    const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

    // Strip internal groups before exporting to clients
    const publicApi = omitGroups(fullApi, 'admin', 'debug');
    // TypeScript: { todos: ..., auth: ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.pickGroups.html b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.pickGroups.html new file mode 100644 index 00000000..e851e68f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/functions/_cleverbrush_server.contract.pickGroups.html @@ -0,0 +1,14 @@ +pickGroups | Libraries
  • Returns a new contract containing only the specified groups.

    +

    The TypeScript return type is Pick<T, K> — the compiler sees exactly the +selected groups and no others. This provides full type safety on the +narrowed contract when passed to createClient() or used as a server +handler map.

    +

    Type Parameters

    • T extends ApiContract

      The shape of the source contract.

      +
    • K extends string | number | symbol

      The union of group keys to keep.

      +

    Parameters

    • contract: T

      The contract to select from.

      +
    • ...groups: K[]

      The group keys to include.

      +

    Returns Readonly<Pick<T, K>>

    A new frozen contract with only the listed groups.

    +
    const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

    // Pick only the groups the frontend needs
    const clientApi = pickGroups(fullApi, 'todos', 'auth');
    // TypeScript: { todos: ..., auth: ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/hierarchy.html b/websites/docs/public/api-docs/v4.3.1/hierarchy.html new file mode 100644 index 00000000..807b29ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/hierarchy.html @@ -0,0 +1 @@ +Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/index.html b/websites/docs/public/api-docs/v4.3.1/index.html new file mode 100644 index 00000000..7ae830d4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/index.html @@ -0,0 +1,421 @@ +Libraries

Libraries

Cleverbrush Framework

+

CI +License: BSD-3-Clause +Standard Schema v1

+ +

Coverage

+ +

A monorepo of production-quality TypeScript libraries. Written with zero runtime dependencies, strict types, and a strong focus on correctness — every package ships with unit tests, full TypeScript type coverage, and automated CI on every pull request.

+

The flagship package is @cleverbrush/schema — a schema validation library that is faster than Zod in 14 out of 15 benchmarks (up to 204× faster on invalid input), 3× smaller than Zod v4 in bundle size, and compatible with 50+ ecosystem tools via Standard Schema v1.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDescription
@cleverbrush/schemaSchema definition, type inference, and runtime validation. Standard Schema v1 compatible — works with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, and 50+ other tools. Wraps external schemas (Zod, Valibot, ArkType) via extern()
@cleverbrush/mapperSchema-driven object mapping with compile-time completeness checking and type-safe property selectors
@cleverbrush/react-formHeadless, schema-driven form system for React — type-safe field binding, auto-field rendering, UI-agnostic
@cleverbrush/schema-jsonBidirectional JSON Schema conversion: toJsonSchema() + fromJsonSchema() with full type inference
@cleverbrush/asyncAsync utilities: Collector, debounce, throttle, retry
@cleverbrush/deepDeep operations on objects: deep equality, deep merge, flattening, hashing
@cleverbrush/schedulerCron-like job scheduler for Node.js using worker threads
@cleverbrush/clientTyped HTTP client for @cleverbrush/server API contracts — Proxy-based, zero codegen, full type inference. Optional React + TanStack Query integration via /react subpath
@cleverbrush/otelOpenTelemetry instrumentation — traces for HTTP, SQL, and outbound client calls; OTLP log sink with trace correlation; DI integration
@cleverbrush/knex-clickhouseKnex query builder dialect for ClickHouse
+
+ +

If you have used Zod, Yup, or Joi, the fluent API will feel immediately familiar — with several important differences.

+ +
@cleverbrush/schema

├── TypeScript inference (InferType<typeof schema>)
├── Runtime validation (.validate() / .validateAsync())
├── @cleverbrush/mapper (type-safe object mapping)
├── @cleverbrush/react-form (auto-generated, schema-driven forms)
└── @cleverbrush/schema-json (bidirectional JSON Schema) +
+ +

Define a schema once and get all four capabilities for free — no duplication between types, validators, mappers, and form configs.

+ +
import { object, string, number, InferType } from '@cleverbrush/schema';

const UserSchema = object({
name: string().nonempty().minLength(2),
email: string().email(),
age: number().min(18).optional(),
});

// TypeScript type — inferred automatically, no duplication
type User = InferType<typeof UserSchema>;

// Runtime validation
const result = UserSchema.validate({ name: 'Alice', email: 'alice@example.com' });
if (result.valid) {
console.log(result.object); // typed as User
} else {
const nameErrors = result.getErrorsFor((p) => p.name);
console.log(nameErrors.errors); // ['Name must be at least 2 characters']
}

// Standard Schema interop — pass directly to tRPC, TanStack Form, T3 Env, …
const validator = UserSchema['~standard']; +
+ + +

Benchmarked with Vitest bench against Zod v4 on the same machine:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Benchmark@cleverbrush/schemaZodRatio
Array 100 objects — valid35,228 ops/s13,277 ops/s2.65× faster
Array 100 objects — invalid899,329 ops/s4,396 ops/s204× faster
Complex order — valid198,988 ops/s136,090 ops/s1.46× faster
Complex order — invalid884,706 ops/s26,106 ops/s33.9× faster
Flat object — valid1,001,194 ops/s840,725 ops/s1.19× faster
Flat object — invalid2,653,630 ops/s176,222 ops/s15.1× faster
Nested object — valid690,556 ops/s368,893 ops/s1.87× faster
Nested object — invalid2,739,319 ops/s87,245 ops/s31.4× faster
String — valid5,348,564 ops/s3,533,945 ops/s1.51× faster
String — invalid5,749,087 ops/s482,961 ops/s11.9× faster
Number — valid7,911,266 ops/s4,806,511 ops/s1.65× faster
Number — invalid5,387,475 ops/s637,513 ops/s8.45× faster
Union first branch1,925,508 ops/s1,529,547 ops/s1.26× faster
Union last branch676,107 ops/s732,682 ops/s0.92×
Union no match — invalid5,873,118 ops/s385,453 ops/s15.2× faster
+

14 out of 15 benchmarks. The early-exit optimization on invalid data produces especially large gains — up to 204× — because type errors are caught at the first failing field without evaluating the rest.

+

Run the benchmarks yourself:

+
npm run bench
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BundleGzippedNotes
@cleverbrush/schema (full)14 KBAll builders + built-in extensions
@cleverbrush/schema/string3.8 KBSub-path import, one builder only
@cleverbrush/schema/object5.8 KBSub-path import, one builder only
Zod v3 (full)14.4 KBFor reference
Zod v4 (full)41 KB3× larger than @cleverbrush/schema
+

Sub-path exports (@cleverbrush/schema/string, /number, /object, /array, /core) enable fine-grained tree-shaking for bundle-critical applications.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@cleverbrush/schemaZodYupJoi
TypeScript type inference~
Standard Schema v1
PropertyDescriptors (runtime introspection)
Type-safe extension system
Built-in object mapper
Built-in form generation
Bidirectional JSON Schema~ (output only)
External schema interop (extern())
JSDoc comment preservation
Immutable fluent API
Zero runtime dependencies
Bundle size (full, gzipped)14 KB41 KB (v4)~19 KB~26 KB
+

PropertyDescriptors are the architectural differentiator. Every schema emits a structured descriptor tree at runtime — not just a black-box validator function. This is what enables the mapper to provide type-safe property selectors, react-form to auto-generate fields, and schema-json to produce accurate JSON Schema output. No other popular validation library exposes this level of runtime metadata.

+
+ +

Every pull request must pass all of the following gates before merging — enforced by the CI pipeline:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GateToolWhat it checks
LintingBiomeCode style, formatting, and static analysis across all packages and the website
Type checkingTypeScript (strict mode)Strict null-checks, no implicit any, full type coverage
Unit testsVitestRuntime behaviour + type-level tests (expectTypeOf) — coverage spans all builders, extensions, edge cases, and error paths
Buildtsup + TurboESM output compiles cleanly with no TypeScript errors
BenchmarksVitest benchPerformance regressions are visible before merge
+

Run everything locally before opening a PR:

+
npm run lint        # Biome static analysis
npm run build # compile all packages
npm test # unit tests + type checks
npm run bench # performance benchmarks +
+ +
+ +

This project uses npm workspaces and Turborepo for incremental builds. All library source is under libs/.

+ +
npm install
+
+ + +
npm run build
+
+ + +
npm test
+
+ + +

API docs are generated by TypeDoc and published at https://docs.cleverbrush.com/.

+
npm run docs
+
+ +

Each library has its own README.md with usage examples and full API reference.

+
+ +

This project uses Changesets for versioning and publishing. All packages are versioned together.

+
    +
  1. +

    Add a changeset after making changes:

    +
    npm run changeset
    +
    + +

    Follow the prompts to describe the change. A changeset file is created in .changeset/.

    +
  2. +
  3. +

    Version packages when ready to release:

    +
    npm run version
    +
    + +

    This bumps package.json versions and updates CHANGELOG.md files.

    +
  4. +
  5. +

    Publish to npm:

    +
    npm run release
    +
    + +

    For a beta release:

    +
    npm run publish:beta
    +
    + +
  6. +
+
+ +

Contributions are welcome. See CONTRIBUTING.md for full guidelines.

+

The short version: make sure your changes include tests, pass linting (npm run lint), and don't break existing tests (npm test). If you add or change behaviour, update the relevant JSDoc comments — that's all the documentation update that's usually needed.

+

Extensions are the easiest place to start contributing — each one is a self-contained file with tests. Look for issues labelled good first issue.

+
+ +

BSD-3-Clause

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthenticationContext.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthenticationContext.html new file mode 100644 index 00000000..0c3dfa11 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthenticationContext.html @@ -0,0 +1,7 @@ +AuthenticationContext | Libraries

Interface AuthenticationContext

Transport-agnostic context passed to authentication schemes. +HTTP middleware builds this from RequestContext; future transports +(WebSocket, gRPC) provide the same shape.

+
interface AuthenticationContext {
    cookies: Record<string, string>;
    headers: Record<string, string>;
    items: Map<string, unknown>;
}
Index

Properties

Properties

cookies: Record<string, string>
headers: Record<string, string>
items: Map<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthenticationScheme.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthenticationScheme.html new file mode 100644 index 00000000..a6b8bd1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthenticationScheme.html @@ -0,0 +1,11 @@ +AuthenticationScheme | Libraries

Interface AuthenticationScheme<T>

An authentication scheme extracts and validates credentials from the +transport-agnostic AuthenticationContext.

+
interface AuthenticationScheme<T = unknown> {
    name: string;
    authenticate(
        context: AuthenticationContext,
    ): Promise<AuthenticationResult<T>>;
    challenge?(): { headerName: string; headerValue: string };
}

Type Parameters

  • T = unknown
Index

Properties

Methods

Properties

name: string

Unique name for this scheme (e.g. "jwt", "cookie").

+

Methods

  • Optional challenge header for 401 responses. +E.g. { headerName: 'WWW-Authenticate', headerValue: 'Bearer' }

    +

    Returns { headerName: string; headerValue: string }

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthorizationCodeSchemeOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthorizationCodeSchemeOptions.html new file mode 100644 index 00000000..06ac505d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthorizationCodeSchemeOptions.html @@ -0,0 +1,15 @@ +AuthorizationCodeSchemeOptions | Libraries

Interface AuthorizationCodeSchemeOptions<T>

Configuration for authorizationCodeScheme.

+
interface AuthorizationCodeSchemeOptions<T> {
    authenticate: (
        context: AuthenticationContext,
    ) => Promise<AuthenticationResult<T>>;
    authorizationUrl: string;
    name?: string;
    refreshUrl?: string;
    scopes?: Record<string, string>;
    tokenUrl: string;
}

Type Parameters

  • T

    The type of the principal value produced by authenticate.

    +
Index

Properties

authenticate: (
    context: AuthenticationContext,
) => Promise<AuthenticationResult<T>>

Validate the incoming request and return the principal or a failure.

+
authorizationUrl: string

OAuth authorization endpoint URL.

+
name?: string

Custom scheme name (default: 'oauth2').

+
refreshUrl?: string

Optional token refresh URL.

+
scopes?: Record<string, string>

Available scopes with descriptions (default: {}).

+
tokenUrl: string

OAuth token endpoint URL.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthorizationPolicy.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthorizationPolicy.html new file mode 100644 index 00000000..a804fd1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.AuthorizationPolicy.html @@ -0,0 +1,6 @@ +AuthorizationPolicy | Libraries

Interface AuthorizationPolicy

A named set of authorization requirements. +All requirements must pass (AND semantics) for the policy to be satisfied. +Build instances using PolicyBuilder.

+
interface AuthorizationPolicy {
    name: string;
    requirements: readonly AuthorizationRequirement[];
}
Index

Properties

Properties

name: string
requirements: readonly AuthorizationRequirement[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.ClientCredentialsSchemeOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.ClientCredentialsSchemeOptions.html new file mode 100644 index 00000000..497655d6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.ClientCredentialsSchemeOptions.html @@ -0,0 +1,13 @@ +ClientCredentialsSchemeOptions | Libraries

Interface ClientCredentialsSchemeOptions<T>

Configuration for clientCredentialsScheme.

+
interface ClientCredentialsSchemeOptions<T> {
    authenticate: (
        context: AuthenticationContext,
    ) => Promise<AuthenticationResult<T>>;
    name?: string;
    refreshUrl?: string;
    scopes?: Record<string, string>;
    tokenUrl: string;
}

Type Parameters

  • T

    The type of the principal value produced by authenticate.

    +
Index

Properties

authenticate: (
    context: AuthenticationContext,
) => Promise<AuthenticationResult<T>>

Validate the incoming request and return the principal or a failure.

+
name?: string

Custom scheme name (default: 'oauth2').

+
refreshUrl?: string

Optional token refresh URL.

+
scopes?: Record<string, string>

Available scopes with descriptions (default: {}).

+
tokenUrl: string

OAuth token endpoint URL.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.CookieOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.CookieOptions.html new file mode 100644 index 00000000..cbf4ac07 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.CookieOptions.html @@ -0,0 +1,17 @@ +CookieOptions | Libraries

Interface CookieOptions

Options for the Set-Cookie header, controlling cookie lifetime, +scope, and security attributes.

+
interface CookieOptions {
    domain?: string;
    expires?: Date;
    httpOnly?: boolean;
    maxAge?: number;
    path?: string;
    sameSite?: "Strict" | "Lax" | "None";
    secure?: boolean;
}
Index

Properties

domain?: string

Cookie domain.

+
expires?: Date

Absolute expiry date.

+
httpOnly?: boolean

Prevent client-side JS access.

+
maxAge?: number

Max lifetime in seconds.

+
path?: string

Cookie path (default "/").

+
sameSite?: "Strict" | "Lax" | "None"

SameSite attribute.

+
secure?: boolean

HTTPS only.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.CookieSchemeOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.CookieSchemeOptions.html new file mode 100644 index 00000000..9f7e2190 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.CookieSchemeOptions.html @@ -0,0 +1,12 @@ +CookieSchemeOptions | Libraries

Interface CookieSchemeOptions<T>

Configuration for cookieScheme.

+
interface CookieSchemeOptions<T> {
    cookieName: string;
    name?: string;
    validate: (cookieValue: string) => Promise<T | null>;
}

Type Parameters

  • T

    The type of the principal value returned by validate.

    +
Index

Properties

Properties

cookieName: string

Name of the cookie to read (e.g. "session", "sid").

+
name?: string

Custom scheme name (default: "cookie").

+
validate: (cookieValue: string) => Promise<T | null>

Validate the cookie value and return the principal data, or null +if the cookie is invalid / session expired.

+

The implementer is responsible for session lookup, signature +verification, etc.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.JwtPayload.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.JwtPayload.html new file mode 100644 index 00000000..3ee81ac3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.JwtPayload.html @@ -0,0 +1,10 @@ +JwtPayload | Libraries

Interface JwtPayload

The decoded JWT payload. Includes standard registered claims (iss, sub, +aud, exp, nbf, iat, jti) and any custom claims.

+
interface JwtPayload {
    aud?: string | string[];
    exp?: number;
    iat?: number;
    iss?: string;
    jti?: string;
    nbf?: number;
    sub?: string;
    [key: string]: unknown;
}

Indexable

  • [key: string]: unknown
Index

Properties

Properties

aud?: string | string[]
exp?: number
iat?: number
iss?: string
jti?: string
nbf?: number
sub?: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.JwtSchemeOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.JwtSchemeOptions.html new file mode 100644 index 00000000..a5d5896a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.JwtSchemeOptions.html @@ -0,0 +1,17 @@ +JwtSchemeOptions | Libraries

Interface JwtSchemeOptions<T>

Configuration for jwtScheme.

+
interface JwtSchemeOptions<T> {
    algorithms?: string[];
    audience?: string;
    clockTolerance?: number;
    issuer?: string;
    mapClaims: (claims: JwtPayload) => T;
    name?: string;
    secret: string | Buffer<ArrayBufferLike>;
}

Type Parameters

  • T

    The type of the principal value produced by mapClaims.

    +
Index

Properties

algorithms?: string[]

Allowed algorithms (default: ['HS256']).

+
audience?: string

Expected audience — if set, aud must include it.

+
clockTolerance?: number

Clock tolerance in seconds for exp/nbf checks (default: 0).

+
issuer?: string

Expected issuer — if set, iss must match.

+
mapClaims: (claims: JwtPayload) => T

Map raw JWT claims to the typed principal value.

+
name?: string

Custom scheme name (default: 'jwt').

+
secret: string | Buffer<ArrayBufferLike>

HMAC secret (for HS256/HS384/HS512) or PEM public key (for RS256/RS384/RS512).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OAuthFlow.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OAuthFlow.html new file mode 100644 index 00000000..b93e3ad4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OAuthFlow.html @@ -0,0 +1,6 @@ +OAuthFlow | Libraries

Interface OAuthFlow

A single OAuth 2.0 flow as defined by the OpenAPI specification.

+
interface OAuthFlow {
    authorizationUrl?: string;
    refreshUrl?: string;
    scopes: Record<string, string>;
    tokenUrl?: string;
}
Index

Properties

authorizationUrl?: string
refreshUrl?: string
scopes: Record<string, string>
tokenUrl?: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OAuthFlows.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OAuthFlows.html new file mode 100644 index 00000000..8539dd5b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OAuthFlows.html @@ -0,0 +1,7 @@ +OAuthFlows | Libraries

Interface OAuthFlows

Map of OAuth 2.0 grant-type flows.

+
interface OAuthFlows {
    authorizationCode?: OAuthFlow;
    clientCredentials?: OAuthFlow;
    implicit?: OAuthFlow;
    password?: OAuthFlow;
}
Index

Properties

authorizationCode?: OAuthFlow
clientCredentials?: OAuthFlow
implicit?: OAuthFlow
password?: OAuthFlow
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OidcSchemeOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OidcSchemeOptions.html new file mode 100644 index 00000000..494f3b4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_auth.OidcSchemeOptions.html @@ -0,0 +1,9 @@ +OidcSchemeOptions | Libraries

Interface OidcSchemeOptions<T>

Configuration for oidcScheme.

+
interface OidcSchemeOptions<T> {
    authenticate: (
        context: AuthenticationContext,
    ) => Promise<AuthenticationResult<T>>;
    name?: string;
    openIdConnectUrl: string;
}

Type Parameters

  • T

    The type of the principal value produced by authenticate.

    +
Index

Properties

authenticate: (
    context: AuthenticationContext,
) => Promise<AuthenticationResult<T>>

Validate the incoming request and return the principal or a failure.

+
name?: string

Custom scheme name (default: 'oidc').

+
openIdConnectUrl: string

OpenID Connect discovery URL (e.g. https://auth.example.com/.well-known/openid-configuration).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..ClientHooks.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..ClientHooks.html new file mode 100644 index 00000000..47757bd9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..ClientHooks.html @@ -0,0 +1,23 @@ +ClientHooks | Libraries

Interface ClientHooks

Lifecycle hooks that are invoked at various stages of a request.

+

All hook arrays are executed serially in order. Hooks can be synchronous +or asynchronous.

+
interface ClientHooks {
    afterResponse?: (
        (
            request: { init: RequestInit; url: string },
            response: Response,
        ) => any
    )[];
    beforeError?: ((error: WebError) => WebError | Promise<WebError>)[];
    beforeRequest?: (
        (request: { init: RequestInit; url: string }) => void | Promise<void>
    )[];
    beforeRetry?: (
        (
            info: {
                error: Error;
                init: RequestInit;
                retryCount: number;
                url: string;
            },
        ) => void
        | Promise<void>
    )[];
}
Index

Properties

afterResponse?: (
    (request: { init: RequestInit; url: string }, response: Response) => any
)[]

Called after a successful response is received. +Returning a Response replaces the original response.

+
hooks: {
afterResponse: [(req, res) => {
console.log(`${req.init.method} ${req.url}${res.status}`);
}],
} +
+ +
beforeError?: ((error: WebError) => WebError | Promise<WebError>)[]

Called before an error is thrown. +Can transform or enrich the error before it reaches the caller. +The returned error replaces the original.

+
beforeRequest?: (
    (request: { init: RequestInit; url: string }) => void | Promise<void>
)[]

Called before every request is sent. +Can be used to log, modify headers, or add tracing information.

+
hooks: {
beforeRequest: [(req) => {
req.init.headers = {
...req.init.headers as Record<string, string>,
'X-Request-Id': crypto.randomUUID(),
};
}],
} +
+ +
beforeRetry?: (
    (
        info: {
            error: Error;
            init: RequestInit;
            retryCount: number;
            url: string;
        },
    ) => void
    | Promise<void>
)[]

Called before a retry attempt. +Useful for logging retry attempts or modifying the request between retries.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..ClientOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..ClientOptions.html new file mode 100644 index 00000000..0437bb22 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..ClientOptions.html @@ -0,0 +1,43 @@ +ClientOptions | Libraries

Interface ClientOptions

Configuration for createClient.

+
interface ClientOptions {
    baseUrl?: string;
    fetch?: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>;
    getToken?: () => string | null;
    headers?: Record<string, string>;
    hooks?: ClientHooks;
    middlewares?: Middleware[];
    onUnauthorized?: () => void;
    subscriptionReconnect?: SubscriptionReconnectOptions;
}
Index

Properties

baseUrl?: string

Base URL prepended to every request path. +Defaults to '' (same origin).

+
`'https://api.example.com'`
+
+ +
fetch?: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>

Custom fetch implementation. +Defaults to the global fetch. Useful for testing or server-side +rendering where a polyfill is needed.

+

Type Declaration

    • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

getToken?: () => string | null

Returns the current authentication token, or null if unauthenticated. +When a non-null value is returned it is sent as a Bearer token in +the Authorization header.

+
headers?: Record<string, string>

Additional headers sent with every request.

+
hooks?: ClientHooks

Lifecycle hooks invoked at various stages of a request.

+
const client = createClient(api, {
hooks: {
beforeRequest: [(req) => { console.log('→', req.url); }],
afterResponse: [(req, res) => { console.log('←', res.status); }],
},
}); +
+ +
middlewares?: Middleware[]

Middleware functions that wrap the fetch call. +Applied in array order — the first middleware is the outermost wrapper.

+
import { retry } from '@cleverbrush/web/retry';
import { timeout } from '@cleverbrush/web/timeout';

const client = createClient(api, {
middlewares: [retry(), timeout({ timeout: 10000 })],
}); +
+ +
onUnauthorized?: () => void

Called when a 401 Unauthorized response is received. +Typically used to clear stored tokens and redirect to a login page.

+
subscriptionReconnect?: SubscriptionReconnectOptions

Default reconnection options for all WebSocket subscriptions created by +this client.

+

Individual subscription calls can override these options by passing a +reconnect argument. Pass reconnect: false at the call site to +disable reconnection for a specific subscription even when a global +default is set.

+
const client = createClient(api, {
baseUrl: 'https://api.example.com',
subscriptionReconnect: {
maxRetries: 10,
backoffLimit: 60_000,
jitter: true,
},
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..EndpointMeta.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..EndpointMeta.html new file mode 100644 index 00000000..5140e8af --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..EndpointMeta.html @@ -0,0 +1,41 @@ +EndpointMeta | Libraries

Interface EndpointMeta

Endpoint metadata carried through PER_CALL_OPTIONS on every request.

+

Computed by the Proxy-based client at call time, this gives middleware +access to the endpoint's structural info plus the actual call arguments +without any URL parsing or regex.

+

Used by throttlingCache for cache-invalidation callbacks.

+
interface EndpointMeta {
    basePath: string;
    baseUrl: string;
    body: unknown;
    cacheTags: readonly {
        name: string;
        properties: Readonly<
            Record<
                string,
                {
                    getValue(
                        root: {
                            body: unknown;
                            headers: Record<string, string>;
                            params: Record<string, unknown>;
                            query: Record<string, unknown>;
                        },
                    ): { success: boolean; value?: unknown };
                },
            >,
        >;
    }[];
    collectionPath: string;
    endpoint: string;
    fullCollectionUrl: string;
    group: string;
    headers: Readonly<Record<string, string>>;
    method: string;
    operationId: string | null;
    params: Readonly<Record<string, unknown>>;
    path: string;
    pathParamNames: string[];
    query: Readonly<Record<string, unknown>>;
    tags: readonly string[];
}
Index

Properties

basePath: string

Resource base path, e.g. /api/todos.

+
baseUrl: string

Client base URL (e.g. "http://localhost:3000" or "").

+
body: unknown

Request body.

+
cacheTags: readonly {
    name: string;
    properties: Readonly<
        Record<
            string,
            {
                getValue(
                    root: {
                        body: unknown;
                        headers: Record<string, string>;
                        params: Record<string, unknown>;
                        query: Record<string, unknown>;
                    },
                ): { success: boolean; value?: unknown };
            },
        >,
    >;
}[]

Cache tag definitions from the endpoint's .cacheTag() calls. +Each tag has a name and a map of properties (key → accessor). +Used by the cacheTags middleware.

+
collectionPath: string

Resource collection path (basePath without param placeholders).

+
endpoint: string

Endpoint name within the group, e.g. "update".

+
fullCollectionUrl: string

Full collection URL matching the HTTP cache key format. +Computed as baseUrl (stripped of trailing slash) + collectionPath.

+
group: string

Contract group name, e.g. "todos".

+
headers: Readonly<Record<string, string>>

Request headers from the call, e.g. { 'x-request-id': 'abc' }.

+
method: string

HTTP method in uppercase, e.g. "PATCH".

+
operationId: string | null

OpenAPI operationId, or null.

+
params: Readonly<Record<string, unknown>>

Actual route parameter values from the call, e.g. { id: 42 }.

+
path: string

Path template with colon placeholders, e.g. /api/todos/:id.

+
pathParamNames: string[]

Names of path parameters, e.g. ["id"].

+
query: Readonly<Record<string, unknown>>

Query parameters, e.g. { page: 1 }.

+
tags: readonly string[]

OpenAPI tags, or [].

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..FilePart.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..FilePart.html new file mode 100644 index 00000000..fc3009a9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..FilePart.html @@ -0,0 +1,10 @@ +FilePart | Libraries

Interface FilePart

Represents a single uploaded file from a multipart/form-data request.

+
interface FilePart {
    buffer: Buffer;
    filename: string;
    mimeType: string;
    size: number;
}
Index

Properties

Properties

buffer: Buffer

Full file contents as a Buffer.

+
filename: string

Original filename as provided by the client.

+
mimeType: string

MIME type of the file (e.g. 'image/jpeg').

+
size: number

File size in bytes.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..PerCallOverrides.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..PerCallOverrides.html new file mode 100644 index 00000000..94c4c650 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..PerCallOverrides.html @@ -0,0 +1,14 @@ +PerCallOverrides | Libraries

Interface PerCallOverrides

Per-call overrides that can be passed alongside endpoint arguments to +override middleware defaults for a single request.

+
interface PerCallOverrides {
    offlineQueue?: { skip?: boolean };
    optimisticUpdate?: { skip?: boolean };
    retry?: {
        backoffLimit?: number;
        jitter?: boolean;
        limit?: number;
        methods?: string[];
        retryOnTimeout?: boolean;
        statusCodes?: number[];
    };
    timeout?: number;
}
Index

Properties

offlineQueue?: { skip?: boolean }

Override offline queue middleware options for this call. +Pass { skip: true } to bypass the queue for this mutation.

+
optimisticUpdate?: { skip?: boolean }

Override optimistic update middleware options for this call. +Pass { skip: true } to skip tagging for this mutation.

+
retry?: {
    backoffLimit?: number;
    jitter?: boolean;
    limit?: number;
    methods?: string[];
    retryOnTimeout?: boolean;
    statusCodes?: number[];
}

Override retry middleware options for this call only. +Pass { limit: 0 } to disable retries entirely.

+
timeout?: number

Override the timeout (in milliseconds) for this call only.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..Subscription.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..Subscription.html new file mode 100644 index 00000000..b5eb4934 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client..Subscription.html @@ -0,0 +1,11 @@ +Subscription | Libraries

Interface Subscription<TOutgoing, TIncoming>

A live WebSocket subscription handle returned by client.group.endpoint().

+

Implements AsyncIterable for consuming server-sent events and provides +send() for client→server messages when the subscription is bidirectional.

+
interface Subscription<TOutgoing, TIncoming = never> {
    state: "connecting" | "connected" | "reconnecting" | "closed";
    "[asyncIterator]"(): AsyncIterator<TOutgoing, any, any>;
    close(): void;
    send(message: TIncoming): void;
}

Type Parameters

  • TOutgoing
  • TIncoming = never

Hierarchy

Index

Properties

Methods

Properties

state: "connecting" | "connected" | "reconnecting" | "closed"

Current connection state.

+

Methods

  • Returns AsyncIterator<TOutgoing, any, any>

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.batching.BatchingOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.batching.BatchingOptions.html new file mode 100644 index 00000000..de874d63 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.batching.BatchingOptions.html @@ -0,0 +1,30 @@ +BatchingOptions | Libraries

Options for the batching middleware.

+
interface BatchingOptions {
    batchPath?: string;
    maxSize?: number;
    skip?: (url: string, init: RequestInit) => boolean;
    windowMs?: number;
}
Index

Properties

batchPath?: string

URL path of the server-side batch endpoint.

+

Must match the path configured via ServerBuilder.useBatching() on the +server (default '/__batch').

+
'/__batch'
+
+ +
maxSize?: number

Maximum number of requests to include in a single batch.

+

When the queue reaches this size the batch is flushed immediately, +before the windowMs timer fires.

+
10
+
+ +
skip?: (url: string, init: RequestInit) => boolean

Predicate to exclude specific requests from batching.

+

Return true to send the request immediately, bypassing the batch +queue. Useful for streaming endpoints, file uploads, or requests that +must not be delayed.

+

Type Declaration

    • (url: string, init: RequestInit): boolean
    • Parameters

      • url: string

        The fully-resolved request URL.

        +
      • init: RequestInit

        The RequestInit object for the request.

        +

      Returns boolean

windowMs?: number

Time window in milliseconds to collect requests before flushing.

+

The first request in a new window starts the timer. All subsequent +requests received before the timer fires are included in the same batch.

+
10
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.cache.CacheOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.cache.CacheOptions.html new file mode 100644 index 00000000..4b8109c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.cache.CacheOptions.html @@ -0,0 +1,21 @@ +CacheOptions | Libraries

Options for the throttlingCache middleware.

+
interface CacheOptions {
    condition?: (response: Response) => boolean;
    invalidate?: (
        url: string,
        init: RequestInit,
        meta?: EndpointMeta,
    ) => string | null;
    key?: (url: string, init: RequestInit) => string;
    skip?: (url: string, init: RequestInit) => boolean;
    throttle?: number;
}
Index

Properties

condition?: (response: Response) => boolean

Predicate that determines whether a response should be cached.

+

Defaults to caching only successful responses (response.ok).

+
invalidate?: (
    url: string,
    init: RequestInit,
    meta?: EndpointMeta,
) => string | null

Returns a cache key to invalidate when a mutating request is made. +Return null to skip invalidation.

+

By default, mutating requests do not invalidate the cache.

+

The meta parameter carries endpoint metadata (group, endpoint, +method, path, params, body, query, etc.) provided by the client proxy.

+
key?: (url: string, init: RequestInit) => string

Computes the cache key for a request.

+

Defaults to method + '@' + url.

+
skip?: (url: string, init: RequestInit) => boolean

Predicate that decides whether a request should be skipped +(i.e. not cached).

+

Defaults to skipping non-GET requests.

+
throttle?: number

Cache TTL in milliseconds. +Defaults to 1000 (1 second).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.cache.CacheTagMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.cache.CacheTagMiddlewareOptions.html new file mode 100644 index 00000000..ebae6466 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.cache.CacheTagMiddlewareOptions.html @@ -0,0 +1,11 @@ +CacheTagMiddlewareOptions | Libraries

Interface CacheTagMiddlewareOptions

Configuration for the cacheTags middleware.

+
interface CacheTagMiddlewareOptions {
    condition?: (response: Response) => boolean;
    defaultTtl?: number;
    ttlByTag?: Record<string, number>;
}
Index

Properties

condition?: (response: Response) => boolean

Predicate that decides whether a request should be cached. +Defaults to caching only successful responses (response.ok).

+
defaultTtl?: number

Default TTL in milliseconds for tags without an explicit TTL. +Defaults to 0 (no caching — invalidation-only mode).

+
ttlByTag?: Record<string, number>

Per-tag TTL map: { [tagName]: ttlMs }. +Tags not listed here fall back to defaultTtl.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.dedupe.DedupeOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.dedupe.DedupeOptions.html new file mode 100644 index 00000000..1a0766af --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.dedupe.DedupeOptions.html @@ -0,0 +1,11 @@ +DedupeOptions | Libraries

Options for the dedupe middleware.

+
interface DedupeOptions {
    key?: (url: string, init: RequestInit) => string;
    skip?: (url: string, init: RequestInit) => boolean;
}
Index

Properties

Properties

key?: (url: string, init: RequestInit) => string

Computes the deduplication key for a request.

+

Requests with the same key that are in-flight simultaneously will +share a single underlying fetch.

+

Defaults to method + '@' + url.

+
skip?: (url: string, init: RequestInit) => boolean

Predicate that decides whether a request should be skipped +(i.e. not deduplicated).

+

Defaults to skipping non-GET requests.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.idempotency.IdempotencyOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.idempotency.IdempotencyOptions.html new file mode 100644 index 00000000..fb0f6c8a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.idempotency.IdempotencyOptions.html @@ -0,0 +1,13 @@ +IdempotencyOptions | Libraries

Configuration for idempotency.

+
interface IdempotencyOptions {
    condition?: (url: string, init: RequestInit) => boolean;
    headerName?: string;
    keyGenerator?: (url: string, init: RequestInit) => string;
}
Index

Properties

condition?: (url: string, init: RequestInit) => boolean

Predicate that decides whether a request should receive a key. +Defaults to true for POST, PUT, PATCH, DELETE.

+
headerName?: string

Header name to use for the idempotency key. +Defaults to "X-Idempotency-Key".

+
keyGenerator?: (url: string, init: RequestInit) => string

Custom key generator. Receives (url, init) and returns a string. +Defaults to generating a UUID v4.

+

The key must be stable across retries of the same logical request. +When not provided, a UUID is generated once and reused on retry.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.OfflineQueueOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.OfflineQueueOptions.html new file mode 100644 index 00000000..70178f30 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.OfflineQueueOptions.html @@ -0,0 +1,4 @@ +OfflineQueueOptions | Libraries
interface OfflineQueueOptions {
    maxRetries?: number;
    skip?: (url: string, init: RequestInit) => boolean;
    store?: OfflineQueueStore;
}
Index

Properties

Properties

maxRetries?: number
skip?: (url: string, init: RequestInit) => boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.OfflineQueueStore.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.OfflineQueueStore.html new file mode 100644 index 00000000..338faf2a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.OfflineQueueStore.html @@ -0,0 +1,4 @@ +OfflineQueueStore | Libraries
interface OfflineQueueStore {
    isOnline: boolean;
    isReplaying: boolean;
    queue: QueuedRequest[];
}
Index

Properties

Properties

isOnline: boolean
isReplaying: boolean
queue: QueuedRequest[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.QueuedRequest.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.QueuedRequest.html new file mode 100644 index 00000000..729abbb9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.offline-queue.QueuedRequest.html @@ -0,0 +1,6 @@ +QueuedRequest | Libraries
interface QueuedRequest {
    id: string;
    init: RequestInit;
    retryCount: number;
    timestamp: number;
    url: string;
}
Index

Properties

Properties

id: string
init: RequestInit
retryCount: number
timestamp: number
url: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticFailure.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticFailure.html new file mode 100644 index 00000000..a347d2ac --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticFailure.html @@ -0,0 +1,6 @@ +OptimisticFailure | Libraries
interface OptimisticFailure {
    error: Error;
    id: string;
    init: RequestInit;
    timestamp: number;
    url: string;
}
Index

Properties

Properties

error: Error
id: string
init: RequestInit
timestamp: number
url: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateOptions.html new file mode 100644 index 00000000..19e8e7c8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateOptions.html @@ -0,0 +1,3 @@ +OptimisticUpdateOptions | Libraries
interface OptimisticUpdateOptions {
    skip?: (url: string, init: RequestInit) => boolean;
    store?: OptimisticUpdateStore;
}
Index

Properties

Properties

skip?: (url: string, init: RequestInit) => boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateStore.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateStore.html new file mode 100644 index 00000000..7622f66b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateStore.html @@ -0,0 +1,2 @@ +OptimisticUpdateStore | Libraries
interface OptimisticUpdateStore {
    failures: OptimisticFailure[];
}
Index

Properties

Properties

failures: OptimisticFailure[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.OptimisticMutationConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.OptimisticMutationConfig.html new file mode 100644 index 00000000..2b638eb8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.OptimisticMutationConfig.html @@ -0,0 +1,6 @@ +OptimisticMutationConfig | Libraries

Interface OptimisticMutationConfig<TData, TArgs>

interface OptimisticMutationConfig<TData, TArgs> {
    onError?: (error: WebError, args: TArgs) => void;
    onSettled?: (
        data: TData | undefined,
        error: WebError | null,
        args: TArgs,
    ) => void;
    onSuccess?: (data: TData, args: TArgs) => void;
    optimisticUpdate: (oldData: TData | undefined, args: TArgs) => TData;
    queryKey: readonly unknown[];
}

Type Parameters

  • TData
  • TArgs
Index

Properties

onError?: (error: WebError, args: TArgs) => void
onSettled?: (
    data: TData | undefined,
    error: WebError | null,
    args: TArgs,
) => void
onSuccess?: (data: TData, args: TArgs) => void
optimisticUpdate: (oldData: TData | undefined, args: TArgs) => TData
queryKey: readonly unknown[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.UseSubscriptionOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.UseSubscriptionOptions.html new file mode 100644 index 00000000..328c59d0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.UseSubscriptionOptions.html @@ -0,0 +1,6 @@ +UseSubscriptionOptions | Libraries

Interface UseSubscriptionOptions

Options for useSubscription.

+
interface UseSubscriptionOptions {
    enabled?: boolean;
    maxEvents?: number;
}
Index

Properties

Properties

enabled?: boolean

Whether the subscription should be active. Defaults to true.

+
maxEvents?: number

Maximum number of events to keep in the events array. Defaults to unlimited.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.UseSubscriptionState.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.UseSubscriptionState.html new file mode 100644 index 00000000..ea0f3943 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.react.UseSubscriptionState.html @@ -0,0 +1,14 @@ +UseSubscriptionState | Libraries

Interface UseSubscriptionState<TOutgoing, TIncoming>

The state returned by useSubscription.

+
interface UseSubscriptionState<TOutgoing, TIncoming> {
    close: () => void;
    error: Error | undefined;
    events: TOutgoing[];
    lastEvent: TOutgoing | undefined;
    send: (message: TIncoming) => void;
    state: "connecting" | "connected" | "reconnecting" | "closed";
}

Type Parameters

  • TOutgoing
  • TIncoming
Index

Properties

close: () => void

Close the subscription.

+
error: Error | undefined

The last error that occurred, if any.

+
events: TOutgoing[]

All events received so far (newest last).

+
lastEvent: TOutgoing | undefined

The most recently received event.

+
send: (message: TIncoming) => void

Send a message to the server (bidirectional subscriptions).

+
state: "connecting" | "connected" | "reconnecting" | "closed"

Current connection state.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.retry.RetryOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.retry.RetryOptions.html new file mode 100644 index 00000000..434e8111 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.retry.RetryOptions.html @@ -0,0 +1,30 @@ +RetryOptions | Libraries

Options for the retry middleware.

+
interface RetryOptions {
    backoffLimit?: number;
    delay?: (attemptCount: number) => number;
    jitter?: boolean | ((delay: number) => number);
    limit?: number;
    methods?: string[];
    retryOnTimeout?: boolean;
    shouldRetry?: (error: Error, retryCount: number) => boolean;
    statusCodes?: number[];
}
Index

Properties

backoffLimit?: number

Maximum delay in milliseconds between retries. +Defaults to Infinity.

+
delay?: (attemptCount: number) => number

Custom delay function. Receives the current attempt number (1-based) +and returns the delay in milliseconds.

+

Defaults to exponential backoff: 0.3 * 2^(attempt-1) * 1000.

+
jitter?: boolean | ((delay: number) => number)

Adds randomized jitter to the delay to avoid thundering-herd problems.

+
    +
  • true — applies full jitter (delay * random(0, 1)).
  • +
  • A function — custom jitter: (delay) => adjustedDelay.
  • +
+

Defaults to false (no jitter).

+
limit?: number

Maximum number of retry attempts. Defaults to 2.

+
methods?: string[]

HTTP methods that are eligible for retry. +Defaults to ['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS'].

+
retryOnTimeout?: boolean

Whether to retry on timeout errors. +Defaults to false.

+
shouldRetry?: (error: Error, retryCount: number) => boolean

Custom predicate to decide whether to retry a given error. +When provided, it is checked in addition to the statusCodes check.

+
statusCodes?: number[]

HTTP status codes that trigger a retry. +Defaults to [408, 429, 500, 502, 503, 504].

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.timeout.TimeoutOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.timeout.TimeoutOptions.html new file mode 100644 index 00000000..3614e71b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_client.timeout.TimeoutOptions.html @@ -0,0 +1,5 @@ +TimeoutOptions | Libraries

Options for the timeout middleware.

+
interface TimeoutOptions {
    timeout?: number;
}
Index

Properties

Properties

timeout?: number

Per-request timeout in milliseconds. +Defaults to 10000 (10 seconds).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.IServiceProvider.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.IServiceProvider.html new file mode 100644 index 00000000..cc9778f7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.IServiceProvider.html @@ -0,0 +1,11 @@ +IServiceProvider | Libraries

Interface IServiceProvider

Minimal interface for the service provider, used to avoid circular +dependencies between modules.

+
interface IServiceProvider {
    get<TSchema extends SchemaBuilder<any, any, any, any, any>>(
        schema: TSchema,
    ): InferType<TSchema>;
    getOptional<TSchema extends SchemaBuilder<any, any, any, any, any>>(
        schema: TSchema,
    ): InferType<TSchema> | undefined;
}

Implemented by

Index

Methods

Methods

  • Resolves a service by its schema key.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema>

    If the service is not registered.

    +
  • Resolves a service by its schema key, or returns undefined if not registered.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema> | undefined

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceDescriptor.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceDescriptor.html new file mode 100644 index 00000000..22852855 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceDescriptor.html @@ -0,0 +1,18 @@ +ServiceDescriptor | Libraries

Interface ServiceDescriptor<T>

Describes a registered service: its schema key, lifetime, factory, and +optional runtime validation flag.

+
interface ServiceDescriptor<T = any> {
    factory: ServiceFactory<T>;
    lifetime: ServiceLifetime;
    schema: SchemaBuilder<T, any, any, any, any>;
    validate: boolean;
}

Type Parameters

  • T = any

    The type of the service instance.

    +
Index

Properties

factory: ServiceFactory<T>

The factory function that creates the service instance.

+
lifetime: ServiceLifetime

The lifetime of the service.

+
schema: SchemaBuilder<T, any, any, any, any>

The schema used as the service identifier (reference equality).

+
validate: boolean

When true, the container validates the factory's return value against +the schema at resolution time using schema.validate().

+

false

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceProviderOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceProviderOptions.html new file mode 100644 index 00000000..0ff92b2d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceProviderOptions.html @@ -0,0 +1,9 @@ +ServiceProviderOptions | Libraries

Interface ServiceProviderOptions

Options for building a ServiceProvider from a ServiceCollection.

+
interface ServiceProviderOptions {
    validateScopes?: boolean;
}
Index

Properties

Properties

validateScopes?: boolean

When true, resolving a Scoped service +from the root provider (outside of a scope) throws an error. This helps +catch accidental singleton captures of scoped services.

+

Recommended for development. Matches .NET's ValidateScopes behaviour.

+

true

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceRegistrationOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceRegistrationOptions.html new file mode 100644 index 00000000..033986d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_di.ServiceRegistrationOptions.html @@ -0,0 +1,12 @@ +ServiceRegistrationOptions | Libraries

Interface ServiceRegistrationOptions

Options for service registration.

+
interface ServiceRegistrationOptions {
    validate?: boolean;
}
Index

Properties

Properties

validate?: boolean

When true, the resolved value is validated against the schema at +resolution time. Useful for development/debugging. Has a performance +cost proportional to the schema complexity.

+

false

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_env.InvalidEnvVar.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_env.InvalidEnvVar.html new file mode 100644 index 00000000..e12f4ee3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_env.InvalidEnvVar.html @@ -0,0 +1,10 @@ +InvalidEnvVar | Libraries

Interface InvalidEnvVar

Describes a single invalid environment variable.

+
interface InvalidEnvVar {
    configPath: string;
    errors: string[];
    value: string;
    varName: string;
}
Index

Properties

configPath: string

Dot-separated config path (e.g. 'db.port').

+
errors: string[]

Validation error messages.

+
value: string

The raw string value that failed validation.

+
varName: string

The environment variable name (e.g. 'DB_PORT').

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_env.MissingEnvVar.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_env.MissingEnvVar.html new file mode 100644 index 00000000..fef0a32a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_env.MissingEnvVar.html @@ -0,0 +1,8 @@ +MissingEnvVar | Libraries

Interface MissingEnvVar

Describes a single missing environment variable.

+
interface MissingEnvVar {
    configPath: string;
    type: string;
    varName: string;
}
Index

Properties

Properties

configPath: string

Dot-separated config path (e.g. 'db.host').

+
type: string

Schema type identifier (e.g. 'string', 'number').

+
varName: string

The environment variable name (e.g. 'DB_HOST').

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-clickhouse.ClickHouseClient.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-clickhouse.ClickHouseClient.html new file mode 100644 index 00000000..26971644 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-clickhouse.ClickHouseClient.html @@ -0,0 +1,40 @@ +ClickHouseClient | Libraries
interface ClickHouseClient {
    "[asyncDispose]"(): Promise<void>;
    close(): Promise<void>;
    command(params: ExecParams): Promise<CommandResult>;
    exec(
        params: ExecParams | ExecParamsWithValues<Readable>,
    ): Promise<ExecResult<Readable>>;
    insert<T>(params: InsertParams<Readable, T>): Promise<InsertResult>;
    ping(params?: PingParams): Promise<ConnPingResult>;
    query<Format extends DataFormat = "JSON">(
        params: QueryParamsWithFormat<Format>,
    ): Promise<QueryResult<Format>>;
}

Hierarchy

  • ClickHouseClient<Stream.Readable>
    • ClickHouseClient
Index

Methods

  • Shuts down the underlying connection. +This method should ideally be called only once per application lifecycle, +for example, during the graceful shutdown phase.

    +

    Returns Promise<void>

  • It should be used for statements that do not have any output, +when the format clause is not applicable, or when you are not interested in the response at all. +The response stream is destroyed immediately as we do not expect useful information there. +Examples of such statements are DDLs or custom inserts.

    +

    Parameters

    • params: ExecParams

    Returns Promise<CommandResult>

    if you have a custom query that does not work with ClickHouseClient.query, +and you are interested in the response data, consider using ClickHouseClient.exec.

    +
  • Similar to ClickHouseClient.command, but for the cases where the output is expected, +but format clause is not applicable. The caller of this method must consume the stream, +as the underlying socket will not be released until then, and the request will eventually be timed out.

    +

    Parameters

    • params: ExecParams | ExecParamsWithValues<Readable>

    Returns Promise<ExecResult<Readable>>

    it is not intended to use this method to execute the DDLs, such as CREATE TABLE or similar; +use ClickHouseClient.command instead.

    +
  • The primary method for data insertion. It is recommended to avoid arrays in case of large inserts +to reduce application memory consumption and consider streaming for most of such use cases. +As the insert operation does not provide any output, the response stream is immediately destroyed.

    +

    Type Parameters

    • T

    Parameters

    • params: InsertParams<Readable, T>

    Returns Promise<InsertResult>

    in case of a custom insert operation (e.g., INSERT FROM SELECT), +consider using ClickHouseClient.command, passing the entire raw query there +(including the FORMAT clause).

    +
  • A health-check request. It does not throw if an error occurs - the error is returned inside the result object.

    +

    By default, Node.js version uses the built-in /ping endpoint, which does not verify credentials. +Optionally, it can be switched to a SELECT query (see PingParamsWithSelectQuery). +In that case, the server will verify the credentials.

    +

    NOTE: Since the /ping endpoint does not support CORS, the Web version always uses a SELECT query.

    +

    Parameters

    • Optionalparams: PingParams

    Returns Promise<ConnPingResult>

  • Type Parameters

    • Format extends DataFormat = "JSON"

    Parameters

    • params: QueryParamsWithFormat<Format>

    Returns Promise<QueryResult<Format>>

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddColumnDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddColumnDiff.html new file mode 100644 index 00000000..48b677a3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddColumnDiff.html @@ -0,0 +1,9 @@ +AddColumnDiff | Libraries

A column to add in a migration.

+
interface AddColumnDiff {
    defaultValue?: any;
    name: string;
    nullable: boolean;
    onDelete?: string;
    onUpdate?: string;
    references?: { column: string; table: string };
    type: string;
}
Index

Properties

defaultValue?: any
name: string
nullable: boolean
onDelete?: string
onUpdate?: string
references?: { column: string; table: string }
type: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddForeignKeyDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddForeignKeyDiff.html new file mode 100644 index 00000000..0a7f2a01 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddForeignKeyDiff.html @@ -0,0 +1,7 @@ +AddForeignKeyDiff | Libraries

A foreign key to add in a migration.

+
interface AddForeignKeyDiff {
    column: string;
    foreignColumn: string;
    foreignTable: string;
    onDelete?: string;
    onUpdate?: string;
}
Index

Properties

column: string
foreignColumn: string
foreignTable: string
onDelete?: string
onUpdate?: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddIndexDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddIndexDiff.html new file mode 100644 index 00000000..49264c0f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AddIndexDiff.html @@ -0,0 +1,5 @@ +AddIndexDiff | Libraries

An index to add in a migration.

+
interface AddIndexDiff {
    columns: string[];
    name?: string;
    unique?: boolean;
}
Index

Properties

Properties

columns: string[]
name?: string
unique?: boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AlterColumnDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AlterColumnDiff.html new file mode 100644 index 00000000..82f34d9b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..AlterColumnDiff.html @@ -0,0 +1,4 @@ +AlterColumnDiff | Libraries

Changes to apply to an existing column.

+
interface AlterColumnDiff {
    changes: Record<string, { from: any; to: any }>;
    name: string;
}
Index

Properties

Properties

changes: Record<string, { from: any; to: any }>
name: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..BoundQuery.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..BoundQuery.html new file mode 100644 index 00000000..d0b57751 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..BoundQuery.html @@ -0,0 +1,3 @@ +BoundQuery | Libraries
interface BoundQuery {
    transaction<T>(callback: (db: BoundQuery) => Promise<T>): Promise<T>;
    withTransaction(trx: Transaction): BoundQuery;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
        baseQuery: QueryBuilder,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
}
Index

Methods

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..CursorPaginationResult.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..CursorPaginationResult.html new file mode 100644 index 00000000..9c1b84d7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..CursorPaginationResult.html @@ -0,0 +1,8 @@ +CursorPaginationResult | Libraries

Interface CursorPaginationResult<T>

Result of cursor-based pagination via SchemaQueryBuilder.paginateAfter.

+
interface CursorPaginationResult<T> {
    data: T[];
    hasMore: boolean;
    nextCursor: string | null;
}

Type Parameters

  • T
Index

Properties

Properties

data: T[]

The rows for the current page.

+
hasMore: boolean

Whether more rows exist after this page.

+
nextCursor: string | null

Cursor value for the next page, or null if no more rows.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseCheckInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseCheckInfo.html new file mode 100644 index 00000000..2808d9ae --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseCheckInfo.html @@ -0,0 +1,4 @@ +DatabaseCheckInfo | Libraries

Check constraint information read from the database.

+
interface DatabaseCheckInfo {
    definition: string;
    name: string;
}
Index

Properties

Properties

definition: string
name: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseColumnInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseColumnInfo.html new file mode 100644 index 00000000..88f9080b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseColumnInfo.html @@ -0,0 +1,8 @@ +DatabaseColumnInfo | Libraries

Interface DatabaseColumnInfo

Column information read from the database.

+
interface DatabaseColumnInfo {
    defaultValue: string | null;
    maxLength: number | null;
    name: string;
    nullable: boolean;
    numericPrecision: number | null;
    type: string;
}
Index

Properties

defaultValue: string | null
maxLength: number | null
name: string
nullable: boolean
numericPrecision: number | null
type: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseForeignKeyInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseForeignKeyInfo.html new file mode 100644 index 00000000..11553a4b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseForeignKeyInfo.html @@ -0,0 +1,8 @@ +DatabaseForeignKeyInfo | Libraries

Interface DatabaseForeignKeyInfo

Foreign key information read from the database.

+
interface DatabaseForeignKeyInfo {
    columnName: string;
    constraintName: string;
    deleteRule: string;
    foreignColumn: string;
    foreignTable: string;
    updateRule: string;
}
Index

Properties

columnName: string
constraintName: string
deleteRule: string
foreignColumn: string
foreignTable: string
updateRule: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseIndexInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseIndexInfo.html new file mode 100644 index 00000000..72f3c92c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseIndexInfo.html @@ -0,0 +1,6 @@ +DatabaseIndexInfo | Libraries

Index information read from the database.

+
interface DatabaseIndexInfo {
    columns: string[];
    definition: string;
    name: string;
    unique: boolean;
}
Index

Properties

Properties

columns: string[]
definition: string
name: string
unique: boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseTableState.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseTableState.html new file mode 100644 index 00000000..dd71fecb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..DatabaseTableState.html @@ -0,0 +1,6 @@ +DatabaseTableState | Libraries

Interface DatabaseTableState

Full database table state from introspection.

+
interface DatabaseTableState {
    checks: DatabaseCheckInfo[];
    columns: Record<string, DatabaseColumnInfo>;
    foreignKeys: DatabaseForeignKeyInfo[];
    indexes: DatabaseIndexInfo[];
}
Index

Properties

columns: Record<string, DatabaseColumnInfo>
foreignKeys: DatabaseForeignKeyInfo[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..JoinManySpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..JoinManySpec.html new file mode 100644 index 00000000..e418bd77 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..JoinManySpec.html @@ -0,0 +1,19 @@ +JoinManySpec | Libraries

Interface JoinManySpec<TLocalSchema, TForeignSchema, TFieldName>

interface JoinManySpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    limit?: number;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    offset?: number;
    orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" };
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
Index

Properties

Name of the field that will hold the loaded array in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
limit?: number

Maximum number of related items to load per parent row

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
offset?: number

Number of related items to skip per parent row

+
orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" }

Column to order the related items by (required for deterministic limit/offset)

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..JoinOneSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..JoinOneSpec.html new file mode 100644 index 00000000..7790abd7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..JoinOneSpec.html @@ -0,0 +1,15 @@ +JoinOneSpec | Libraries

Interface JoinOneSpec<TLocalSchema, TForeignSchema, TFieldName, TRequired>

interface JoinOneSpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
    TRequired extends boolean = true,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    required?: TRequired;
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
  • TRequired extends boolean = true
Index

Properties

Name of the field that will hold the loaded object in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
required?: TRequired

If true (default), uses INNER JOIN; if false, uses LEFT JOIN (result may be null)

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..MigrationDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..MigrationDiff.html new file mode 100644 index 00000000..e074a7f5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..MigrationDiff.html @@ -0,0 +1,9 @@ +MigrationDiff | Libraries

Schema diff result between the code-first model and the live database.

+
interface MigrationDiff {
    addColumns: AddColumnDiff[];
    addForeignKeys: AddForeignKeyDiff[];
    addIndexes: AddIndexDiff[];
    alterColumns: AlterColumnDiff[];
    dropColumns: string[];
    dropForeignKeys: string[];
    dropIndexes: string[];
}
Index

Properties

addColumns: AddColumnDiff[]
addForeignKeys: AddForeignKeyDiff[]
addIndexes: AddIndexDiff[]
alterColumns: AlterColumnDiff[]
dropColumns: string[]
dropForeignKeys: string[]
dropIndexes: string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..PaginationResult.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..PaginationResult.html new file mode 100644 index 00000000..285dca62 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..PaginationResult.html @@ -0,0 +1,16 @@ +PaginationResult | Libraries

Interface PaginationResult<T>

Result of offset-based pagination via SchemaQueryBuilder.paginate.

+
interface PaginationResult<T> {
    data: T[];
    hasNextPage: boolean;
    hasPreviousPage: boolean;
    page: number;
    pageSize: number;
    total: number;
    totalPages: number;
}

Type Parameters

  • T
Index

Properties

data: T[]

The rows for the current page.

+
hasNextPage: boolean

Whether a next page exists.

+
hasPreviousPage: boolean

Whether a previous page exists.

+
page: number

Current page number (1-based).

+
pageSize: number

Number of rows per page.

+
total: number

Total number of matching rows across all pages.

+
totalPages: number

Total number of pages.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..PrimaryKeyColumns.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..PrimaryKeyColumns.html new file mode 100644 index 00000000..766129e2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..PrimaryKeyColumns.html @@ -0,0 +1,9 @@ +PrimaryKeyColumns | Libraries

Result of getPrimaryKeyColumns.

+

propertyKeys are the schema property names (the keys you'd use in +.where(t => t.id, ...) style accessors); columnNames are the SQL +column names after applying any hasColumnName() overrides. Order is +preserved: composite-PK ordering matches the user's hasPrimaryKey() +declaration; single-PK arrays have length 1.

+
interface PrimaryKeyColumns {
    columnNames: readonly string[];
    propertyKeys: readonly string[];
}
Index

Properties

columnNames: readonly string[]
propertyKeys: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RelationInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RelationInfo.html new file mode 100644 index 00000000..486b7761 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RelationInfo.html @@ -0,0 +1,6 @@ +RelationInfo | Libraries

Interface RelationInfo<TKind, TForeign>

Phantom info for a single declared relation, stored on Entity's TRels +generic. TForeign is captured so .include() can type the customize +callback against the correct foreign schema.

+
interface RelationInfo<
    TKind extends "belongsTo"
    | "hasOne"
    | "hasMany"
    | "belongsToMany" = any,
    TForeign extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
    >,
> {
    foreign: TForeign;
    kind: TKind;
}

Type Parameters

  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany" = any
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<any, any, any, any, any, any, any>
Index

Properties

Properties

foreign: TForeign
kind: TKind
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RelationSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RelationSpec.html new file mode 100644 index 00000000..e488f250 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RelationSpec.html @@ -0,0 +1,7 @@ +RelationSpec | Libraries

Interface RelationSpecInternal

Relation metadata stored via .hasMany(), .belongsTo(), etc.

+
interface RelationSpec {
    foreignKey?: any;
    name: string;
    schema: any;
    through?: { foreignKey: string; localKey: string; table: string };
    type: "hasMany" | "hasOne" | "belongsTo" | "belongsToMany";
}
Index

Properties

foreignKey?: any
name: string
schema: any
through?: { foreignKey: string; localKey: string; table: string }
type: "hasMany" | "hasOne" | "belongsTo" | "belongsToMany"
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ResolvedVariantConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ResolvedVariantConfig.html new file mode 100644 index 00000000..1ba5e182 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ResolvedVariantConfig.html @@ -0,0 +1,8 @@ +ResolvedVariantConfig | Libraries

Interface ResolvedVariantConfigInternal

Full variant config stored in the schema extension 'variants'.

+
interface ResolvedVariantConfig {
    discriminatorColumn: string;
    discriminatorKey: string;
    variants: Record<string, ResolvedVariantSpec>;
}
Index

Properties

discriminatorColumn: string

SQL column name corresponding to discriminatorKey. Filled by query builder.

+
discriminatorKey: string

Property key on the base schema that is the discriminator.

+
variants: Record<string, ResolvedVariantSpec>

Map from discriminator value → resolved variant spec.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ResolvedVariantSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ResolvedVariantSpec.html new file mode 100644 index 00000000..aac0d0ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ResolvedVariantSpec.html @@ -0,0 +1,12 @@ +ResolvedVariantSpec | Libraries

Interface ResolvedVariantSpecInternal

Resolved, normalised variant spec stored in schema extensions.

+
interface ResolvedVariantSpec {
    allowOrphan: boolean;
    enforceCheck: boolean;
    foreignKey?: string;
    relations: ResolvedVariantRelationSpec[];
    schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    storage: VariantStorageType;
    tableName?: string;
}
Index

Properties

allowOrphan: boolean
enforceCheck: boolean
foreignKey?: string

CTI: FK column name on the variant table.

+
relations: ResolvedVariantRelationSpec[]

Variant-scoped relations (resolved), populated by .withVariants().

+
schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
tableName?: string

CTI: variant table name (from schema.hasTableName()).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RowVersionColumn.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RowVersionColumn.html new file mode 100644 index 00000000..dcadec3d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..RowVersionColumn.html @@ -0,0 +1,9 @@ +RowVersionColumn | Libraries

Resolved row-version column for a schema, returned by +getRowVersionColumn.

+
interface RowVersionColumn {
    columnName: string;
    propertyKey: string;
    strategy: RowVersionStrategy;
}
Index

Properties

columnName: string

SQL column name (after any hasColumnName() override).

+
propertyKey: string

Schema property name.

+

Concurrency-token update strategy.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..SchemaSnapshot.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..SchemaSnapshot.html new file mode 100644 index 00000000..cc55eee9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..SchemaSnapshot.html @@ -0,0 +1,11 @@ +SchemaSnapshot | Libraries

Serialized snapshot of all entity schemas at a given point in time.

+

Stored in <migrations.directory>/snapshot.json and committed to version +control. migrate generate diffs the current code against this snapshot +(instead of a live database) to produce migration files, so no DB +connection is required.

+

Each entry in tables mirrors the shape that introspectDatabase would +return — allowing diffSchema to be reused unchanged.

+
interface SchemaSnapshot {
    tables: Record<string, DatabaseTableState>;
    version: 1;
}
Index

Properties

Properties

tables: Record<string, DatabaseTableState>

Map of table name → database state derived from entity schemas.

+
version: 1
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ValidatedJoinManySpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ValidatedJoinManySpec.html new file mode 100644 index 00000000..c0b52fa4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ValidatedJoinManySpec.html @@ -0,0 +1,9 @@ +ValidatedJoinManySpec | Libraries

Interface ValidatedJoinManySpec

interface ValidatedJoinManySpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    limit: number | null;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    offset: number | null;
    orderBy: { column: string; direction: "asc" | "desc" } | null;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
limit: number | null
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
offset: number | null
orderBy: { column: string; direction: "asc" | "desc" } | null
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ValidatedJoinOneSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ValidatedJoinOneSpec.html new file mode 100644 index 00000000..e3888cdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema..ValidatedJoinOneSpec.html @@ -0,0 +1,7 @@ +ValidatedJoinOneSpec | Libraries

Interface ValidatedJoinOneSpec

interface ValidatedJoinOneSpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    required: boolean;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
required: boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema.extension.VariantInputForResolver.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema.extension.VariantInputForResolver.html new file mode 100644 index 00000000..ac574923 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_knex-schema.extension.VariantInputForResolver.html @@ -0,0 +1,14 @@ +VariantInputForResolver | Libraries

Interface VariantInputForResolverInternal

Input to applyVariantsToSchema: a single resolved variant +entry, as produced by Entity.ctiVariant() / Entity.stiVariant().

+
interface VariantInputForResolver {
    allowOrphan?: boolean;
    enforceCheck?: boolean;
    foreignKeyColumn?: string;
    relations?: ResolvedVariantRelationSpec[];
    schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    storage: VariantStorageType;
}
Index

Properties

allowOrphan?: boolean
enforceCheck?: boolean
foreignKeyColumn?: string

CTI-only: FK column name on the variant table that joins back to base PK.

+
relations?: ResolvedVariantRelationSpec[]

Variant-scoped relations (already resolved to FK column names). When +the variant entry is sourced from another Entity, these are read +from that entity's 'relations' extension and passed in here.

+
schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

Variant body schema (CTI table or STI extras).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..BatchingSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..BatchingSinkOptions.html new file mode 100644 index 00000000..bed8810a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..BatchingSinkOptions.html @@ -0,0 +1,34 @@ +BatchingSinkOptions | Libraries

Interface BatchingSinkOptions

Configuration for the batching sink wrapper.

+
interface BatchingSinkOptions {
    batchSize?: number;
    circuitBreakerThreshold?: number;
    emit: (batch: LogEvent[]) => Promise<void>;
    flushInterval?: number;
    maxQueueSize?: number;
    maxRetries?: number;
    retryDelay?: number;
}
Index

Properties

batchSize?: number

Flush after this many events.

+
100
+
+ +
circuitBreakerThreshold?: number

Consecutive failures before circuit breaker opens.

+
3
+
+ +
emit: (batch: LogEvent[]) => Promise<void>

The emit function that writes a batch to the target.

+
flushInterval?: number

Flush after this many milliseconds of inactivity.

+
2000
+
+ +
maxQueueSize?: number

Maximum buffered events before dropping.

+
50000
+
+ +
maxRetries?: number

Maximum retry attempts for failed flushes.

+
5
+
+ +
retryDelay?: number

Initial retry delay in ms (exponential backoff).

+
1000
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..ConsoleSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..ConsoleSinkOptions.html new file mode 100644 index 00000000..dc5d3944 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..ConsoleSinkOptions.html @@ -0,0 +1,17 @@ +ConsoleSinkOptions | Libraries

Interface ConsoleSinkOptions

Console sink configuration.

+
interface ConsoleSinkOptions {
    minimumLevel?: LogLevelName;
    mode?: "pretty" | "json";
    theme?: "dark" | "light" | "none";
}
Index

Properties

Properties

minimumLevel?: LogLevelName

Minimum level for this sink.

+
undefined (uses pipeline level)
+
+ +
mode?: "pretty" | "json"

Output mode: 'pretty' for colored human-readable, 'json' for CLEF.

+
'pretty'
+
+ +
theme?: "dark" | "light" | "none"

Color theme for pretty mode.

+
'dark'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..CorrelationIdMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..CorrelationIdMiddlewareOptions.html new file mode 100644 index 00000000..b7975c25 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..CorrelationIdMiddlewareOptions.html @@ -0,0 +1,17 @@ +CorrelationIdMiddlewareOptions | Libraries

Interface CorrelationIdMiddlewareOptions

Correlation ID middleware configuration.

+
interface CorrelationIdMiddlewareOptions {
    generate?: () => string;
    requestHeaders?: string[];
    responseHeader?: string | false;
}
Index

Properties

generate?: () => string

Custom ID generator.

+
generateCorrelationId
+
+ +
requestHeaders?: string[]

Headers to read from incoming request (checked in order).

+
['X-Correlation-Id', 'X-Request-Id']
+
+ +
responseHeader?: string | false

Header to set on the response. Set to false to skip setting a response header entirely.

+
'X-Correlation-Id'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..CreateSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..CreateSinkOptions.html new file mode 100644 index 00000000..3282c29c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..CreateSinkOptions.html @@ -0,0 +1,10 @@ +CreateSinkOptions | Libraries

Interface CreateSinkOptions

Configuration for a quick custom sink.

+
interface CreateSinkOptions {
    dispose?: () => Promise<void>;
    emit: (events: LogEvent[]) => Promise<void>;
    flush?: () => Promise<void>;
    minimumLevel?: LogLevelName;
}
Index

Properties

dispose?: () => Promise<void>

Optional dispose function.

+
emit: (events: LogEvent[]) => Promise<void>

The emit function that writes events.

+
flush?: () => Promise<void>

Optional flush function.

+
minimumLevel?: LogLevelName

Minimum level for this sink.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..FileSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..FileSinkOptions.html new file mode 100644 index 00000000..ca556c15 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..FileSinkOptions.html @@ -0,0 +1,8 @@ +FileSinkOptions | Libraries

Interface FileSinkOptions

File sink configuration.

+
interface FileSinkOptions {
    minimumLevel?: LogLevelName;
    path: string;
    rotation?: RotationOptions;
}
Index

Properties

minimumLevel?: LogLevelName

Minimum level for this sink.

+
path: string

Path to the log file.

+
rotation?: RotationOptions

Rotation configuration.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogContextStore.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogContextStore.html new file mode 100644 index 00000000..08b3e24e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogContextStore.html @@ -0,0 +1,5 @@ +LogContextStore | Libraries

Interface LogContextStore

Store shape for the ambient log context.

+
interface LogContextStore {
    correlationId?: string;
    logger: Logger;
    properties?: Record<string, unknown>;
}
Index

Properties

correlationId?: string
logger: Logger
properties?: Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogEvent.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogEvent.html new file mode 100644 index 00000000..502d50d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogEvent.html @@ -0,0 +1,19 @@ +LogEvent | Libraries

Interface LogEvent

Represents a single structured log event in the pipeline.

+

Log events carry both a human-readable rendered message and the original +message template with structured property values, enabling both +human-friendly display and machine-queryable structured search.

+
interface LogEvent {
    eventId?: string;
    exception?: Error;
    level: LogLevel;
    messageTemplate: string;
    properties: Record<string, unknown>;
    renderedMessage: string;
    timestamp: Date;
}
Index

Properties

eventId?: string

Deterministic hex hash of messageTemplate — maps to CLEF @i.

+
exception?: Error

The exception associated with this event, if any.

+
level: LogLevel

Severity level of the event.

+
messageTemplate: string

The raw message template with {Property} holes.

+
properties: Record<string, unknown>

Structured properties extracted from the template and enrichers.

+
renderedMessage: string

The fully interpolated, human-readable message.

+
timestamp: Date

ISO timestamp when the event occurred.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogSink.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogSink.html new file mode 100644 index 00000000..8b5d5e54 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LogSink.html @@ -0,0 +1,10 @@ +LogSink | Libraries

Interface LogSink

A sink that receives batches of log events for output.

+

Sinks must implement AsyncDisposable for graceful shutdown. +The flush() method is optional and forces immediate delivery +of any buffered events.

+
interface LogSink {
    "[asyncDispose]"(): PromiseLike<void>;
    emit(events: LogEvent[]): Promise<void>;
    flush?(): Promise<void>;
}

Hierarchy

  • AsyncDisposable
    • LogSink

Implemented by

Index

Methods

  • Returns PromiseLike<void>

  • Force immediate delivery of buffered events.

    +

    Returns Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LoggerConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LoggerConfig.html new file mode 100644 index 00000000..f1a9636c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..LoggerConfig.html @@ -0,0 +1,30 @@ +LoggerConfig | Libraries

Interface LoggerConfig

Configuration for creating a structured logger.

+
interface LoggerConfig {
    dropPolicy?: "dropOldest" | "dropNewest" | "block";
    enrichers?: Enricher[];
    filters?: LogFilter[];
    handleProcessExit?: boolean;
    levelOverrides?: Record<string, LogLevelName>;
    maxQueueSize?: number;
    minimumLevel?: LogLevel | LogLevelName;
    sinks: LogSink[];
}
Index

Properties

dropPolicy?: "dropOldest" | "dropNewest" | "block"

Policy when queue is full.

+
'dropOldest'
+
+ +
enrichers?: Enricher[]

Enrichers that add properties to every event.

+
filters?: LogFilter[]

Filters that determine which events pass through.

+
handleProcessExit?: boolean

Whether to hook SIGTERM and beforeExit for flush.

+
false
+
+ +
levelOverrides?: Record<string, LogLevelName>

Namespace-level overrides for minimum log level.

+
maxQueueSize?: number

Maximum queued events before dropping.

+
10000
+
+ +
minimumLevel?: LogLevel | LogLevelName

Minimum log level (name or numeric).

+
'information'
+
+ +
sinks: LogSink[]

Output sinks for log events.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..RequestLoggingOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..RequestLoggingOptions.html new file mode 100644 index 00000000..5e8fc71e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..RequestLoggingOptions.html @@ -0,0 +1,23 @@ +RequestLoggingOptions | Libraries

Interface RequestLoggingOptions

Request logging middleware configuration.

+
interface RequestLoggingOptions {
    enrichRequest?: (ctx: any) => Record<string, unknown>;
    excludePaths?: (string | { path: string })[];
    getLevel?: (statusCode: number, elapsedMs: number) => LogLevelName;
    logRequestBody?: boolean;
    logRequestStart?: boolean;
    logResponseBody?: boolean;
}
Index

Properties

enrichRequest?: (ctx: any) => Record<string, unknown>

Extract custom properties from the request context.

+
excludePaths?: (string | { path: string })[]

Paths to exclude from request logging. Accepts plain strings or objects with a path property (e.g. endpoint builders).

+
getLevel?: (statusCode: number, elapsedMs: number) => LogLevelName

Customize log level based on status code and elapsed time.

+
logRequestBody?: boolean

Whether to log request bodies.

+
false
+
+ +
logRequestStart?: boolean

Whether to log when request starts (in addition to completion).

+
false
+
+ +
logResponseBody?: boolean

Whether to log response bodies.

+
false
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..RotationOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..RotationOptions.html new file mode 100644 index 00000000..a8d7de7f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..RotationOptions.html @@ -0,0 +1,13 @@ +RotationOptions | Libraries

Interface RotationOptions

File rotation configuration.

+
interface RotationOptions {
    interval?: "hourly" | "daily";
    maxBytes?: number;
    retainCount?: number;
    strategy: "size" | "time" | "hybrid";
}
Index

Properties

interval?: "hourly" | "daily"

Time-based rotation interval (for 'time' and 'hybrid').

+
maxBytes?: number

Maximum file size in bytes before rotation (for 'size' and 'hybrid').

+
retainCount?: number

Number of rotated files to retain.

+
10
+
+ +
strategy: "size" | "time" | "hybrid"

Rotation strategy.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..SeqSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..SeqSinkOptions.html new file mode 100644 index 00000000..804f1665 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..SeqSinkOptions.html @@ -0,0 +1,26 @@ +SeqSinkOptions | Libraries

Interface SeqSinkOptions

Seq sink configuration.

+
interface SeqSinkOptions {
    apiKey?: string;
    batchSize?: number;
    flushInterval?: number;
    maxRetries?: number;
    retryDelay?: number;
    serverUrl: string;
}
Index

Properties

apiKey?: string

Optional API key sent as X-Seq-ApiKey header.

+
batchSize?: number

Events per batch.

+
100
+
+ +
flushInterval?: number

Max milliseconds between flushes.

+
2000
+
+ +
maxRetries?: number

Maximum retry attempts.

+
5
+
+ +
retryDelay?: number

Initial retry delay in ms.

+
1000
+
+ +
serverUrl: string

Base URL of the Seq server (e.g. http://localhost:5341).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..SerializationOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..SerializationOptions.html new file mode 100644 index 00000000..dd4a3ee9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..SerializationOptions.html @@ -0,0 +1,12 @@ +SerializationOptions | Libraries

Interface SerializationOptions

Options for the safe serializer.

+
interface SerializationOptions {
    maxDepth?: number;
    maxStringLength?: number;
}
Index

Properties

maxDepth?: number

Maximum nesting depth for objects/arrays.

+
10
+
+ +
maxStringLength?: number

Maximum length for string values before truncation.

+
32768
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..TypedTemplate.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..TypedTemplate.html new file mode 100644 index 00000000..117c5420 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log..TypedTemplate.html @@ -0,0 +1,12 @@ +TypedTemplate | Libraries

Interface TypedTemplate<T>

A typed message template created via ParseStringSchemaBuilder.

+

When passed to a Logger log method, the logger uses template as the +messageTemplate (so events with the same shape are grouped in Seq / +SigNoz / ClickHouse) and derives the rendered message by interpolating +template with the supplied parameters.

+
import { s } from '@cleverbrush/schema';

// Build a reusable typed template once
const tmpl = s.parseString('Todo #{TodoId} "{Title}" created by {UserId}');

// All log sites share the same messageTemplate → groupable in the UI
logger.info(tmpl, { TodoId: 1, Title: 'Buy milk', UserId: 'u-42' }); +
+ +
interface TypedTemplate<T extends Record<string, unknown>> {
    template?: string;
    serialize(params: T): string;
}

Type Parameters

  • T extends Record<string, unknown>
Index

Properties

Methods

Properties

template?: string

The raw {Property} pattern string, used as messageTemplate.

+

Methods

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.ClickHouseColumnMapping.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.ClickHouseColumnMapping.html new file mode 100644 index 00000000..754055fe --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.ClickHouseColumnMapping.html @@ -0,0 +1,12 @@ +ClickHouseColumnMapping | Libraries

Interface ClickHouseColumnMapping

Column mapping for the ClickHouse logs table.

+
interface ClickHouseColumnMapping {
    correlationId?: string;
    exception?: string;
    level?: string;
    messageTemplate?: string;
    properties?: string;
    renderedMessage?: string;
    sourceContext?: string;
    spanId?: string;
    timestamp?: string;
    traceId?: string;
}
Index

Properties

correlationId?: string
exception?: string
level?: string
messageTemplate?: string
properties?: string
renderedMessage?: string
sourceContext?: string
spanId?: string
timestamp?: string
traceId?: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.ClickHouseSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.ClickHouseSinkOptions.html new file mode 100644 index 00000000..4f31c78a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.ClickHouseSinkOptions.html @@ -0,0 +1,18 @@ +ClickHouseSinkOptions | Libraries

ClickHouse sink configuration.

+
interface ClickHouseSinkOptions {
    batchSize?: number;
    columns?: ClickHouseColumnMapping;
    connection: any;
    flushInterval?: number;
    table: string;
}
Index

Properties

batchSize?: number

Events per batch.

+
1000
+
+ +

Custom column mapping.

+
connection: any

Knex-ClickHouse connection instance.

+
flushInterval?: number

Max milliseconds between flushes.

+
5000
+
+ +
table: string

Table name to insert into.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.CreateLogsTableOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.CreateLogsTableOptions.html new file mode 100644 index 00000000..0f06d89d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_log.clickhouse.CreateLogsTableOptions.html @@ -0,0 +1,19 @@ +CreateLogsTableOptions | Libraries

Interface CreateLogsTableOptions

Options for creating the ClickHouse logs table.

+
interface CreateLogsTableOptions {
    engine?: string;
    orderBy?: string[];
    partitionBy?: string;
    ttl?: string;
}
Index

Properties

engine?: string

Table engine.

+
'MergeTree'
+
+ +
orderBy?: string[]

ORDER BY columns.

+
['timestamp', 'level']
+
+ +
partitionBy?: string

Partition expression.

+
"toYYYYMM(timestamp)"
+
+ +
ttl?: string

TTL expression for automatic data expiration.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm-cli.MigrationsConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm-cli.MigrationsConfig.html new file mode 100644 index 00000000..088d48d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm-cli.MigrationsConfig.html @@ -0,0 +1,11 @@ +MigrationsConfig | Libraries

Interface MigrationsConfig

Migration-runner configuration block inside OrmCliConfig.

+
interface MigrationsConfig {
    directory: string;
    snapshot?: string;
    tableName?: string;
}
Index

Properties

directory: string

Directory where migration files are read from / written to.

+
snapshot?: string

Path to the schema snapshot file. Must be committed to version control +— it is the source of truth for migrate generate.

+

<directory>/snapshot.json

+
tableName?: string

Knex migration tracking table name.

+

'knex_migrations'

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm-cli.OrmCliConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm-cli.OrmCliConfig.html new file mode 100644 index 00000000..c50e55fa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm-cli.OrmCliConfig.html @@ -0,0 +1,12 @@ +OrmCliConfig | Libraries

Interface OrmCliConfig

Shape of the default export expected in db.config.ts.

+
// db.config.ts
import { defineConfig } from '@cleverbrush/orm-cli';
import knex from './src/db/knex.js';
import { UserEntity, TodoEntity } from './src/db/schemas.js';

export default defineConfig({
knex,
entities: { users: UserEntity, todos: TodoEntity },
migrations: { directory: './migrations' },
}); +
+ +
interface OrmCliConfig {
    entities: Record<string, Entity<any, any>>;
    knex: Knex;
    migrations: MigrationsConfig;
}
Index

Properties

Properties

entities: Record<string, Entity<any, any>>

Map of entity name to Entity definition. The same map you pass to +createDb() from @cleverbrush/orm.

+
knex: Knex

A live Knex instance connected to your database.

+
migrations: MigrationsConfig

Migration configuration.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddColumnDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddColumnDiff.html new file mode 100644 index 00000000..cd8fe8ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddColumnDiff.html @@ -0,0 +1,9 @@ +AddColumnDiff | Libraries

Interface AddColumnDiff

A column to add in a migration.

+
interface AddColumnDiff {
    defaultValue?: any;
    name: string;
    nullable: boolean;
    onDelete?: string;
    onUpdate?: string;
    references?: { column: string; table: string };
    type: string;
}
Index

Properties

defaultValue?: any
name: string
nullable: boolean
onDelete?: string
onUpdate?: string
references?: { column: string; table: string }
type: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddForeignKeyDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddForeignKeyDiff.html new file mode 100644 index 00000000..767223cf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddForeignKeyDiff.html @@ -0,0 +1,7 @@ +AddForeignKeyDiff | Libraries

Interface AddForeignKeyDiff

A foreign key to add in a migration.

+
interface AddForeignKeyDiff {
    column: string;
    foreignColumn: string;
    foreignTable: string;
    onDelete?: string;
    onUpdate?: string;
}
Index

Properties

column: string
foreignColumn: string
foreignTable: string
onDelete?: string
onUpdate?: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddIndexDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddIndexDiff.html new file mode 100644 index 00000000..611990e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AddIndexDiff.html @@ -0,0 +1,5 @@ +AddIndexDiff | Libraries

Interface AddIndexDiff

An index to add in a migration.

+
interface AddIndexDiff {
    columns: string[];
    name?: string;
    unique?: boolean;
}
Index

Properties

Properties

columns: string[]
name?: string
unique?: boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AlterColumnDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AlterColumnDiff.html new file mode 100644 index 00000000..69a8fa3a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.AlterColumnDiff.html @@ -0,0 +1,4 @@ +AlterColumnDiff | Libraries

Interface AlterColumnDiff

Changes to apply to an existing column.

+
interface AlterColumnDiff {
    changes: Record<string, { from: any; to: any }>;
    name: string;
}
Index

Properties

Properties

changes: Record<string, { from: any; to: any }>
name: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.BoundQuery.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.BoundQuery.html new file mode 100644 index 00000000..27362d8c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.BoundQuery.html @@ -0,0 +1,3 @@ +BoundQuery | Libraries

Interface BoundQuery

interface BoundQuery {
    transaction<T>(callback: (db: BoundQuery) => Promise<T>): Promise<T>;
    withTransaction(trx: Transaction): BoundQuery;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
        baseQuery: QueryBuilder,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
}
Index

Methods

  • Type Parameters

    • T

    Parameters

    Returns Promise<T>

  • Parameters

    • trx: Transaction

    Returns BoundQuery

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.CursorPaginationResult.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.CursorPaginationResult.html new file mode 100644 index 00000000..e589c63a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.CursorPaginationResult.html @@ -0,0 +1,8 @@ +CursorPaginationResult | Libraries

Interface CursorPaginationResult<T>

Result of cursor-based pagination via SchemaQueryBuilder.paginateAfter.

+
interface CursorPaginationResult<T> {
    data: T[];
    hasMore: boolean;
    nextCursor: string | null;
}

Type Parameters

  • T
Index

Properties

Properties

data: T[]

The rows for the current page.

+
hasMore: boolean

Whether more rows exist after this page.

+
nextCursor: string | null

Cursor value for the next page, or null if no more rows.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseCheckInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseCheckInfo.html new file mode 100644 index 00000000..dba0ec1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseCheckInfo.html @@ -0,0 +1,4 @@ +DatabaseCheckInfo | Libraries

Interface DatabaseCheckInfo

Check constraint information read from the database.

+
interface DatabaseCheckInfo {
    definition: string;
    name: string;
}
Index

Properties

Properties

definition: string
name: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseColumnInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseColumnInfo.html new file mode 100644 index 00000000..7c231bbb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseColumnInfo.html @@ -0,0 +1,8 @@ +DatabaseColumnInfo | Libraries

Interface DatabaseColumnInfo

Column information read from the database.

+
interface DatabaseColumnInfo {
    defaultValue: string | null;
    maxLength: number | null;
    name: string;
    nullable: boolean;
    numericPrecision: number | null;
    type: string;
}
Index

Properties

defaultValue: string | null
maxLength: number | null
name: string
nullable: boolean
numericPrecision: number | null
type: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseForeignKeyInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseForeignKeyInfo.html new file mode 100644 index 00000000..182b8a51 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseForeignKeyInfo.html @@ -0,0 +1,8 @@ +DatabaseForeignKeyInfo | Libraries

Interface DatabaseForeignKeyInfo

Foreign key information read from the database.

+
interface DatabaseForeignKeyInfo {
    columnName: string;
    constraintName: string;
    deleteRule: string;
    foreignColumn: string;
    foreignTable: string;
    updateRule: string;
}
Index

Properties

columnName: string
constraintName: string
deleteRule: string
foreignColumn: string
foreignTable: string
updateRule: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseIndexInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseIndexInfo.html new file mode 100644 index 00000000..d8007b33 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseIndexInfo.html @@ -0,0 +1,6 @@ +DatabaseIndexInfo | Libraries

Interface DatabaseIndexInfo

Index information read from the database.

+
interface DatabaseIndexInfo {
    columns: string[];
    definition: string;
    name: string;
    unique: boolean;
}
Index

Properties

Properties

columns: string[]
definition: string
name: string
unique: boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseTableState.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseTableState.html new file mode 100644 index 00000000..eb3486b4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DatabaseTableState.html @@ -0,0 +1,6 @@ +DatabaseTableState | Libraries

Interface DatabaseTableState

Full database table state from introspection.

+
interface DatabaseTableState {
    checks: DatabaseCheckInfo[];
    columns: Record<string, DatabaseColumnInfo>;
    foreignKeys: DatabaseForeignKeyInfo[];
    indexes: DatabaseIndexInfo[];
}
Index

Properties

columns: Record<string, DatabaseColumnInfo>
foreignKeys: DatabaseForeignKeyInfo[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DbSet.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DbSet.html new file mode 100644 index 00000000..7aa3f145 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.DbSet.html @@ -0,0 +1,139 @@ +DbSet | Libraries

Interface DbSet<TEntity>

Typed query starter for a registered entity. Structurally it behaves like +a fresh EntityQuery — every method invocation allocates a new +underlying SchemaQueryBuilder so chains stay isolated.

+

Additional members beyond EntityQuery:

+
    +
  • entity — the wrapped Entity definition.
  • +
  • query() — explicit factory for a fresh EntityQuery (rarely needed).
  • +
  • withTransaction(trx) — return a new DbSet bound to a transaction.
  • +
+
interface DbSet<TEntity extends Entity<any, any, any>> {
    entity: TEntity;
    andWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    andWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    andWhere(record: Record<string, any>): this;
    andWhere(callback: (builder: QueryBuilder) => void): this;
    andWhere(raw: Raw): this;
    apply(fn: (builder: QueryBuilder) => void): this;
    avg(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    bulkInsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts?: {
            chunkSize?: number;
            conflictColumns?: ColumnRef<EntitySchema<TEntity>>[];
            onConflict?: "ignore" | "merge";
        },
    ): Promise<EntityResult<TEntity>[]>;
    bulkUpdate(
        updates: readonly {
            set: Partial<InferType<TLocalSchema>>;
            where: Partial<InferType<TLocalSchema>>;
        }[],
    ): Promise<number>;
    bulkUpsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts: {
            chunkSize?: number;
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<EntityResult<TEntity>[]>;
    count(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    countDistinct(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    delete(): Promise<number>;
    distinct(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    execute(): Promise<EntityResult<TEntity>[]>;
    find(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<EntityResult<TEntity> | undefined>;
    findMany(
        pks: readonly PrimaryKeyValueOf<EntitySchema<TEntity>>[],
    ): Promise<EntityResult<TEntity>[]>;
    findOrFail(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<EntityResult<TEntity>>;
    first(): Promise<EntityResult<TEntity> | undefined>;
    groupBy(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    groupByRaw(sql: string, ...bindings: any[]): this;
    hardDelete(): Promise<number>;
    having(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    havingRaw(sql: string, ...bindings: any[]): this;
    include<K extends string>(
        sel: (t: RelKeyTree<TEntity>) => K,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<TEntity, WithIncluded<TEntity, EntityResult<TEntity>, K>>;
    includeVariant<TVariant extends string, TRel extends string>(
        variantKey: TVariant,
        relationName: TRel,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<
        TEntity,
        TRel extends keyof EntityRelations<TEntity> & string
            ? WithVariantIncluded<TEntity, EntityResult<TEntity>, TVariant, TRel>
            : EntityResult<TEntity>,
    >;
    insert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
    ): Promise<EntityResult<TEntity>>;
    insertMany(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
    ): Promise<EntityResult<TEntity>[]>;
    joinMany<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
    >(
        spec: JoinManySpec<EntitySchema<TEntity>, TForeignSchema, TFieldName>,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedMany<EntityResult<TEntity>, TFieldName, TForeignSchema>,
    >;
    joinOne<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
        TRequired extends boolean = true,
    >(
        spec: JoinOneSpec<
            EntitySchema<TEntity>,
            TForeignSchema,
            TFieldName,
            TRequired,
        >,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedOne<
            EntityResult<TEntity>,
            TFieldName,
            TForeignSchema,
            TRequired,
        >,
    >;
    limit(n: number): this;
    max(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    min(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    offset(n: number): this;
    ofVariant<K extends string>(variantKey: K): VariantDbSet<TEntity, K>;
    onConflict(
        ...conflictColumns: ColumnRef<EntitySchema<TEntity>>[],
    ): OnConflictBuilder<EntitySchema<TEntity>, EntityResult<TEntity>>;
    onlyDeleted(): this;
    orderBy(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        direction?: "asc" | "desc",
    ): this;
    orderByRaw(sql: string, ...bindings: any[]): this;
    orWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    orWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    orWhere(record: Record<string, any>): this;
    orWhere(callback: (builder: QueryBuilder) => void): this;
    orWhere(raw: Raw): this;
    orWhereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    orWhereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    paginate(
        opts: { page: number; pageSize: number },
    ): Promise<PaginationResult<EntityResult<TEntity>>>;
    paginateAfter(
        opts: {
            column?: ColumnRef<EntitySchema<TEntity>>;
            cursor?: any;
            direction?: "asc" | "desc";
            limit: number;
        },
    ): Promise<CursorPaginationResult<EntityResult<TEntity>>>;
    pluck<K extends string>(
        column: ColumnRef<EntitySchema<TEntity>>,
    ): Promise<EntityResult<TEntity>[K][]>;
    projected<K extends string>(
        name: K,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        Pick<
            EntityResult<TEntity>,
            ProjectionKeysOf<EntitySchema<TEntity>, K> & keyof EntityResult<TEntity>,
        >,
    >;
    query(): EntityQuery<TEntity, EntityResult<TEntity>>;
    restore(): Promise<EntityResult<TEntity>[]>;
    save(graph: SaveGraph<TEntity>): Promise<EntityResult<TEntity>>;
    scoped<K extends never>(name: K): this;
    select(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    select<TSel extends SelectSelector<EntitySchema<TEntity>>>(
        selector: TSel,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        SelectProjection<ReturnType<TSel>>,
    >;
    selectRaw(sql: string, bindings?: any[]): this;
    selectVariants(keys: string[]): this;
    sum(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    then<TReturn1 = EntityResult<TEntity>[], TReturn2 = never>(
        onfulfilled?:
            | (
                (value: EntityResult<TEntity>[]) => TReturn1 | PromiseLike<TReturn1>
            )
            | null,
        onrejected?: ((reason: any) => TReturn2 | PromiseLike<TReturn2>) | null,
    ): Promise<TReturn1 | TReturn2>;
    toKnexQuery(): QueryBuilder;
    toQuery(): string;
    toString(): string;
    transacting(
        trx: Transaction,
    ): SchemaQueryBuilder<EntitySchema<TEntity>, EntityResult<TEntity>>;
    unscoped(): this;
    update(
        data: Partial<InferType<TLocalSchema>>,
    ): Promise<EntityResult<TEntity>[]>;
    upsert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
        opts: {
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
            updateColumns?: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<EntityResult<TEntity>>;
    where(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    where(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    where(raw: Raw, operator: string, value: any): this;
    where(callback: (builder: QueryBuilder) => void): this;
    where(record: Record<string, any>): this;
    where(raw: Raw): this;
    whereBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereILike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereJsonPath(
        column: ColumnRef<EntitySchema<TEntity>>,
        path: string,
        operator?: string,
        value?: any,
    ): this;
    whereLike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereNot(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    whereNot(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    whereNot(record: Record<string, any>): this;
    whereNot(callback: (builder: QueryBuilder) => void): this;
    whereNot(raw: Raw): this;
    whereNotBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereNotExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereRaw(sql: string, ...bindings: any[]): this;
    whereVariant(
        key: string,
        column: string,
        operator: string,
        value: any,
    ): this;
    withDeleted(): this;
    withTransaction(trx: Transaction): DbSet<TEntity>;
}

Type Parameters

  • TEntity extends Entity<any, any, any>

Hierarchy (View Summary)

Index

Properties

entity: TEntity

The wrapped entity definition.

+

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<number>

  • Returns Promise<number>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Return a typed variant view pre-filtered to variantKey.

    +

    Behaves like EF Core's Set<DerivedType>(): all reads automatically +filter by the discriminator value, and insert / update / delete +apply the correct single-table (STI) or two-table (CTI) logic.

    +
    const assigned = db.activities.ofVariant('assigned');

    // Insert a new variant row (discriminator set automatically):
    await assigned.insert({ todoId: 42, userId: 7, assigneeId: 9 });

    // Update variant-specific columns for matching rows:
    await assigned.where(t => t.id, activityId).update({ assigneeId: 10 });

    // Delete variant rows (CTI: variant table first, then base):
    await assigned.where(t => t.id, activityId).delete();

    // Find by PK (result is narrowed to the variant branch):
    const a = await assigned.find(activityId);
    // a.type === 'assigned' and a.assigneeId is available +
    + +

    Type Parameters

    • K extends string

    Parameters

    • variantKey: K

    Returns VariantDbSet<TEntity, K>

  • Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Persist a nested write graph (root + related entities) in a single +transaction. Each node is INSERTed when its primary-key fields are +absent and UPDATEd when they are present (composite-PK aware).

    +

    Topology:

    +
      +
    • belongsTo parents are saved first; their PKs feed the root's FK.
    • +
    • The root row is then written.
    • +
    • hasOne / hasMany / belongsToMany children inherit the root's +PK into their FK column.
    • +
    • belongsToMany children may be passed as full nested graphs (new +rows) or as { pk: value } references (link existing rows).
    • +
    +

    If called inside an existing transaction (via withTransaction), the +outer transaction is reused; otherwise a fresh one is opened and +automatically rolled back on failure.

    +

    Parameters

    Returns Promise<EntityResult<TEntity>>

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • raw: Raw
    • operator: string
    • value: any

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.EntityEntry.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.EntityEntry.html new file mode 100644 index 00000000..cabe017d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.EntityEntry.html @@ -0,0 +1,15 @@ +EntityEntry | Libraries

Interface EntityEntry<T>

Public view of a tracked entry, exposed via db.entry(entity).

+
interface EntityEntry<T extends object> {
    currentValues: T;
    originalValues: Readonly<T>;
    state: EntryState;
    isModified(field?: keyof T): boolean;
    reset(): void;
}

Type Parameters

  • T extends object
Index

Properties

currentValues: T

Live object (same reference as the tracked entity).

+
originalValues: Readonly<T>

Snapshot of the values at the time the entity was last loaded/saved.

+
state: EntryState

Current state of the entry.

+

Methods

  • Returns true when a specific field has changed since the last +snapshot, or true when any field has changed when called without +arguments.

    +

    Parameters

    • Optionalfield: keyof T

    Returns boolean

  • Reset all changes to the snapshot values and transition state back +to 'Unchanged' (or 'Added' if the entity was never persisted).

    +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.EntityQuery.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.EntityQuery.html new file mode 100644 index 00000000..407ce1fe --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.EntityQuery.html @@ -0,0 +1,104 @@ +EntityQuery | Libraries

Interface EntityQuery<TEntity, TResult>

The typed query handle returned by every DbSet method that +initiates a query (e.g. .where(), .include(), .first()).

+

Structurally it IS a SchemaQueryBuilder for the entity's schema, +with typed .include() / .includeVariant() methods overlaid. All other +SchemaQueryBuilder methods are available and this-returning chains +preserve the typed wrapper.

+
interface EntityQuery<TEntity extends Entity<any, any, any>, TResult> {
    andWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    andWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    andWhere(record: Record<string, any>): this;
    andWhere(callback: (builder: QueryBuilder) => void): this;
    andWhere(raw: Raw): this;
    apply(fn: (builder: QueryBuilder) => void): this;
    avg(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    bulkInsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts?: {
            chunkSize?: number;
            conflictColumns?: ColumnRef<EntitySchema<TEntity>>[];
            onConflict?: "ignore" | "merge";
        },
    ): Promise<TResult[]>;
    bulkUpdate(
        updates: readonly {
            set: Partial<InferType<TLocalSchema>>;
            where: Partial<InferType<TLocalSchema>>;
        }[],
    ): Promise<number>;
    bulkUpsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts: {
            chunkSize?: number;
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<TResult[]>;
    count(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    countDistinct(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    delete(): Promise<number>;
    distinct(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    execute(): Promise<TResult[]>;
    find(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<TResult | undefined>;
    findMany(
        pks: readonly PrimaryKeyValueOf<EntitySchema<TEntity>>[],
    ): Promise<TResult[]>;
    findOrFail(pk: PrimaryKeyValueOf<EntitySchema<TEntity>>): Promise<TResult>;
    first(): Promise<TResult | undefined>;
    groupBy(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    groupByRaw(sql: string, ...bindings: any[]): this;
    hardDelete(): Promise<number>;
    having(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    havingRaw(sql: string, ...bindings: any[]): this;
    include<K extends string>(
        sel: (t: RelKeyTree<TEntity>) => K,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<TEntity, WithIncluded<TEntity, TResult, K>>;
    includeVariant<TVariant extends string, TRel extends string>(
        variantKey: TVariant,
        relationName: TRel,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<
        TEntity,
        TRel extends keyof EntityRelations<TEntity> & string
            ? WithVariantIncluded<TEntity, TResult, TVariant, TRel>
            : TResult,
    >;
    insert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
    ): Promise<TResult>;
    insertMany(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
    ): Promise<TResult[]>;
    joinMany<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
    >(
        spec: JoinManySpec<EntitySchema<TEntity>, TForeignSchema, TFieldName>,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedMany<TResult, TFieldName, TForeignSchema>,
    >;
    joinOne<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
        TRequired extends boolean = true,
    >(
        spec: JoinOneSpec<
            EntitySchema<TEntity>,
            TForeignSchema,
            TFieldName,
            TRequired,
        >,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedOne<TResult, TFieldName, TForeignSchema, TRequired>,
    >;
    limit(n: number): this;
    max(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    min(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    offset(n: number): this;
    onConflict(
        ...conflictColumns: ColumnRef<EntitySchema<TEntity>>[],
    ): OnConflictBuilder<EntitySchema<TEntity>, TResult>;
    onlyDeleted(): this;
    orderBy(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        direction?: "asc" | "desc",
    ): this;
    orderByRaw(sql: string, ...bindings: any[]): this;
    orWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    orWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    orWhere(record: Record<string, any>): this;
    orWhere(callback: (builder: QueryBuilder) => void): this;
    orWhere(raw: Raw): this;
    orWhereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    orWhereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    paginate(
        opts: { page: number; pageSize: number },
    ): Promise<PaginationResult<TResult>>;
    paginateAfter(
        opts: {
            column?: ColumnRef<EntitySchema<TEntity>>;
            cursor?: any;
            direction?: "asc" | "desc";
            limit: number;
        },
    ): Promise<CursorPaginationResult<TResult>>;
    pluck<K extends string>(
        column: ColumnRef<EntitySchema<TEntity>>,
    ): Promise<TResult[K][]>;
    projected<K extends string>(
        name: K,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        Pick<TResult, ProjectionKeysOf<EntitySchema<TEntity>, K> & keyof TResult>,
    >;
    restore(): Promise<TResult[]>;
    scoped<K extends never>(name: K): this;
    select(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    select<TSel extends SelectSelector<EntitySchema<TEntity>>>(
        selector: TSel,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        SelectProjection<ReturnType<TSel>>,
    >;
    selectRaw(sql: string, bindings?: any[]): this;
    selectVariants(keys: string[]): this;
    sum(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    then<TReturn1 = TResult[], TReturn2 = never>(
        onfulfilled?:
            | ((value: TResult[]) => TReturn1 | PromiseLike<TReturn1>)
            | null,
        onrejected?: ((reason: any) => TReturn2 | PromiseLike<TReturn2>) | null,
    ): Promise<TReturn1 | TReturn2>;
    toKnexQuery(): QueryBuilder;
    toQuery(): string;
    toString(): string;
    transacting(
        trx: Transaction,
    ): SchemaQueryBuilder<EntitySchema<TEntity>, TResult>;
    unscoped(): this;
    update(data: Partial<InferType<TLocalSchema>>): Promise<TResult[]>;
    upsert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
        opts: {
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
            updateColumns?: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<TResult>;
    where(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    where(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    where(raw: Raw, operator: string, value: any): this;
    where(callback: (builder: QueryBuilder) => void): this;
    where(record: Record<string, any>): this;
    where(raw: Raw): this;
    whereBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereILike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereJsonPath(
        column: ColumnRef<EntitySchema<TEntity>>,
        path: string,
        operator?: string,
        value?: any,
    ): this;
    whereLike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereNot(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    whereNot(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    whereNot(record: Record<string, any>): this;
    whereNot(callback: (builder: QueryBuilder) => void): this;
    whereNot(raw: Raw): this;
    whereNotBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereNotExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereRaw(sql: string, ...bindings: any[]): this;
    whereVariant(
        key: string,
        column: string,
        operator: string,
        value: any,
    ): this;
    withDeleted(): this;
}

Type Parameters

  • TEntity extends Entity<any, any, any>
  • TResult

Hierarchy (View Summary)

Index

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    Returns Promise<number>

  • Parameters

    Returns Promise<TResult[]>

  • Returns Promise<number>

  • Returns Promise<TResult[]>

  • Look up a single entity by primary key. Returns undefined when no +row matches.

    +

    The PK column(s) are resolved automatically from the entity's schema +via the primaryKey / hasPrimaryKey extensions. Composite PKs are +passed as a tuple in declaration order:

    +
    await db.todos.find(42);                 // single PK
    await db.userRoles.find([userId, role]); // composite PK +
    + +

    Any chained .include() / .includeVariant() calls on this query +are honoured by the underlying SELECT.

    +

    Returns Promise<TResult | undefined>

  • Returns Promise<TResult | undefined>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns Promise<TResult>

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • opts: { page: number; pageSize: number }

    Returns Promise<PaginationResult<TResult>>

  • Returns Promise<TResult[]>

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • raw: Raw
    • operator: string
    • value: any

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.JoinManySpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.JoinManySpec.html new file mode 100644 index 00000000..ed7b84db --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.JoinManySpec.html @@ -0,0 +1,19 @@ +JoinManySpec | Libraries

Interface JoinManySpec<TLocalSchema, TForeignSchema, TFieldName>

interface JoinManySpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    limit?: number;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    offset?: number;
    orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" };
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
Index

Properties

Name of the field that will hold the loaded array in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
limit?: number

Maximum number of related items to load per parent row

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
offset?: number

Number of related items to skip per parent row

+
orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" }

Column to order the related items by (required for deterministic limit/offset)

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.JoinOneSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.JoinOneSpec.html new file mode 100644 index 00000000..b1f9421b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.JoinOneSpec.html @@ -0,0 +1,15 @@ +JoinOneSpec | Libraries

Interface JoinOneSpec<TLocalSchema, TForeignSchema, TFieldName, TRequired>

interface JoinOneSpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
    TRequired extends boolean = true,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    required?: TRequired;
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
  • TRequired extends boolean = true
Index

Properties

Name of the field that will hold the loaded object in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
required?: TRequired

If true (default), uses INNER JOIN; if false, uses LEFT JOIN (result may be null)

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.MigrationDiff.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.MigrationDiff.html new file mode 100644 index 00000000..e5a8f476 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.MigrationDiff.html @@ -0,0 +1,9 @@ +MigrationDiff | Libraries

Interface MigrationDiff

Schema diff result between the code-first model and the live database.

+
interface MigrationDiff {
    addColumns: AddColumnDiff[];
    addForeignKeys: AddForeignKeyDiff[];
    addIndexes: AddIndexDiff[];
    alterColumns: AlterColumnDiff[];
    dropColumns: string[];
    dropForeignKeys: string[];
    dropIndexes: string[];
}
Index

Properties

addColumns: AddColumnDiff[]
addForeignKeys: AddForeignKeyDiff[]
addIndexes: AddIndexDiff[]
alterColumns: AlterColumnDiff[]
dropColumns: string[]
dropForeignKeys: string[]
dropIndexes: string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.PaginationResult.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.PaginationResult.html new file mode 100644 index 00000000..411bea63 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.PaginationResult.html @@ -0,0 +1,16 @@ +PaginationResult | Libraries

Interface PaginationResult<T>

Result of offset-based pagination via SchemaQueryBuilder.paginate.

+
interface PaginationResult<T> {
    data: T[];
    hasNextPage: boolean;
    hasPreviousPage: boolean;
    page: number;
    pageSize: number;
    total: number;
    totalPages: number;
}

Type Parameters

  • T
Index

Properties

data: T[]

The rows for the current page.

+
hasNextPage: boolean

Whether a next page exists.

+
hasPreviousPage: boolean

Whether a previous page exists.

+
page: number

Current page number (1-based).

+
pageSize: number

Number of rows per page.

+
total: number

Total number of matching rows across all pages.

+
totalPages: number

Total number of pages.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.PrimaryKeyColumns.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.PrimaryKeyColumns.html new file mode 100644 index 00000000..3eb4da67 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.PrimaryKeyColumns.html @@ -0,0 +1,9 @@ +PrimaryKeyColumns | Libraries

Interface PrimaryKeyColumns

Result of getPrimaryKeyColumns.

+

propertyKeys are the schema property names (the keys you'd use in +.where(t => t.id, ...) style accessors); columnNames are the SQL +column names after applying any hasColumnName() overrides. Order is +preserved: composite-PK ordering matches the user's hasPrimaryKey() +declaration; single-PK arrays have length 1.

+
interface PrimaryKeyColumns {
    columnNames: readonly string[];
    propertyKeys: readonly string[];
}
Index

Properties

columnNames: readonly string[]
propertyKeys: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RelationInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RelationInfo.html new file mode 100644 index 00000000..e2627079 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RelationInfo.html @@ -0,0 +1,6 @@ +RelationInfo | Libraries

Interface RelationInfo<TKind, TForeign>

Phantom info for a single declared relation, stored on Entity's TRels +generic. TForeign is captured so .include() can type the customize +callback against the correct foreign schema.

+
interface RelationInfo<
    TKind extends "belongsTo"
    | "hasOne"
    | "hasMany"
    | "belongsToMany" = any,
    TForeign extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
    >,
> {
    foreign: TForeign;
    kind: TKind;
}

Type Parameters

  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany" = any
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<any, any, any, any, any, any, any>
Index

Properties

Properties

foreign: TForeign
kind: TKind
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RelationSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RelationSpec.html new file mode 100644 index 00000000..7d4a9f41 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RelationSpec.html @@ -0,0 +1,7 @@ +RelationSpec | Libraries

Interface RelationSpecInternal

Relation metadata stored via .hasMany(), .belongsTo(), etc.

+
interface RelationSpec {
    foreignKey?: any;
    name: string;
    schema: any;
    through?: { foreignKey: string; localKey: string; table: string };
    type: "belongsTo" | "hasOne" | "hasMany" | "belongsToMany";
}
Index

Properties

foreignKey?: any
name: string
schema: any
through?: { foreignKey: string; localKey: string; table: string }
type: "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ResolvedVariantConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ResolvedVariantConfig.html new file mode 100644 index 00000000..22cf1825 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ResolvedVariantConfig.html @@ -0,0 +1,8 @@ +ResolvedVariantConfig | Libraries

Interface ResolvedVariantConfigInternal

Full variant config stored in the schema extension 'variants'.

+
interface ResolvedVariantConfig {
    discriminatorColumn: string;
    discriminatorKey: string;
    variants: Record<string, ResolvedVariantSpec>;
}
Index

Properties

discriminatorColumn: string

SQL column name corresponding to discriminatorKey. Filled by query builder.

+
discriminatorKey: string

Property key on the base schema that is the discriminator.

+
variants: Record<string, ResolvedVariantSpec>

Map from discriminator value → resolved variant spec.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ResolvedVariantSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ResolvedVariantSpec.html new file mode 100644 index 00000000..8804d565 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ResolvedVariantSpec.html @@ -0,0 +1,12 @@ +ResolvedVariantSpec | Libraries

Interface ResolvedVariantSpecInternal

Resolved, normalised variant spec stored in schema extensions.

+
interface ResolvedVariantSpec {
    allowOrphan: boolean;
    enforceCheck: boolean;
    foreignKey?: string;
    relations: ResolvedVariantRelationSpec[];
    schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    storage: VariantStorageType;
    tableName?: string;
}
Index

Properties

allowOrphan: boolean
enforceCheck: boolean
foreignKey?: string

CTI: FK column name on the variant table.

+
relations: ResolvedVariantRelationSpec[]

Variant-scoped relations (resolved), populated by .withVariants().

+
schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
tableName?: string

CTI: variant table name (from schema.hasTableName()).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RowVersionColumn.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RowVersionColumn.html new file mode 100644 index 00000000..0f2a8401 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.RowVersionColumn.html @@ -0,0 +1,9 @@ +RowVersionColumn | Libraries

Interface RowVersionColumn

Resolved row-version column for a schema, returned by +getRowVersionColumn.

+
interface RowVersionColumn {
    columnName: string;
    propertyKey: string;
    strategy: RowVersionStrategy;
}
Index

Properties

columnName: string

SQL column name (after any hasColumnName() override).

+
propertyKey: string

Schema property name.

+

Concurrency-token update strategy.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.SchemaSnapshot.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.SchemaSnapshot.html new file mode 100644 index 00000000..5b7bd89c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.SchemaSnapshot.html @@ -0,0 +1,11 @@ +SchemaSnapshot | Libraries

Interface SchemaSnapshot

Serialized snapshot of all entity schemas at a given point in time.

+

Stored in <migrations.directory>/snapshot.json and committed to version +control. migrate generate diffs the current code against this snapshot +(instead of a live database) to produce migration files, so no DB +connection is required.

+

Each entry in tables mirrors the shape that introspectDatabase would +return — allowing diffSchema to be reused unchanged.

+
interface SchemaSnapshot {
    tables: Record<string, DatabaseTableState>;
    version: 1;
}
Index

Properties

Properties

tables: Record<string, DatabaseTableState>

Map of table name → database state derived from entity schemas.

+
version: 1
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ValidatedJoinManySpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ValidatedJoinManySpec.html new file mode 100644 index 00000000..55ede1c9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ValidatedJoinManySpec.html @@ -0,0 +1,9 @@ +ValidatedJoinManySpec | Libraries

Interface ValidatedJoinManySpec

interface ValidatedJoinManySpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    limit: number | null;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    offset: number | null;
    orderBy: { column: string; direction: "asc" | "desc" } | null;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
limit: number | null
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
offset: number | null
orderBy: { column: string; direction: "asc" | "desc" } | null
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ValidatedJoinOneSpec.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ValidatedJoinOneSpec.html new file mode 100644 index 00000000..22b6197e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.ValidatedJoinOneSpec.html @@ -0,0 +1,7 @@ +ValidatedJoinOneSpec | Libraries

Interface ValidatedJoinOneSpec

interface ValidatedJoinOneSpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    required: boolean;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
required: boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.VariantDbSet.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.VariantDbSet.html new file mode 100644 index 00000000..5f589659 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_orm.VariantDbSet.html @@ -0,0 +1,90 @@ +VariantDbSet | Libraries

Interface VariantDbSet<TEntity, K>

A DbSet-like handle scoped to a single polymorphic variant (one branch +of a discriminated union entity). All reads are automatically pre-filtered +by the discriminator; all writes apply the correct STI / CTI logic.

+

Obtain via DbSet.ofVariant('key') — analogous to EF Core's +Set<DerivedType>().

+
interface VariantDbSet<TEntity extends Entity<any, any, any>, K extends string> {
    andWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    andWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    andWhere(record: Record<string, any>): this;
    andWhere(callback: (builder: QueryBuilder) => void): this;
    andWhere(raw: Raw): this;
    apply(fn: (builder: QueryBuilder) => void): this;
    avg(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    bulkInsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts?: {
            chunkSize?: number;
            conflictColumns?: ColumnRef<EntitySchema<TEntity>>[];
            onConflict?: "ignore" | "merge";
        },
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    bulkUpdate(
        updates: readonly {
            set: Partial<InferType<TLocalSchema>>;
            where: Partial<InferType<TLocalSchema>>;
        }[],
    ): Promise<number>;
    bulkUpsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts: {
            chunkSize?: number;
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    count(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    countDistinct(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    delete(): Promise<void>;
    distinct(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    execute(): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    find(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<VariantResult<TEntity, K> | undefined>;
    findMany(
        pks: readonly PrimaryKeyValueOf<EntitySchema<TEntity>>[],
    ): Promise<VariantResult<TEntity, K>[]>;
    findOrFail(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<VariantResult<TEntity, K>>;
    first(): Promise<
        ExtractBranch<EntityResultByVariant<TEntity>, K>
        | undefined,
    >;
    groupBy(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    groupByRaw(sql: string, ...bindings: any[]): this;
    hardDelete(): Promise<number>;
    having(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    havingRaw(sql: string, ...bindings: any[]): this;
    include<R extends string>(
        sel: (t: RelKeyTree<TEntity>) => R,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): VariantDbSet<TEntity, K>;
    insert(
        payload: VariantInsertPayload<TEntity, K>,
    ): Promise<VariantResult<TEntity, K>>;
    insertMany(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    joinMany<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
    >(
        spec: JoinManySpec<EntitySchema<TEntity>, TForeignSchema, TFieldName>,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedMany<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
            TFieldName,
            TForeignSchema,
        >,
    >;
    joinOne<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
        TRequired extends boolean = true,
    >(
        spec: JoinOneSpec<
            EntitySchema<TEntity>,
            TForeignSchema,
            TFieldName,
            TRequired,
        >,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedOne<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
            TFieldName,
            TForeignSchema,
            TRequired,
        >,
    >;
    limit(n: number): this;
    max(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    min(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    offset(n: number): this;
    onConflict(
        ...conflictColumns: ColumnRef<EntitySchema<TEntity>>[],
    ): OnConflictBuilder<
        EntitySchema<TEntity>,
        ExtractBranch<EntityResultByVariant<TEntity>, K>,
    >;
    onlyDeleted(): this;
    orderBy(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        direction?: "asc" | "desc",
    ): this;
    orderByRaw(sql: string, ...bindings: any[]): this;
    orWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    orWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    orWhere(record: Record<string, any>): this;
    orWhere(callback: (builder: QueryBuilder) => void): this;
    orWhere(raw: Raw): this;
    orWhereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    orWhereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    paginate(
        opts: { page: number; pageSize: number },
    ): Promise<
        PaginationResult<ExtractBranch<EntityResultByVariant<TEntity>, K>>,
    >;
    paginateAfter(
        opts: {
            column?: ColumnRef<EntitySchema<TEntity>>;
            cursor?: any;
            direction?: "asc" | "desc";
            limit: number;
        },
    ): Promise<
        CursorPaginationResult<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
        >,
    >;
    pluck<K extends string>(
        column: ColumnRef<EntitySchema<TEntity>>,
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[K][]>;
    projected<K extends string>(
        name: K,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        Pick<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
            ProjectionKeysOf<EntitySchema<TEntity>, K> & keyof ExtractBranch<
                EntityResultByVariant<TEntity>,
                K,
            >,
        >,
    >;
    restore(): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    scoped<K extends never>(name: K): this;
    select(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    select<TSel extends SelectSelector<EntitySchema<TEntity>>>(
        selector: TSel,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        SelectProjection<ReturnType<TSel>>,
    >;
    selectRaw(sql: string, bindings?: any[]): this;
    selectVariants(keys: string[]): this;
    sum(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    then<
        TReturn1 = ExtractBranch<EntityResultByVariant<TEntity>, K>[],
        TReturn2 = never,
    >(
        onfulfilled?:
            | (
                (
                    value: ExtractBranch<EntityResultByVariant<TEntity>, K>[],
                ) => TReturn1 | PromiseLike<TReturn1>
            )
            | null,
        onrejected?: ((reason: any) => TReturn2 | PromiseLike<TReturn2>) | null,
    ): Promise<TReturn1 | TReturn2>;
    toKnexQuery(): QueryBuilder;
    toQuery(): string;
    toString(): string;
    transacting(
        trx: Transaction,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        ExtractBranch<EntityResultByVariant<TEntity>, K>,
    >;
    unscoped(): this;
    update(patch: VariantUpdatePayload<TEntity, K>): Promise<void>;
    upsert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
        opts: {
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
            updateColumns?: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>>;
    where(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    where(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    where(raw: Raw, operator: string, value: any): this;
    where(callback: (builder: QueryBuilder) => void): this;
    where(record: Record<string, any>): this;
    where(raw: Raw): this;
    whereBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereILike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereJsonPath(
        column: ColumnRef<EntitySchema<TEntity>>,
        path: string,
        operator?: string,
        value?: any,
    ): this;
    whereLike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereNot(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    whereNot(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    whereNot(record: Record<string, any>): this;
    whereNot(callback: (builder: QueryBuilder) => void): this;
    whereNot(raw: Raw): this;
    whereNotBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereNotExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereRaw(sql: string, ...bindings: any[]): this;
    whereVariant(
        key: string,
        column: string,
        operator: string,
        value: any,
    ): this;
    withDeleted(): this;
    withTransaction(trx: Transaction): VariantDbSet<TEntity, K>;
}

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string

Hierarchy

Index

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<number>

  • Delete rows matched by the current WHERE clause (CTI: atomic).

    +

    Returns Promise<void>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..ConfigureOtelOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..ConfigureOtelOptions.html new file mode 100644 index 00000000..e7423a64 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..ConfigureOtelOptions.html @@ -0,0 +1,14 @@ +ConfigureOtelOptions | Libraries

Interface ConfigureOtelOptions

Configuration for configureOtel.

+
interface ConfigureOtelOptions {
    meterName?: string;
    tracerName?: string;
    version?: string;
}
Index

Properties

meterName?: string

Meter name.

+
'@cleverbrush/otel'
+
+ +
tracerName?: string

Tracer name.

+
'@cleverbrush/otel'
+
+ +
version?: string

Optional version string used for both tracer and meter.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..InstrumentKnexOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..InstrumentKnexOptions.html new file mode 100644 index 00000000..e3e1fa97 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..InstrumentKnexOptions.html @@ -0,0 +1,21 @@ +InstrumentKnexOptions | Libraries

Interface InstrumentKnexOptions

Configuration for instrumentKnex.

+
interface InstrumentKnexOptions {
    dbSystem?: string;
    recordStatement?: boolean;
    sanitizeStatement?: (sql: string) => string;
    tracerName?: string;
}
Index

Properties

dbSystem?: string

Value to record as db.system.name (e.g. postgresql, mysql, +sqlite). When omitted, inferred from the knex client.

+
recordStatement?: boolean

Whether to include the SQL statement as db.query.text.

+

The statement is taken verbatim from knex (parameter placeholders +are kept; bound values are not included). Disable if your +SQL itself may contain sensitive identifiers.

+
true
+
+ +
sanitizeStatement?: (sql: string) => string

Optional hook to redact / rewrite the SQL before it is recorded. +Called only when recordStatement is enabled.

+
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel/knex'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelConfig.html new file mode 100644 index 00000000..2290821a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelConfig.html @@ -0,0 +1,61 @@ +OtelConfig | Libraries

Interface OtelConfig

Configuration for setupOtel.

+
interface OtelConfig {
    debug?: boolean;
    disableLogs?: boolean;
    disableMetrics?: boolean;
    disableTraces?: boolean;
    environment?: string;
    headers?: Record<string, string>;
    instrumentations?: unknown[];
    logsEndpoint?: string;
    metricsEndpoint?: string;
    metricsExportIntervalMs?: number;
    otlpEndpoint?: string;
    resourceAttributes?: Record<string, string | number | boolean>;
    serviceName: string;
    serviceVersion?: string;
    tracesEndpoint?: string;
}
Index

Properties

debug?: boolean

Enable verbose OTel SDK diagnostics (sets the global diag logger).

+
false
+
+ +
disableLogs?: boolean

Disable log export.

+
false
+
+ +
disableMetrics?: boolean

Disable metrics export.

+
false
+
+ +
disableTraces?: boolean

Disable trace export.

+
false
+
+ +
environment?: string

Deployment environment name (e.g. production, staging, dev). +Becomes the deployment.environment.name resource attribute.

+
headers?: Record<string, string>

Optional headers to send with every OTLP export request +(e.g. authentication tokens for hosted backends).

+
instrumentations?: unknown[]

Auto-instrumentations to register at SDK startup.

+

Use the helpers from @cleverbrush/otel/instrumentations +(e.g. outboundHttpInstrumentations(), runtimeMetrics()).

+
logsEndpoint?: string

Override the OTLP logs endpoint (/v1/logs is appended).

+
metricsEndpoint?: string

Override the OTLP metrics endpoint (/v1/metrics is appended).

+
metricsExportIntervalMs?: number

Metric export interval in milliseconds.

+
60000
+
+ +
otlpEndpoint?: string

Base OTLP/HTTP endpoint for traces, logs, and metrics.

+

If not provided, falls back to the standard OTel environment +variables (OTEL_EXPORTER_OTLP_ENDPOINT, +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, etc.).

+

Per-signal endpoints below take precedence over this value.

+
process.env.OTEL_EXPORTER_OTLP_ENDPOINT
+
+ +
resourceAttributes?: Record<string, string | number | boolean>

Additional resource attributes merged onto the default resource. +Useful for host.name, cloud.region, custom team tags, etc.

+
serviceName: string

Logical name of the service emitting telemetry. +Becomes the service.name resource attribute and is the primary +identifier in observability backends.

+
serviceVersion?: string

Optional service version → service.version resource attribute.

+
tracesEndpoint?: string

Override the OTLP traces endpoint (/v1/traces is appended).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelHandle.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelHandle.html new file mode 100644 index 00000000..ea92a6a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelHandle.html @@ -0,0 +1,11 @@ +OtelHandle | Libraries

Interface OtelHandle

Handle returned by setupOtel for lifecycle management.

+
interface OtelHandle {
    sdk: NodeSDK;
    shutdown(): Promise<void>;
}
Index

Properties

sdk +

Methods

Properties

sdk: NodeSDK

The underlying NodeSDK instance.

+

Exposed for advanced use cases (custom span processors, runtime +configuration). Most consumers do not need to touch this directly.

+

Methods

  • Gracefully flushes and shuts down all exporters.

    +

    Idempotent — safe to call multiple times. +Should be invoked from your process's shutdown hook +(SIGTERM/SIGINT) before process.exit.

    +

    Returns Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelLogSinkOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelLogSinkOptions.html new file mode 100644 index 00000000..d5b97432 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..OtelLogSinkOptions.html @@ -0,0 +1,14 @@ +OtelLogSinkOptions | Libraries

Interface OtelLogSinkOptions

Configuration for otelLogSink.

+
interface OtelLogSinkOptions {
    loggerName?: string;
    loggerVersion?: string;
    sanitizeAttribute?: (key: string, value: unknown) => unknown;
}
Index

Properties

loggerName?: string

Logger name (InstrumentationScope) under which records are +emitted via the OTel Logs API.

+
'@cleverbrush/otel'
+
+ +
loggerVersion?: string

Optional logger version.

+
sanitizeAttribute?: (key: string, value: unknown) => unknown

Hook for redacting / dropping properties before they become +OTel log record attributes. Return undefined to drop the +attribute entirely.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..SpanHandle.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..SpanHandle.html new file mode 100644 index 00000000..e9460d57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..SpanHandle.html @@ -0,0 +1,20 @@ +SpanHandle | Libraries

Interface SpanHandle

Handle returned by the disposable form of withSpan.

+

Implements AsyncDisposable so it can be used with await using:

+
await using handle = withSpan('my.operation');
handle.span.setAttribute('key', value);
try {
// ... do work ...
} catch (err) {
handle.fail(err);
throw err;
}
// span.end() is called automatically when the block exits +
+ +

Note: The span created by the disposable form is NOT activated as +the current context span (OTel's public API requires a callback scope +for context propagation). DB / outbound-HTTP child spans created +inside the await using block will be siblings of this span (both +children of the enclosing HTTP span) rather than nested under it. +Use the callback form of withSpan when proper nesting is required.

+
interface SpanHandle {
    span: Span;
    "[asyncDispose]"(): Promise<void>;
    fail(err: unknown): void;
}
Index

Properties

Methods

Properties

span: Span

The underlying OTel span. Use it to set attributes or add events.

+

Methods

  • Ends the span. Called automatically when exiting an await using block.

    +

    Returns Promise<void>

  • Records an exception and marks the span as errored.

    +

    Idempotent — safe to call in a catch block even if the same +error might be reported elsewhere.

    +

    Parameters

    • err: unknown

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..TracingMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..TracingMiddlewareOptions.html new file mode 100644 index 00000000..9a5ec524 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..TracingMiddlewareOptions.html @@ -0,0 +1,34 @@ +TracingMiddlewareOptions | Libraries

Interface TracingMiddlewareOptions

Configuration for tracingMiddleware.

+
interface TracingMiddlewareOptions {
    enrichSpan?: (span: Span, ctx: any) => void;
    excludePaths?: (string | { path: string })[];
    recordQuery?: boolean;
    responseTraceHeader?: string | false;
    tracerName?: string;
    tracerVersion?: string;
}
Index

Properties

enrichSpan?: (span: Span, ctx: any) => void

Hook for adding custom attributes to the server span just before +the inner pipeline runs. Errors thrown here are swallowed.

+
excludePaths?: (string | { path: string })[]

Paths to exclude from tracing entirely (no span created).

+

Accepts plain strings or objects with a path property +(e.g. an EndpointBuilder). Useful for /health and other +high-frequency, low-value endpoints.

+
recordQuery?: boolean

Whether to record the URL query string as url.query.

+

Disabled by default because query strings frequently contain PII +(search terms, tokens). Enable explicitly only when you have +verified your URLs are safe to record.

+
false
+
+ +
responseTraceHeader?: string | false

Name of the response header that carries the W3C trace ID for the +current request span.

+

Expose this so API consumers can include it in bug reports and you +can look up the exact trace in SigNoz / Jaeger / etc.

+

Set to false to disable the header entirely.

+
'X-Trace-Id'
+
+ +
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel'
+
+ +
tracerVersion?: string

Tracer version.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..WithSpanOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..WithSpanOptions.html new file mode 100644 index 00000000..caf21e7e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel..WithSpanOptions.html @@ -0,0 +1,16 @@ +WithSpanOptions | Libraries

Interface WithSpanOptions

Options shared by both calling conventions of withSpan.

+
interface WithSpanOptions {
    attributes?: Attributes;
    kind?: SpanKind;
    tracerName?: string;
    tracerVersion?: string;
}
Index

Properties

attributes?: Attributes

Initial attributes to set on the span.

+
kind?: SpanKind

OTel span kind.

+
SpanKind.INTERNAL
+
+ +
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel'
+
+ +
tracerVersion?: string

Tracer version.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingEndpointMeta.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingEndpointMeta.html new file mode 100644 index 00000000..58d80ea6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingEndpointMeta.html @@ -0,0 +1,11 @@ +ClientTracingEndpointMeta | Libraries

Interface ClientTracingEndpointMeta

Endpoint metadata attached to RequestInit by @cleverbrush/client.

+

This is intentionally structural and partial so the OTel package can read +metadata when present without coupling to client internals at runtime.

+
interface ClientTracingEndpointMeta {
    collectionPath?: string;
    endpoint?: string;
    group?: string;
    method?: string;
    operationId?: string | null;
    path?: string;
    tags?: readonly string[];
}
Index

Properties

collectionPath?: string
endpoint?: string
group?: string
method?: string
operationId?: string | null
path?: string
tags?: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingInfo.html new file mode 100644 index 00000000..1f018c41 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingInfo.html @@ -0,0 +1,6 @@ +ClientTracingInfo | Libraries

Interface ClientTracingInfo

Information passed to the enrichSpan hook.

+
interface ClientTracingInfo {
    endpoint?: ClientTracingEndpointMeta;
    headers: Record<string, string>;
    method: string;
    url: string;
}
Index

Properties

Properties

headers: Record<string, string>
method: string
url: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingMiddlewareOptions.html new file mode 100644 index 00000000..9d3e9dee --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_otel.client.ClientTracingMiddlewareOptions.html @@ -0,0 +1,21 @@ +ClientTracingMiddlewareOptions | Libraries

Interface ClientTracingMiddlewareOptions

Configuration for clientTracingMiddleware.

+
interface ClientTracingMiddlewareOptions {
    enrichSpan?: (span: Span, info: ClientTracingInfo) => void;
    recordUrlFull?: boolean;
    skip?: (url: string, init: RequestInit) => boolean;
    tracerName?: string;
    tracerVersion?: string;
}
Index

Properties

enrichSpan?: (span: Span, info: ClientTracingInfo) => void

Hook for adding custom attributes/events before the request is sent. +Errors thrown here are swallowed.

+
recordUrlFull?: boolean

Whether to record url.full.

+

Disabled by default because full URLs can include query strings with +sensitive values.

+
false
+
+ +
skip?: (url: string, init: RequestInit) => boolean

Predicate for skipping tracing on selected outbound requests.

+
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel'
+
+ +
tracerVersion?: string

Tracer version.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Converter.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Converter.html new file mode 100644 index 00000000..ae925ecc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Converter.html @@ -0,0 +1,6 @@ +Converter | Libraries

The Standard JSON Schema converter interface.

+
interface Converter {
    input: (
        options: StandardJSONSchemaV1.Options,
    ) => Record<string, unknown>;
    output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
}
Index

Properties

Properties

input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>

Converts the input type to JSON Schema. May throw if conversion is not supported.

+
output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>

Converts the output type to JSON Schema. May throw if conversion is not supported.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Options.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Options.html new file mode 100644 index 00000000..4376b82c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Options.html @@ -0,0 +1,6 @@ +Options | Libraries

The options for the input/output methods.

+
interface Options {
    libraryOptions?: Record<string, unknown>;
    target: Target;
}
Index

Properties

Properties

libraryOptions?: Record<string, unknown>

Explicit support for additional vendor-specific parameters, if needed.

+
target: Target

Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Props.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Props.html new file mode 100644 index 00000000..dc66ed06 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Props.html @@ -0,0 +1,10 @@ +Props | Libraries

The Standard JSON Schema properties interface.

+
interface Props<Input = unknown, Output = Input> {
    jsonSchema: Converter;
    types?: StandardTypedV1.Types<Input, Output>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

jsonSchema: Converter

Methods for generating the input/output JSON Schema.

+

Inferred types associated with the schema.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Types.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Types.html new file mode 100644 index 00000000..69ea2cc7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

The Standard types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.html new file mode 100644 index 00000000..15d1f0d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.html @@ -0,0 +1,4 @@ +StandardJSONSchemaV1 | Libraries

Interface StandardJSONSchemaV1<Input, Output>

The Standard JSON Schema interface.

+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
    "~standard": StandardJSONSchemaV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard JSON Schema properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.Props.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.Props.html new file mode 100644 index 00000000..4ef6ab3e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.Props.html @@ -0,0 +1,8 @@ +Props | Libraries

Interface Props<Input, Output>

The Standard Typed properties interface.

+
interface Props<Input = unknown, Output = Input> {
    types?: StandardTypedV1.Types<Input, Output>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

Inferred types associated with the schema.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.Types.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.Types.html new file mode 100644 index 00000000..83f4462c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

Interface Types<Input, Output>

The Standard Typed types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.html new file mode 100644 index 00000000..53997890 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema-json.StandardTypedV1.html @@ -0,0 +1,4 @@ +StandardTypedV1 | Libraries

Interface StandardTypedV1<Input, Output>

The Standard Typed interface. This is a base type extended by other specs.

+
interface StandardTypedV1<Input = unknown, Output = Input> {
    "~standard": StandardTypedV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.ArrayBuiltinExtensions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.ArrayBuiltinExtensions.html new file mode 100644 index 00000000..2b029c0f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.ArrayBuiltinExtensions.html @@ -0,0 +1,26 @@ +ArrayBuiltinExtensions | Libraries

Interface ArrayBuiltinExtensions<TElementSchema>

Methods added to ArraySchemaBuilder by the built-in array extension pack.

+

WORKAROUND: This interface duplicates the method signatures from +arrayExtensions so that JSDoc survives into the published .d.ts +files. TypeScript strips JSDoc when method signatures are reconstructed +through the FixedMethods mapped type (conditional infer loses +comments). Remove this interface once TypeScript preserves JSDoc +through mapped types / conditional type inference.

+
interface ArrayBuiltinExtensions<
    TElementSchema extends
        SchemaBuilder<any, any, any, any, any> = SchemaBuilder<any, any, any>,
> {
    nonempty(
        errorMessage?: ValidationErrorMessageProvider<
            ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >,
        >,
    ): ArrayExtReturn<TElementSchema>;
    unique(
        keyFn?: (item: any) => unknown,
        errorMessage?: ValidationErrorMessageProvider<
            ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >,
        >,
    ): ArrayExtReturn<TElementSchema>;
}

Type Parameters

Index

Methods

Methods

  • Validates that the array contains at least one element.

    +

    Parameters

    • OptionalerrorMessage: ValidationErrorMessageProvider<
          ArraySchemaBuilder<
              any,
              true,
              false,
              undefined,
              false,
              {},
              any[]
              | unknown[],
          >,
      >

      custom error message or function to generate one

      +

    Returns ArrayExtReturn<TElementSchema>

    a new schema builder with the nonempty validator applied

    +
    array().nonempty();
    array().nonempty('At least one item required'); +
    + +
  • Validates that all elements in the array are unique.

    +

    For primitive elements, uses strict equality. For objects, pass a keyFn +that extracts a comparison key from each element.

    +

    Parameters

    • OptionalkeyFn: (item: any) => unknown

      optional function to extract a comparison key from each element

      +
    • OptionalerrorMessage: ValidationErrorMessageProvider<
          ArraySchemaBuilder<
              any,
              true,
              false,
              undefined,
              false,
              {},
              any[]
              | unknown[],
          >,
      >

      custom error message or function to generate one

      +

    Returns ArrayExtReturn<TElementSchema>

    a new schema builder with the unique validator applied

    +
    array().unique();
    array().unique((item) => item.id);
    array().unique(undefined, 'No duplicates allowed'); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.NumberBuiltinExtensions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.NumberBuiltinExtensions.html new file mode 100644 index 00000000..d6050d3a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.NumberBuiltinExtensions.html @@ -0,0 +1,61 @@ +NumberBuiltinExtensions | Libraries

Interface NumberBuiltinExtensions<T>

Methods added to NumberSchemaBuilder by the built-in number extension pack.

+

WORKAROUND: This interface duplicates the method signatures from +numberExtensions so that JSDoc survives into the published .d.ts +files. TypeScript strips JSDoc when method signatures are reconstructed +through the FixedMethods mapped type (conditional infer loses +comments). Remove this interface once TypeScript preserves JSDoc +through mapped types / conditional type inference.

+
interface NumberBuiltinExtensions<T extends number = number> {
    finite(
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
    multipleOf(
        n: number,
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
    negative(
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
    oneOf<V extends number>(...values: [V, ...V[]]): NumberExtReturn<V>;
    oneOf<V extends number>(
        ...args: [
            V,
            ...V[],
            ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ],
    ): NumberExtReturn<V>;
    oneOf<V extends number>(
        values: readonly [V, V],
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<V>;
    positive(
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
}

Type Parameters

  • T extends number = number
Index

Methods

  • Validates that the number is an exact multiple of n.

    +

    Uses a relative tolerance of 1e-10 for float-safe comparison.

    +

    Parameters

    Returns NumberExtReturn<T>

    a new schema builder with the multipleOf validator applied

    +
    number().multipleOf(5);
    number().multipleOf(0.1, 'Must be a multiple of 0.1'); +
    + +
  • Constrains the number to one of the specified literal values.

    +

    Narrows the inferred type from number to the union of the +provided literals.

    +

    Type Parameters

    • V extends number

    Parameters

    • ...values: [V, ...V[]]

      the allowed number literals

      +

    Returns NumberExtReturn<V>

    a new schema builder restricted to the given values

    +
    import { number, InferType } from '@cleverbrush/schema';

    const priority = number().oneOf(1, 2, 3);
    type Priority = InferType<typeof priority>; // 1 | 2 | 3

    priority.validate(1); // valid
    priority.validate(4); // invalid — "must be one of: 1, 2, 3" +
    + +
  • Constrains the number to one of the specified literal values, +with a custom error message or factory as the last argument.

    +

    Type Parameters

    • V extends number

    Parameters

    Returns NumberExtReturn<V>

    const priority = number().oneOf(1, 2, 3, 'Priority must be 1, 2, or 3');
    const priority2 = number().oneOf(1, 2, 3, (val) => `${val} is not a valid priority`); +
    + +
  • Constrains the number to one of the specified literal values, +with an optional custom error message or factory.

    +

    Type Parameters

    • V extends number

    Parameters

    Returns NumberExtReturn<V>

    a new schema builder restricted to the given values

    +
    const priority = number().oneOf([1, 2, 3], 'Must be 1, 2, or 3');
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.FailureResult.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.FailureResult.html new file mode 100644 index 00000000..da2dcfd7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.FailureResult.html @@ -0,0 +1,4 @@ +FailureResult | Libraries

The result interface if validation fails.

+
interface FailureResult {
    issues: readonly Issue[];
}
Index

Properties

Properties

issues: readonly Issue[]

The issues of failed validation.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Issue.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Issue.html new file mode 100644 index 00000000..a1fc86d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Issue.html @@ -0,0 +1,6 @@ +Issue | Libraries

The issue interface of the failure output.

+
interface Issue {
    message: string;
    path?: readonly (PropertyKey | PathSegment)[];
}
Index

Properties

Properties

message: string

The error message of the issue.

+
path?: readonly (PropertyKey | PathSegment)[]

The path of the issue, if any.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Options.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Options.html new file mode 100644 index 00000000..02ddd2b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Options.html @@ -0,0 +1,3 @@ +Options | Libraries
interface Options {
    libraryOptions?: Record<string, unknown>;
}
Index

Properties

Properties

libraryOptions?: Record<string, unknown>

Explicit support for additional vendor-specific parameters, if needed.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.PathSegment.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.PathSegment.html new file mode 100644 index 00000000..efebf6da --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.PathSegment.html @@ -0,0 +1,4 @@ +PathSegment | Libraries

The path segment interface of the issue.

+
interface PathSegment {
    key: PropertyKey;
}
Index

Properties

key +

Properties

key: PropertyKey

The key representing a path segment.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Props.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Props.html new file mode 100644 index 00000000..2a262375 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Props.html @@ -0,0 +1,10 @@ +Props | Libraries

Interface Props<Input, Output>

The Standard Schema properties interface.

+
interface Props<Input = unknown, Output = Input> {
    types?: StandardTypedV1.Types<Input, Output>;
    validate: (
        value: unknown,
        options?: StandardSchemaV1.Options,
    ) => Result<Output> | Promise<Result<Output>>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

Inferred types associated with the schema.

+
validate: (
    value: unknown,
    options?: StandardSchemaV1.Options,
) => Result<Output> | Promise<Result<Output>>

Validates unknown input values.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.SuccessResult.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.SuccessResult.html new file mode 100644 index 00000000..f3084a44 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.SuccessResult.html @@ -0,0 +1,6 @@ +SuccessResult | Libraries

The result interface if validation succeeds.

+
interface SuccessResult<Output> {
    issues?: undefined;
    value: Output;
}

Type Parameters

  • Output
Index

Properties

Properties

issues?: undefined

A falsy value for issues indicates success.

+
value: Output

The typed output value.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Types.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Types.html new file mode 100644 index 00000000..b23a5ccb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

Interface Types<Input, Output>

The Standard types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.html new file mode 100644 index 00000000..2028a33b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardSchemaV1.html @@ -0,0 +1,4 @@ +StandardSchemaV1 | Libraries

Interface StandardSchemaV1<Input, Output>

The Standard Schema interface.

+
interface StandardSchemaV1<Input = unknown, Output = Input> {
    "~standard": StandardSchemaV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard Schema properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.Props.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.Props.html new file mode 100644 index 00000000..258c0e08 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.Props.html @@ -0,0 +1,8 @@ +Props | Libraries

Interface Props<Input, Output>

The Standard Typed properties interface.

+
interface Props<Input = unknown, Output = Input> {
    types?: StandardTypedV1.Types<Input, Output>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

Inferred types associated with the schema.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.Types.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.Types.html new file mode 100644 index 00000000..d854da56 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

Interface Types<Input, Output>

The Standard Typed types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.html new file mode 100644 index 00000000..17061062 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StandardTypedV1.html @@ -0,0 +1,4 @@ +StandardTypedV1 | Libraries

Interface StandardTypedV1<Input, Output>

The Standard Typed interface. This is a base type extended by other specs.

+
interface StandardTypedV1<Input = unknown, Output = Input> {
    "~standard": StandardTypedV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StringBuiltinExtensions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StringBuiltinExtensions.html new file mode 100644 index 00000000..23c2516b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_schema.StringBuiltinExtensions.html @@ -0,0 +1,84 @@ +StringBuiltinExtensions | Libraries

Interface StringBuiltinExtensions<T>

Methods added to StringSchemaBuilder by the built-in string extension pack.

+

WORKAROUND: This interface duplicates the method signatures from +stringExtensions so that JSDoc survives into the published .d.ts +files. TypeScript strips JSDoc when method signatures are reconstructed +through the FixedMethods mapped type (conditional infer loses +comments). Remove this interface once TypeScript preserves JSDoc +through mapped types / conditional type inference.

+
interface StringBuiltinExtensions<T extends string = string> {
    email(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    ip(
        opts?: { version?: "v4" | "v6" },
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    nonempty(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    oneOf<V extends string>(...values: [V, ...V[]]): StringExtReturn<V>;
    oneOf<V extends string>(
        ...args: [
            V,
            ...V[],
            ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ],
    ): StringExtReturn<V>;
    oneOf<V extends string>(
        values: readonly [V, V],
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<V>;
    toLowerCase(): StringExtReturn<T>;
    trim(): StringExtReturn<T>;
    url(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    url(
        opts?: { protocols?: string[] },
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    uuid(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
}

Type Parameters

  • T extends string = string
Index

Methods

  • Validates that the string is a well-formed email address.

    +

    Uses the pattern ^[^\s@]+@[^\s@]+\.[^\s@]+$ for validation.

    +

    Parameters

    Returns StringExtReturn<T>

    a new schema builder with the email validator applied

    +
    string().email();
    string().email('Please enter a valid email');
    string().email((val) => `"${val}" is not a valid email`); +
    + +
  • Validates that the string is a valid IP address (IPv4 or IPv6).

    +

    Pass opts.version to restrict validation to a specific IP version.

    +

    Parameters

    • Optionalopts: { version?: "v4" | "v6" }

      optional configuration

      +
      • Optionalversion?: "v4" | "v6"

        restrict to 'v4' or 'v6' (default: accept both)

        +
    • OptionalerrorMessage: ValidationErrorMessageProvider<
          StringSchemaBuilder<string, true, false, false, {}>,
      >

      custom error message or function to generate one

      +

    Returns StringExtReturn<T>

    a new schema builder with the IP validator applied

    +
    string().ip();
    string().ip({ version: 'v4' });
    string().ip(undefined, 'Bad IP address'); +
    + +
  • Constrains the string to one of the specified literal values.

    +

    Narrows the inferred type from string to the union of the +provided literals.

    +

    Type Parameters

    • V extends string

    Parameters

    • ...values: [V, ...V[]]

      the allowed string literals

      +

    Returns StringExtReturn<V>

    a new schema builder restricted to the given values

    +
    import { string, InferType } from '@cleverbrush/schema';

    const role = string().oneOf('admin', 'user', 'guest');
    type Role = InferType<typeof role>; // 'admin' | 'user' | 'guest'

    role.validate('admin'); // valid
    role.validate('other'); // invalid — "must be one of: admin, user, guest" +
    + +
  • Constrains the string to one of the specified literal values, +with a custom error message or factory as the last argument.

    +

    Type Parameters

    • V extends string

    Parameters

    Returns StringExtReturn<V>

    const role = string().oneOf('admin', 'user', (val) => `"${val}" is not allowed`);
    +
    + +
  • Constrains the string to one of the specified literal values, +with an optional custom error message or factory.

    +

    Type Parameters

    • V extends string

    Parameters

    Returns StringExtReturn<V>

    a new schema builder restricted to the given values

    +
    const role = string().oneOf(['admin', 'user', 'guest'], 'Invalid role');
    +
    + +
  • Preprocessor that converts the string to lowercase before validation.

    +

    Returns StringExtReturn<T>

    a new schema builder with the toLowerCase preprocessor applied

    +
    string().toLowerCase(); // 'HELLO' → 'hello'
    +
    + +
  • Preprocessor that trims leading and trailing whitespace before validation.

    +

    Returns StringExtReturn<T>

    a new schema builder with the trim preprocessor applied

    +
    string().trim().minLength(1); // '  hi  ' → 'hi'
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiInfo.html new file mode 100644 index 00000000..d30d9b64 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiInfo.html @@ -0,0 +1,15 @@ +AsyncApiInfo | Libraries

API metadata included in the AsyncAPI info object. +Maps to the AsyncAPI 3.0 Info Object.

+
interface AsyncApiInfo {
    contact?: { email?: string; name?: string; url?: string };
    description?: string;
    license?: { name: string; url?: string };
    termsOfService?: string;
    title: string;
    version: string;
}
Index

Properties

contact?: { email?: string; name?: string; url?: string }

Contact information for the application.

+
description?: string

A short description of the application.

+
license?: { name: string; url?: string }

License information for the application.

+
termsOfService?: string

A URL to the Terms of Service.

+
title: string

The title of the application.

+
version: string

The application version.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiOptions.html new file mode 100644 index 00000000..e45e2f38 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiOptions.html @@ -0,0 +1,20 @@ +AsyncApiOptions | Libraries

Options passed to generateAsyncApiSpec.

+

When server is provided, subscriptions are derived from it +automatically (unless explicitly overridden).

+
interface AsyncApiOptions {
    info: AsyncApiInfo;
    pathPrefix?: string;
    server?: AsyncApiServer_ServerLike;
    servers?: Record<string, AsyncApiServerEntry>;
    subscriptions?: readonly SubscriptionRegistration[];
}
Index

Properties

API metadata (title, version, description).

+
pathPrefix?: string

Path prefix to strip from all channel addresses. +Useful when the subscription endpoints are mounted under a prefix +that differs from how the AsyncAPI doc should describe them.

+

A ServerBuilder (or any object implementing getSubscriptionRegistrations()). +When set, subscription registrations are automatically read from the +server instance. Explicit subscriptions values take precedence.

+
servers?: Record<string, AsyncApiServerEntry>

Server entries to include in the spec's servers map. +Keys are server IDs (e.g. 'production', 'staging').

+
subscriptions?: readonly SubscriptionRegistration[]

Subscription registrations to document. +When omitted, registrations are read from the server option.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiServerEntry.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiServerEntry.html new file mode 100644 index 00000000..480c180e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiServerEntry.html @@ -0,0 +1,15 @@ +AsyncApiServerEntry | Libraries

A server entry in the AsyncAPI 3.0 servers map. +Describes a connection endpoint where the API is accessible.

+
interface AsyncApiServerEntry {
    description?: string;
    host: string;
    pathname?: string;
    protocol: "http" | "ws" | "wss" | "https";
}
Index

Properties

description?: string

An optional string describing the server.

+
host: string

The host of the server (hostname + optional port).

+
`'api.example.com'`, `'localhost:3000'`
+
+ +
pathname?: string

The path component of the server URL.

+
protocol: "http" | "ws" | "wss" | "https"

The protocol used to connect to the server.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiServer_ServerLike.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiServer_ServerLike.html new file mode 100644 index 00000000..dfa07814 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.AsyncApiServer_ServerLike.html @@ -0,0 +1,4 @@ +AsyncApiServer_ServerLike | Libraries

Interface AsyncApiServer_ServerLike

Minimal interface for a @cleverbrush/server server instance. Matches +the relevant subset of ServerBuilder needed for AsyncAPI generation.

+
interface AsyncApiServer_ServerLike {
    getSubscriptionRegistrations(): readonly SubscriptionRegistration[];
}
Index

Methods

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiEndpointOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiEndpointOptions.html new file mode 100644 index 00000000..293d6ff3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiEndpointOptions.html @@ -0,0 +1,21 @@ +OpenApiEndpointOptions | Libraries

Options for createOpenApiEndpoint.

+

When server is provided, getRegistrations and authConfig are derived +from it automatically (unless explicitly overridden).

+
interface OpenApiEndpointOptions {
    authConfig?: AuthenticationConfig | null;
    getRegistrations?: () => readonly EndpointRegistration[];
    info: OpenApiInfo;
    path?: string;
    securitySchemes?: Record<string, OpenApiSecurityScheme>;
    server?: OpenApiServer_ServerLike;
    servers?: readonly OpenApiServer[];
}
Index

Properties

authConfig?: AuthenticationConfig | null

Optional auth config for security scheme generation.

+
getRegistrations?: () => readonly EndpointRegistration[]

Function that returns endpoint registrations.

+

OpenAPI info metadata.

+
path?: string

Path to serve the spec at (default: /openapi.json).

+
securitySchemes?: Record<string, OpenApiSecurityScheme>

Override security schemes manually.

+

A ServerBuilder (or any structurally compatible object). When set, +endpoint registrations and auth config are read from the server +automatically. Explicit getRegistrations / authConfig values +take precedence.

+
servers?: readonly OpenApiServer[]

Optional server entries.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiInfo.html new file mode 100644 index 00000000..fbc9d5e3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiInfo.html @@ -0,0 +1,9 @@ +OpenApiInfo | Libraries

API metadata included in the OpenAPI info object. +Maps directly to the OpenAPI 3.1 Info Object.

+
interface OpenApiInfo {
    contact?: { email?: string; name?: string; url?: string };
    description?: string;
    license?: { name: string; url?: string };
    termsOfService?: string;
    title: string;
    version: string;
}
Index

Properties

contact?: { email?: string; name?: string; url?: string }
description?: string
license?: { name: string; url?: string }
termsOfService?: string
title: string
version: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiOptions.html new file mode 100644 index 00000000..3fc041ac --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiOptions.html @@ -0,0 +1,28 @@ +OpenApiOptions | Libraries

Options passed to generateOpenApiSpec.

+

When server is provided, registrations and authConfig are derived +from it automatically (unless explicitly overridden).

+
interface OpenApiOptions {
    authConfig?: AuthenticationConfig | null;
    info: OpenApiInfo;
    registrations?: readonly EndpointRegistration[];
    securitySchemes?: Record<string, OpenApiSecurityScheme>;
    server?: OpenApiServer_ServerLike;
    servers?: readonly OpenApiServer[];
    tags?: readonly OpenApiTag[];
    webhooks?: readonly WebhookDefinition[];
}
Index

Properties

authConfig?: AuthenticationConfig | null
registrations?: readonly EndpointRegistration[]
securitySchemes?: Record<string, OpenApiSecurityScheme>

A ServerBuilder (or any object implementing the same methods). +When set, registrations, authConfig, and webhooks are +automatically read from the server instance. Explicit values for +those fields take precedence over the server-derived ones.

+
servers?: readonly OpenApiServer[]
tags?: readonly OpenApiTag[]

Top-level tag definitions with optional descriptions and external docs.

+

When provided, these entries are emitted as the top-level tags array. +Any tag names used by registered endpoints but absent from this list are +automatically appended as name-only entries (sorted alphabetically).

+

When omitted, unique tag names are still auto-collected from all +registered endpoints and emitted as name-only entries.

+
webhooks?: readonly WebhookDefinition[]

Webhook definitions to emit in the top-level webhooks map of the +generated OpenAPI document.

+

Webhooks are not served as HTTP routes — they merely document async +out-of-band requests that your API sends to subscribers.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiSecurityScheme.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiSecurityScheme.html new file mode 100644 index 00000000..4a34a74a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiSecurityScheme.html @@ -0,0 +1,11 @@ +OpenApiSecurityScheme | Libraries

An OpenAPI 3.1 Security Scheme Object. +Describes how requests to the API are authenticated.

+
interface OpenApiSecurityScheme {
    bearerFormat?: string;
    flows?: Record<string, unknown>;
    in?: string;
    name?: string;
    openIdConnectUrl?: string;
    scheme?: string;
    type: string;
}
Index

Properties

bearerFormat?: string
flows?: Record<string, unknown>
in?: string
name?: string
openIdConnectUrl?: string
scheme?: string
type: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiServer.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiServer.html new file mode 100644 index 00000000..028d5d7d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiServer.html @@ -0,0 +1,5 @@ +OpenApiServer | Libraries

A server entry in the OpenAPI servers array. +Describes a base URL where the API is accessible.

+
interface OpenApiServer {
    description?: string;
    url: string;
}
Index

Properties

Properties

description?: string
url: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiServer_ServerLike.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiServer_ServerLike.html new file mode 100644 index 00000000..5acee3e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiServer_ServerLike.html @@ -0,0 +1,7 @@ +OpenApiServer_ServerLike | Libraries

Interface OpenApiServer_ServerLike

Minimal interface for a @cleverbrush/server server instance. Matches +the relevant subset of ServerBuilder so that callers can pass the +server directly without importing the class.

+
interface OpenApiServer_ServerLike {
    getAuthenticationConfig(): AuthenticationConfig | null;
    getRegistrations(): readonly EndpointRegistration[];
    getWebhooks(): readonly WebhookDefinition[];
}
Index

Methods

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiTag.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiTag.html new file mode 100644 index 00000000..0fb3a402 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.OpenApiTag.html @@ -0,0 +1,11 @@ +OpenApiTag | Libraries

A tag entry in the OpenAPI top-level tags array. +Provides a name, optional description, and optional external documentation +for a tag group.

+
interface OpenApiTag {
    description?: string;
    externalDocs?: { description?: string; url: string };
    name: string;
}
Index

Properties

description?: string

Short description for the tag group, displayed in Swagger UI / Redoc.

+
externalDocs?: { description?: string; url: string }

Link to external documentation for this tag.

+
name: string

Tag name. Must match the tag strings used on individual operations.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.PathParameterInfo.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.PathParameterInfo.html new file mode 100644 index 00000000..3e2410fc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.PathParameterInfo.html @@ -0,0 +1,5 @@ +PathParameterInfo | Libraries

Describes a single path parameter extracted from a route template, +including its name and the JSON Schema representation of its type.

+
interface PathParameterInfo {
    name: string;
    schema: Record<string, unknown>;
}
Index

Properties

Properties

name: string
schema: Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ResolvedPath.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ResolvedPath.html new file mode 100644 index 00000000..91d21d87 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ResolvedPath.html @@ -0,0 +1,7 @@ +ResolvedPath | Libraries

The output of resolving a route path template to an OpenAPI-compatible +path string and its parameter list.

+
interface ResolvedPath {
    parameters: readonly PathParameterInfo[];
    path: string;
}
Index

Properties

Properties

parameters: readonly PathParameterInfo[]

Extracted path parameters with their JSON Schema

+
path: string

OpenAPI-formatted path, e.g. /api/users/{id}

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ServeAsyncApiOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ServeAsyncApiOptions.html new file mode 100644 index 00000000..6cddf2e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ServeAsyncApiOptions.html @@ -0,0 +1,18 @@ +ServeAsyncApiOptions | Libraries

Options for the serveAsyncApi middleware.

+

When server is provided, getSubscriptionRegistrations is derived +from it automatically (unless explicitly overridden).

+
interface ServeAsyncApiOptions {
    getSubscriptionRegistrations?: () => readonly SubscriptionRegistration[];
    info: AsyncApiInfo;
    path?: string;
    server?: AsyncApiServer_ServerLike;
    servers?: Record<string, AsyncApiServerEntry>;
}
Index

Properties

getSubscriptionRegistrations?: () => readonly SubscriptionRegistration[]

Function that returns subscription registrations. +Takes precedence over server.getSubscriptionRegistrations().

+

AsyncAPI info metadata (title, version, description).

+
path?: string

Path to serve the spec at. Defaults to /asyncapi.json.

+

A ServerBuilder (or any structurally compatible object). When set, +subscription registrations are read from the server automatically. +An explicit getSubscriptionRegistrations value takes precedence.

+
servers?: Record<string, AsyncApiServerEntry>

Server entries to include in the spec's servers map. +Keys are server IDs (e.g. 'production', 'staging').

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ServeOpenApiOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ServeOpenApiOptions.html new file mode 100644 index 00000000..a570c111 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server-openapi.ServeOpenApiOptions.html @@ -0,0 +1,21 @@ +ServeOpenApiOptions | Libraries

Options for the serveOpenApi middleware.

+

When server is provided, getRegistrations and authConfig are derived +from it automatically (unless explicitly overridden).

+
interface ServeOpenApiOptions {
    authConfig?: AuthenticationConfig | null;
    getRegistrations?: () => readonly EndpointRegistration[];
    info: OpenApiInfo;
    path?: string;
    securitySchemes?: Record<string, OpenApiSecurityScheme>;
    server?: OpenApiServer_ServerLike;
    servers?: readonly OpenApiServer[];
}
Index

Properties

authConfig?: AuthenticationConfig | null

Optional auth config for security scheme generation.

+
getRegistrations?: () => readonly EndpointRegistration[]

Function that returns endpoint registrations.

+

OpenAPI info metadata.

+
path?: string

Path to serve the spec at (default: /openapi.json).

+
securitySchemes?: Record<string, OpenApiSecurityScheme>

Override security schemes manually.

+

A ServerBuilder (or any structurally compatible object). When set, +endpoint registrations and auth config are read from the server +automatically. Explicit getRegistrations / authConfig values +take precedence.

+
servers?: readonly OpenApiServer[]

Optional server entries.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..AuthenticationConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..AuthenticationConfig.html new file mode 100644 index 00000000..23bc8f45 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..AuthenticationConfig.html @@ -0,0 +1,9 @@ +AuthenticationConfig | Libraries

Interface AuthenticationConfig

Authentication configuration passed to ServerBuilder.useAuthentication().

+

At least one scheme must be listed. The defaultScheme name must match +one of the registered scheme name values — it is used when no specific +scheme is requested.

+
interface AuthenticationConfig {
    defaultScheme: string;
    schemes: AuthenticationScheme<any>[];
}
Index

Properties

Properties

defaultScheme: string

Name of the default scheme to use (must match a scheme's name).

+
schemes: AuthenticationScheme<any>[]

Registered authentication schemes.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..AuthorizationConfig.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..AuthorizationConfig.html new file mode 100644 index 00000000..dec5d4dd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..AuthorizationConfig.html @@ -0,0 +1,6 @@ +AuthorizationConfig | Libraries

Interface AuthorizationConfig

Authorization configuration passed to ServerBuilder.useAuthorization().

+

Named policies can be referenced by string in future authorize('policy-name') +calls (currently resolved at startup time).

+
interface AuthorizationConfig {
    policies?: Record<string, (builder: PolicyBuilder) => void>;
}
Index

Properties

Properties

policies?: Record<string, (builder: PolicyBuilder) => void>

Named policies (looked up by authorize('policy-name') — future use).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CacheTagDefinition.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CacheTagDefinition.html new file mode 100644 index 00000000..1327e10e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CacheTagDefinition.html @@ -0,0 +1,7 @@ +CacheTagDefinition | Libraries

Interface CacheTagDefinition

A serialisable cache-tag definition stored on endpoint metadata.

+

properties maps human-readable key names (used as label segments +in the final cache key) to accessors that resolve the actual value +from call-time request data.

+
interface CacheTagDefinition {
    name: string;
    properties: Readonly<Record<string, CacheTagPropertyAccessor>>;
}
Index

Properties

Properties

name: string
properties: Readonly<Record<string, CacheTagPropertyAccessor>>
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CacheTagPropertyAccessor.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CacheTagPropertyAccessor.html new file mode 100644 index 00000000..b527cbc9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CacheTagPropertyAccessor.html @@ -0,0 +1,5 @@ +CacheTagPropertyAccessor | Libraries

Interface CacheTagPropertyAccessor

An accessor that can extract a property value from a structured +request root. Wraps a PropertyDescriptor's getValue +closure so the middleware layer does not need to know about schemas.

+
interface CacheTagPropertyAccessor {
    getValue(
        root: {
            body: unknown;
            headers: Record<string, string>;
            params: Record<string, unknown>;
            query: Record<string, unknown>;
        },
    ): { success: boolean; value?: unknown };
}
Index

Methods

Methods

  • Parameters

    • root: {
          body: unknown;
          headers: Record<string, string>;
          params: Record<string, unknown>;
          query: Record<string, unknown>;
      }

    Returns { success: boolean; value?: unknown }

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CallbackDefinition.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CallbackDefinition.html new file mode 100644 index 00000000..9497ae2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..CallbackDefinition.html @@ -0,0 +1,22 @@ +CallbackDefinition | Libraries

Interface CallbackDefinition<TBody>

A callback declaration for async request/response patterns.

+
interface CallbackDefinition<TBody = any> {
    body?: SchemaBuilder<any, any, any, any, any>;
    description?: string;
    expression?: string;
    method?: string;
    response?: SchemaBuilder<any, any, any, any, any>;
    summary?: string;
    urlFrom?: (
        body: TBody extends ObjectSchemaBuilder<
            any,
            any,
            any,
            any,
            any,
            {},
            [],
        >
            ? PropertyDescriptorTree<TBody, TBody>
            : PropertyRefTree<any>,
    ) => unknown;
}

Type Parameters

  • TBody = any
Index

Properties

body?: SchemaBuilder<any, any, any, any, any>

Request body schema for the callback payload.

+
description?: string

Detailed description of the callback operation.

+
expression?: string

Raw OpenAPI runtime expression for the callback URL, +e.g. '{$request.body#/callbackUrl}'. +Mutually exclusive with urlFrom.

+
method?: string

HTTP method for the callback request (default: 'POST').

+
response?: SchemaBuilder<any, any, any, any, any>

Response schema expected from the callback consumer.

+
summary?: string

Short summary of the callback operation.

+
urlFrom?: (
    body: TBody extends ObjectSchemaBuilder<any, any, any, any, any, {}, []>
        ? PropertyDescriptorTree<TBody, TBody>
        : PropertyRefTree<any>,
) => unknown

Type-safe selector for the request body field holding the callback URL. +The generator converts the selected property to a +'{$request.body#/<pointer>}' expression automatically. +Mutually exclusive with expression.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ContentTypeHandler.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ContentTypeHandler.html new file mode 100644 index 00000000..9be358fb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ContentTypeHandler.html @@ -0,0 +1,10 @@ +ContentTypeHandler | Libraries

Interface ContentTypeHandler

A pluggable serializer/deserializer for a specific MIME type. +Register instances with ServerBuilder.contentType() or +ContentNegotiator.register() to extend content negotiation.

+
const msgpackHandler: ContentTypeHandler = {
mimeType: 'application/msgpack',
serialize: (value) => encode(value),
deserialize: (raw) => decode(Buffer.from(raw))
};
server.contentType(msgpackHandler); +
+ +
interface ContentTypeHandler {
    mimeType: string;
    deserialize(raw: string): unknown;
    serialize(value: unknown): string;
}
Index

Properties

Methods

Properties

mimeType: string

Methods

diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..EndpointMetadata.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..EndpointMetadata.html new file mode 100644 index 00000000..3b94f4e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..EndpointMetadata.html @@ -0,0 +1,63 @@ +EndpointMetadata | Libraries

Interface EndpointMetadata

Snapshot of all configuration set on an EndpointBuilder. +Used by the server for routing and by @cleverbrush/server-openapi for +spec generation.

+
interface EndpointMetadata {
    authRoles: readonly string[] | null;
    basePath: string;
    bodySchema: SchemaBuilder<any, any, any, any, any> | null;
    cacheTags: readonly CacheTagDefinition[];
    callbacks: Record<string, CallbackDefinition<any>> | null;
    deprecated: boolean;
    description: string | null;
    example: unknown;
    examples:
        | Record<
            string,
            { description?: string; summary?: string; value: unknown },
        >
        | null;
    externalDocs: { description?: string; url: string } | null;
    fileUpload: UploadOptions | null;
    headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    links: Record<string, LinkDefinition<any>> | null;
    method: string;
    operationId: string | null;
    pathTemplate: RoutePath;
    produces:
        | Record<string, { schema?: SchemaBuilder<any, any, any, any, any> }>
        | null;
    producesFile: { contentType?: string; description?: string } | null;
    querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    responseHeaderSchema:
        | ObjectSchemaBuilder<any, any, any, any, any, any, any>
        | null;
    responseSchema: SchemaBuilder<any, any, any, any, any> | null;
    responsesSchemas:
        | Record<number, SchemaBuilder<any, any, any, any, any> | null>
        | null;
    serviceSchemas:
        | Record<string, SchemaBuilder<any, any, any, any, any>>
        | null;
    summary: string | null;
    tags: readonly string[];
}
Index

Properties

authRoles: readonly string[] | null

Authorization roles required for this endpoint.

+
    +
  • null → no authorization required (public)
  • +
  • [] → any authenticated user
  • +
  • ['admin', ...] → user must have at least one of these roles
  • +
+
basePath: string
bodySchema: SchemaBuilder<any, any, any, any, any> | null
cacheTags: readonly CacheTagDefinition[]

Cache tags declared via .clearsCacheTag(), providing tag-based cache +key computation for the client middleware.

+
callbacks: Record<string, CallbackDefinition<any>> | null

Callbacks declared via .callbacks(), emitted as callbacks on the +OpenAPI Operation Object.

+
deprecated: boolean
description: string | null
example: unknown

A single example value for the request body, emitted as example on the +OpenAPI Media Type Object.

+
examples:
    | Record<
        string,
        { description?: string; summary?: string; value: unknown },
    >
    | null

A map of named examples for the request body, emitted as examples on the +OpenAPI Media Type Object. Each entry follows the OpenAPI Example Object shape.

+
externalDocs: { description?: string; url: string } | null

External documentation URL for this operation, emitted as externalDocs +on the OpenAPI Operation Object.

+
fileUpload: UploadOptions | null

When set, the endpoint accepts multipart/form-data uploads. +The configuration controls max file size, allowed MIME types, etc.

+

EndpointBuilder.upload()

+
headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
links: Record<string, LinkDefinition<any>> | null

Response links declared via .links(), emitted under the primary +success response's links map in the OpenAPI spec.

+
method: string
operationId: string | null
pathTemplate: RoutePath
produces:
    | Record<string, { schema?: SchemaBuilder<any, any, any, any, any> }>
    | null

Multiple response content types for content-negotiated endpoints. +Keys are MIME types; an optional schema overrides the default response +schema for that content type. When set alongside .producesFile(), +producesFile takes precedence.

+
producesFile: { contentType?: string; description?: string } | null

When set, the endpoint produces a binary file response instead of JSON. +The OpenAPI spec will emit the appropriate binary content type.

+
querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
responseHeaderSchema:
    | ObjectSchemaBuilder<any, any, any, any, any, any, any>
    | null

Schema describing response headers emitted on every response code. +Each property in the object schema becomes a header name with its +sub-schema and optional description.

+
responseSchema: SchemaBuilder<any, any, any, any, any> | null
responsesSchemas:
    | Record<number, SchemaBuilder<any, any, any, any, any> | null>
    | null

Per-status-code response schemas declared via .responses(). +When non-null, takes precedence over responseSchema for OpenAPI generation +and constrains the handler return type to the declared codes. +A null schema value means the response has no body (e.g. 204).

+
serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null
summary: string | null
tags: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..EndpointRegistration.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..EndpointRegistration.html new file mode 100644 index 00000000..cb115f5c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..EndpointRegistration.html @@ -0,0 +1,6 @@ +EndpointRegistration | Libraries

Interface EndpointRegistration

A registered endpoint pairing its metadata (method, path, schemas) with +the handler function and any per-endpoint middleware.

+
interface EndpointRegistration {
    endpoint: EndpointMetadata;
    handler: (...args: any[]) => any;
    middlewares?: readonly Middleware[];
}
Index

Properties

handler: (...args: any[]) => any
middlewares?: readonly Middleware[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..FilePart.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..FilePart.html new file mode 100644 index 00000000..f943f13b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..FilePart.html @@ -0,0 +1,10 @@ +FilePart | Libraries

Interface FilePart

Represents a single uploaded file from a multipart/form-data request.

+
interface FilePart {
    buffer: Buffer;
    filename: string;
    mimeType: string;
    size: number;
}
Index

Properties

Properties

buffer: Buffer

Full file contents as a Buffer.

+
filename: string

Original filename as provided by the client.

+
mimeType: string

MIME type of the file (e.g. 'image/jpeg').

+
size: number

File size in bytes.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..HandlerMapping.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..HandlerMapping.html new file mode 100644 index 00000000..bb4d2caa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..HandlerMapping.html @@ -0,0 +1,5 @@ +HandlerMapping | Libraries

Interface HandlerMapping

The opaque result of mapHandlers. Passed to +ServerBuilder.handleAll() to register every endpoint at once.

+
interface HandlerMapping {
    _entries: readonly {
        endpoint: AnyEndpoint;
        handler: (...args: any[]) => any;
        middlewares?: Middleware[];
    }[];
    _subscriptions: readonly {
        endpoint: AnySubscriptionBuilder;
        handler: (...args: any[]) => any;
        middlewares?: Middleware[];
    }[];
}
Index

Properties

_entries: readonly {
    endpoint: AnyEndpoint;
    handler: (...args: any[]) => any;
    middlewares?: Middleware[];
}[]
_subscriptions: readonly {
    endpoint: AnySubscriptionBuilder;
    handler: (...args: any[]) => any;
    middlewares?: Middleware[];
}[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..LinkDefinition.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..LinkDefinition.html new file mode 100644 index 00000000..14ea007f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..LinkDefinition.html @@ -0,0 +1,18 @@ +LinkDefinition | Libraries

Interface LinkDefinition<TResponse>

A link from a response to a follow-up operation.

+
interface LinkDefinition<TResponse = any> {
    description?: string;
    operationId: string;
    parameters?:
        | Record<string, string>
        | (
            (
                response: TResponse extends ObjectSchemaBuilder<
                    any,
                    any,
                    any,
                    any,
                    any,
                    {},
                    [],
                >
                    ? PropertyDescriptorTree<TResponse, TResponse>
                    : PropertyRefTree<any>,
            ) => Record<string, unknown>
        );
    requestBody?: string;
}

Type Parameters

  • TResponse = any
Index

Properties

description?: string

Human-readable description of the link relationship.

+
operationId: string

operationId of the target operation.

+
parameters?:
    | Record<string, string>
    | (
        (
            response: TResponse extends ObjectSchemaBuilder<
                any,
                any,
                any,
                any,
                any,
                {},
                [],
            >
                ? PropertyDescriptorTree<TResponse, TResponse>
                : PropertyRefTree<any>,
        ) => Record<string, unknown>
    )

Map of target parameter names to values.

+
    +
  • Record<string, string> — raw OpenAPI runtime expressions such as +'$response.body#/id'.
  • +
  • Callback (response: PropertyRefTree<TResponse>) => Record<string, unknown> — +type-safe selector; properties accessed on response are converted to +$response.body#/<pointer> expressions automatically.
  • +
+
requestBody?: string

Runtime expression or literal for the linked operation's request body.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ProblemDetails.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ProblemDetails.html new file mode 100644 index 00000000..f679cc1e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ProblemDetails.html @@ -0,0 +1,10 @@ +ProblemDetails | Libraries

Interface ProblemDetails

An RFC 9457 (formerly RFC 7807) Problem Details object.

+

Provides machine-readable error information in HTTP API responses. +Serialized as application/problem+json.

+
interface ProblemDetails {
    detail?: string;
    instance?: string;
    status: number;
    title: string;
    type: string;
    readonly [extension: string]: unknown;
}

Indexable

  • readonly [extension: string]: unknown
Index

Properties

detail?: string
instance?: string
status: number
title: string
type: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..RejectedFile.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..RejectedFile.html new file mode 100644 index 00000000..3f7744d5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..RejectedFile.html @@ -0,0 +1,8 @@ +RejectedFile | Libraries

Interface RejectedFile

Describes a file that was rejected during multipart parsing.

+
interface RejectedFile {
    filename: string;
    mimeType: string;
    reason: string;
}
Index

Properties

Properties

filename: string

Original filename as provided by the client.

+
mimeType: string

MIME type of the file (e.g. 'application/xlsx').

+
reason: string

Human-readable reason the file was rejected.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerBatchingOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerBatchingOptions.html new file mode 100644 index 00000000..3a502a47 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerBatchingOptions.html @@ -0,0 +1,31 @@ +ServerBatchingOptions | Libraries

Interface ServerBatchingOptions

Configuration for the server-side request batching endpoint, enabled via +ServerBuilder.useBatching().

+

The batch endpoint accepts POST <path> with a JSON body containing an +array of sub-requests. It processes each through the full middleware and +handler pipeline, then returns an array of sub-responses in a single reply.

+
new ServerBuilder()
.useBatching({ path: '/__batch', maxSize: 20, parallel: true })
.handleAll(mapping)
.listen(3000); +
+ +
interface ServerBatchingOptions {
    maxSize?: number;
    parallel?: boolean;
    path?: string;
}
Index

Properties

Properties

maxSize?: number

Maximum number of sub-requests allowed per batch.

+

Requests exceeding this limit are rejected with 400 Bad Request.

+
20
+
+ +
parallel?: boolean

Whether to execute sub-requests in parallel (true) or sequentially +(false).

+

Parallel execution is faster but requires all handlers to be +concurrency-safe. Set to false if your handlers share mutable +request-scoped state that would cause conflicts when run concurrently.

+
true
+
+ +
path?: string

URL path of the batch endpoint.

+

Must match the batchPath configured on the client-side +batching() middleware.

+
'/__batch'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerCacheOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerCacheOptions.html new file mode 100644 index 00000000..302216e6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerCacheOptions.html @@ -0,0 +1,7 @@ +ServerCacheOptions | Libraries

Interface ServerCacheOptions

Configuration for cacheResponse.

+
interface ServerCacheOptions {
    defaultTtl?: number;
    ttlByTag?: Record<string, number>;
}
Index

Properties

Properties

defaultTtl?: number

Default TTL in milliseconds for tags without an explicit TTL. +Defaults to 60000 (60 seconds).

+
ttlByTag?: Record<string, number>

Per-tag TTL overrides: { [tagName]: ttlMs }.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerIdempotencyOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerIdempotencyOptions.html new file mode 100644 index 00000000..b110444d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerIdempotencyOptions.html @@ -0,0 +1,11 @@ +ServerIdempotencyOptions | Libraries

Interface ServerIdempotencyOptions

Configuration for idempotency.

+
interface ServerIdempotencyOptions {
    headerName?: string;
    skip?: (ctx: RequestContext) => boolean;
    ttl?: number;
}
Index

Properties

Properties

headerName?: string

Header name to read the idempotency key from. +Defaults to "x-idempotency-key".

+
skip?: (ctx: RequestContext) => boolean

Predicate that decides whether a request should be skipped. +Defaults to skipping non-mutating requests (GET, HEAD, OPTIONS).

+
ttl?: number

TTL in milliseconds for stored responses. +Defaults to 86_400_000 (24 hours).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerOptions.html new file mode 100644 index 00000000..b74d8766 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ServerOptions.html @@ -0,0 +1,13 @@ +ServerOptions | Libraries

Interface ServerOptions

Configuration options passed to ServerBuilder.listen() or the Server +constructor. All fields are optional; sensible defaults are applied.

+
interface ServerOptions {
    host?: string;
    https?: { cert: string; key: string };
    maxBodySize?: number;
    port?: number;
}
Index

Properties

host?: string
https?: { cert: string; key: string }
maxBodySize?: number

Maximum allowed size (in bytes) for incoming request bodies, batch +payloads, and WebSocket messages.

+

Requests that exceed this limit are rejected with 413 Payload Too Large.

+
5_242_880 (5 MB)
+
+ +
port?: number
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..SubscriptionMetadata.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..SubscriptionMetadata.html new file mode 100644 index 00000000..d16dc6c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..SubscriptionMetadata.html @@ -0,0 +1,20 @@ +SubscriptionMetadata | Libraries

Interface SubscriptionMetadata

Snapshot of all configuration set on a SubscriptionBuilder. +Used by the server for WebSocket upgrade handling and by documentation +generators for AsyncAPI / OpenAPI spec output.

+
interface SubscriptionMetadata {
    authRoles: readonly string[] | null;
    basePath: string;
    deprecated: boolean;
    description: string | null;
    externalDocs: { description?: string; url: string } | null;
    headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    incomingSchema: SchemaBuilder<any, any, any, any, any> | null;
    operationId: string | null;
    outgoingSchema: SchemaBuilder<any, any, any, any, any> | null;
    pathTemplate: RoutePath;
    protocol: "subscription";
    querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    serviceSchemas:
        | Record<string, SchemaBuilder<any, any, any, any, any>>
        | null;
    summary: string | null;
    tags: readonly string[];
}
Index

Properties

authRoles: readonly string[] | null
basePath: string
deprecated: boolean
description: string | null
externalDocs: { description?: string; url: string } | null
headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
incomingSchema: SchemaBuilder<any, any, any, any, any> | null
operationId: string | null
outgoingSchema: SchemaBuilder<any, any, any, any, any> | null
pathTemplate: RoutePath
protocol: "subscription"

Always 'subscription'. Distinguishes from HTTP endpoint metadata.

+
querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null
summary: string | null
tags: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..SubscriptionRegistration.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..SubscriptionRegistration.html new file mode 100644 index 00000000..1b311bc3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..SubscriptionRegistration.html @@ -0,0 +1,6 @@ +SubscriptionRegistration | Libraries

Interface SubscriptionRegistration

A registered subscription pairing its metadata with the async generator +handler and any per-subscription middleware.

+
interface SubscriptionRegistration {
    endpoint: SubscriptionMetadata;
    handler: (...args: any[]) => any;
    middlewares?: readonly Middleware[];
}
Index

Properties

handler: (...args: any[]) => any
middlewares?: readonly Middleware[]
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..TrackedEvent.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..TrackedEvent.html new file mode 100644 index 00000000..60cf50c4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..TrackedEvent.html @@ -0,0 +1,11 @@ +TrackedEvent | Libraries

Interface TrackedEvent<T>

A server-sent event wrapped with a unique ID for resumable subscriptions.

+

When a client reconnects, it can send the last received event ID so the +server resumes from that point instead of replaying everything.

+

tracked

+
interface TrackedEvent<T = unknown> {
    "[TRACKED_SYMBOL]": true;
    data: T;
    id: string;
}

Type Parameters

  • T = unknown
Index

Properties

Properties

"[TRACKED_SYMBOL]": true

Brand marker.

+
data: T

The actual event payload.

+
id: string

Unique event identifier for resume tracking.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..UploadOptions.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..UploadOptions.html new file mode 100644 index 00000000..f5a135f3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..UploadOptions.html @@ -0,0 +1,16 @@ +UploadOptions | Libraries

Interface UploadOptions

Configuration for file upload endpoints declared via +EndpointBuilder.upload().

+
interface UploadOptions {
    allowedMimeTypes?: string[];
    maxFileCount?: number;
    maxFileSize?: number;
}
Index

Properties

allowedMimeTypes?: string[]

Allowed MIME types or patterns (e.g. 'image/*', 'application/pdf'). +When not set, all MIME types are accepted.

+
maxFileCount?: number

Maximum number of files allowed in a single request.

+
10
+
+ +
maxFileSize?: number

Maximum allowed file size per uploaded file in bytes.

+
10_485_760 (10 MB)
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ValidationErrorItem.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ValidationErrorItem.html new file mode 100644 index 00000000..bd4a5a79 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..ValidationErrorItem.html @@ -0,0 +1,8 @@ +ValidationErrorItem | Libraries

Interface ValidationErrorItem

A single field-level validation error, used in validation Problem Details +responses. pointer follows JSON Pointer syntax (RFC 6901).

+
`{ pointer: '/body/email', detail: 'Must be a valid email address' }`
+
+ +
interface ValidationErrorItem {
    detail: string;
    pointer: string;
}
Index

Properties

Properties

detail: string
pointer: string
diff --git a/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..WebhookDefinition.html b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..WebhookDefinition.html new file mode 100644 index 00000000..29c6e80c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/interfaces/_cleverbrush_server..WebhookDefinition.html @@ -0,0 +1,22 @@ +WebhookDefinition | Libraries

Interface WebhookDefinition

Describes an out-of-band webhook that your API can send to consumers.

+

Pass instances to ServerBuilder.webhook() so that +@cleverbrush/server-openapi can emit them inside the webhooks map of +the generated OpenAPI document.

+
const userCreatedWebhook = defineWebhook('userCreated', {
method: 'POST',
summary: 'Fired when a new user is created',
body: object({ id: number(), email: string() }),
}); +
+ +
interface WebhookDefinition {
    body?: SchemaBuilder<any, any, any, any, any>;
    description?: string;
    method?: string;
    name: string;
    response?: SchemaBuilder<any, any, any, any, any>;
    summary?: string;
    tags?: readonly string[];
}
Index

Properties

body?: SchemaBuilder<any, any, any, any, any>

Schema describing the webhook request payload.

+
description?: string

Longer description for OpenAPI documentation. Supports Markdown.

+
method?: string

HTTP method sent to the consumer endpoint (default: 'POST').

+
name: string

Unique webhook name used as the key in the webhooks map.

+
response?: SchemaBuilder<any, any, any, any, any>

Schema describing the expected response from the consumer.

+
summary?: string

Short summary for OpenAPI documentation.

+
tags?: readonly string[]

Tags to group this webhook in generated documentation.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/media/CONTRIBUTING.md b/websites/docs/public/api-docs/v4.3.1/media/CONTRIBUTING.md new file mode 100644 index 00000000..6abba706 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/media/CONTRIBUTING.md @@ -0,0 +1,125 @@ +# Contributing to @cleverbrush/framework + +Thanks for your interest in contributing! This guide will help you get started. + +## Prerequisites + +- **Node.js** 20 or later (22 recommended — see `.nvmrc`) +- **npm** (ships with Node) + +## Getting Started + +```bash +# Clone the repo +git clone https://github.com/cleverbrush/framework.git +cd framework + +# Install dependencies +npm ci + +# Build all packages +npm run build + +# Run tests & typechecks +npm run test +``` + +## Monorepo Structure + +This project uses **npm workspaces** with **Turborepo** for orchestration. All packages live under `libs/`: + +| Package | Description | +| --- | --- | +| `@cleverbrush/schema` | Type-safe schema validation with immutable builders | +| `@cleverbrush/deep` | Deep equality & deep extend utilities | +| `@cleverbrush/async` | Async utilities (Collector, debounce, throttle, retry) | +| `@cleverbrush/mapper` | Schema-driven object mapping | +| `@cleverbrush/react-form` | React form library powered by schema PropertyDescriptors | +| `@cleverbrush/scheduler` | Cron-like job scheduler with schema-validated config | +| `@cleverbrush/knex-clickhouse` | Knex dialect for ClickHouse | + +## Development Workflow + +### Code Style + +[Biome](https://biomejs.dev) handles both formatting and linting: + +```bash +# Check for lint/format issues +npm run lint + +# Auto-fix issues +npm run lint:fix +``` + +### Testing + +Tests use [Vitest](https://vitest.dev) and are co-located with source files (`*.test.ts`): + +```bash +# Run all tests with typechecking +npm run test + +# Run tests for a specific package +npx vitest --run libs/schema +``` + +### Building + +```bash +# Build all packages (respects dependency order via Turbo) +npm run build + +# Clean all build artifacts +npm run clean +``` + +## Adding a Schema Extension + +The extension system is the primary way to add new validators. See `libs/schema/src/extensions/` for examples. + +1. Create your extension file (e.g. `libs/schema/src/extensions/myExtension.ts`) +2. Export extension functions that call the builder's `.extend()` method +3. Add tests in a co-located `*.test.ts` file +4. Re-export from `libs/schema/src/extensions/index.ts` + +Look at `libs/schema/src/extensions/string.ts` for a complete example of how extensions add validators like `email()`, `url()`, `uuid()`, etc. + +## Adding a New Builder + +Builders live in `libs/schema/src/builders/`. Each builder extends the base `SchemaBuilder` class. + +1. Create your builder file in `libs/schema/src/builders/` +2. Extend `SchemaBuilder` with appropriate type parameters +3. Add a factory function (e.g. `myType()`) and export it +4. Add comprehensive tests in a co-located `*.test.ts` file +5. Export from `libs/schema/src/index.ts` + +## Pull Request Process + +1. **Fork** the repo and create a feature branch from `master` +2. Make your changes with tests +3. **Add a changeset** — every PR that changes package behavior needs one: + ```bash + npx changeset + ``` + Follow the prompts to select affected packages and describe the change. +4. Ensure all checks pass: + ```bash + npm run lint + npm run build + npm run test + ``` +5. Open a PR against `master` + +### Changeset Guidelines + +- **patch** — bug fixes, internal refactors with no API change +- **minor** — new features, new extensions, new builders +- **major** — breaking API changes + +All packages are versioned together (fixed release group), so a single changeset covers all packages. + +## Questions? + +Open a [GitHub issue](https://github.com/cleverbrush/framework/issues) — we're happy to help. diff --git a/websites/docs/public/api-docs/v4.3.1/media/LICENSE b/websites/docs/public/api-docs/v4.3.1/media/LICENSE new file mode 100644 index 00000000..0b842d4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/media/LICENSE @@ -0,0 +1,52 @@ +Cleverbrush Framework is dual-licensed under both the "Unlicense" and the +"Zero-Clause BSD" (0BSD) licenses. The intent of this dual-licensing +structure is to make Cleverbrush Framework as consumable as possible in as many +environments / countries / companies as possible without encumbering +users. + +This license applies to all of the Cleverbrush Framework source code, build code, +and tests. + +The text of the two licenses follows below: + +============================== UNLICENSE ============================== + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + +================================ 0BSD ================================= + +Copyright (C) 2024 by Andrew Zolotuhkin + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.1/media/ci.yml b/websites/docs/public/api-docs/v4.3.1/media/ci.yml new file mode 100644 index 00000000..5c9af5d0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/media/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ci: + name: Lint, Build & Test (Node ${{ matrix.node }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: [24] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Build + run: npm run build + + - name: Typecheck schema site + run: npm run typecheck:schema-site + + - name: Typecheck docs site + run: npm run typecheck:docs-site + + - name: Test & Typecheck + run: npm run test diff --git a/websites/docs/public/api-docs/v4.3.1/modules.html b/websites/docs/public/api-docs/v4.3.1/modules.html new file mode 100644 index 00000000..8ed1885c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules.html @@ -0,0 +1 @@ +Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_async.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_async.html new file mode 100644 index 00000000..2fd8edeb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_async.html @@ -0,0 +1,202 @@ +@cleverbrush/async | Libraries

Module @cleverbrush/async

@cleverbrush/async

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A set of simple utilities for working with asynchronous operations.

+ +
npm install @cleverbrush/async
+
+ + +
import { Collector, debounce, throttle, retry, withTimeout, dedupe } from '@cleverbrush/async';
+
+ + + +

Collects a set of named values and emits an event when all items have been collected. Extends EventEmitter. The constructor accepts a list of keys to collect and an optional timeout in milliseconds.

+
type Person = {
firstName: string;
lastName: string;
};

const collector = new Collector<Person>(['firstName', 'lastName'], 10000);

collector.on('end', (collectedObject: Person) => {
console.log(collectedObject);
});

collector.on('timeout', (collectedData: Partial<Person>) => {
// timeout reached before all items were collected
});

collector.collect('firstName', 'John');
collector.collect('lastName', 'Smith'); +
+ +

The Collector can also be used with a Promise-based approach:

+
const collector = new Collector<Person>(['firstName', 'lastName'], 10000);
const promise = collector.toPromise();

collector.collect('firstName', 'John').collect('lastName', 'Smith');

try {
const person: Person = await promise;
} catch (e) {
// timeout or error occurred
} +
+ + +

Ensures a function is only called after a specified delay since the last invocation. Useful for handling rapid user input such as search fields or window resizing.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
func(...args) => voidThe function to debounce
waitnumberDelay in milliseconds
opts.immediatebooleanIf true, calls the function immediately on the first invocation, then debounces subsequent calls. Default: false
+
import { debounce } from '@cleverbrush/async';

const debouncedSearch = debounce((query: string) => {
// perform search
}, 300);

// called rapidly, but only the last call executes after 300ms of inactivity
debouncedSearch('h');
debouncedSearch('he');
debouncedSearch('hello'); +
+ + +

Ensures a function is called at most once per specified interval. Unlike debounce, it guarantees regular execution during sustained activity.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
func(...args) => voidThe function to throttle
limitnumberMinimum interval in milliseconds between calls
+
import { throttle } from '@cleverbrush/async';

const throttledResize = throttle(() => {
// handle resize
}, 200);

window.addEventListener('resize', throttledResize); +
+ + +

Retries an async function with exponential backoff on failure. Returns the result of the first successful attempt.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
fn() => Promise<T>The async function to retry
options.maxRetriesnumber3Maximum number of retry attempts
options.minDelaynumber100Minimum delay in milliseconds before the first retry
options.delayFactornumber2Multiplier applied to the delay after each retry
options.delayRandomizationPercentnumber0Randomization factor (01) added to each delay
options.shouldRetry(error) => booleanOptional predicate to decide whether to retry a given error
+
import { retry } from '@cleverbrush/async';

const data = await retry(
() => fetch('https://api.example.com/data').then((r) => r.json()),
{
maxRetries: 5,
minDelay: 200,
delayFactor: 2,
shouldRetry: (err) => err.status !== 404
}
); +
+ + +

Wraps a promise-returning function with a timeout. If the function does not resolve within ms milliseconds, the returned promise rejects with a TimeoutError and the internal AbortSignal is triggered.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn(signal: AbortSignal) => Promise<T>The async function to wrap. Receives an AbortSignal that fires on timeout.
msnumberTimeout in milliseconds
+
import { withTimeout } from '@cleverbrush/async';

const data = await withTimeout(
(signal) => fetch('/api/slow', { signal }).then(r => r.json()),
5000
); +
+ + +

Deduplicates concurrent calls to the same async function. If a call with the same key is already in-flight, returns the existing promise instead of starting a new one.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyFn(...args) => stringComputes a cache key from the arguments
fn(...args) => Promise<T>The async function to wrap
+
import { dedupe } from '@cleverbrush/async';

const fetchUser = dedupe(
(id: number) => `user-${id}`,
(id: number) => fetch(`/api/users/${id}`).then(r => r.json())
);

// These two concurrent calls share a single fetch:
const [a, b] = await Promise.all([fetchUser(1), fetchUser(1)]); +
+ + +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode
  • +
  • Unit tests: Vitest — covering Collector event/promise modes, debounce/throttle timing, and retry back-off logic
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Classes

Collector
TimeoutError

Functions

debounce
dedupe
retry
throttle
withTimeout
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_auth.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_auth.html new file mode 100644 index 00000000..84bb4571 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_auth.html @@ -0,0 +1,52 @@ +@cleverbrush/auth | Libraries

Module @cleverbrush/auth

@cleverbrush/auth

+

CI +License: BSD-3-Clause

+

Transport-agnostic authentication and authorization for TypeScript. Ships with JWT and cookie schemes, a fluent policy builder, and a typed Principal value object. Designed for @cleverbrush/server but usable in any Node.js context.

+ +
    +
  • Transport-agnostic — authentication schemes receive a plain AuthenticationContext (headers + cookies + items), not a raw HTTP request.
  • +
  • Principal<T> — immutable, typed value object exposing .hasRole(), .hasClaim(), .isAuthenticated, and .claims.
  • +
  • JWT schemejwtScheme() supports HS256/HS384/HS512 and RS256/RS384/RS512; configurable issuer, audience, clock tolerance, and role claim.
  • +
  • Cookie schemecookieScheme() with a user-supplied async validate() function (session lookup, signature check, etc.).
  • +
  • AuthorizationPolicyBuilder with .requireRole() / .require(predicate) fluent API; AuthorizationService.authorize() accepts requirements or a named policy.
  • +
  • requireRole() helper — convenience factory for single-call role requirements.
  • +
  • Cookie utilitiesparseCookies() and serializeCookie() for low-level cookie handling.
  • +
  • Zero runtime dependencies — uses only Node.js built-in crypto.
  • +
+ +
npm install @cleverbrush/auth
+
+ + +
import { jwtScheme, Principal } from '@cleverbrush/auth';

type UserClaims = { sub: string; role: string };

const jwt = jwtScheme<UserClaims>({
secret: process.env.JWT_SECRET!,
mapClaims: claims => ({
sub: claims.sub as string,
role: claims.role as string
})
});

// Authenticate a request context (built from HTTP headers)
const result = await jwt.authenticate({
headers: { authorization: 'Bearer <token>' },
cookies: {},
items: new Map()
});

if (result.succeeded) {
const principal: Principal<UserClaims> = result.principal;
principal.isAuthenticated; // true
principal.hasRole('admin'); // boolean
principal.value.sub; // string
} +
+ + +
import { jwtScheme, signJwt } from '@cleverbrush/auth';

// Sign a token (for testing or token issuance)
const token = signJwt({ sub: 'user-1', role: 'admin' }, 'my-secret');

// Verify and authenticate
const scheme = jwtScheme({
secret: 'my-secret',
algorithms: ['HS256'], // default
issuer: 'https://my-app.com', // optional iss check
audience: 'my-api', // optional aud check
clockTolerance: 5, // seconds
roleClaim: 'role', // default
mapClaims: c => ({ sub: c.sub as string, role: c.role as string })
}); +
+ +

Supported algorithms: HS256, HS384, HS512, RS256, RS384, RS512.

+ +
import { cookieScheme } from '@cleverbrush/auth';

const cookie = cookieScheme<{ userId: string; role: string }>({
cookieName: 'session',
validate: async (cookieValue) => {
// Look up session from DB, verify signature, etc.
const session = await sessionStore.get(cookieValue);
if (!session) return null;
return { userId: session.userId, role: session.role };
}
}); +
+ + + +
import { PolicyBuilder, requireRole } from '@cleverbrush/auth';

const adminPolicy = new PolicyBuilder()
.requireRole('admin')
.require(principal => principal.hasClaim('verified', 'true'))
.build('admin-only'); +
+ + +
import { AuthorizationService } from '@cleverbrush/auth';

const policies = new Map([['admin-only', adminPolicy]]);
const authz = new AuthorizationService(policies);

// Check by requirements array
const result = await authz.authorize(principal, [requireRole('admin')]);

// Check by named policy
const result2 = await authz.authorize(principal, 'admin-only');

if (!result.allowed) {
console.log(result.reason); // 'Not authenticated' | 'Forbidden'
} +
+ + +
import { parseCookies, serializeCookie } from '@cleverbrush/auth';

// Parse Cookie header
const cookies = parseCookies('session=abc123; theme=dark');
// { session: 'abc123', theme: 'dark' }

// Build Set-Cookie header value
const header = serializeCookie('session', 'abc123', {
httpOnly: true,
secure: true,
sameSite: 'Lax',
maxAge: 3600
}); +
+ + +
import { ServerBuilder } from '@cleverbrush/server';
import { jwtScheme } from '@cleverbrush/auth';

const server = new ServerBuilder();

server
.useAuthentication({
defaultScheme: 'jwt',
schemes: [jwtScheme({ secret: process.env.JWT_SECRET!, mapClaims: c => c })]
})
.useAuthorization();

await server.listen(3000); +
+ + +

BSD-3-Clause — see LICENSE.

+

Classes

AuthorizationService
PolicyBuilder
Principal

Interfaces

AuthenticationContext
AuthenticationScheme
AuthorizationCodeSchemeOptions
AuthorizationPolicy
ClientCredentialsSchemeOptions
CookieOptions
CookieSchemeOptions
JwtPayload
JwtSchemeOptions
OAuthFlow
OAuthFlows
OidcSchemeOptions

Type Aliases

AuthenticationResult
AuthorizationRequirement
AuthorizationResult

Functions

authorizationCodeScheme
clientCredentialsScheme
cookieScheme
defineRoles
jwtScheme
oidcScheme
parseCookies
requireRole
serializeCookie
signJwt
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client..html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client..html new file mode 100644 index 00000000..1d0e3169 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client..html @@ -0,0 +1,6 @@ + | Libraries

@cleverbrush/client — typed HTTP client for @cleverbrush/server API contracts.

+

For React + TanStack Query hooks, import from @cleverbrush/client/react.

+
import { createClient } from '@cleverbrush/client';
import { api } from 'todo-shared';

const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
});

const todos = await client.todos.list(); +
+ +

Classes

ApiError
NetworkError
OfflineError
TimeoutError
WebError

Interfaces

ClientHooks
ClientOptions
EndpointMeta
FilePart
PerCallOverrides
Subscription

Type Aliases

ApiContract
EndpointCall
EndpointCallArgs
EndpointResponse
FetchLike
Middleware
SubscriptionCall
SubscriptionCallArgs
SubscriptionIncoming
SubscriptionOutgoing
TypedClient

Variables

PER_CALL_OPTIONS

Functions

composeMiddleware
createClient
getPerCallOptions
isApiError
isNetworkError
isOfflineError
isTimeoutError
isWebError
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.batching.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.batching.html new file mode 100644 index 00000000..7f3ec275 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.batching.html @@ -0,0 +1 @@ +batching | Libraries

Interfaces

BatchingOptions

Functions

batching
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.cache.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.cache.html new file mode 100644 index 00000000..dea59abc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.cache.html @@ -0,0 +1 @@ +cache | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.dedupe.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.dedupe.html new file mode 100644 index 00000000..aaf96f2e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.dedupe.html @@ -0,0 +1 @@ +dedupe | Libraries

Interfaces

DedupeOptions

Functions

dedupe
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.html new file mode 100644 index 00000000..16505a02 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.html @@ -0,0 +1,692 @@ +@cleverbrush/client | Libraries

Module @cleverbrush/client

@cleverbrush/client

+

Typed HTTP client for @cleverbrush/server API contracts — zero codegen, full type safety. Optional React + TanStack Query integration via @cleverbrush/client/react.

+ +

@cleverbrush/client provides a Proxy-based HTTP client that infers all endpoint types (params, body, query, headers, responses) from an API contract defined with defineApi() from @cleverbrush/server/contract. No code generation or manual type annotations are needed.

+

The optional /react subpath adds TanStack Query hooks to the same client, so every endpoint is both a callable function and a hook provider.

+ + +
// packages/shared/src/contract.ts
import { defineApi, endpoint, route } from '@cleverbrush/server/contract';
import { array, number, object, string, boolean } from '@cleverbrush/schema';

const TodoSchema = object({ id: number(), title: string(), completed: boolean() });
const todosResource = endpoint.resource('/api/todos');
const ById = route({ id: number().coerce() })`/${t => t.id}`;

export const api = defineApi({
todos: {
list: todosResource.get()
.query(object({ page: number().optional(), limit: number().optional() }))
.responses({ 200: array(TodoSchema) }),
get: todosResource.get(ById)
.responses({ 200: TodoSchema }),
create: todosResource.post()
.body(object({ title: string() }))
.responses({ 201: TodoSchema }),
delete: todosResource.delete(ById)
.responses({ 204: null }),
},
auth: {
login: endpoint.post('/api/auth/login')
.body(object({ email: string(), password: string() }))
.responses({ 200: object({ token: string() }) }),
},
}); +
+ + +
// Framework-agnostic (works in any JS runtime)
import { createClient } from '@cleverbrush/client';
import { api } from 'shared/contract';

export const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
onUnauthorized: () => { window.location.href = '/login'; },
}); +
+ +

Or with React + TanStack Query hooks:

+
// React — adds useQuery, useMutation, etc. to every endpoint
import { createClient } from '@cleverbrush/client/react';
import { api } from 'shared/contract';

export const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
}); +
+ + +
// Direct fetch (both clients)
const todos = await client.todos.list({ query: { page: 1, limit: 10 } });
// ^? TodoResponse[]

const todo = await client.todos.get({ params: { id: 1 } });
// ^? TodoResponse

const created = await client.todos.create({ body: { title: 'Buy milk' } });
// ^? TodoResponse

await client.todos.delete({ params: { id: 1 } });
// ^? undefined (204 No Content) +
+ +
// React hooks (react client only)
function TodoList() {
const { data, isLoading } = client.todos.list.useQuery();

if (isLoading) return <p>Loading…</p>;
return <ul>{data?.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
} +
+ + + +

Creates a typed HTTP client from an API contract.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contractApiContractContract created with defineApi()
options.baseUrlstringBase URL prepended to every request (default: '')
options.getToken() => string | nullReturns auth token for Authorization: Bearer header
options.onUnauthorized() => voidCalled on 401 responses
options.fetchtypeof fetchCustom fetch implementation (default: globalThis.fetch)
options.headersRecord<string, string>Extra headers sent with every request
options.middlewaresMiddleware[]Middleware functions that wrap the fetch call
options.hooksClientHooksLifecycle hooks invoked at various stages of a request
+ +

Middlewares wrap the fetch call, allowing you to intercept, modify, or short-circuit requests and responses. They compose like an onion — the first middleware in the array is the outermost wrapper.

+
import { createClient } from '@cleverbrush/client';
import { retry } from '@cleverbrush/client/retry';
import { timeout } from '@cleverbrush/client/timeout';
import { dedupe } from '@cleverbrush/client/dedupe';
import { throttlingCache } from '@cleverbrush/client/cache';

const client = createClient(api, {
baseUrl: 'https://api.example.com',
middlewares: [
retry({ limit: 3 }),
timeout({ timeout: 10000 }),
dedupe(),
throttlingCache({ throttle: 2000 }),
],
}); +
+ + +
import type { Middleware } from '@cleverbrush/client';

const logger: Middleware = (next) => async (url, init) => {
console.log('→', init.method, url);
const res = await next(url, init);
console.log('←', res.status);
return res;
}; +
+ + +

Hooks are invoked at various stages of a request. All hook arrays execute serially in order.

+
const client = createClient(api, {
hooks: {
beforeRequest: [(req) => {
req.init.headers = {
...req.init.headers as Record<string, string>,
'X-Request-Id': crypto.randomUUID(),
};
}],
afterResponse: [(req, res) => {
console.log(`${req.init.method} ${req.url}${res.status}`);
}],
beforeError: [(error) => {
console.error('Request failed:', error.message);
return error;
}],
},
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HookSignatureDescription
beforeRequest(req: { url, init }) => voidModify request before sending
afterResponse(req, response) => void | ResponseInspect/replace response
beforeRetry(info: { url, init, error, retryCount }) => voidCalled between retry attempts
beforeError(error: WebError) => WebErrorTransform errors before throwing
+ + +
import { retry } from '@cleverbrush/client/retry';

retry({
limit: 2, // max retries (default: 2)
methods: ['GET'], // retryable methods (default: GET, PUT, HEAD, DELETE, OPTIONS)
statusCodes: [500], // retryable status codes (default: 408, 429, 500, 502, 503, 504)
backoffLimit: 5000, // max delay in ms (default: Infinity)
delay: (n) => n * 1000, // custom delay function
jitter: true, // add randomization to delays
retryOnTimeout: false, // retry on TimeoutError (default: false)
shouldRetry: (err, count) => count < 3, // custom predicate
}); +
+ +

Respects Retry-After headers (seconds and HTTP-date formats) on 429/503 responses.

+ +
import { timeout } from '@cleverbrush/client/timeout';

timeout({ timeout: 10000 }); // 10 second timeout (default) +
+ +

Aborts requests that exceed the configured duration, throwing a TimeoutError.

+ +
import { dedupe } from '@cleverbrush/client/dedupe';

dedupe({
skip: (url, init) => init.method !== 'GET', // skip non-GET (default)
key: (url, init) => `${init.method}@${url}`, // dedup key (default)
}); +
+ +

Prevents duplicate in-flight requests. Concurrent calls with the same key share a single fetch; each caller receives a cloned response.

+ +
import { throttlingCache } from '@cleverbrush/client/cache';

throttlingCache({
throttle: 1000, // TTL in ms (default: 1000)
skip: (url, init) => init.method !== 'GET', // skip non-GET (default)
condition: (res) => res.ok, // only cache successful responses (default)
invalidate: (url, init) => {
if (init.method !== 'GET') return `GET@${url}`;
return null;
},
}); +
+ +

Caches successful GET responses for a configurable TTL. Subsequent requests within the TTL receive a cloned cached response without hitting the network.

+ +

Tag-based HTTP caching with automatic invalidation driven by server-side endpoint +annotations (.cacheTag() / .clearsCacheTag()). Replaces manual invalidation callbacks — mutations +automatically clear cache entries matching the endpoint's declared tag names.

+
import { cacheTags } from '@cleverbrush/client/cache';

const client = createClient(api, {
middlewares: [cacheTags({ defaultTtl: 5000 })],
});

// Populates cache entries for 'todo-list' and 'todo:id=1' tags.
await client.todos.list({ query: { page: 1 } });
await client.todos.get({ params: { id: 1 } });

// Mutation — automatically invalidates both tags.
await client.todos.update({ params: { id: 1 }, body: { title: 'Updated' } });

// Triggers network fetch — cache was cleared.
await client.todos.list({ query: { page: 1 } }); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
defaultTtlnumber0TTL in ms for tags without explicit TTL. 0 = invalidation-only.
ttlByTagRecord<string, number>{}Per-tag TTL overrides.
condition(Response) => booleanresponse.okPredicate controlling which responses are cached.
+

When used with @cleverbrush/client/react, TanStack Query's useMutation hooks +automatically invalidate the query cache for the affected group — no manual +queryClient.invalidateQueries() needed.

+

See the server-side cache tags section for how to declare +tags on your endpoints.

+ +

Override middleware options for individual calls:

+
// Override timeout for a slow endpoint
const report = await client.reports.generate({
body: { type: 'annual' },
timeout: 60000,
});

// Override retry limit
const data = await client.data.fetch({
query: { id: 1 },
retry: { limit: 5 },
}); +
+ + +

All errors extend a common WebError base class.

+
import {
ApiError, TimeoutError, NetworkError,
isApiError, isTimeoutError, isNetworkError, isWebError
} from '@cleverbrush/client'; +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ErrorDescriptionProperties
WebErrorBase class for all web client errorsmessage
ApiErrorNon-2xx HTTP responsestatus, message, body
TimeoutErrorRequest exceeded timeouttimeout (ms)
NetworkErrorNetwork-level failurecause
+ +
try {
await client.todos.get({ params: { id: 999 } });
} catch (err) {
if (isApiError(err)) {
console.log(err.status, err.body);
} else if (isTimeoutError(err)) {
console.log('Timed out after', err.timeout, 'ms');
} else if (isNetworkError(err)) {
console.log('Network failure:', err.cause);
}
} +
+ + +
import { batching } from '@cleverbrush/client/batching';
+
+ +

Reduces HTTP round-trips by coalescing concurrent requests into a single POST /__batch. Individual call sites are completely unaware of batching — they still receive their own typed responses.

+
+

Prerequisite: the server must have batching enabled via ServerBuilder.useBatching().

+
+ +
import { batching } from '@cleverbrush/client/batching';

const client = createClient(api, {
baseUrl: 'https://api.example.com',
middlewares: [
retry(),
timeout(),
batching({ maxSize: 10, windowMs: 10 }), // innermost — closest to fetch
],
});

// These three concurrent calls are coalesced into ONE HTTP request.
const [todos, user, stats] = await Promise.all([
client.todos.list(),
client.users.me(),
client.stats.summary(),
]); +
+ + +
    +
  1. The first queued request starts a windowMs timer.
  2. +
  3. Additional requests arriving before the timer fires join the same batch.
  4. +
  5. When the timer fires (or maxSize is reached), all queued requests are sent as a single POST /__batch.
  6. +
  7. The server processes each sub-request through its full pipeline and returns an array of sub-responses.
  8. +
  9. Each caller receives its own reconstructed Response.
  10. +
+

If only one request is queued at flush time it is sent directly — no batch overhead.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
maxSizenumber10Maximum requests per batch; flush immediately on reaching this limit
windowMsnumber10Collection window in milliseconds
batchPathstring'/__batch'Batch endpoint path (must match server config)
skip(url, init) => booleanReturn true to bypass batching for a specific request
+ +
batching({
skip: (_url, init) => {
// Never batch file uploads
return init.body instanceof FormData;
},
}) +
+ + +

Place batching() last in the middleware array so that retry() and timeout() operate on each logical call promise independently, not on the single batch fetch:

+
middlewares: [retry(), timeout(), batching()], // ✅ correct
middlewares: [batching(), retry(), timeout()], // ⚠️ retry wraps the whole batch +
+ + +

Subscription endpoints defined with endpoint.subscription() in the server contract are automatically detected by the client. Instead of returning a Promise, they return a live Subscription handle backed by the browser WebSocket API.

+ +
// The subscribe function returns a Subscription handle, not a Promise
const sub = client.live.todoUpdates();

// Consume events via async iteration
for await (const event of sub) {
console.log(event.action, event.todoId);
} +
+ + +
const chat = client.live.chat();

// Send messages to the server
chat.send({ text: 'Hello!' });

// Receive messages
for await (const msg of chat) {
console.log(`${msg.user}: ${msg.text}`);
} +
+ + +
const sub = client.live.events();

sub.state; // 'connecting' | 'connected' | 'reconnecting' | 'closed' +
+ + +
sub.close();
+
+ + +
const ac = new AbortController();
const sub = client.live.events({ signal: ac.signal });

// Abort closes the WebSocket
ac.abort(); +
+ + +

Auth tokens are sent as a ?token= query parameter (the browser WebSocket API does not support custom headers):

+
const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
});

// Token is automatically appended:
// wss://api.example.com/ws/events?token=<token>
const sub = client.live.events(); +
+ + +

Enable automatic reconnection with exponential backoff for WebSocket subscriptions. Reconnection is not triggered by manual .close() calls or AbortSignal aborts — only by unexpected connection drops.

+ +
const client = createClient(api, {
baseUrl: 'https://api.example.com',
subscriptionReconnect: {
maxRetries: 10, // default: Infinity
backoffLimit: 30_000, // max delay ms (default: 30 000)
jitter: true, // ±25% random jitter (default: true)
},
}); +
+ + +
// Override the global default for this subscription:
const sub = client.live.events({
reconnect: { maxRetries: 3, jitter: false },
});

// Disable reconnection for this subscription even when a global default is set:
const sub = client.live.events({ reconnect: false });

// Use global defaults explicitly:
const sub = client.live.events({ reconnect: true }); +
+ + +
const sub = client.live.events({
reconnect: {
delay: (attempt) => Math.min(500 * 2 ** (attempt - 1), 60_000),
jitter: false,
},
}); +
+ +

The default delay formula is 300 × 2^(attempt − 1) ms (same as the HTTP retry middleware), capped by backoffLimit.

+ +
const sub = client.live.events({
reconnect: {
shouldReconnect: ({ code, reason }) => code !== 4003,
},
}); +
+ +

When shouldReconnect returns false the subscription transitions directly to 'closed' without further attempts.

+ +
const { state } = useSubscription(() => client.live.events({
reconnect: { maxRetries: 5 },
}));

// state can be: 'connecting' | 'connected' | 'reconnecting' | 'closed'
if (state === 'reconnecting') {
return <Badge>Reconnecting…</Badge>;
} +
+ + +

Import from @cleverbrush/client/react:

+
import { useSubscription } from '@cleverbrush/client/react';

function LiveFeed() {
const { events, state, send, close, error } = useSubscription(
() => client.live.events(),
{ maxEvents: 100, enabled: true }
);

return (
<div>
<p>Status: {state}</p>
{events.map((e, i) => <div key={i}>{JSON.stringify(e)}</div>)}
</div>
);
} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Return valueTypeDescription
lastEventT | undefinedMost recently received event
eventsT[]Accumulated events (newest last)
statestringConnection state: connecting, connected, reconnecting, closed
send(msg) => voidSend a message (bidirectional subscriptions)
close() => voidClose the subscription
errorError | undefinedLast error, if any
+ + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
enabledbooleantrueToggle the subscription on/off
maxEventsnumberunlimitedMaximum events to keep in the events array
+ +

The /react subpath provides a createClient() that wraps the core client with TanStack Query hooks. Every endpoint becomes callable and provides hooks.

+

Peer dependencies: react >=18, @tanstack/react-query ^5

+ +
import { createClient } from '@cleverbrush/client/react';

const client = createClient(api, { baseUrl: '/api' });

// Each endpoint provides:
client.todos.list(args?) // Direct fetch → Promise<T>
client.todos.list.stream(args?) // NDJSON streaming → AsyncIterable<string>
client.todos.list.useQuery(args?, options?) // TanStack useQuery
client.todos.list.useSuspenseQuery(args?, options?) // TanStack useSuspenseQuery
client.todos.list.useInfiniteQuery(argsFn, options) // TanStack useInfiniteQuery
client.todos.list.useMutation(options?) // TanStack useMutation
client.todos.list.queryKey(args?) // Query key array
client.todos.list.prefetch(qc, args?) // Prefetch into cache

// Group-level query key for bulk invalidation:
client.todos.queryKey() // → ['@cleverbrush', 'todos'] +
+ + +

Keys follow a hierarchical structure for predictable invalidation:

+
client.todos.queryKey()
// → ['@cleverbrush', 'todos']

client.todos.list.queryKey()
// → ['@cleverbrush', 'todos', 'list']

client.todos.get.queryKey({ params: { id: 42 } })
// → ['@cleverbrush', 'todos', 'get', { params: { id: 42 } }] +
+ + +

For manual key construction outside of the proxy:

+
import { buildQueryKey, buildGroupQueryKey, QUERY_KEY_PREFIX } from '@cleverbrush/client/react';

buildGroupQueryKey('todos'); // ['@cleverbrush', 'todos']
buildQueryKey('todos', 'list'); // ['@cleverbrush', 'todos', 'list']
buildQueryKey('todos', 'get', args); // ['@cleverbrush', 'todos', 'get', args] +
+ + +
function TodoDetail({ id }: { id: number }) {
const { data } = client.todos.get.useQuery({ params: { id } });
return <h2>{data?.title}</h2>;
} +
+ + +
import { useQueryClient } from '@tanstack/react-query';

function CreateTodo() {
const queryClient = useQueryClient();
const mutation = client.todos.create.useMutation({
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: client.todos.queryKey() });
},
});

return (
<button onClick={() => mutation.mutate({ body: { title: 'New todo' } })}>
Add Todo
</button>
);
} +
+ + +
import { Suspense } from 'react';

function TodoListSuspense() {
const { data } = client.todos.list.useSuspenseQuery();
return <ul>{data.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
}

function App() {
return (
<Suspense fallback={<p>Loading…</p>}>
<TodoListSuspense />
</Suspense>
);
} +
+ + +
const queryClient = useQueryClient();

<button
onMouseEnter={() => client.todos.get.prefetch(queryClient, { params: { id: 1 } })}
>
View Todo
</button> +
+ + +
function UserTodos({ userId }: { userId: number | null }) {
const { data } = client.todos.list.useQuery({
query: { userId: userId! },
enabled: userId !== null,
});
// ...
} +
+ + +
function InfiniteTodos() {
const { data, fetchNextPage, hasNextPage } = client.todos.list.useInfiniteQuery(
(pageParam) => ({ query: { page: pageParam, limit: 10 } }),
{
initialPageParam: 1,
getNextPageParam: (lastPage, allPages) => allPages.length + 1,
}
);
// ...
} +
+ + +

The useOptimisticMutation hook wraps TanStack Query's useMutation with automatic cache snapshot, optimistic update, and rollback on error. This replaces the manual onMutate/onError/onSettled pattern.

+
import { useOptimisticMutation } from '@cleverbrush/client/react';

function TodoItem({ todo }: { todo: Todo }) {
const toggleMutation = useOptimisticMutation(client.todos.update, {
queryKey: client.todos.list.queryKey(),
optimisticUpdate: (oldTodos, variables) =>
(oldTodos ?? []).map(t =>
t.id === variables.params.id
? { ...t, completed: variables.body.completed }
: t
),
onSettled: () => {
queryClient.invalidateQueries({
queryKey: client.todos.queryKey()
});
}
});

return (
<button onClick={() => toggleMutation.mutate({
params: { id: todo.id },
body: { completed: !todo.completed }
})}>
{todo.completed ? '✓' : '○'}
</button>
);
} +
+ +

The hook handles:

+
    +
  1. Cancel — cancels in-flight queries for the given queryKey
  2. +
  3. Snapshot — captures the current cache state
  4. +
  5. Optimistic update — applies your optimisticUpdate function
  6. +
  7. Rollback — restores the snapshot if the mutation fails
  8. +
  9. Invalidate — invalidates the cache when the mutation settles
  10. +
+ +
import { isApiError, isTimeoutError } from '@cleverbrush/client';

const { error } = client.todos.list.useQuery();

if (isApiError(error)) {
console.log(error.status, error.body);
} else if (isTimeoutError(error)) {
console.log('Timed out after', err.timeout, 'ms');
} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
EndpointCallCallable endpoint function type
EndpointCallArgs<E>Request argument shape for an endpoint
EndpointResponse<E>Success response type for an endpoint
TypedClient<T>Full client type mirroring the contract
ClientOptionsConfiguration for createClient()
MiddlewareMiddleware function type
PerCallOverridesPer-call override options (retry, timeout, etc.)
UnifiedClient<T>React client type with hooks on every endpoint
+ +
    +
  1. +

    Compile time: TypeScript infers the full type of each endpoint from the defineApi() contract. TypedClient<T> maps each group/endpoint to a typed async function.

    +
  2. +
  3. +

    Runtime: createClient() returns a two-level Proxy. When you call client.todos.list(args), the proxy:

    +
      +
    • Calls .introspect() on the endpoint builder to get HTTP method, base path, and path template
    • +
    • Serializes path parameters via ParseStringSchemaBuilder.serialize()
    • +
    • Serializes query parameters to a URL query string
    • +
    • JSON-encodes the body for POST/PUT/PATCH requests
    • +
    • Sends the request via fetch with auth headers
    • +
    +
  4. +
  5. +

    React layer (optional): The /react createClient() wraps the core client in an additional proxy layer that attaches TanStack Query hook factories to each endpoint function.

    +
  6. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImportDescription
@cleverbrush/clientCore client, errors, middleware utilities, types
@cleverbrush/client/retryRetry middleware with exponential backoff
@cleverbrush/client/timeoutAbortController-based timeout middleware
@cleverbrush/client/dedupeRequest deduplication middleware
@cleverbrush/client/idempotencyIdempotency key middleware (deduplicates mutations)
@cleverbrush/client/cacheThrottling cache + tag-based cache invalidation middleware
@cleverbrush/client/batchingRequest batching middleware
@cleverbrush/client/optimistic-updateOptimistic update middleware (mutation tracking)
@cleverbrush/client/offline-queueOffline queue middleware (queue + replay)
@cleverbrush/client/reactTanStack Query hooks + unified client
+ +
import { optimisticUpdate } from '@cleverbrush/client/optimistic-update';
+
+ +

Tags mutation requests (POST/PUT/PATCH/DELETE) with a unique ID and tracks network failures in an inspectable store. Designed to work with the useOptimisticMutation React hook.

+ +
import { createClient } from '@cleverbrush/client';
import { optimisticUpdate } from '@cleverbrush/client/optimistic-update';

const client = createClient(api, {
middlewares: [optimisticUpdate()]
}); +
+ + +

Pass a shared store to inspect failed mutations:

+
import { optimisticUpdate, type OptimisticUpdateStore } from '@cleverbrush/client/optimistic-update';

const store: OptimisticUpdateStore = { failures: [] };

const client = createClient(api, {
middlewares: [optimisticUpdate({ store })]
});

// After a network error:
console.log(store.failures);
// → [{ id, url, init, error, timestamp }] +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
storeOptimisticUpdateStore{ failures: [] }Shared mutable store
skip(url, init) => booleanSkip tagging for specific requests
+ +
await client.todos.create({
body: { title: 'test' },
optimisticUpdate: { skip: true } // skip tagging for this call
}); +
+ + +
import { offlineQueue } from '@cleverbrush/client/offline-queue';
+
+ +

Queues mutation requests (POST/PUT/PATCH/DELETE) when the browser reports offline (navigator.onLine). Automatically replays queued mutations when connectivity is restored.

+ +

offlineQueue() must be the outermost middleware (first in the array) so that retry/timeout/etc. middlewares re-apply when queued mutations are replayed:

+
middlewares: [
offlineQueue(), // outermost
retry({ limit: 3 }), // re-applies on replay
timeout({ timeout: 10000 }),
batching(),
] +
+ + +
import { createClient } from '@cleverbrush/client';
import { offlineQueue } from '@cleverbrush/client/offline-queue';

const client = createClient(api, {
middlewares: [offlineQueue()]
}); +
+ + +

Pass a shared store to observe queue state:

+
import { offlineQueue, type OfflineQueueStore } from '@cleverbrush/client/offline-queue';

const store: OfflineQueueStore = { queue: [], isOnline: true, isReplaying: false };

const client = createClient(api, {
middlewares: [offlineQueue({ store })]
});

// Check queue status:
console.log(store.isOnline); // boolean
console.log(store.queue.length); // queued mutations
console.log(store.isReplaying); // currently replaying +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
storeOfflineQueueStore{ queue: [], isOnline: true, isReplaying: false }Shared mutable store
skip(url, init) => booleanSkip queue for specific requests
maxRetriesnumber3Max flush retries per queued item
+ +
await client.todos.create({
body: { title: 'test' },
offlineQueue: { skip: true } // bypass queue for this call
}); +
+ + +

BSD 3-Clause

+

Modules

batching
cache
dedupe
idempotency
offline-queue
optimistic-update
react
retry
timeout
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.idempotency.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.idempotency.html new file mode 100644 index 00000000..ce98806d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.idempotency.html @@ -0,0 +1 @@ +idempotency | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.offline-queue.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.offline-queue.html new file mode 100644 index 00000000..de8a18b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.offline-queue.html @@ -0,0 +1 @@ +offline-queue | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.optimistic-update.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.optimistic-update.html new file mode 100644 index 00000000..e094c97d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.optimistic-update.html @@ -0,0 +1 @@ +optimistic-update | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.react.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.react.html new file mode 100644 index 00000000..49ef065a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.react.html @@ -0,0 +1,2 @@ +react | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.retry.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.retry.html new file mode 100644 index 00000000..d025c329 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.retry.html @@ -0,0 +1 @@ +retry | Libraries

Interfaces

RetryOptions

Functions

retry
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.timeout.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.timeout.html new file mode 100644 index 00000000..3f924538 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_client.timeout.html @@ -0,0 +1 @@ +timeout | Libraries

Interfaces

TimeoutOptions

Functions

timeout
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_deep.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_deep.html new file mode 100644 index 00000000..e84f1695 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_deep.html @@ -0,0 +1,127 @@ +@cleverbrush/deep | Libraries

Module @cleverbrush/deep

@cleverbrush/deep

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A library for deep operations on JavaScript objects — deep equality, deep merge, and flattening.

+ +
npm install @cleverbrush/deep
+
+ + +
import { deepEqual, deepExtend, deepFlatten } from '@cleverbrush/deep';
+
+ + + +

Recursively compares two values and returns true if they are deeply equal. Supports nested objects, arrays, Date instances, and handles circular references.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
aanyFirst value
banySecond value
options.disregardArrayOrderbooleanfalseWhen true, arrays are treated as equal regardless of element order
+
import { deepEqual } from '@cleverbrush/deep';

deepEqual({ a: { b: 1 } }, { a: { b: 1 } });
// => true

deepEqual({ a: { b: 1 } }, { a: { b: 20 } });
// => false

deepEqual({ a: { b: 1, c: 2 } }, { a: { b: 1 } });
// => false

// Array order can be ignored
deepEqual([1, 2, 3], [3, 1, 2], { disregardArrayOrder: true });
// => true +
+ + +

Deeply merges multiple objects. Works like Object.assign, but recursively merges nested objects instead of overwriting them. All arguments must be non-null objects.

+

Returns a new object that is the deep merge of all provided objects.

+
import { deepExtend } from '@cleverbrush/deep';

const result = deepExtend(
{},
{
a: 'something',
name: {
first: 'Ivan'
}
},
{
name: {
last: 'Ivanov'
}
}
);

// result:
// {
// a: 'something',
// name: {
// first: 'Ivan',
// last: 'Ivanov'
// }
// } +
+ +

The result type is inferred from the input types using the Merge<T> utility type, which is also exported from the library.

+ +

Flattens a nested object to a single level, concatenating keys with the specified delimiter.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
objRecord<string, any>Object to flatten
delimiterstring'.'Separator used to join nested keys
+

Throws an error if the object contains circular references.

+
import { deepFlatten } from '@cleverbrush/deep';

deepFlatten({
a: {
b: 1,
c: 2
},
d: 3
});
// => { 'a.b': 1, 'a.c': 2, d: 3 }

deepFlatten(
{
a: {
b: 1,
c: 2
},
d: {
e: {
f: 3
}
}
},
'-'
);
// => { 'a-b': 1, 'a-c': 2, 'd-e-f': 3 } +
+ + +

Generates a hash representation for an object. Useful for comparing objects by value.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
objanyThe value to hash
excludeany[]Optional list of values to exclude from hashing
+
import { HashObject } from '@cleverbrush/deep';

const hash = HashObject({ name: 'John', age: 30 }); +
+ + +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode
  • +
  • Unit tests: Vitest — covering deep equality edge cases (circular references, Date instances, array order), deep merge, flattening, and hashing
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Type Aliases

Merge
MergeTwo

Variables

deepExtend

Functions

deepEqual
deepFlatten
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_di.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_di.html new file mode 100644 index 00000000..d573406c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_di.html @@ -0,0 +1,209 @@ +@cleverbrush/di | Libraries

Module @cleverbrush/di

@cleverbrush/di — .NET-style dependency injection for TypeScript.

+

Uses @cleverbrush/schema instances as service keys for type-safe +registration and resolution. Supports singleton, scoped, and transient +lifetimes, function injection via FunctionSchemaBuilder, and +automatic disposal of scoped services.

+
import { ServiceCollection } from '@cleverbrush/di';
import { object, string, number, func } from '@cleverbrush/schema';

// Define service contracts as schemas
const IConfig = object({ port: number(), host: string() });
const ILogger = object({ info: func().addParameter(string()) });

// Register services
const services = new ServiceCollection();
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addSingleton(ILogger, () => ({ info: console.log }));

// Build the provider
const provider = services.buildServiceProvider();

// Resolve — fully typed, no generics needed
const config = provider.get(IConfig);
config.port; // number +
+ +

@cleverbrush/di

+

CI +License: BSD-3-Clause

+

A .NET-style dependency injection container for TypeScript. Uses @cleverbrush/schema instances as service keys for fully-typed, zero-generic registration and resolution. Supports three service lifetimes, schema-driven function injection, and automatic disposal of scoped services.

+ +
    +
  • Schema-as-key — schema instances (from @cleverbrush/schema) serve as service identifiers via reference equality. No string tokens, no Symbol, no decorators.
  • +
  • Three lifetimesSingleton, Scoped, and Transient, matching .NET semantics.
  • +
  • Function injection — resolve dependencies automatically via FunctionSchemaBuilder parameter lists with invoke() / addSingletonFromSchema().
  • +
  • Scope validation — resolving a scoped service from the root provider throws by default, catching common lifecycle bugs early.
  • +
  • Automatic disposalServiceScope disposes scoped services in reverse creation order (LIFO) on scope exit, supporting both Symbol.dispose and Symbol.asyncDispose.
  • +
  • using keyword supportServiceScope implements Disposable and AsyncDisposable.
  • +
  • No decorators, no reflect-metadata — works in any TypeScript project without experimentalDecorators.
  • +
  • Zero runtime dependencies (other than @cleverbrush/schema).
  • +
+ +
npm install @cleverbrush/di @cleverbrush/schema
+
+ + +
import { ServiceCollection } from '@cleverbrush/di';
import { object, string, number, func } from '@cleverbrush/schema';

// 1. Define service contracts as schemas (used as keys)
const IConfig = object({ port: number(), host: string() });
const ILogger = object({ info: func().addParameter(string()) });

// 2. Register services
const services = new ServiceCollection();
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addSingleton(ILogger, () => ({ info: (msg) => console.log(msg) }));

// 3. Build the provider
const provider = services.buildServiceProvider();

// 4. Resolve — fully typed, no explicit generics needed
const config = provider.get(IConfig);
config.port; // number +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
LifetimeCreatedUse for
SingletonOnce per ServiceProviderLoggers, configuration, connection pools
ScopedOnce per ServiceScopeDatabase contexts, HTTP request state
TransientOn every get() callLightweight, stateless services
+
const IDbContext = object({ query: func() });
const IRequestId = object({ id: string() });

services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addScoped(IDbContext, (provider) => {
const config = provider.get(IConfig);
return new DbContext(config.host);
});
services.addTransient(IRequestId, () => ({ id: crypto.randomUUID() })); +
+ + + +
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
+
+ + +

The factory receives the ServiceProvider so it can resolve other services:

+
services.addSingleton(ILogger, (provider) => {
const config = provider.get(IConfig);
return new ConsoleLogger(config.logLevel);
}); +
+ + +

Use when the service is a function type — addSingleton would invoke a function value as a factory, but addSingletonInstance always treats its argument as the value:

+
const IHandler = func();
const myHandler = (req: Request) => new Response('ok');

services.addSingletonInstance(IHandler, myHandler); +
+ + +

Declare dependencies via a FunctionSchemaBuilder and let the container resolve them automatically:

+
const IGreeter = object({ greet: func() });

const greeterDeps = func()
.addParameter(IConfig)
.addParameter(ILogger);

services.addSingletonFromSchema(
IGreeter,
greeterDeps,
(config, logger) => ({
greet() { logger.info(`Hello from ${config.host}`); }
})
);
// Also available: addScopedFromSchema, addTransientFromSchema +
+ + +

Pass { validate: true } to any registration method to validate the resolved value against its schema at resolution time. Useful in development and testing:

+
services.addSingleton(IConfig, loadConfig(), { validate: true });
+
+ + +
const provider = services.buildServiceProvider();

// Throws if not registered
const config = provider.get(IConfig);

// Returns undefined if not registered (no throw)
const mailer = provider.getOptional(IMailer); +
+ + +

Create a scope for work that has a bounded lifetime (e.g. an HTTP request). Scoped services are cached within the scope and disposed when the scope exits.

+
// Automatic disposal with `using`
using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db is disposed when the block exits

// Async disposal
await using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db.[Symbol.asyncDispose]() is called when the block exits

// Manual disposal
const scope = provider.createScope();
try {
const db = scope.serviceProvider.get(IDbContext);
// use db...
} finally {
await scope.asyncDispose();
} +
+ +

Services registered with a class that implements Symbol.dispose or Symbol.asyncDispose are tracked and disposed automatically when the scope ends.

+ +

Resolve dependencies described by a FunctionSchemaBuilder and call a function with them directly, without registering anything:

+
const handlerDeps = func()
.addParameter(ILogger)
.addParameter(IDbContext);

const result = scope.serviceProvider.invoke(handlerDeps, (logger, db) => {
logger.info('Handling request');
return db.query('SELECT 1');
}); +
+ + +

By default, resolving a Scoped service from the root provider throws an error, preventing accidental singleton captures:

+
// Throws: "Cannot resolve scoped service from the root provider."
provider.get(IDbContext);

// Disable if intentional (not recommended for production)
const provider = services.buildServiceProvider({ validateScopes: false }); +
+ + +

The container detects circular dependencies at resolution time and throws a descriptive error showing the dependency chain.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
addSingleton(schema, factoryOrValue, options?)Register a singleton service
addScoped(schema, factory, options?)Register a scoped service
addTransient(schema, factory, options?)Register a transient service
addSingletonInstance(schema, instance, options?)Register a pre-created singleton (safe for function values)
addSingletonFromSchema(target, funcSchema, impl, options?)Register a singleton with schema-driven dependencies
addScopedFromSchema(target, funcSchema, impl, options?)Register a scoped service with schema-driven dependencies
addTransientFromSchema(target, funcSchema, impl, options?)Register a transient service with schema-driven dependencies
buildServiceProvider(options?)Build the immutable ServiceProvider
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
get(schema)Resolve a service; throws if not registered
getOptional(schema)Resolve a service; returns undefined if not registered
createScope()Create a new ServiceScope
invoke(funcSchema, implementation)Call a function with its dependencies resolved automatically
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberDescription
serviceProviderThe scoped IServiceProvider for this scope
[Symbol.dispose]()Synchronously dispose scoped services (LIFO)
[Symbol.asyncDispose]()Asynchronously dispose scoped services (LIFO)
asyncDispose()Explicit async dispose (same as Symbol.asyncDispose)
+ +

BSD 3-Clause

+

Enumerations

ServiceLifetime

Classes

ScopedServiceProvider
ServiceCollection
ServiceProvider
ServiceScope

Interfaces

IServiceProvider
ServiceDescriptor
ServiceProviderOptions
ServiceRegistrationOptions

Type Aliases

ServiceFactory

Functions

isAsyncDisposable
isDisposable
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_env.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_env.html new file mode 100644 index 00000000..6a50a7c3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_env.html @@ -0,0 +1,182 @@ +@cleverbrush/env | Libraries

Module @cleverbrush/env

@cleverbrush/env

+

CI +License: BSD-3-Clause

+

Type-safe environment variable parsing with @cleverbrush/schema — validated, coerced, structured configs from process.env.

+ +

The problem: Environment variables are untyped strings. Most apps access them via process.env.SOME_VAR! — no validation, no coercion, no structure. Missing variables surface as runtime crashes. Secrets accidentally leak into frontend bundles. Config objects are ad-hoc and fragile.

+

The solution: @cleverbrush/env uses @cleverbrush/schema builders for validation and coercion, and a branded env() wrapper for type-safe variable binding. TypeScript enforces at compile time that every config leaf is bound to an environment variable. At runtime, all variables are validated at once and coerced to the correct types — with clear error messages for CI and startup logs.

+

What makes it different:

+
    +
  • Compile-time enforcement — forgetting env() on a config leaf is a TypeScript error, not a runtime surprise
  • +
  • Structured configs — nest objects arbitrarily deep; env vars map to leaf fields
  • +
  • Validation & coercion — full @cleverbrush/schema power: .minLength(), .coerce(), .default(), custom validators
  • +
  • Array supportsplitBy(',') preprocessor for comma-separated values
  • +
  • Clear error reporting — lists all missing and invalid vars at once with paths and types
  • +
  • Computed values — derive values from resolved config via a type-safe callback
  • +
  • Flat modeparseEnvFlat() for simple apps where keys = env var names
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/envt3-envenvalid
Compile-time leaf enforcement
Nested config structures
Schema-based validation~
Type coercion (number, boolean, date)Manual
Array support
Computed / derived values
All-at-once error reporting
No Zod dependency
+ +
npm install @cleverbrush/env @cleverbrush/schema
+
+ +

Peer dependency: @cleverbrush/schema must be installed separately.

+ + +
import { env, parseEnv, splitBy } from '@cleverbrush/env';
import { string, number, boolean, array } from '@cleverbrush/schema';

const config = parseEnv({
db: {
host: env('DB_HOST', string().default('localhost')),
port: env('DB_PORT', number().coerce().default(5432)),
name: env('DB_NAME', string()),
},
jwt: {
secret: env('JWT_SECRET', string().minLength(32)),
},
debug: env('DEBUG', boolean().coerce().default(false)),
allowedOrigins: env(
'ALLOWED_ORIGINS',
array(string()).addPreprocessor(splitBy(','), { mutates: false })
),
});

// Type is fully inferred:
// {
// db: { host: string, port: number, name: string },
// jwt: { secret: string },
// debug: boolean,
// allowedOrigins: string[]
// } +
+ + +

For simple apps where each key is both the property name and the env var name:

+
import { parseEnvFlat } from '@cleverbrush/env';
import { string, number } from '@cleverbrush/schema';

const config = parseEnvFlat({
DB_HOST: string().default('localhost'),
DB_PORT: number().coerce().default(5432),
JWT_SECRET: string().minLength(32),
});
// Type: { DB_HOST: string, DB_PORT: number, JWT_SECRET: string } +
+ + +

Forgetting env() is a compile-time error:

+
parseEnv({
db: {
host: string(), // ← TypeScript ERROR: not assignable to EnvConfigNode
},
}); +
+ + +

Use the splitBy() preprocessor helper:

+
// Comma-separated strings
env('ALLOWED_ORIGINS', array(string()).addPreprocessor(splitBy(','), { mutates: false }))
// "a, b, c" → ['a', 'b', 'c']

// Comma-separated numbers
env('PORTS', array(number().coerce()).addPreprocessor(splitBy(','), { mutates: false }))
// "3000, 4000" → [3000, 4000] +
+ + +

When variables are missing or invalid, EnvValidationError is thrown with a formatted message:

+
Missing environment variables:
- DB_NAME (required by db.name) [string]
- JWT_SECRET (required by jwt.secret) [string]
Invalid environment variables:
- DB_PORT: "abc" (required by db.port) — number expected +
+ +

The error also exposes structured .missing and .invalid properties for programmatic access.

+ +

By default, parseEnv() reads from process.env. Pass a custom source for testing or alternative runtimes:

+
const config = parseEnv(schema, {
DB_HOST: 'test-host',
DB_PORT: '9999',
}); +
+ + +

Derive values from the resolved config by passing a compute callback as the second argument. The callback receives the fully typed base config and returns an object that is deep-merged into the result:

+
import { env, parseEnv } from '@cleverbrush/env';
import { string, number } from '@cleverbrush/schema';

const config = parseEnv(
{
db: {
host: env('DB_HOST', string().default('localhost')),
port: env('DB_PORT', number().coerce().default(5432)),
name: env('DB_NAME', string()),
},
},
(base) => ({
db: {
connectionString: `postgres://${base.db.host}:${base.db.port}/${base.db.name}`,
},
})
);

// base is fully typed: { db: { host: string, port: number, name: string } }
// Result type is deep-merged:
// { db: { host: string, port: number, name: string, connectionString: string } }

config.db.connectionString // "postgres://localhost:5432/mydb" +
+ +

When using a compute callback, the optional source is passed as the third argument:

+
const config = parseEnv(
{ host: env('HOST', string()) },
(base) => ({ url: `http://${base.host}` }),
{ HOST: 'example.com' } // custom source
); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExportTypeDescription
env(varName, schema)FunctionBinds a schema to an env var name. Required for every leaf in parseEnv().
parseEnv(config, source?)FunctionParses env vars into a validated, typed nested config object.
parseEnv(config, compute, source?)FunctionParses env vars, then deep-merges computed values from the callback.
parseEnvFlat(schemas, source?)FunctionFlat convenience — keys are env var names, no env() needed.
splitBy(separator)FunctionPreprocessor that splits a string into an array.
EnvValidationErrorClassThrown when env vars are missing or invalid. Has .missing and .invalid.
EnvField<T>TypeBranded wrapper type created by env().
EnvConfigTypeConfig descriptor tree type (input to parseEnv).
InferEnvConfig<T>TypeInfers the runtime type from a config descriptor.
+ +

BSD-3-Clause

+

Classes

EnvValidationError

Interfaces

InvalidEnvVar
MissingEnvVar

Type Aliases

EnvConfig
EnvConfigNode
EnvField
InferEnvConfig

Functions

env
parseEnv
parseEnvFlat
splitBy
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-clickhouse.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-clickhouse.html new file mode 100644 index 00000000..801d4072 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-clickhouse.html @@ -0,0 +1,94 @@ +@cleverbrush/knex-clickhouse | Libraries

Module @cleverbrush/knex-clickhouse

@cleverbrush/knex-clickhouse

+ +

Coverage

+ +

A Knex dialect for ClickHouse. Uses the official @clickhouse/client library to connect to ClickHouse and lets you build queries with Knex's familiar API.

+ +
npm install @cleverbrush/knex-clickhouse
+
+ +

Peer dependency: knex >= 3.1.0

+ +
import { getClickhouseConnection } from '@cleverbrush/knex-clickhouse';

const db = getClickhouseConnection({
connection: {
url: 'http://localhost:8123',
user: 'default',
password: '',
database: 'my_database'
}
});

// Select
const [rows] = await db('my_table').select('*').where('id', 1);

// Insert
await db('my_table').insert({ id: 1, name: 'Alice' });

// Raw queries
const [rows] = await db.raw('SELECT * FROM my_table WHERE id = ?', [1]); +
+ + + +

Creates and returns a Knex instance configured with the ClickHouse dialect.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
configKnex.Config & AdditionalClientOptionsKnex configuration with optional retry settings
clickHouseSettingsClickHouseSettingsOptional ClickHouse-specific settings
+ +

The Knex client class for ClickHouse. Can be used directly if you need more control over Knex initialization:

+
import Knex from 'knex';
import { ClickhouseKnexClient } from '@cleverbrush/knex-clickhouse';

const db = Knex({
client: ClickhouseKnexClient,
connection: {
url: 'http://localhost:8123',
user: 'default',
password: '',
database: 'my_database'
}
}); +
+ + +

Standard Knex query methods are supported:

+
    +
  • select() / first() / pluck() — read queries
  • +
  • insert() — standard inserts
  • +
  • update() — update records
  • +
  • del() — delete records
  • +
  • raw() — raw SQL queries (auto-detected as SELECT when the query starts with SELECT or WITH)
  • +
+ +

An extended method for inserting rows with ClickHouse-specific data types like arrays and tuples:

+
await db('my_table').insertToClickhouse([
[1, 'Alice', [10, 20, 30]],
[2, 'Bob', [40, 50]]
]); +
+ + +

By default, queries are retried up to 10 times on ECONNRESET errors with exponential backoff. You can customize or disable this:

+
const db = getClickhouseConnection({
connection: { /* ... */ },
retry: {
maxRetries: 5,
minDelay: 200,
delayFactor: 2,
delayRandomizationPercent: 0.1,
shouldRetry: (error) => error.code === 'ECONNRESET'
}
});

// Disable retries
const db = getClickhouseConnection({
connection: { /* ... */ },
retry: null
}); +
+ + +

The client automatically parses ClickHouse types to JavaScript types:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ClickHouse TypeJavaScript Type
Date, DateTime, DateTime('UTC')Date
Nullable(Date), Nullable(DateTime)Date
LowCardinality(Date), LowCardinality(DateTime)Date
UInt64, UInt32number
+ +

BSD-3-Clause

+

Classes

ClickhouseKnexClient

Interfaces

ClickHouseClient

Functions

getClickhouseConnection
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema..html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema..html new file mode 100644 index 00000000..9baa9871 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema..html @@ -0,0 +1 @@ + | Libraries

Classes

Entity
SchemaQueryBuilder

Interfaces

AddColumnDiff
AddForeignKeyDiff
AddIndexDiff
AlterColumnDiff
BoundQuery
CursorPaginationResult
DatabaseCheckInfo
DatabaseColumnInfo
DatabaseForeignKeyInfo
DatabaseIndexInfo
DatabaseTableState
JoinManySpec
JoinOneSpec
MigrationDiff
PaginationResult
PrimaryKeyColumns
RelationInfo
RelationSpec
ResolvedVariantConfig
ResolvedVariantSpec
RowVersionColumn
SchemaSnapshot
ValidatedJoinManySpec
ValidatedJoinOneSpec

Type Aliases

ColumnRef
EntityPropSelector
EntityRelationKeys
EntityRelations
EntitySchema
EntityVariantUnion
InsertType
PrimaryKeyOf
PrimaryKeyValueOf
RowVersionStrategy
SchemaKeys
SchemaProps
SelectProjection
SelectSelector
UnwrapNavSchema
ValidatedSpec
VariantBranch
VariantStorageType
WithJoinedMany
WithJoinedOne
WithRelation

Variables

EXTRA_TYPE_BRAND
MAPPERS
METHOD_LITERAL_BRAND

Functions

applyDiff
buildColumnMap
clearRow
createQuery
defineEntity
diffSchema
entitiesToSnapshot
entitySchemaToTableState
generateCreatePolymorphicTables
generateCreateTable
generateCreateTableSource
generateMigration
generateMigrationsForContext
getPrimaryKeyColumns
getRowVersionColumn
introspectDatabase
isDiffEmpty
loadSnapshot
mapObject
mapValue
query
rawQuery
resolveColumnRef
resolvePropertyKey
tableExistsInDb
writeSnapshot

References

any → any
array → array
boolean → boolean
COMPOSITE_PRIMARY_KEY_BRAND → COMPOSITE_PRIMARY_KEY_BRAND
date → date
dbExtension → dbExtension
ddlExtension → ddlExtension
func → func
getColumnName → getColumnName
getPolymorphicVariantSchemas → getPolymorphicVariantSchemas
getProjections → getProjections
getTableName → getTableName
getVariants → getVariants
number → number
object → object
POLYMORPHIC_TYPE_BRAND → POLYMORPHIC_TYPE_BRAND
PRIMARY_KEY_BRAND → PRIMARY_KEY_BRAND
string → string
union → union
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema.extension.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema.extension.html new file mode 100644 index 00000000..22c47535 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema.extension.html @@ -0,0 +1 @@ +extension | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema.html new file mode 100644 index 00000000..71044a35 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_knex-schema.html @@ -0,0 +1,247 @@ +@cleverbrush/knex-schema | Libraries

Module @cleverbrush/knex-schema

@cleverbrush/knex-schema

+

Type-safe, schema-driven query builder for Knex. Use @cleverbrush/schema object builders to describe your PostgreSQL tables — column name mapping, eager loading, and full CRUD are handled automatically with complete TypeScript inference.

+ +
npm install @cleverbrush/knex-schema
+
+ +

Peer dependency: knex >= 3.1.0

+ +
import knex from 'knex';
import { query, object, string, number, date } from '@cleverbrush/knex-schema';

// 1. Describe your table with a schema
const UserSchema = object({
id: number(),
firstName: string().hasColumnName('first_name'),
lastName: string().hasColumnName('last_name'),
age: number().optional(),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('users');

// 2. Create a Knex instance
const db = knex({ client: 'pg', connection: process.env.DB_URL });

// 3. Query — fully typed, column names resolved automatically
const adults = await query(db, UserSchema)
.where(t => t.age, '>', 18)
.orderBy(t => t.lastName);
// → typed as Array<{ id: number; firstName: string; lastName: string; age?: number; createdAt: Date }> +
+ + +

Import schema builders from @cleverbrush/knex-schema (re-exported with the database extensions applied) instead of from @cleverbrush/schema:

+
import { object, string, number, date, boolean, any } from '@cleverbrush/knex-schema';
// NOT from '@cleverbrush/schema' — those builders lack hasColumnName / hasTableName +
+ + +

Set the SQL column name for a property when it differs from the property key:

+
const OrderSchema = object({
id: number(),
customerId: number().hasColumnName('customer_id'), // snake_case column
totalAmount: number().hasColumnName('total_amount'),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('orders'); +
+ + +

Set the SQL table name on an object schema. Required before calling query().

+
+ + +
const users = await query(db, UserSchema);
// or explicitly:
const users = await query(db, UserSchema).execute(); +
+ + +
const user = await query(db, UserSchema)
.where(t => t.id, 1)
.first();
// → UserType | undefined +
+ + +
// Single row — returns the inserted record (including database-generated fields)
const newUser = await query(db, UserSchema).insert({
firstName: 'Alice',
lastName: 'Smith',
age: 30,
createdAt: new Date(),
});

// Multiple rows
const newUsers = await query(db, UserSchema).insertMany([
{ firstName: 'Bob', lastName: 'Jones', createdAt: new Date() },
{ firstName: 'Carol', lastName: 'White', createdAt: new Date() },
]); +
+ + +
// Updates rows matching the WHERE clause, returns updated records
const updated = await query(db, UserSchema)
.where(t => t.id, userId)
.update({ firstName: 'Alicia' }); +
+ + +
// Returns the number of deleted rows
const count = await query(db, UserSchema)
.where(t => t.id, userId)
.delete(); +
+ +
+ +

Column references accept either a property accessor (t => t.firstName) or a string property key ('firstName') — both are resolved to the correct SQL column name:

+
query(db, UserSchema)
.where(t => t.firstName, 'like', 'A%')
.andWhere(t => t.age, '>', 18)
.orWhere({ lastName: 'Smith' }) // record syntax — keys mapped to columns
.whereIn(t => t.id, [1, 2, 3])
.whereNotNull(t => t.createdAt)
.whereBetween(t => t.age, [20, 40])
.whereILike(t => t.lastName, 'sm%') // case-insensitive (PostgreSQL)
.whereRaw('extract(year from created_at) = ?', [2025]); +
+ +

Available WHERE methods: where, andWhere, orWhere, whereNot, whereIn, whereNotIn, orWhereIn, orWhereNotIn, whereNull, whereNotNull, orWhereNull, orWhereNotNull, whereBetween, whereNotBetween, whereLike, whereILike, whereRaw, whereExists.

+
+ +
query(db, UserSchema)
.orderBy(t => t.lastName)
.orderBy(t => t.firstName, 'desc')
.limit(20)
.offset(40)
.groupBy(t => t.age)
.having(t => t.age, '>', 18)
.select(t => t.firstName, t => t.age)
.distinct(t => t.age); +
+ +
+ +

Related rows are loaded in a single query using PostgreSQL CTEs and jsonb_agg.

+ +
const PostSchema = object({
id: number(),
title: string(),
authorId: number().hasColumnName('author_id'),
}).hasTableName('posts');

const posts = await query(db, PostSchema)
.joinOne({
foreignSchema: UserSchema,
localColumn: t => t.authorId,
foreignColumn: t => t.id,
as: 'author',
});
// posts[0].author.firstName — typed as string ✓ +
+ + +
const users = await query(db, UserSchema)
.joinMany({
foreignSchema: PostSchema,
localColumn: t => t.id,
foreignColumn: t => t.authorId,
as: 'posts',
limit: 5,
orderBy: { column: t => t.id, direction: 'desc' },
});
// users[0].posts — typed as Array<{ id: number; title: string; authorId: number }> ✓ +
+ +

The joinMany spec supports:

+
    +
  • limit / offset — per-parent pagination using row_number() window functions
  • +
  • orderBy{ column, direction } for the sub-collection
  • +
  • foreignQuery — pre-filtered Knex.QueryBuilder (e.g. for soft-delete scopes)
  • +
  • required (joinOne only) — true = inner join, false = left join (nullable result)
  • +
+
+ +

When you need a Knex feature not exposed by this API, use .apply():

+
const rows = await query(db, UserSchema)
.apply(qb => qb.forUpdate().noWait())
.where(t => t.id, id); +
+ +
+ +

Define reusable WHERE/ORDER/LIMIT conditions on the schema. A default scope is applied +automatically unless bypassed with .unscoped().

+
const PostSchema = object({
id: number(),
title: string(),
status: string(),
isActive: boolean().hasColumnName('is_active'),
})
.hasTableName('posts')
.scope('published', q => q.where(t => t.status, 'published'))
.scope('recent', q => q.orderBy(t => t.id, 'desc').limit(10))
.defaultScope( q => q.where(t => t.isActive, true));

// Apply named scopes
const posts = await query(db, PostSchema)
.scoped('published')
.scoped('recent');

// Bypass default scope (also skips soft-delete filter if present)
const all = await query(db, PostSchema).unscoped(); +
+ +

scoped() is statically typed: TypeScript only allows registered scope names.

+
+ +

Define named column subsets on the schema with .projection(name, columns). At query time, +.projected(name) restricts the SELECT clause and narrows the TypeScript result type to +Pick<Row, Keys> — accessing columns outside the projection is a compile-time error.

+ +
const PostSchema = object({
id: number().primaryKey(),
title: string(),
body: string(),
status: string(),
})
.hasTableName('posts')
.projection('summary', ['id', 'title'] as const)
.projection('withStatus', ['id', 'title', 'status'] as const);

const rows = await query(db, PostSchema)
.scoped('published')
.projected('summary');

// rows: Array<Pick<Post, 'id' | 'title'>>
// rows[0].body // ← TypeScript error: 'body' not in projection ✓ +
+ + +
.projection('withStatus', t => [t.id, t.title, t.status])
+
+ +

The accessor receives the schema's property-descriptor tree; each element resolves to the +property name at runtime. This form is more refactor-safe but does not provide the compile-time +Pick<> narrowing that the tuple form offers.

+ +

.projected() cannot be combined with .select(), .distinct(), or any aggregate +(.count(), .min(), etc.) on the same query. Attempting to do so throws at runtime.

+ +

hasColumnName() is respected: if isActive is mapped to is_active, the generated SQL +uses is_active automatically.

+
+ +

In addition to query building, this package provides the schema-level primitives that +@cleverbrush/orm and +@cleverbrush/orm-cli build on top of:

+ +

Wrap a schema to declare typed belongsTo / hasOne / hasMany / belongsToMany +relations that downstream packages use for eager-loading joins and ORM navigation properties.

+
import { defineEntity, object, number, string } from '@cleverbrush/knex-schema';

const UserSchema = object({
id: number().primaryKey(),
email: string(),
}).hasTableName('users');

const PostSchema = object({
id: number().primaryKey(),
title: string(),
authorId: number().hasColumnName('author_id'),
author: UserSchema.optional(),
}).hasTableName('posts');

export const PostEntity = defineEntity(PostSchema)
.belongsTo(t => t.author, l => l.authorId, r => r.id); +
+ +

The returned Entity carries the relation map in its type, so downstream query(db, entity) +calls (and @cleverbrush/orm's DbSet.include()) get full inference.

+ +

Mark a schema as polymorphic to support single-table or class-table inheritance — variants +are discoverable via getVariants() / getPolymorphicVariantSchemas():

+
import { POLYMORPHIC_TYPE_BRAND } from '@cleverbrush/knex-schema';
+
+ +

See the @cleverbrush/orm docs for the full inheritance API (.ofVariant() etc.).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionPurpose
entitiesToSnapshot(entities)Materialise entity definitions into a JSON-serialisable schema snapshot
loadSnapshot(path) / writeSnapshot(path, snap)Read/write the committed snapshot file
generateMigrationsForContext(entities, prevSnapshot)Diff entities against the snapshot and emit a TS migration source plus the next snapshot
generateMigration(snapshotA, snapshotB)Lower-level snapshot-vs-snapshot diff
diffSchema(schema, dbState) / applyDiff(knex, diff, table)Live-database diff/apply (used by cb-orm db push)
introspectDatabase(knex, table) / tableExistsInDb(knex, table)Database introspection helpers
generateCreateTable(schema) / generateCreatePolymorphicTables(schema)Knex-statement builders for fresh CREATE TABLE
+

Most users invoke these indirectly through the cb-orm +CLI (cb-orm migrate generate, cb-orm db push).

+ +

Mark a column as a row version with .rowVersion() to opt-in to optimistic concurrency +checks in @cleverbrush/orm's change tracker:

+
const TodoSchema = object({
id: number().primaryKey(),
title: string(),
rowVersion: number().rowVersion(),
}).hasTableName('todos'); +
+ +

getRowVersionColumn(schema) returns the marked column at runtime.

+
+ +

Both styles are equivalent and resolve to the same SQL column:

+
// 1. Property accessor (recommended — refactor-safe, IDE auto-complete)
.where(t => t.firstName, 'Alice')

// 2. String property key
.where('firstName', 'Alice') +
+ +

The schema's hasColumnName() metadata is used to map firstNamefirst_name in both cases.

+
+ + +

Creates a SchemaQueryBuilder. schema must have .hasTableName() set. +Optionally pass a baseQuery (e.g. a scoped knex('users').where('deleted_at', null)) as the starting point.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryMethods
Eager loading.joinOne(spec), .joinMany(spec)
Filtering.where(), .andWhere(), .orWhere(), .whereNot(), .whereIn(), .whereNotIn(), .orWhereIn(), .orWhereNotIn(), .whereNull(), .whereNotNull(), .orWhereNull(), .orWhereNotNull(), .whereBetween(), .whereNotBetween(), .whereLike(), .whereILike(), .whereRaw(), .whereExists()
Ordering.orderBy(col, dir?), .orderByRaw(sql)
Grouping.groupBy(...cols), .groupByRaw(sql), .having(col, op, val), .havingRaw(sql)
Pagination.limit(n), .offset(n)
Selection.select(...cols), .distinct(...cols), .projected(name)
Aggregates.count(col?), .countDistinct(col?), .min(col), .max(col), .sum(col), .avg(col)
Writes.insert(data), .insertMany(data[]), .update(data), .delete()
Execution.execute(), .first(), await builder (thenable)
Debugging.toQuery(), .toString()
Escape hatch.apply(fn)
+

Modules

extension
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log..html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log..html new file mode 100644 index 00000000..7f936d73 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log..html @@ -0,0 +1 @@ + | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log.clickhouse.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log.clickhouse.html new file mode 100644 index 00000000..2a586cf9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log.clickhouse.html @@ -0,0 +1 @@ +clickhouse | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log.html new file mode 100644 index 00000000..cc6576c5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_log.html @@ -0,0 +1,42 @@ +@cleverbrush/log | Libraries

Module @cleverbrush/log

@cleverbrush/log

+

Enterprise structured logging for TypeScript — Serilog-style message templates, CLEF format, batching sinks with circuit breaking, ambient correlation IDs.

+ +
npm install @cleverbrush/log
+
+ + +
import {
createLogger,
consoleSink,
hostnameEnricher,
processIdEnricher,
} from '@cleverbrush/log';

const logger = createLogger({
minimumLevel: 'information',
sinks: [consoleSink({ theme: 'dark' })],
enrichers: [hostnameEnricher(), processIdEnricher()],
});

logger.info('Server started on port {Port}', { Port: 3000 });
logger.error(new Error('oops'), 'Request failed for {UserId}', { UserId: 42 });

await logger.dispose(); +
+ + +
    +
  • Message Templates{Named} properties captured as structured data
  • +
  • Typed TemplatesTypedTemplate<T> via @cleverbrush/schema for compile-time checked, groupable log events
  • +
  • CLEF Format — Compact Log Event Format for Seq, ClickHouse, etc.
  • +
  • Sinks — Console, File (with rotation), Seq, ClickHouse, custom
  • +
  • Batching — All network sinks batch with retry & circuit breaking
  • +
  • Enrichers — hostname, processId, environment, application, correlationId, caller
  • +
  • Correlation IDs — UUID v7, extracted from headers, propagated via AsyncLocalStorage
  • +
  • Middleware — Request logging & correlation ID for @cleverbrush/server
  • +
  • DIconfigureLogging() for @cleverbrush/di
  • +
  • Sampling — Per-level sampling filters
  • +
+ +

Pass a ParseStringSchemaBuilder (from @cleverbrush/schema) directly to any log method. The logger uses the raw {Property} pattern as messageTemplate so all events of the same shape are grouped in Seq, SigNoz, ClickHouse, etc., while the rendered message is interpolated as usual.

+
import { s } from '@cleverbrush/schema';
import { createLogger, consoleSink } from '@cleverbrush/log';

// Define once — compile-time checked parameter types
const TodoCreated = s.parseString('Todo #{TodoId} "{Title}" created by {UserId}');

const logger = createLogger({ sinks: [consoleSink()] });

// TypeScript enforces { TodoId, Title, UserId }
logger.info(TodoCreated, { TodoId: 1, Title: 'Buy milk', UserId: 'u-42' }); +
+ + +
import { useLogging } from '@cleverbrush/log';

// Returns [correlationIdMiddleware, requestLoggingMiddleware]
const [correlationId, requestLogging] = useLogging(logger, {
excludePaths: ['/health'],
// Set to false when OTel traceparent already provides traceability
correlationResponseHeader: false,
}); +
+ +

correlationResponseHeader: false suppresses the X-Correlation-Id response header entirely — useful when @cleverbrush/otel's tracing middleware already sets a traceparent / traceresponse header and a second ID would be redundant.

+ +

Trace correlation, OTLP log export, and the traceEnricher (which copies the active span's traceId / spanId onto every log event) live in @cleverbrush/otel. Wire them up like this:

+
import { createLogger, consoleSink } from '@cleverbrush/log';
import { otelLogSink, traceEnricher } from '@cleverbrush/otel';

const logger = createLogger({
sinks: [consoleSink(), otelLogSink()],
enrichers: [traceEnricher()],
}); +
+ +

@cleverbrush/log itself stays free of any OpenTelemetry runtime dependency.

+ +

BSD-3-Clause

+

Modules

clickhouse
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_mapper.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_mapper.html new file mode 100644 index 00000000..c33ac154 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_mapper.html @@ -0,0 +1,206 @@ +@cleverbrush/mapper | Libraries

Module @cleverbrush/mapper

@cleverbrush/mapper

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A type-safe, declarative object mapper for converting objects between different @cleverbrush/schema representations. Uses PropertyDescriptors as pointers to properties (similar to expressions in C# .NET) and enforces compile-time completeness — TypeScript will produce an error if any target property is not mapped, auto-mapped, or explicitly ignored.

+ +

The problem: Converting between different object shapes — API responses to domain models, domain models to DTOs, database rows to view models — is tedious and error-prone. You write manual mapping functions full of destination.x = source.y assignments. Add a new property to a schema and nothing tells you the mapper is incomplete. The bug shows up at runtime, not at compile time.

+

The solution: @cleverbrush/mapper uses PropertyDescriptor-based selectors (similar to C# expression trees) for type-safe property mapping. The TypeScript compiler enforces that every target property is mapped — unmapped properties cause a compile-time error. You literally cannot forget a field.

+

What makes it different:

+
    +
  • Compile-time completeness — unmapped properties are a TypeScript error, not a runtime surprise
  • +
  • Type-safe selectors.for((t) => t.name).from((s) => s.name) — fully checked at compile time, not string-based
  • +
  • Auto-mapping — properties with the same name and compatible type are mapped automatically; you only configure what differs
  • +
  • Immutable registryconfigure() returns a new registry; safe to share and extend
  • +
  • No decorators or classes — works with plain objects and schemas
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/mapperAutoMapper-tsclass-transformermorphism
Compile-time completeness
Type-safe selectors
No decorators required
Works without classes
Auto-mapping
Immutable registry
Nested schema support~~
+ +
npm install @cleverbrush/mapper
+
+ +

Peer dependency: @cleverbrush/schema

+ +
import { object, string, number } from '@cleverbrush/schema';
import { mapper } from '@cleverbrush/mapper';

// Define source and target schemas
const ApiUser = object({
first_name: string(),
last_name: string(),
birth_year: number()
});

const DomainUser = object({
fullName: string(),
age: number()
});

// Configure the mapping — returns a new (immutable) registry
const registry = mapper().configure(
ApiUser,
DomainUser,
(m) =>
m
.for((t) => t.fullName)
.compute((src) => src.first_name + ' ' + src.last_name)
.for((t) => t.age)
.compute((src) => new Date().getFullYear() - src.birth_year)
);

// Get the mapper function and use it
const mapFn = registry.getMapper(ApiUser, DomainUser);

const dto = await mapFn({
first_name: 'Jane',
last_name: 'Doe',
birth_year: 1995
});
// { fullName: 'Jane Doe', age: <current year - 1995> } +
+ + +
    +
  1. Define schemas — use @cleverbrush/schema to define source and target shapes
  2. +
  3. Configure mappings — use .for() to select a target property, then .from(), .compute(), or .ignore() to define how it's populated
  4. +
  5. Auto-mapping fills the gaps — properties with the same name and compatible type are mapped automatically
  6. +
  7. Get a mapper functionregistry.getMapper(from, to) returns an async function that transforms objects
  8. +
  9. TypeScript enforces completeness — if any target property is unmapped, you get a compile-time error
  10. +
+ +

The mapper enforces multiple layers of compile-time safety:

+ +

Every target property must be either mapped, auto-mapped, or explicitly ignored. If you forget to map a property, TypeScript will produce a compile-time error on the configure callback return:

+
mapper().configure(
UserSchema,
UserDtoSchema,
(m) =>
m
.for((t) => t.name)
.from((f) => f.name)
.for((t) => t.cityName)
.from((f) => f.address.city)
// TS Error: Type 'Mapper<..., "fullAddress", ...>' is not assignable to
// type 'Mapper<..., never, ...>'.
// Types of property '[SYMBOL_UNMAPPED]' are incompatible.
// Type '"fullAddress"' is not assignable to type 'never'.
); +
+ +

The error message shows the names of the unmapped properties directly in the type mismatch.

+ +

from only shows source properties whose InferType is assignable to the target property's type. If you select an incompatible property (e.g., mapping a number to a string), TypeScript produces a compile-time error:

+
// Trying to map a string target from a number source
m.for((t) => t.cityName).from((f) => f.houseNr)
// TS Error: source property type is not assignable to target property type
// Use .compute() instead to transform the value +
+ + +

When from maps between two ObjectSchemaBuilder properties, a mapping for that schema pair must be registered in the registry first. Otherwise, TypeScript produces a compile-time error:

+
const PersonSchema = object({ name: string(), address: AddressSchema });
const PersonDtoSchema = object({ name: string(), address: AddressDtoSchema });

// Error — AddressSchema→AddressDtoSchema is not registered
mapper().configure(
PersonSchema,
PersonDtoSchema,
(m) =>
m
.for((t) => t.name)
.from((f) => f.name)
.for((t) => t.address)
.from((f) => f.address) // TS Error: Register a mapping for the
// source→target schema pair first
); +
+ + +

Properties that can be automatically determined don't need explicit mapping configuration. Auto-mapping activates in two scenarios:

+ +

When the source and target schemas have a property with the same name and compatible InferType, it is auto-mapped automatically:

+
const Source = object({
id: string(),
name: string(),
email: string(),
age: number()
});

const Target = object({
id: string(), // same name + type → auto-mapped
name: string(), // same name + type → auto-mapped
email: string(), // same name + type → auto-mapped
ageGroup: string() // different name → must be configured
});

const registry = mapper().configure(Source, Target, (m) =>
m
.for((t) => t.ageGroup)
.compute((src) => src.age < 18 ? 'minor' : 'adult')
// id, name, email are auto-mapped — no configuration needed!
); +
+ + +

When both the source and target have a same-name property that is an ObjectSchemaBuilder, and a mapping for that schema pair has been previously registered, the nested property is auto-mapped using the registered mapper:

+
const AddressSchema = object({ city: string(), houseNr: number() });
const AddressDtoSchema = object({ city: string() });

const PersonSchema = object({ name: string(), address: AddressSchema });
const PersonDtoSchema = object({ name: string(), address: AddressDtoSchema });

const registry = mapper()
// Register Address mapping first
.configure(AddressSchema, AddressDtoSchema, (m) =>
m.for((t) => t.city).from((f) => f.city)
)
// address is auto-mapped using the registered AddressSchema→AddressDtoSchema mapper
.configure(PersonSchema, PersonDtoSchema, (m) =>
m.for((t) => t.name).from((f) => f.name)
);

const mapFn = registry.getMapper(PersonSchema, PersonDtoSchema);
const result = await mapFn({
name: 'Alice',
address: { city: 'Berlin', houseNr: 10 }
});
// result: { name: 'Alice', address: { city: 'Berlin' } } +
+ +

Ordering matters: nested mappings must be registered before the parent mapping. Explicit mappings via compute or ignore take priority over auto-mapping.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StrategyUsagePurpose
.from(selector).for(t => t.x).from(s => s.y)Copy from a source property (supports nested paths)
.compute(fn).for(t => t.x).compute(s => s.a + s.b)Compute from a sync or async function
.ignore().for(t => t.x).ignore()Exclude a target property
(auto-mapped)(no configuration needed)Same-name, compatible-type primitives or registered nested schemas
+

Every non-auto-mappable target property must be either mapped or explicitly ignored. Unmapped properties cause:

+
    +
  • A compile-time TypeScript type error — a type-assignability mismatch that includes the unmapped property names in the type parameters
  • +
  • A runtime MapperConfigurationError if type checks are bypassed
  • +
+ + +

A convenience factory function that creates a new MappingRegistry:

+
const registry = mapper()
.configure(A, B, (m) => ...)
.configure(C, D, (m) => ...); +
+ + +

Defines a mapping between two schemas and returns a new immutable registry containing the mapping. The callback fn receives a fresh Mapper and must return it after configuring all non-auto-mappable property mappings.

+

Throws if schemas are invalid, the mapping is a duplicate, or if unmapped properties remain that cannot be auto-mapped.

+ +

Retrieves a previously registered mapper function. Throws if no mapper has been registered for the given schema pair.

+
const mapFn = registry.getMapper(ApiUser, DomainUser);
const result = await mapFn(sourceObject); +
+ + +

A fluent builder for configuring how each target property is populated:

+
    +
  • .for(selector) — selects a target property to configure
  • +
  • .from(selector) — maps from a source property (types must be compatible)
  • +
  • .compute(fn) — computes the value from the entire source object (sync or async)
  • +
  • .ignore() — explicitly excludes the property
  • +
  • .getMapper() — returns the mapping function (only available when all properties are mapped)
  • +
+
const mapper = new Mapper(SourceSchema, TargetSchema);
const mapFn = mapper
.for((t) => t.fullName)
.compute((src) => `${src.firstName} ${src.lastName}`)
.for((t) => t.age)
.from((src) => src.years)
.getMapper();

const result = await mapFn(sourceObject); +
+ + +

A complete example mapping API responses through multiple layers:

+
import { object, string, number } from '@cleverbrush/schema';
import { mapper } from '@cleverbrush/mapper';

// API response shape
const ApiOrderResponse = object({
order_id: string(),
customer_name: string(),
total_cents: number(),
status_code: number()
});

// Domain model
const Order = object({
id: string(),
customer: string(),
totalPrice: string(),
status: string()
});

const registry = mapper().configure(
ApiOrderResponse,
Order,
(m) =>
m
.for((t) => t.id)
.from((s) => s.order_id)
.for((t) => t.customer)
.from((s) => s.customer_name)
.for((t) => t.totalPrice)
.compute((s) => `$${(s.total_cents / 100).toFixed(2)}`)
.for((t) => t.status)
.compute((s) => {
const statuses: Record<number, string> = {
0: 'pending', 1: 'confirmed', 2: 'shipped', 3: 'delivered'
};
return statuses[s.status_code] ?? 'unknown';
})
);

const mapOrder = registry.getMapper(ApiOrderResponse, Order);
const order = await mapOrder({
order_id: 'ORD-123',
customer_name: 'Alice Smith',
total_cents: 4999,
status_code: 2
});
// { id: 'ORD-123', customer: 'Alice Smith', totalPrice: '$49.99', status: 'shipped' } +
+ + +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode — all type selectors and mapping configurations are validated at compile time
  • +
  • Unit tests: Vitest — runtime tests + type-level tests (expectTypeOf) covering auto-mapping, computed fields, nested schemas, and compile-time completeness errors
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Classes

Mapper
MapperConfigurationError
MappingRegistry
PropertyMappingBuilder

Type Aliases

SchemaToSchemaMapperResult

Functions

mapper
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_orm-cli.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_orm-cli.html new file mode 100644 index 00000000..2f59c583 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_orm-cli.html @@ -0,0 +1,147 @@ +@cleverbrush/orm-cli | Libraries

Module @cleverbrush/orm-cli

@cleverbrush/orm-cli

+

A standalone CLI for managing PostgreSQL schema migrations for projects built +with @cleverbrush/orm.

+
cb-orm migrate generate [name]   # diff DBschema, emit TS migration file (name defaults to "migration")
cb-orm migrate run # apply pending migrations
cb-orm migrate rollback # roll back last batch
cb-orm migrate status # list applied/pending migrations
cb-orm db push # sync schema in-place (dev only) +
+ +
+ +
npm install --save-dev @cleverbrush/orm-cli
+
+ +

knex is a peer dependency and must be installed in your project. tsx is a regular dependency and is installed automatically.

+
+ + +
// db.config.ts
import knex from 'knex';
import { defineConfig } from '@cleverbrush/orm-cli';
import { UserEntity, TodoEntity } from './src/db/schemas.js';

const db = knex({
client: 'pg',
connection: process.env.DATABASE_URL
});

export default defineConfig({
knex: db,
entities: { users: UserEntity, todos: TodoEntity },
migrations: {
directory: './migrations', // where .ts migration files are written
tableName: 'knex_migrations' // default; override if needed
}
}); +
+ + +
{
"scripts": {
"db:generate": "cb-orm migrate generate",
"db:run": "cb-orm migrate run",
"db:rollback": "cb-orm migrate rollback",
"db:status": "cb-orm migrate status",
"db:push": "cb-orm db push"
}
} +
+ +
+ + +

Compares every entity in config.entities against the live database and emits +a single timestamped TypeScript migration file when differences are found.

+
    +
  • New tables → CREATE TABLE.
  • +
  • Existing tables with column/index/FK changes → ALTER TABLE.
  • +
  • Multiple tables are FK-dependency-ordered (parents created first, dropped last).
  • +
  • Polymorphic (CTI) entities include one entry per variant table.
  • +
  • File written as <dir>/YYYYMMDDHHmmss_<name>.ts.
  • +
+
npx cb-orm migrate generate add_role_column
# → migrations/20260423120000_add_role_column.ts +
+ + +

Applies all pending migrations via knex.migrate.latest.

+
npx cb-orm migrate run
# Batch 1. Applied 2 migration(s):
# ✓ 20260423000001_init.ts
# ✓ 20260423120000_add_role_column.ts +
+ +

Use --to <filename> to migrate up to a specific file:

+
npx cb-orm migrate run --to 20260423000001_init.ts
+
+ + +

Rolls back the most recently applied batch.

+
npx cb-orm migrate rollback
# Roll back all batches:
npx cb-orm migrate rollback --all +
+ + +

Lists applied and pending migrations.

+
npx cb-orm migrate status

# Applied migrations:
# ✓ 20260423000001_init.ts
# Pending migrations:
# ○ 20260423120000_add_role_column.ts +
+ + +

Applies all schema changes directly to the database without writing a +migration file. Runs inside a single transaction.

+
+

Warning — dev only. Requires --yes when NODE_ENV=production.

+
+
npx cb-orm db push          # asks for confirmation
npx cb-orm db push --yes # skip confirmation +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagCommandsDescription
--config <path>allPath to config file (default: db.config.ts in cwd)
--dir <path>allMigrations directory (overrides config.migrations.directory)
--to <name>migrate runApply up to a specific migration filename
--allmigrate rollbackRoll back all batches
--yesdb pushSkip the interactive confirmation prompt
+
+ +

The CLI delegates all schema intelligence to @cleverbrush/knex-schema:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StepFunction
Detect new tablestableExistsInDb(knex, tableName)
Generate CREATE TABLE sourcegenerateCreateTableSource(schema)
Introspect live tableintrospectDatabase(knex, tableName)
Diff schema vs DBdiffSchema(schema, dbState)
Generate ALTER TABLE sourcegenerateMigration(diff, tableName)
Apply diff without fileapplyDiff(knex, diff, tableName)
Polymorphic variant tablesgetPolymorphicVariantSchemas(schema)
+

tsx is used to load db.config.ts at runtime by registering the +tsx/esm/api hook before any dynamic import() of the config file.

+

Interfaces

MigrationsConfig
OrmCliConfig

Functions

defineConfig
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_orm.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_orm.html new file mode 100644 index 00000000..5733416a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_orm.html @@ -0,0 +1,313 @@ +@cleverbrush/orm | Libraries

Module @cleverbrush/orm

@cleverbrush/orm

+

EF-Core-like typed ORM layer on top of @cleverbrush/knex-schema.

+
    +
  • Define entities with defineEntity(schema) and declare relations via +.hasOne() / .hasMany() / .belongsTo() / .belongsToMany().
  • +
  • Group entities into a typed context with createDb(knex, { todos, users }).
  • +
  • Access db.todos, db.users as fully-typed DbSet<TEntity> instances.
  • +
  • Eager-load related entities with .include(t => t.author).
  • +
  • Use { tracking: true } for an identity map + change-tracking context.
  • +
  • Model inheritance with STI (single-table) and CTI (class-table) variants.
  • +
  • Manage schema migrations with @cleverbrush/orm-cli.
  • +
+
+ +
npm install @cleverbrush/orm
+
+ +

knex is a peer dependency (install it alongside @cleverbrush/orm). @cleverbrush/knex-schema is a direct dependency and is installed automatically.

+
+ + +
import { number, object, string, defineEntity } from '@cleverbrush/orm';

const UserSchema = object({
id: number().primaryKey(),
email: string().hasColumnName('email_address'),
name: string(),
}).hasTableName('users');

export const UserEntity = defineEntity(UserSchema); +
+ + +
import knex from 'knex';
import { createDb } from '@cleverbrush/orm';
import { UserEntity } from './schemas.js';

const knexClient = knex({ client: 'pg', connection: process.env.DATABASE_URL });

const db = createDb(knexClient, { users: UserEntity }); +
+ + +
// Find by PK
const alice = await db.users.find(1);

// Find with WHERE clause
const user = await db.users.where(t => t.email, 'alice@example.com').first();

// Insert
const created = await db.users.save({ email: 'bob@example.com', name: 'Bob' });

// Update (PK present → UPDATE)
const updated = await db.users.save({ id: 1, email: 'alice@example.com', name: 'Alice' }); +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
.find(pk)Find one row by PK; returns undefined when not found
.findOrFail(pk)Like .find, but throws EntityNotFoundError when not found
.findMany([pk1, pk2, …])Fetch multiple rows by PK in one query
.all()Alias for .execute() — returns all rows
.first()Returns the first matching row or undefined
.where(col, value)Adds a WHERE predicate (chainable)
.include(t => t.rel)Eager-loads a relation (chainable)
.save(graph)Insert or update a row graph (transactional)
.ofVariant(key)Return a typed VariantDbSet scoped to a polymorphic variant
.query()Returns the underlying EntityQuery for advanced querying
.withTransaction(trx)Returns a new DbSet bound to an existing transaction
+

Any method from the underlying SchemaQueryBuilder (e.g. .execute(), +.where(), .orderBy(), .pluck(), .count()) is also available and +fully typed.

+
+ +

Declare relations on the entity using fluent builders. Relations are optional +by default (omit from the save-graph to skip them).

+
const TodoSchema = object({
id: number().primaryKey(),
title: string(),
userId: number().hasColumnName('user_id'),
author: object({ id: number().primaryKey(), name: string() })
.hasTableName('users').optional(),
}).hasTableName('todos');

const TodoEntity = defineEntity(TodoSchema)
.belongsTo(t => t.author, 'userId'); // FK is on todos.user_id → users.id

const UserEntity = defineEntity(UserSchema)
.hasMany(t => t.todos, TodoEntity, 'userId'); // FK on todos.user_id +
+ + +
const todo = await db.todos
.where(t => t.id, 42)
.include(t => t.author)
.first();

console.log(todo?.author?.name); // fully typed +
+ + +

db.todos.save(graph) traverses the whole object graph and persists every +level in the correct FK order inside a single transaction.

+
// Create a new user and a new todo in one call.
const result = await db.users.save({
name: 'Alice',
todos: [
{ title: 'Buy milk', completed: false, userId: 0 },
],
}); +
+ +

Topology rules:

+
    +
  • belongsTo parents are inserted first; their PK feeds the child FK.
  • +
  • The root entity is then written.
  • +
  • hasOne / hasMany children inherit the root PK into their FK.
  • +
  • belongsToMany children may be new objects (inserted + pivot) or bare +{ pk: value } references (pivot only).
  • +
+
+ +

Pass { tracking: true } to createDb to get a TrackedDbContext. The +context maintains an identity map (same PK → same object reference) and +tracks every mutation automatically.

+
const db = createDb(knex, { users: UserEntity }, { tracking: true });

// Load entity — it's now in the identity map.
const user = await db.users.find(1);

// Mutate normally.
user.name = 'Updated';

// Flush all dirty entries in a single transaction.
const { inserted, updated, deleted } = await db.saveChanges(); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method / propertyDescription
.attach(key, entity)Register an existing entity as Unchanged
.entry(entity)Return the EntityEntry for a tracked entity
.entry(entity).state'Added' | 'Modified' | 'Unchanged' | 'Deleted'
.entry(entity).isModified(field?)Check if a specific (or any) field changed
.entry(entity).reset()Revert the entity to its last snapshot
.detach(entity)Remove an entity from the tracker
.remove(entity)Mark a tracked entity as Deleted
.saveChanges()Flush all pending changes to the DB
.discardChanges()Roll back all in-memory changes
.reload(entity)Re-fetch the entity from the DB and refresh its snapshot
.onSavingChanges(hook)Register a pre-flush callback (e.g. for audit fields)
[Symbol.asyncDispose]()Usable in await using blocks; throws on pending changes
+ +

Mark any numeric or timestamp column as a row version:

+
const OrderSchema = object({
id: number().primaryKey(),
status: string(),
version: number().rowVersion(), // auto-incremented by the ORM on every UPDATE
}).hasTableName('orders'); +
+ +

saveChanges() appends AND version = <snapshot> to every UPDATE and throws +ConcurrencyError if rowCount === 0.

+ +
async function updateUser(userId: number) {
await using db = createDb(knex, { users: UserEntity }, { tracking: true });
const user = await db.users.find(userId);
if (!user) return;
user.name = 'Updated';
await db.saveChanges();
} // Symbol.asyncDispose fires here; throws if changes are still pending +
+ +
+ + +

All variants share one table; a discriminator column identifies the type.

+
const ActivityBase = object({
id: number().primaryKey(),
type: string(),
todoId: number().hasColumnName('todo_id'),
}).hasTableName('activities');

const ActivityEntity = defineEntity(ActivityBase)
.discriminator('type')
.stiVariant('assigned', object({
type: string('assigned'),
assigneeId: number().hasColumnName('assignee_id').optional(),
}))
.stiVariant('commented', object({
type: string('commented'),
body: string().optional(),
})); +
+ + +

The base row is in one table; each variant has its own extension table.

+
const AssignedExtras = defineEntity(
object({
activityId: number().hasColumnName('activity_id'),
assigneeId: number().hasColumnName('assignee_id'),
}).hasTableName('assigned_activities')
);

const ActivityEntity = defineEntity(ActivityBase)
.discriminator('type')
.ctiVariant('assigned', AssignedExtras, t => t.activityId); +
+ + +

Call db.set.ofVariant('key') to obtain a VariantDbSet — a typed view +scoped to that variant, analogous to EF Core's Set<DerivedType>(). All +reads are pre-filtered by the discriminator; writes use the correct STI / CTI +logic automatically.

+
// Insert a new variant row (discriminator is set automatically)
const activity = await db.activities.ofVariant('assigned').insert({
todoId: 42,
assigneeId: 9,
});
// activity.type === 'assigned'
// activity.assigneeId === 9

// Find a single variant by PK
const found = await db.activities.ofVariant('assigned').find(activityId);

// Update matching rows (chain .where() before .update())
await db.activities.ofVariant('assigned').where(t => t.id, 3).update({ assigneeId: 99 });

// Delete matching rows
await db.activities.ofVariant('assigned').where(t => t.id, 3).delete(); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
.insert(payload)Insert a new variant row; discriminator is set automatically
.update(patch)Update variant columns for rows matched by the current WHERE clause
.delete()Delete rows matched by the current WHERE clause (CTI: atomic)
.find(pk)Find a single variant row by PK; undefined if not found
.findOrFail(pk)Like .find, but throws EntityNotFoundError
.findMany([pk…])Fetch multiple variant rows by PK in one query
.where(col, value)Adds a WHERE predicate (chainable; returns VariantDbSet)
.include(t => t.rel)Eager-loads a relation (chainable; returns VariantDbSet)
.withTransaction(trx)Returns a new VariantDbSet bound to an existing transaction
+

Calling .insert() / .update() / .delete() directly on the polymorphic +base DbSet (without ofVariant) throws a runtime error — use ofVariant +for all writes on polymorphic entities.

+
+ +
// One-off transaction (non-tracking context)
await db.transaction(async trx => {
const user = await trx.users.save({ name: 'Alice' });
await trx.todos.save({ title: 'Buy milk', userId: user.id });
});

// Wrap existing transaction
const user = await db.users.withTransaction(existingTrx).save({ name: 'Alice' }); +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassThrown when
EntityNotFoundErrorfindOrFail can't locate the requested PK
ConcurrencyErrorsaveChanges UPDATE/DELETE hits a row-version mismatch
InvariantViolationErrorPK or discriminator column mutated on a tracked entity
PendingChangesError[Symbol.asyncDispose] fires with unsaved changes
+
+ +

Use @cleverbrush/orm-cli to generate and apply migration files +from your entity definitions:

+
# Diff schema vs DB → emit a TypeScript migration file
npx cb-orm migrate generate add_users_table

# Apply pending migrations
npx cb-orm migrate run +
+ +
+ + +

Classes

ConcurrencyError
Entity
EntityNotFoundError
InvariantViolationError
PendingChangesError
SchemaQueryBuilder

Interfaces

AddColumnDiff
AddForeignKeyDiff
AddIndexDiff
AlterColumnDiff
BoundQuery
CursorPaginationResult
DatabaseCheckInfo
DatabaseColumnInfo
DatabaseForeignKeyInfo
DatabaseIndexInfo
DatabaseTableState
DbSet
EntityEntry
EntityQuery
JoinManySpec
JoinOneSpec
MigrationDiff
PaginationResult
PrimaryKeyColumns
RelationInfo
RelationSpec
ResolvedVariantConfig
ResolvedVariantSpec
RowVersionColumn
SchemaSnapshot
ValidatedJoinManySpec
ValidatedJoinOneSpec
VariantDbSet

Type Aliases

ColumnRef
DbContext
EntityMap
EntityPropSelector
EntityRelationKeys
EntityRelations
EntityResult
EntityResultByVariant
EntitySchema
EntityVariantUnion
EntryState
ExtractBranch
HasVariants
InsertType
PrimaryKeyOf
PrimaryKeyValueOf
RelKeyTree
ResolvedRel
RowVersionStrategy
SaveGraph
SavingChangesHook
SchemaKeys
SchemaProps
SelectProjection
SelectSelector
TrackedDbContext
UnwrapNavSchema
ValidatedSpec
VariantBranch
VariantInsertPayload
VariantResult
VariantStorageType
VariantUpdatePayload
WithIncluded
WithJoinedMany
WithJoinedOne
WithRelation
WithVariantIncluded

Variables

any
array
boolean
COMPOSITE_PRIMARY_KEY_BRAND
date
dbExtension
ddlExtension
EXTRA_TYPE_BRAND
func
MAPPERS
METHOD_LITERAL_BRAND
number
object
POLYMORPHIC_TYPE_BRAND
PRIMARY_KEY_BRAND
string
union

Functions

applyDiff
buildColumnMap
clearRow
createDb
createQuery
defineEntity
diffSchema
entitiesToSnapshot
entitySchemaToTableState
generateCreatePolymorphicTables
generateCreateTable
generateCreateTableSource
generateMigration
generateMigrationsForContext
getColumnName
getPolymorphicVariantSchemas
getPrimaryKeyColumns
getProjections
getRowVersionColumn
getTableName
getVariants
introspectDatabase
isDiffEmpty
loadSnapshot
mapObject
mapValue
query
rawQuery
resolveColumnRef
resolvePropertyKey
tableExistsInDb
writeSnapshot
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel..html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel..html new file mode 100644 index 00000000..3041615b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel..html @@ -0,0 +1 @@ + | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.client.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.client.html new file mode 100644 index 00000000..1d89cc07 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.client.html @@ -0,0 +1 @@ +client | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.html new file mode 100644 index 00000000..252a3f79 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.html @@ -0,0 +1,100 @@ +@cleverbrush/otel | Libraries

Module @cleverbrush/otel

@cleverbrush/otel

+

OpenTelemetry instrumentation for the Cleverbrush framework — traces, logs, and metrics over OTLP for @cleverbrush/server, @cleverbrush/orm, and @cleverbrush/log. Designed to ship straight into SigNoz, Grafana Tempo, Jaeger, or any OTLP-compatible backend.

+ +
npm install @cleverbrush/otel @opentelemetry/api
# Optional auto-instrumentations (only if you want them):
npm install @opentelemetry/instrumentation-http \
@opentelemetry/instrumentation-undici \
@opentelemetry/instrumentation-runtime-node +
+ + + +
// telemetry.ts — load FIRST
import { setupOtel } from '@cleverbrush/otel';
import {
outboundHttpInstrumentations,
runtimeMetrics
} from '@cleverbrush/otel/instrumentations';

export const otel = setupOtel({
serviceName: 'todo-backend',
serviceVersion: '1.0.0',
environment: process.env.NODE_ENV,
otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
instrumentations: [
...outboundHttpInstrumentations(),
...runtimeMetrics()
]
}); +
+ +

Run with:

+
node --import ./dist/telemetry.js dist/index.js
+
+ +

Don't forget to await otel.shutdown() on SIGTERM / SIGINT so batched data flushes.

+ +
import { tracingMiddleware } from '@cleverbrush/otel';
import { createServer } from '@cleverbrush/server';

const server = createServer()
.use(tracingMiddleware({ excludePaths: ['/health'] })) // first!
.use(corsMiddleware)
// ... rest of the chain +
+ +

A SpanKind.SERVER span is opened per request, named operationId or METHOD route and tagged with the standard HTTP semantic-convention attributes. W3C traceparent is extracted, so spans link to upstream callers.

+ +
import { createClient } from '@cleverbrush/client';
import { clientTracingMiddleware } from '@cleverbrush/otel/client';

const client = createClient(api, {
baseUrl: 'http://todo-backend:3000',
middlewares: [clientTracingMiddleware()]
}); +
+ +

clientTracingMiddleware() opens a SpanKind.CLIENT span around each typed client call and injects W3C traceparent / tracestate / baggage headers. When the downstream Cleverbrush service uses tracingMiddleware(), SigNoz and other OTel backends show both services under one distributed trace.

+

Put the tracing middleware first in the client middleware list so it wraps retries, timeouts, and batching. If you use batching(), keep batching last so each logical subrequest carries its own trace context.

+ +
import { instrumentKnex } from '@cleverbrush/otel';
import knex from 'knex';

const db = instrumentKnex(
knex({ client: 'pg', connection: '...' })
); +
+ +

Every Knex query becomes a SpanKind.CLIENT span with db.system.name, db.namespace, db.operation.name, db.query.text, and parented under the active server span automatically.

+ +
import { createLogger, consoleSink } from '@cleverbrush/log';
import { otelLogSink, traceEnricher } from '@cleverbrush/otel';

const logger = createLogger({
minimumLevel: 'information',
sinks: [consoleSink({ theme: 'dark' }), otelLogSink()],
enrichers: [traceEnricher()] // attaches TraceId/SpanId to every event
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExportPurpose
setupOtel(config)Boot the Node SDK; returns { shutdown(), sdk }
tracingMiddleware(opts?)@cleverbrush/server middleware; opens SERVER span
clientTracingMiddleware(opts?)@cleverbrush/client middleware; opens CLIENT span
instrumentKnex(knex, opts?)Hook a Knex instance; emits CLIENT span per query
otelLogSink(opts?)@cleverbrush/log sink → OTLP log records
traceEnricher()@cleverbrush/log enricher → adds TraceId / SpanId
configureOtel(services, opts?)Register ITracer / IMeter in @cleverbrush/di
outboundHttpInstrumentations()Lazy-load HTTP / undici client auto-instrumentations
runtimeMetrics()Lazy-load Node runtime metrics
OTEL_SPAN_ITEM_KEYctx.items key under which the request span is stashed
+

All optional auto-instrumentations and knex are declared as optional peer dependencies, so the package is usable with only @opentelemetry/api installed.

+ +

tracingMiddleware stores the active server span on ctx.items under OTEL_SPAN_ITEM_KEY. Use this to attach custom attributes or events from inside endpoint handlers:

+
import { OTEL_SPAN_ITEM_KEY } from '@cleverbrush/otel';
import type { Span } from '@opentelemetry/api';

// Inside a @cleverbrush/server endpoint handler
const span = ctx.items.get(OTEL_SPAN_ITEM_KEY) as Span | undefined;
span?.setAttribute('app.user_id', userId);
span?.addEvent('cache.miss', { key: cacheKey }); +
+ + +

setupOtel reads OTEL_EXPORTER_OTLP_ENDPOINT from the environment by default (recommended). Per-signal endpoints (tracesEndpoint / logsEndpoint / metricsEndpoint) and signal toggles (disableTraces, disableLogs, disableMetrics) let you wire up split collectors. Headers (e.g. for SaaS tokens) are passed via headers: { authorization: 'Bearer …' }.

+ +

tracingMiddleware does not record query strings (recordQuery: false by default) and instrumentKnex lets you redact SQL via sanitizeStatement. otelLogSink accepts a sanitizeAttribute hook to drop sensitive fields per event.

+ +

BSD-3-Clause

+

Modules

client
instrumentations
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.instrumentations.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.instrumentations.html new file mode 100644 index 00000000..1d1a8146 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_otel.instrumentations.html @@ -0,0 +1,8 @@ +instrumentations | Libraries

Module instrumentations

Opt-in auto-instrumentations.

+

These helpers wrap upstream OpenTelemetry instrumentation packages +for outbound HTTP and Node.js runtime metrics. They are kept in a +separate entry point so projects that don't want them avoid the +extra dependencies and the require-in-the-middle patching at +startup.

+

Pass the returned arrays to setupOtel({ instrumentations: [...] }).

+

Functions

outboundHttpInstrumentations
runtimeMetrics
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_react-form.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_react-form.html new file mode 100644 index 00000000..18e39a57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_react-form.html @@ -0,0 +1,457 @@ +@cleverbrush/react-form | Libraries

Module @cleverbrush/react-form

@cleverbrush/react-form

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A headless, schema-driven form system for React based on @cleverbrush/schema. Uses PropertyDescriptors for type-safe field binding, supports global UI renderer configuration via a provider, and is completely UI-agnostic — works with plain HTML, MUI, Ant Design, or any component library.

+ +

The problem: Every popular React form library — React Hook Form, Formik, React Final Form — requires you to reference fields by string names: register("email"), <Field name="address.city" />. The moment you pass a field name as a string, you lose TypeScript's type safety. Rename a property in your data model and the compiler stays silent — your form just silently breaks at runtime. The larger your codebase, the more of these invisible string references you accumulate, and the more fragile every refactor becomes.

+
// React Hook Form — field names are plain strings
const { register } = useForm<User>();
<input {...register("name")} /> // ← no compiler error if "name" is renamed
<input {...register("emial")} /> // ← typo: silently fails at runtime

// Formik — same problem
<Field name="address.city" /> // ← rename "city" → "town" and nothing warns you +
+ +

The solution: @cleverbrush/react-form binds fields via PropertyDescriptor selectors — actual TypeScript expressions like (t) => t.address.city — instead of strings. The compiler knows the exact shape of your schema, so a renamed or mistyped property is a compile-time error, not a runtime surprise. On top of that, the schema IS the validation, the type definition, AND the form field configuration. One source of truth.

+
// @cleverbrush/react-form — fully type-safe selectors
<Field forProperty={(t) => t.name} form={form} /> // ✓ checked at compile time
<Field forProperty={(t) => t.address.city} form={form} /> // ✓ rename "city" → compiler error
<Field forProperty={(t) => t.emial} form={form} /> // ✗ compile error: "emial" doesn't exist +
+ +

What makes it different:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/react-formReact Hook FormFormikReact Final Form
Schema-driven validation✓ built-in~ via resolver~ via plugin
Single source of truth (types + validation)
Type-safe field selectors~
Headless / UI-agnostic~
Global renderer system
Auto-field rendering by type + variant
Nested objects
Async validation
+ +
npm install @cleverbrush/react-form
+
+ +

Peer dependencies: react >=18, @cleverbrush/schema ^2.0.0

+ +
import { object, string, number } from '@cleverbrush/schema';
import { useSchemaForm, FormSystemProvider, Field } from '@cleverbrush/react-form';

// 1. Define schema — reuse across forms, API validation, mapping, etc.
const ContactSchema = object({
name: string().required('Name is required').minLength(2, 'Name must be at least 2 characters'),
email: string().required('Email is required'),
age: number().required('Age is required').min(18, 'Must be at least 18')
});

// 2. Define renderers once per app — maps schema types to UI components
const renderers = {
string: ({ value, onChange, onBlur, error, touched }) => (
<div>
<input
type="text"
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
/>
{touched && error && <span className="error">{error}</span>}
</div>
),
number: ({ value, onChange, onBlur, error, touched }) => (
<div>
<input
type="number"
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
/>
{touched && error && <span className="error">{error}</span>}
</div>
)
};

// 3. Each form component only picks which fields to show — no boilerplate
function ContactForm() {
const form = useSchemaForm(ContactSchema);

const handleSubmit = async () => {
const result = await form.submit();
if (result.valid) {
console.log('Submitted:', result.object);
}
};

return (
<div>
<Field forProperty={(t) => t.name} form={form} />
<Field forProperty={(t) => t.email} form={form} />
<Field forProperty={(t) => t.age} form={form} />
<button onClick={handleSubmit}>Submit</button>
</div>
);
}

// 4. Wrap once at the app root — all forms below share the renderers
function App() {
return (
<FormSystemProvider renderers={renderers}>
<ContactForm />
</FormSystemProvider>
);
} +
+ + +
    +
  1. Define a schema using @cleverbrush/schema — this is your single source of truth for types, validation rules, and field metadata
  2. +
  3. Register renderers via FormSystemProvider — plain functions that map schema types ("string", "number", "boolean") to your UI components (plain HTML, MUI, Ant Design, etc.)
  4. +
  5. Create a form instance via useSchemaForm(schema) — returns state management, validation, submit/reset lifecycle
  6. +
  7. Render fields via <Field forProperty={(t) => t.name} form={form} /> — the component looks up the registered renderer for the field's schema type
  8. +
  9. Submitform.submit() runs the schema's full validation and returns a typed result
  10. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PartResponsibilityWhen to Use
FormSystemProviderGlobal renderer registry via React ContextOnce at the app root
useSchemaFormPer-schema form instance (state, validation, lifecycle)In every component that needs a form
useFieldDescriptor-based field binding (value, dirty, touched, error)When you want fine-grained control
FieldUI-agnostic component that resolves renderers by schema typeFor most form fields — quick and declarative
+ +

Renderers are plain functions that receive field state and return React nodes. Define a renderer map keyed by schema type (string, number, boolean, etc.):

+ +
import { FieldRenderProps } from '@cleverbrush/react-form';

const htmlRenderers = {
string: ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input
type="text"
name={name}
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
{...fieldProps}
/>
{touched && error && <span className="error">{error}</span>}
</div>
),
number: ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input
type="number"
name={name}
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
{...fieldProps}
/>
{touched && error && <span className="error">{error}</span>}
</div>
),
boolean: ({ value, onChange, label }: FieldRenderProps) => (
<label>
<input
type="checkbox"
checked={value ?? false}
onChange={(e) => onChange(e.target.checked)}
/>
{label}
</label>
)
}; +
+ + +

You can register renderers for specific variants using a "type:variant" key. +When <Field variant="password" /> is rendered on a string field, the +registry is checked for "string:password" first, then falls back to "string":

+
const renderers = {
// Default string renderer
string: ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input type="text" name={name} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onBlur={onBlur}
{...fieldProps} />
{touched && error && <span className="error">{error}</span>}
</div>
),
// Password variant — rendered when <Field variant="password" /> is used on a string field
'string:password': ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input type="password" name={name} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onBlur={onBlur}
{...fieldProps} />
{touched && error && <span className="error">{error}</span>}
</div>
),
// Textarea variant
'string:textarea': ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<textarea name={name} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onBlur={onBlur}
{...(fieldProps as any)} />
{touched && error && <span className="error">{error}</span>}
</div>
)
}; +
+ + +
import { TextField, Checkbox } from '@mui/material';

const muiRenderers = {
string: ({ value, onChange, onBlur, error, touched }: FieldRenderProps) => (
<TextField
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
/>
),
number: ({ value, onChange, onBlur, error, touched }: FieldRenderProps) => (
<TextField
type="number"
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
/>
),
boolean: ({ value, onChange }: FieldRenderProps) => (
<Checkbox
checked={value ?? false}
onChange={(e) => onChange(e.target.checked)}
/>
)
}; +
+ + +

Register renderers once at the top of your app. All <Field> components below resolve renderers by schema type automatically:

+
import { FormSystemProvider } from '@cleverbrush/react-form';

// Public website with plain HTML inputs
<FormSystemProvider renderers={htmlRenderers}>
<PublicApp />
</FormSystemProvider>

// Admin panel using MUI
<FormSystemProvider renderers={muiRenderers}>
<AdminApp />
</FormSystemProvider> +
+ + +

Inner providers override/extend outer providers:

+
<FormSystemProvider renderers={muiRenderers}>
<MainApp />
{/* Override just the string renderer in this section */}
<FormSystemProvider renderers={{ string: customStringRenderer }}>
<SpecialSection />
</FormSystemProvider>
</FormSystemProvider> +
+ + +

Creates a form instance bound to a schema. Returns field binding and form lifecycle methods:

+
const form = useSchemaForm(UserSchema, {
createMissingStructure: true, // default: true — auto-create parent objects when setting nested values
validateOnMount: false, // default: false — set to true to show errors immediately on mount
validationDebounceMs: 300 // optional — debounce onChange validation (ms); validate()/submit() are always immediate
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
form.useField(forProperty)Bind a field by PropertyDescriptor selector
form.submit()Validate and return ValidationResult (includes result.object on success)
form.validate()Run validation, propagate errors to fields
form.reset(values?)Reset all fields; optionally set new initial values
form.getValue()Get current form values as plain object
form.setValue(values)Merge values into form state
+ +

Binds a single field via PropertyDescriptor selector. Can be used via form.useField() or the context-based standalone useField():

+
// Via form instance
const name = form.useField((t) => t.name);
const city = form.useField((t) => t.address.city);

// Or via context (inside a FormProvider)
const name = useField((t) => t.name); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
valueT | undefinedCurrent field value
initialValueT | undefinedValue at form init / last reset
dirtybooleantrue if value differs from initialValue
touchedbooleantrue after onBlur has been called
errorstring | undefinedValidation error message from schema
validatingbooleantrue during async validation
onChange(value)(T) => voidUpdate field value
onBlur()() => voidMark field as touched
setValue(value)(T) => voidAlias for onChange
schemaSchemaBuilderThe field's schema builder
+ +

Resolves the renderer from the FormSystemProvider registry by schema type (and optional variant), or uses an explicit renderer prop:

+
// Auto-resolved from FormSystemProvider (string schema → string renderer)
<Field forProperty={(t) => t.name} form={form} />

// Variant-based resolution: looks up "string:password", falls back to "string"
<Field forProperty={(t) => t.password} form={form} variant="password" />

// With label, name, and extra props for the renderer
<Field
forProperty={(t) => t.email}
form={form}
label="Email address"
name="email"
fieldProps={{ placeholder: 'you@example.com', autoComplete: 'email' }}
/>

// Explicit renderer override
<Field forProperty={(t) => t.name} form={form} renderer={customRenderer} /> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropTypeDescription
forProperty(tree) => PropertyDescriptorPropertyDescriptor selector for the field
formSchemaFormInstanceForm instance from useSchemaForm
renderer?FieldRendererOptional explicit renderer (overrides provider)
variant?stringVariant hint for renderer resolution and forwarded to the renderer
label?stringVisible label text forwarded to the renderer
name?stringHTML name attribute forwarded to the renderer
fieldProps?Record<string, unknown>Extra renderer-specific props (e.g. placeholder, autoComplete)
+ +

For full control over rendering, use form.useField() directly:

+
function UserForm() {
const form = useSchemaForm(UserSchema);
const name = form.useField((t) => t.name);
const email = form.useField((t) => t.email);

return (
<>
<input
value={name.value ?? ''}
onChange={(e) => name.onChange(e.target.value)}
onBlur={name.onBlur}
/>
{name.touched && name.error && <span>{name.error}</span>}

<input
value={email.value ?? ''}
onChange={(e) => email.onChange(e.target.value)}
onBlur={email.onBlur}
/>
<button onClick={() => form.submit()}>Submit</button>
</>
);
} +
+ + +

Context bridge that allows standalone useField() usage outside of form.useField():

+
import { FormProvider, useField } from '@cleverbrush/react-form';

function NameInput() {
const name = useField((t) => t.name);
return <input value={name.value ?? ''} onChange={(e) => name.onChange(e.target.value)} />;
}

function UserForm() {
const form = useSchemaForm(UserSchema);

return (
<FormProvider form={form}>
<NameInput />
</FormProvider>
);
} +
+ + +

PropertyDescriptor selectors support nested paths:

+
const UserSchema = object({
name: string(),
address: object({
city: string(),
zip: number()
})
});

function UserForm() {
const form = useSchemaForm(UserSchema);

return (
<>
<Field forProperty={(t) => t.name} form={form} />
<Field forProperty={(t) => t.address.city} form={form} />
<Field forProperty={(t) => t.address.zip} form={form} />
</>
);
} +
+ + +

Validation uses @cleverbrush/schema validators. Errors are automatically propagated to the corresponding field state:

+
const SignupSchema = object({
username: string().addValidator(async (val) => {
if (val.length < 3) {
return {
valid: false,
errors: [{ message: 'Username must be at least 3 characters' }]
};
}
return { valid: true };
}),
email: string()
});

function SignupForm() {
const form = useSchemaForm(SignupSchema);

return (
<FormSystemProvider renderers={htmlRenderers}>
<Field forProperty={(t) => t.username} form={form} />
<Field forProperty={(t) => t.email} form={form} />
<button onClick={async () => {
const result = await form.submit();
if (result.valid) {
console.log('Success:', result.object);
}
}}>Submit</button>
</FormSystemProvider>
);
} +
+ + +
    +
  1. form.validate() or form.submit() runs the schema's full validation
  2. +
  3. Per-property errors are resolved via getErrorsFor() using PropertyDescriptors
  4. +
  5. Each field's error state is updated automatically
  6. +
  7. Renderers receive the error string and touched boolean to decide how/when to display errors
  8. +
+ +

Here's a complete, realistic example showing all pieces together — a registration form with nested address, custom validation, and MUI renderers:

+
import { object, string, number } from '@cleverbrush/schema';
import { useSchemaForm, FormSystemProvider, Field } from '@cleverbrush/react-form';
import { TextField } from '@mui/material';

// Schema — single source of truth for types, validation, and form fields
const RegistrationSchema = object({
name: string().required('Name is required').minLength(2, 'Too short'),
email: string().required('Email is required').matches(/^[^\s@]+@[^\s@]+\.[^\s@]+$/, 'Invalid email'),
age: number().required('Age is required').min(18, 'Must be 18+'),
address: object({
city: string().required('City is required'),
zip: string().required('ZIP is required').minLength(5, 'Invalid ZIP')
})
});

// Renderers — define once, reuse everywhere
const renderers = {
string: ({ value, onChange, onBlur, error, touched }) => (
<TextField
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
fullWidth
margin="normal"
/>
),
number: ({ value, onChange, onBlur, error, touched }) => (
<TextField
type="number"
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
fullWidth
margin="normal"
/>
)
};

// Form component — just declare which fields to show
function RegistrationForm() {
const form = useSchemaForm(RegistrationSchema);

return (
<div>
<Field forProperty={(t) => t.name} form={form} />
<Field forProperty={(t) => t.email} form={form} />
<Field forProperty={(t) => t.age} form={form} />
<Field forProperty={(t) => t.address.city} form={form} />
<Field forProperty={(t) => t.address.zip} form={form} />
<button onClick={async () => {
const result = await form.submit();
if (result.valid) {
console.log('Registered:', result.object);
}
}}>Register</button>
</div>
);
}

// App — wrap with provider
function App() {
return (
<FormSystemProvider renderers={renderers}>
<RegistrationForm />
</FormSystemProvider>
);
} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExportTypeDescription
FormSystemProviderComponentGlobal renderer registry provider
FormProviderComponentForm context bridge for standalone useField
FieldComponentAuto-rendered field by schema type
useSchemaFormHookCreate a form instance from schema
useFieldHookContext-based field binding (use inside FormProvider)
useFormSystemHookAccess FormSystemProvider config
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
FieldRenderer(props: FieldRenderProps) => ReactNode
FieldRenderPropsProps passed to renderers: value, initialValue, dirty, touched, error, validating, onChange, onBlur, setValue, schema, variant?, label?, name?, fieldProps?
FormSystemConfig{ renderers?: Record<string, FieldRenderer> } — keys can be "type" or "type:variant"
FieldState{ value, initialValue, dirty, touched, error, validating }
UseFieldResultFieldState & { onChange, onBlur, setValue, schema }
UseSchemaFormOptions{ createMissingStructure?: boolean; validateOnMount?: boolean; validationDebounceMs?: number }
SchemaFormInstanceReturn type of useSchemaForm
FormSystemProviderPropsProps for FormSystemProvider
FormProviderPropsProps for FormProvider
FieldPropsProps for Field
+ +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode — field selectors and form state are fully typed end-to-end
  • +
  • Unit tests: Vitest + Testing Library — covering form state management, validation, async validators, field rendering, and provider configuration
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Type Aliases

FieldProps
FieldRenderer
FieldRenderProps
FieldState
FormProviderProps
FormSystemConfig
FormSystemProviderProps
SchemaFormInstance
UseFieldResult
UseSchemaFormOptions

Functions

Field
FormProvider
FormSystemProvider
useField
useFormSystem
useSchemaForm
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_scheduler.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_scheduler.html new file mode 100644 index 00000000..83a3c0a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_scheduler.html @@ -0,0 +1,154 @@ +@cleverbrush/scheduler | Libraries

Module @cleverbrush/scheduler

@cleverbrush/scheduler

+ +

Coverage

+ +

A job scheduler for Node.js that runs tasks in worker threads on configurable schedules.

+ +
npm install @cleverbrush/scheduler
+
+ +

This library uses the Node.js worker_threads module. It is tested on Node.js v16+.

+ +
import { JobScheduler } from '@cleverbrush/scheduler';

const scheduler = new JobScheduler({
rootFolder: '/path/to/your/jobs'
});

scheduler.addJob({
id: 'my-job-1',
path: 'job1.js',
schedule: {
every: 'minute',
interval: 5
}
});

scheduler.addJob({
id: 'my-job-2',
path: 'job2.js',
schedule: {
every: 'week',
interval: 2,
dayOfWeek: [1, 3, 5],
hour: 9,
minute: 30
},
timeout: 1000 * 60 * 4,
maxRetries: 3
});

scheduler.start(); +
+ + + +

The main class for scheduling and running jobs. Extends EventEmitter.

+ +
const scheduler = new JobScheduler(props: JobSchedulerProps);
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDefaultDescription
rootFolderstringPath to the folder containing job files
defaultTimeZonestring'UTC'Timezone used for scheduling
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
start()Starts the scheduler
stop()Stops the scheduler
addJob(job)Adds a job to the scheduler
removeJob(jobId)Removes a job by ID
jobExists(jobId)Returns true if a job with the given ID exists
statusCurrent scheduler status: 'started' or 'stopped'
+ +
scheduler.on('job:start', ({ jobId, instanceId, startDate }) => {
console.log(`Job ${jobId} started`);
});

scheduler.on('job:end', ({ jobId, instanceId, startDate, endDate, stdout, stderr }) => {
console.log(`Job ${jobId} finished`);
});

scheduler.on('job:error', ({ jobId, instanceId, startDate, endDate, stdout, stderr }) => {
console.error(`Job ${jobId} failed`);
});

scheduler.on('job:timeout', ({ jobId, instanceId, startDate, endDate }) => {
console.warn(`Job ${jobId} timed out`);
});

scheduler.on('job:message', ({ jobId, instanceId, message }) => {
console.log(`Message from ${jobId}:`, message);
}); +
+ + +
scheduler.addJob({
id: 'unique-job-id',
path: 'relative/path/to/job.js',
schedule: { /* see Schedule Types */ },
timeout: 60000, // timeout in milliseconds
maxRetries: 3, // retry on failure
maxConsequentFails: 10, // disable after N consecutive failures
noConcurrentRuns: true, // prevent overlapping executions
props: { key: 'value' } // data passed to the worker
}); +
+ + +

All schedules share these optional properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
intervalnumberNumber of periods between repeats (1–356)
startsOnDateDo not start before this date
endsOnDateDo not repeat after this date
maxOccurencesnumberMaximum number of executions
skipFirstnumberSkip this many initial executions
+ +
{ every: 'minute', interval: 5 }
+
+ +

Runs every N minutes.

+ +
{ every: 'day', interval: 1, hour: 9, minute: 30 }
+
+ +

Runs every N days at the specified time.

+ +
{ every: 'week', interval: 2, dayOfWeek: [1, 3, 5], hour: 9, minute: 30 }
+
+ +

Runs every N weeks on the specified days (1 = Monday, 7 = Sunday).

+ +
{ every: 'month', interval: 1, day: 15, hour: 0, minute: 0 }
// or on the last day of the month:
{ every: 'month', interval: 1, day: 'last', hour: 0, minute: 0 } +
+ +

Runs every N months on the specified day (1–28 or 'last').

+ +
{ every: 'year', interval: 1, month: 6, day: 1, hour: 12, minute: 0 }
+
+ +

Runs every N years on the specified month (1–12) and day (1–28 or 'last').

+ +

BSD-3-Clause

+

Classes

JobScheduler
ScheduleCalculator

Type Aliases

TaskSchedule

Variables

Schemas
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.StandardJSONSchemaV1.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.StandardJSONSchemaV1.html new file mode 100644 index 00000000..1da8834d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.StandardJSONSchemaV1.html @@ -0,0 +1 @@ +StandardJSONSchemaV1 | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.StandardTypedV1.html new file mode 100644 index 00000000..391ea4c3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.StandardTypedV1.html @@ -0,0 +1 @@ +StandardTypedV1 | Libraries

Interfaces

Props
Types

Type Aliases

InferInput
InferOutput
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.html new file mode 100644 index 00000000..6c957a5f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema-json.html @@ -0,0 +1,335 @@ +@cleverbrush/schema-json | Libraries

Module @cleverbrush/schema-json

@cleverbrush/schema-json — Bidirectional JSON Schema interop for @cleverbrush/schema.

+
import { toJsonSchema, fromJsonSchema } from '@cleverbrush/schema-json';
import { object, string, number } from '@cleverbrush/schema';

// Schema → JSON Schema
const spec = toJsonSchema(object({ name: string(), age: number().optional() }));

// JSON Schema → Schema (use `as const` for type inference)
const schema = fromJsonSchema({ type: 'object', properties: { name: { type: 'string' } }, required: ['name'] } as const);
schema.parse({ name: 'Alice' }); // inferred as { name: string } +
+ +

@cleverbrush/schema-json

+ +

Coverage

+ +

Bidirectional JSON Schema (Draft 7 / 2020-12) interop for +@cleverbrush/schema.

+

Import a JSON Schema and get a fully-typed @cleverbrush/schema builder that +preserves every constraint. Or convert a builder back to a JSON Schema object +for use in OpenAPI specs, form generators, or any other JSON Schema consumer.

+ +
    +
  • Consuming external APIs — you have a JSON Schema from an OpenAPI spec or +a third-party service and want to validate incoming data with full TypeScript +type inference.
  • +
  • OpenAPI / JSON Schema round-trip — generate JSON Schemas from your +@cleverbrush/schema validators to embed in API specs.
  • +
  • Migrating from raw JSON Schema — convert an existing schema catalogue to +@cleverbrush/schema builders incrementally.
  • +
  • Code generation — introspect a JSON Schema at the type level via +JsonSchemaNodeToBuilder<S> without running any code.
  • +
+ +
npm install @cleverbrush/schema-json
+
+ +
+

Peer dependency: @cleverbrush/schema@^2.0.0 must already be installed.

+
+ +
import { fromJsonSchema, toJsonSchema } from '@cleverbrush/schema-json';
import { object, string, number } from '@cleverbrush/schema';

// ── JSON Schema → builder ──────────────────────────────────────────────────
const PersonSchema = fromJsonSchema({
type: 'object',
properties: {
name: { type: 'string', minLength: 1 },
email: { type: 'string', format: 'email' },
age: { type: 'integer', minimum: 0 },
},
required: ['name', 'email'],
} as const); // ← `as const` is required for precise type inference

const result = PersonSchema.parse({ name: 'Alice', email: 'alice@example.com', age: 30 });
// result.object is typed as { name: string; email: string; age?: number }

// ── Builder → JSON Schema ──────────────────────────────────────────────────
const ApiSchema = object({
id: string().uuid(),
title: string().minLength(1).maxLength(255),
score: number().min(0).max(100).optional(),
});

const spec = toJsonSchema(ApiSchema);
// {
// "$schema": "https://json-schema.org/draft/2020-12/schema",
// "type": "object",
// "properties": {
// "id": { "type": "string", "format": "uuid" },
// "title": { "type": "string", "minLength": 1, "maxLength": 255 },
// "score": { "type": "number" }
// },
// "required": ["id", "title"]
// } +
+ + + +

Converts a JSON Schema literal to a @cleverbrush/schema builder.

+
function fromJsonSchema<const S>(schema: S): JsonSchemaNodeToBuilder<S>
+
+ + + + + + + + + + + + + + + + +
ParameterTypeDescription
schemaJSON Schema literalPass with as const for precise TypeScript inference
+

Returns a @cleverbrush/schema builder (e.g. StringSchemaBuilder, +ObjectSchemaBuilder, UnionSchemaBuilder, etc.) whose static type mirrors the +JSON Schema structure.

+ +

Without as const, TypeScript widens string literals to string and object +shapes to Record<string, unknown>, so inference collapses to +SchemaBuilder<unknown>. Always annotate:

+
const S = { type: 'object', properties: { x: { type: 'number' } } } as const;
const schema = fromJsonSchema(S); // ObjectSchemaBuilder<{ x: NumberSchemaBuilder<...> }> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeywordBuilder equivalent
type: 'string'string()
type: 'number'number()
type: 'integer'number() with integer flag
type: 'boolean'boolean()
type: 'null'SchemaBuilder<null>
type: 'array' + itemsarray(itemBuilder)
type: 'object' + propertiesobject({ … })
required: […]required / optional per property
additionalProperties: true.acceptUnknownProps()
constliteral builder (.equals(...))
enumunion(…) of const builders
anyOfunion(…) of sub-builders
anyOf + discriminatorauto-emitted for discriminated union() branches (see below)
allOfintersection(...) — chains sub-schemas via the intersection() builder
minLength / maxLength.minLength() / .maxLength()
pattern.matches(regex) (invalid patterns silently ignored)
minimum / maximum.min() / .max()
exclusiveMinimum / exclusiveMaximumcustom validator (not round-trippable via toJsonSchema)
multipleOf.multipleOf()
minItems / maxItems.minLength() / .maxLength() on array
format: 'email'.email() extension
format: 'uuid'.uuid() extension
format: 'uri' or 'url'.url() extension
format: 'ipv4'.ip({ version: 'v4' })
format: 'ipv6'.ip({ version: 'v6' })
format: 'date-time'.matches(iso8601 regex)
readOnly: true.readonly()
description.describe(text)
+
+ +

Converts a @cleverbrush/schema builder to a JSON Schema object.

+
function toJsonSchema(
schema: SchemaBuilder<any, any, any>,
opts?: ToJsonSchemaOptions,
): Record<string, unknown> +
+ + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
schemaSchemaBuilderany builder from @cleverbrush/schema
optsToJsonSchemaOptionsoptional output configuration
+

Returns a plain JavaScript object that is safe to JSON.stringify.

+

Descriptions set via .describe(text) are emitted as the description field on the corresponding JSON Schema node (including nested object properties).

+

Examples set via .example(value) are emitted as the examples array on the corresponding JSON Schema node.

+ +

When a union() is a discriminated union — all branches are objects sharing a required property with unique literal values — toJsonSchema() automatically emits the discriminator keyword alongside anyOf:

+
const schema = union(
object({ type: string('cat'), name: string() })
).or(
object({ type: string('dog'), breed: string() })
);

toJsonSchema(schema, { $schema: false });
// {
// anyOf: [ { ... type: { const: 'cat' } ... }, { ... type: { const: 'dog' } ... } ],
// discriminator: { propertyName: 'type' }
// } +
+ +

When a nameResolver is provided and union branches resolve to $ref pointers, a mapping is also emitted:

+
// discriminator: { propertyName: 'type', mapping: { cat: '#/components/schemas/Cat', dog: '#/components/schemas/Dog' } }
+
+ +

This enables code-generation tools (openapi-generator, orval, etc.) to produce proper tagged union types.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
draft'2020-12' | '07''2020-12'JSON Schema draft version for the $schema URI
$schemabooleantrueWhether to include the $schema header in the output
nameResolver(schema: SchemaBuilder) => string | nullundefinedCalled for every node before conversion. Return a non-null string to emit { $ref: '#/components/schemas/<name>' } instead of an inline schema. Used by @cleverbrush/server-openapi to wire named schemas from .schemaName() into $ref pointers.
+
// Embed in OpenAPI (suppress the $schema header)
toJsonSchema(schema, { $schema: false });

// Use Draft 07
toJsonSchema(schema, { draft: '07' }); +
+ + +

toJsonSchema resolves lazy() schemas transparently. When the resolved schema +has a name returned by nameResolver, the output is a $ref pointer — which +is the key mechanism for breaking recursive cycles:

+
import { object, number, array, lazy } from '@cleverbrush/schema';
import { toJsonSchema } from '@cleverbrush/schema-json';

type TreeNode = { value: number; children: TreeNode[] };

const treeNode: ReturnType<typeof object> = object({
value: number(),
children: array(lazy(() => treeNode))
}).schemaName('TreeNode');

let rootSeen = false;
toJsonSchema(treeNode, {
$schema: false,
nameResolver: s => {
// Inline the root once (for the definition itself), then emit $ref
if (s === treeNode && !rootSeen) { rootSeen = true; return null; }
return (s.introspect() as any).schemaName ?? null;
}
});
// {
// type: 'object',
// properties: {
// value: { type: 'integer' },
// children: { type: 'array', items: { $ref: '#/components/schemas/TreeNode' } }
// },
// ...
// } +
+ +

When using @cleverbrush/server-openapi, this is handled automatically — call +.schemaName() on the root schema and generateOpenApiSpec will emit the +correct $ref pointers and component definition with no extra configuration.

+
+ + +

Recursively derives the TypeScript value type from a statically-known JSON +Schema. Useful when you want the type without calling fromJsonSchema at +runtime.

+
import type { InferFromJsonSchema } from '@cleverbrush/schema-json';

const S = {
type: 'object',
properties: {
id: { type: 'integer' },
label: { type: 'string' },
},
required: ['id'],
} as const;

type Item = InferFromJsonSchema<typeof S>;
// { id: number; label?: string } +
+ + +

Maps a statically-known JSON Schema literal to the @cleverbrush/schema +builder type — purely at the type level, no runtime code executed.

+
import type { JsonSchemaNodeToBuilder } from '@cleverbrush/schema-json';

const S = { type: 'string', format: 'email' } as const;
type B = JsonSchemaNodeToBuilder<typeof S>;
// StringSchemaBuilder<string, true> +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LimitationNotes
Custom validators (addValidator)Not representable in JSON Schema — omitted in toJsonSchema output, not recoverable by fromJsonSchema
Preprocessors (addPreprocessor)Same as above
$ref / $defsNot supported in fromJsonSchema
if / then / elseNot supported
notNot supported
Dual IP format (ip() with both v4 + v6)format is omitted in toJsonSchema output (no standard keyword covers both)
JSDoc comments on propertiesNot preserved in toJsonSchema output
nameResolver + $ref / $defs round-tripnameResolver emits $ref pointers based on external registry; fromJsonSchema does not resolve $ref references — they fall back to any()
+

Namespaces

StandardJSONSchemaV1
StandardTypedV1

Interfaces

StandardJSONSchemaV1
StandardTypedV1

Type Aliases

InferFromJsonSchema
JsonSchemaNode
JsonSchemaNodeToBuilder
ToJsonSchemaOptions

Functions

fromJsonSchema
toJsonSchema
withStandardJsonSchema
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.StandardSchemaV1.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.StandardSchemaV1.html new file mode 100644 index 00000000..f241808a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.StandardSchemaV1.html @@ -0,0 +1 @@ +StandardSchemaV1 | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.StandardTypedV1.html new file mode 100644 index 00000000..ea6ef7d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.StandardTypedV1.html @@ -0,0 +1 @@ +StandardTypedV1 | Libraries

Namespace StandardTypedV1

Interfaces

Props
Types

Type Aliases

InferInput
InferOutput
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.html new file mode 100644 index 00000000..8e6fc1e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_schema.html @@ -0,0 +1,1034 @@ +@cleverbrush/schema | Libraries

Module @cleverbrush/schema

@cleverbrush/schema

+

CI +Standard Schema v1

+ +

Bundle size

+ +

License: BSD-3-Clause

+ +

Coverage

+ +

A schema definition and validation library for TypeScript — faster than Zod in 14/15 benchmarks (up to 204× faster on invalid input), 3× smaller than Zod v4, and compatible with 50+ ecosystem tools via Standard Schema v1.

+

Define a schema once and get TypeScript type inference, runtime validation, object mapping (@cleverbrush/mapper), auto-generated React forms (@cleverbrush/react-form), and bidirectional JSON Schema conversion (@cleverbrush/schema-json) — all from the same immutable, fluent API.

+ +

The problem: In a typical TypeScript project, types and runtime validation are separate concerns. You define a User type in one file, then write Joi / Yup / Zod schemas (or manual if checks) in another. Over time these drift apart — the type says a field is required, but the validation allows it to be undefined. Tests pass, but production data breaks because the validation didn't match the type.

+

The solution: @cleverbrush/schema lets you define a schema once and derive both the TypeScript type (via InferType) and runtime validation from the same source. Because every method returns a new builder instance (immutability), you can safely compose and extend schemas without accidentally mutating shared definitions.

+

What makes it different from Zod / Yup / Joi:

+
    +
  • PropertyDescriptors — a runtime descriptor tree that every tool in the ecosystem can introspect. The @cleverbrush/mapper uses it for type-safe property selectors. The @cleverbrush/react-form uses it to auto-generate form fields with correct validation. This makes the schema library a foundation for an entire ecosystem — not just a standalone validation tool. No other popular schema library exposes this level of runtime metadata.
  • +
  • Standard Schema v1 — the ['~standard'] getter is implemented on every builder. That means your schema works as-is with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, Elysia, next-safe-action, and every other Standard Schema consumer.
  • +
  • Extension system — add custom methods to any builder type (string, number, date, …) via defineExtension() + withExtensions(). Extensions are fully typed, chainable, composable, and appear in introspect(). No other popular schema library offers a comparable type-safe plugin system.
  • +
  • Built-in extension pack — common validators like email(), url(), uuid(), ip(), trim(), positive(), negative(), nonempty(), unique(), and more are included out of the box. The default import has them pre-applied; import from @cleverbrush/schema/core to get bare builders without extensions.
  • +
  • 14 KB gzipped (full) — 3× smaller than Zod v4 — sub-path imports (@cleverbrush/schema/string, /number, /object, /array) drop individual builders to ~4 KB.
  • +
  • First-class nullable support.nullable() and .notNullable() are native methods on every builder. The inferred type automatically includes or excludes null, and introspect() exposes isNullable for runtime metadata.
  • +
  • JSDoc comment preservation — JSDoc comments on schema properties carry through to the inferred TypeScript type, so IDE tooltips and autocomplete descriptions come from the schema definition itself.
  • +
  • Zero runtime dependencies.
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/schemaZodYupJoi
TypeScript type inference~
Standard Schema v1
PropertyDescriptors (runtime introspection)
Type-safe extension system
Built-in object mapper
Built-in form generation
Bidirectional JSON Schema~ (output only)
External schema interop (extern())
JSDoc preservation
Immutable schemas
Zero dependencies
Sync + async validation
Per-property error inspection~~~
Default values
Bundle size (full, gzipped)14 KB41 KB (v4)~19 KB~26 KB
+ +
npm install @cleverbrush/schema
+
+ + +

▶ Open in Playground

+
import {
object,
string,
number,
boolean,
InferType
} from '@cleverbrush/schema';

// 1. Define a schema with fluent constraints
const UserSchema = object({
name: string().nonempty('Name is required').minLength(2, 'Name must be at least 2 characters'),
email: string().email('Please enter a valid email'),
age: number().min(0, 'Age cannot be negative').max(150).positive(),
isActive: boolean()
});

// 2. TypeScript type is inferred automatically — no duplication!
type User = InferType<typeof UserSchema>;
// Equivalent to: { name: string; email: string; age: number; isActive: boolean }

// 3. Validate data at runtime — synchronous by default
const result = UserSchema.validate({
name: 'Alice',
email: 'alice@example.com',
age: 30,
isActive: true
});

// Or use validateAsync() when you have async validators/preprocessors
// const result = await UserSchema.validateAsync({ ... });

if (result.valid) {
console.log('Validated:', result.object); // typed as User
} else {
// For object schemas, prefer getErrorsFor() for per-property error inspection:
const nameErrors = result.getErrorsFor((p) => p.name);
console.log(nameErrors.isValid); // false
console.log(nameErrors.errors); // ['Name must be at least 2 characters']

// result.errors on object schemas is deprecated — use getErrorsFor() instead
console.log('Errors:', result.errors);
// Array of { message: string }
} +
+ +

Type inference works in plain JavaScript too, using JSDoc:

+
/**
* @type {import('@cleverbrush/schema').InferType<typeof UserSchema>}
*/
const user = {
// type is inferred as { name: string; email: string; age: number; isActive: boolean }
}; +
+ + +

▶ Open in Playground

+

The following builder functions are available:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionDescriptionKey Methods
any()Any value. Similar to TypeScript's any type..optional(), .nullable(), .notNullable(), .default(value), .addValidator(fn)
string()String value with constraints..minLength(n), .maxLength(n), .matches(re), .email(), .url(), .uuid(), .ip(), .trim(), .toLowerCase(), .nonempty(), .oneOf(...values), .nullable(), .notNullable(), .default(value)
number()Numeric value with constraints..min(n), .max(n), .integer(), .positive(), .negative(), .finite(), .multipleOf(n), .coerce(), .oneOf(...values), .nullable(), .notNullable(), .default(value)
boolean()Boolean value..coerce(), .optional(), .nullable(), .notNullable(), .default(value)
date()JavaScript Date instance..coerce(), .optional(), .nullable(), .notNullable(), .default(value)
func()Function value. Supports typed parameter and return-type schemas..addParameter(schema), .hasReturnType(schema), .optional(), .nullable(), .notNullable(), .default(value)
promise(schema?)JavaScript Promise. Optionally typed resolved value via promise(schema) or .hasResolvedType(schema)..hasResolvedType(schema), .optional(), .nullable(), .notNullable(), .default(value)
nul()Exactly null. Useful in nullable unions..optional(), .default(value)
object(props)Object with typed properties. Supports nesting..validate(data), .addProps({...}), .optional(), .nullable(), .notNullable(), .default(value)
array()Array with optional element schema (via .of())..minLength(n), .maxLength(n), .of(schema), .nonempty(), .unique(), .nullable(), .notNullable(), .default(value)
tuple([...schemas])Fixed-length array with per-position types. Each index validated against its own schema — mirrors TypeScript tuple types..rest(schema), .optional(), .nullable(), .notNullable(), .default(value)
record(keySchema, valSchema)Object with dynamic string keys. Every key must satisfy keySchema (a string schema) and every value must satisfy valSchema — mirrors TypeScript's Record<K, V>..optional(), .nullable(), .notNullable(), .default(value), .addValidator(fn)
union(schema)Union of schemas — e.g. string | number..or(schema), .validate(data), .optional(), .nullable(), .notNullable(), .default(value)
intersection(left, right)Intersection of two schemas — both must pass. Merges validated outputs. Use .acceptUnknownProps() on object schemas..optional(), .nullable(), .notNullable(), .default(value), .addValidator(fn)
enumOf(...values)String enum — sugar for string().oneOf(...)..optional(), .nullable(), .notNullable(), .default(value)
lazy(getter)Recursive/self-referential schema. The getter is called once and its result is cached. Enables tree structures, linked lists, and other recursive types..resolve(), .optional(), .addValidator(fn), .default(value)
generic(fn)Parameterized schema template. Call .apply(...schemas) with concrete schemas to obtain a fully typed concrete schema builder. TypeScript infers the result type from the template function's own generic signature. Optionally pass a defaults array as the first argument to enable direct validation without calling .apply()..apply(...schemas), .optional(), .nullable(), .default(value)
parseString(objectSchema, templateFn)Validates a string against a template pattern and parses it into a strongly-typed object. Property schemas handle their own coercion (e.g. number().coerce())..optional(), .nullable(), .default(value), .readonly(), .brand()
+ +

▶ Open in Playground

+

All schema builders are immutable. Every method call returns a new schema builder instance, so existing schemas are never modified:

+
const base = string().minLength(1);
const strict = base.maxLength(50); // new instance — base is unchanged
const loose = base.optional(); // another new instance

// base still only has minLength(1)
// strict has minLength(1) + maxLength(50)
// loose has minLength(1) + optional +
+ +

This is especially powerful when building a library of reusable schema fragments:

+
const Email = string().minLength(5).maxLength(255);
const Name = string().minLength(1).maxLength(100);

const CreateUser = object({ name: Name, email: Email });
const UpdateUser = object({ name: Name.optional(), email: Email.optional() });
// Both schemas share the same base constraints but differ in optionality +
+ + +

▶ Open in Playground

+

Schemas can be extended with additional properties, combined with unions, or nested inside arrays and objects:

+
import { object, string, number, array, union } from '@cleverbrush/schema';

// Extend an existing schema with new properties
const BaseEntity = object({
id: string(),
createdAt: string()
});

const UserEntity = BaseEntity.addProps({
name: string().minLength(2),
email: string().minLength(5)
});

// Nest objects inside arrays
const TeamSchema = object({
name: string().minLength(1),
members: array().of(UserEntity).minLength(1).maxLength(50)
});

// Union types
const IdOrEmail = union(string().minLength(1)).or(
string().matches(/^[^@]+@[^@]+$/)
);

// Intersection types — combine two schemas into one (both must pass)
import { intersection } from '@cleverbrush/schema';

const NameAndAge = intersection(
object({ name: string() }).acceptUnknownProps(),
object({ age: number() }).acceptUnknownProps()
);
const person = NameAndAge.parse({ name: 'Alice', age: 30 });
// typeof person === { name: string } & { age: number } +
+ + +

▶ Open in Playground

+

Use generic(fn) to create a reusable, parameterized schema template. The template function accepts one or more schema builders as arguments and returns a concrete schema. Call .apply(...schemas) to instantiate the template — TypeScript infers the resulting type automatically from the function's own generic signature.

+

Single type parameter — a paginated list that works for any element type:

+
import {
generic, object, array, number, string,
type SchemaBuilder, type InferType
} from '@cleverbrush/schema';

const PaginatedList = generic(
<T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
object({
items: array(itemSchema),
total: number(),
page: number(),
})
);

const PaginatedUsers = PaginatedList.apply(
object({ name: string(), age: number() })
);

type PaginatedUsersType = InferType<typeof PaginatedUsers>;
// → { items: { name: string; age: number }[]; total: number; page: number }

PaginatedUsers.validate({
items: [{ name: 'Alice', age: 30 }],
total: 1,
page: 1,
}); // { valid: true } +
+ +

Multiple type parameters — a Result / Either type:

+
import {
generic, object, boolean, string, number,
type SchemaBuilder, type InferType
} from '@cleverbrush/schema';

const Result = generic(
<
T extends SchemaBuilder<any, any, any, any, any>,
E extends SchemaBuilder<any, any, any, any, any>
>(
valueSchema: T,
errorSchema: E
) =>
object({
ok: boolean(),
value: valueSchema.optional(),
error: errorSchema.optional(),
})
);

const StringResult = Result.apply(string(), number());
// InferType → { ok: boolean; value?: string; error?: number }

StringResult.validate({ ok: true, value: 'hello' }); // valid
StringResult.validate({ ok: false, error: 404 }); // valid +
+ +

Default arguments — pass a defaults array as the first argument so the template can be validated directly without calling .apply() first:

+
import {
generic, object, array, number, any,
type SchemaBuilder
} from '@cleverbrush/schema';

const AnyList = generic(
[any()], // default for the single type parameter
<T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
object({ items: array(itemSchema), total: number() })
);

// Validate directly — uses the any() default
AnyList.validate({ items: [1, 'two', true], total: 3 }); // valid

// Or apply a stricter schema first
AnyList.apply(string()).validate({ items: ['a', 'b'], total: 2 }); // valid +
+ +
+

Tip: Each call to .apply() returns an independent schema builder. You can chain .optional(), .addValidator(), .default(value), and every other fluent method on the result.

+
+ +

▶ Open in Playground

+

Use func() to validate that a value is a function. Two fluent methods let you annotate the expected signature — the inferred TypeScript type reflects both the parameter types and the return type:

+
    +
  • .addParameter(schema) — appends a parameter schema. Each call extends the inferred tuple of parameter types. The schemas are accessible at runtime via introspect().parameters.
  • +
  • .hasReturnType(schema) — sets the return type schema. The inferred function type gains a concrete return type instead of any. Accessible via introspect().returnType.
  • +
+
import { func, string, number, boolean, InferType } from '@cleverbrush/schema';

// Plain function validator — accepts any () => any
const anyFn = func();
anyFn.validate(() => 42); // { valid: true }
anyFn.validate('not a fn'); // { valid: false }

// Typed parameter and return type
const greet = func()
.addParameter(string()) // first param: string
.addParameter(number().optional()) // second param: number | undefined
.hasReturnType(string()); // return type: string

// InferType preserves the declared parameter types and return type.
// Function schemas also remain compatible with callbacks of any arity.
type Greet = InferType<typeof greet>;
// → (param0: string, param1: number | undefined, ...args: any[]) => string

// Introspect at runtime
const info = greet.introspect();
// info.parameters → [StringSchemaBuilder, NumberSchemaBuilder]
// info.returnType → StringSchemaBuilder

// Optional function schemas infer a union with undefined
const optionalHandler = func()
.addParameter(string())
.addParameter(boolean())
.hasReturnType(boolean())
.optional();

type OptionalHandler = InferType<typeof optionalHandler>;
// → ((param0: string, param1: boolean, ...args: any[]) => boolean) | undefined +
+ + +

▶ Open in Playground

+

Use .addConstructor(funcSchema) on an object() schema to declare one or more constructor overloads. Each call appends a FunctionSchemaBuilder to an accumulated list; the inferred TypeScript type becomes an intersection of all construct signatures and the plain instance type.

+
    +
  • .addConstructor(funcSchema) — appends a constructor overload. Each call extends the inferred tuple of constructor schemas. Chainable.
  • +
  • .clearConstructors() — resets constructor schemas to an empty list, removing all construct signatures from the inferred type.
  • +
  • introspect().constructorSchemas — array of all accumulated constructor FunctionSchemaBuilder schemas.
  • +
+

Constructor signatures are type-only: runtime validate() continues to validate plain objects as before.

+
import { object, func, string, number, InferType } from '@cleverbrush/schema';

// Single constructor overload
const PersonSchema = object({ name: string(), age: number() })
.addConstructor(func().addParameter(string()));

type Person = InferType<typeof PersonSchema>;
// → { new(p0: string): { name: string; age: number } } & { name: string; age: number }

// Multiple chained constructors → overloaded construct signatures
const FlexPersonSchema = object({ name: string(), age: number() })
.addConstructor(func().addParameter(string()))
.addConstructor(func().addParameter(string()).addParameter(number()));

type FlexPerson = InferType<typeof FlexPersonSchema>;
// → { new(p0: string): { name: string; age: number } }
// & { new(p0: string, p1: number): { name: string; age: number } }
// & { name: string; age: number }

// Runtime validation is unchanged — plain objects still validate
FlexPersonSchema.validate({ name: 'Alice', age: 30 }); // { valid: true }

// Introspect constructor schemas at runtime
const { constructorSchemas } = FlexPersonSchema.introspect();
// constructorSchemas.length → 2

// Remove all constructor signatures
const PlainSchema = FlexPersonSchema.clearConstructors();
type Plain = InferType<typeof PlainSchema>;
// → { name: string; age: number } +
+ + +

▶ Open in Playground

+

Use promise() to validate that a value is a JavaScript Promise. Pass an optional schema to type the resolved value — the inferred TypeScript type becomes Promise<T>. You can also call .hasResolvedType(schema) on the returned builder to set or replace the resolved-value schema.

+
    +
  • promise(schema?) — factory shorthand. When schema is provided the inferred type is Promise<InferType<typeof schema>>.
  • +
  • .hasResolvedType(schema) — sets the resolved-value schema; replaces any previously set one. Accessible via introspect().resolvedType.
  • +
+
import { promise, string, number, InferType } from '@cleverbrush/schema';

// Untyped — validates that the value is any Promise
const anyPromise = promise();
anyPromise.validate(Promise.resolve(42)); // { valid: true }
anyPromise.validate('not a promise' as any); // { valid: false }

// Typed resolved value via factory argument
const stringPromise = promise(string());
type StringPromise = InferType<typeof stringPromise>;
// → Promise<string>

// Typed resolved value via fluent method
const numPromise = promise().hasResolvedType(number());
type NumPromise = InferType<typeof numPromise>;
// → Promise<number>

// Introspect at runtime
const info = numPromise.introspect();
// info.resolvedType → NumberSchemaBuilder

// Optional promise — undefined is also accepted
const optPromise = promise(string()).optional();
type OptPromise = InferType<typeof optPromise>;
// → Promise<string> | undefined

optPromise.validate(undefined as any); // { valid: true } +
+ + +

▶ Open in Playground

+

Use record(keySchema, valueSchema) to validate objects with dynamic string keys — lookup tables, i18n bundles, caches, or any Record<string, V> shape. Unlike object(), which requires a fixed set of known property names, record() validates objects whose keys are not known at schema-definition time.

+

Both the key and the value schema are enforced at runtime, and the inferred TypeScript type mirrors Record<K, V>.

+
import { record, string, number, object, InferType } from '@cleverbrush/schema';

// ── Basic: string keys → number values ──────────────────────────────────────
const scores = record(string(), number().min(0).max(100));
// InferType<typeof scores> → Record<string, number>

scores.validate({ alice: 95, bob: 87 }); // { valid: true }
scores.validate({ alice: 95, bob: -1 }); // { valid: false } — negative score

// ── Key constraint — only locale-style keys allowed ──────────────────────────
const i18n = record(
string().matches(/^[a-z]{2}(-[A-Z]{2})?$/),
string().nonempty()
);

i18n.validate({ en: 'Hello', 'fr-FR': 'Bonjour' }); // { valid: true }
i18n.validate({ '123': 'oops' }); // { valid: false } — bad key

// ── Nested: values are objects ───────────────────────────────────────────────
const userMap = record(
string(),
object({ name: string(), age: number() })
);
// InferType<typeof userMap> → Record<string, { name: string; age: number }>

// ── Optional with factory default ────────────────────────────────────────────
const cache = record(string(), number()).optional().default(() => ({}));

// ── getErrorsFor(key) — rich per-key result with descriptor ────────────────────
const schema = record(string(), number().min(0));
const result = schema.validate(
{ a: 1, b: -2, c: -3 },
{ doNotStopOnFirstError: true }
);

if (!result.valid) {
// Root-level errors (e.g. 'object expected')
const root = result.getErrorsFor();
console.log(root.isValid); // false if the container itself is invalid

// Per-key errors
const bResult = result.getErrorsFor('b');
console.log(bResult.isValid); // false
console.log(bResult.errors[0]); // 'the value must be >= 0'
console.log(bResult.seenValue); // -2

// Descriptor: read/write the entry on the original object
const descriptor = bResult.descriptor;
console.log(descriptor.key); // 'b'
descriptor.getSchema(); // → NumberSchemaBuilder
descriptor.getValue(result.object); // → { success: true, value: -2 }
descriptor.setValue(result.object, 0); // fixes the value in-place
} +
+ + +

▶ Open in Playground

+

Use parseString(objectSchema, templateFn) to validate a string against a template pattern and parse it into a strongly-typed object. The template expression uses a tagged-template syntax with type-safe property selectors — you get full IntelliSense in the selector lambdas.

+
import { parseString, object, string, number, type InferType } from '@cleverbrush/schema';

const RouteSchema = parseString(
object({ userId: string().uuid(), id: number().coerce() }),
$t => $t`/orders/${t => t.id}/${t => t.userId}`
);

type Route = InferType<typeof RouteSchema>;
// { userId: string; id: number }

const result = RouteSchema.validate('/orders/42/550e8400-e29b-41d4-a716-446655440000');
// result.valid === true
// result.object === { id: 42, userId: '550e8400-...' } +
+ +

Nested objects — navigate deep properties via t => t.parent.child:

+
const schema = parseString(
object({
order: object({ id: number().coerce() }),
user: object({ name: string() })
}),
$t => $t`/orders/${t => t.order.id}/by/${t => t.user.name}`
);
// InferType → { order: { id: number }; user: { name: string } }

schema.validate('/orders/42/by/Alice');
// { valid: true, object: { order: { id: 42 }, user: { name: 'Alice' } } } +
+ +

Coercion is the property schema's responsibility — the builder passes the raw captured substring directly to each property schema's validate(). Use .coerce() on number(), boolean(), or date() to convert from strings:

+
const LogEntry = parseString(
object({
level: string(),
ts: date().coerce(),
message: string()
}),
$t => $t`[${t => t.level}] ${t => t.ts} ${t => t.message}`
); +
+ +

Error messages include the property path for easy debugging:

+
const result = RouteSchema.validate('/orders/abc/bad-uuid');
// result.errors[0].message → "id: expected an integer number" +
+ +

Raw template access — the original {Property} pattern is exposed via the .template getter. This enables consumers to use a parse-string schema as a Serilog-style message template (used by @cleverbrush/log for typed log events):

+
const TodoCreated = parseString(
object({ TodoId: number(), Title: string(), UserId: string() }),
$t => $t`Todo #${t => t.TodoId} "${t => t.Title}" created by ${t => t.UserId}`
);

TodoCreated.template;
// → 'Todo #{TodoId} "{Title}" created by {UserId}' +
+ + +

The number(), boolean(), and date() builders each have a .coerce() method that adds a preprocessor to convert string values to the target type. This is especially useful with parse-string schemas where captured segments are always strings, but also works standalone for URL parameters, form inputs, or any other string source.

+
import { number, boolean, date } from '@cleverbrush/schema';

// number().coerce() — uses Number(value)
number().coerce().validate('42'); // { valid: true, object: 42 }
number().coerce().validate('hello'); // { valid: false } — NaN fails

// boolean().coerce() — "true" → true, "false" → false
boolean().coerce().validate('true'); // { valid: true, object: true }
boolean().coerce().validate('yes'); // { valid: false } — unrecognized

// date().coerce() — new Date(value) if valid
date().coerce().validate('2024-01-15'); // { valid: true, object: Date }
date().coerce().validate('nope'); // { valid: false } — invalid date +
+ +

Non-string values pass through unchanged, so .coerce() is safe to chain even when the input might already be the correct type. All three methods return a new immutable schema instance.

+ +

▶ Open in Playground

+

Use lazy(() => schema) to define recursive or self-referential schemas — tree structures, comment threads, nested menus, org charts, and any other type that refers to itself.

+

The getter function is called once on first validation, and the resolved schema is cached. Every subsequent call reuses the cache.

+
+

TypeScript limitation: TypeScript cannot infer recursive types automatically. You must provide an explicit type annotation on the variable holding the schema.

+
+
import {
object,
string,
number,
array,
lazy,
type SchemaBuilder
} from '@cleverbrush/schema';

// ── Tree structure ───────────────────────────────────────────────
type TreeNode = { value: number; children: TreeNode[] };

// Explicit annotation required — TypeScript can't infer recursive types
const treeNode: SchemaBuilder<TreeNode, true> = object({
value: number(),
children: array(lazy(() => treeNode))
});

treeNode.validate({
value: 1,
children: [
{ value: 2, children: [] },
{ value: 3, children: [{ value: 4, children: [] }] }
]
});
// { valid: true, object: { value: 1, children: [...] } }

// ── Comment thread ───────────────────────────────────────────────
type Comment = { text: string; replies: Comment[] };

const commentSchema: SchemaBuilder<Comment, true> = object({
text: string(),
replies: array(lazy(() => commentSchema))
});

// ── Navigation menu with optional sub-levels ─────────────────────
type MenuItem = { label: string; submenu?: MenuItem[] };

const menuItem: SchemaBuilder<MenuItem, true> = object({
label: string(),
submenu: array(lazy(() => menuItem)).optional()
}); +
+ +

lazy() is fully compatible with .optional(), .addPreprocessor(), .addValidator(), and all other fluent methods. The wrapper's own preprocessors and validators run before delegating to the resolved schema.

+
// Preprocessors and validators work on the lazy wrapper itself
const schema = lazy(() => string())
.addPreprocessor((v) => (typeof v === 'number' ? String(v) : v))
.addValidator((v) => ({ valid: v !== 'forbidden' })); +
+ + +

▶ Open in Playground

+

Some libraries ship a dedicated .discriminator() API for tagged unions. With @cleverbrush/schema you don't need one — union() combined with string-literal schemas gives you the same pattern naturally, with full type inference.

+

Use string('literal') for the discriminator field. Each branch of the union gets its own object schema whose discriminator can only match one exact value. TypeScript narrows the inferred type automatically:

+
import { object, string, number, union, type InferType } from '@cleverbrush/schema';

// Each variant has a literal "type" field acting as the discriminator
const Circle = object({
type: string('circle'),
radius: number().min(0)
});

const Rectangle = object({
type: string('rectangle'),
width: number().min(0),
height: number().min(0)
});

const Triangle = object({
type: string('triangle'),
base: number().min(0),
height: number().min(0)
});

// Combine with union() — no special .discriminator() call needed
const ShapeSchema = union(Circle).or(Rectangle).or(Triangle);

type Shape = InferType<typeof ShapeSchema>;
// Shape is automatically:
// | { type: 'circle'; radius: number }
// | { type: 'rectangle'; width: number; height: number }
// | { type: 'triangle'; base: number; height: number }

// Validation picks the matching branch by the literal field
const result = ShapeSchema.validate({ type: 'circle', radius: 5 }); +
+ + +

The @cleverbrush/scheduler library uses this exact pattern to validate job schedules. The every field acts as the discriminator, and each variant adds its own set of allowed properties:

+
import { object, string, number, array, date, union, type InferType } from '@cleverbrush/schema';

// Shared base with common schedule fields
const ScheduleBase = object({
interval: number().min(1).max(356),
hour: number().min(0).max(23).optional(),
minute: number().min(0).max(59).optional(),
startsOn: date().acceptJsonString().optional(),
endsOn: date().acceptJsonString().optional()
});

// Minute schedule — omit hour/minute (they don't apply)
const EveryMinute = ScheduleBase
.omit('hour').omit('minute')
.addProps({ every: string('minute') });

// Day schedule
const EveryDay = ScheduleBase
.addProps({ every: string('day') });

// Week schedule — adds dayOfWeek array
const EveryWeek = ScheduleBase.addProps({
every: string('week'),
dayOfWeek: array().of(number().min(1).max(7)).minLength(1).maxLength(7)
});

// Month schedule — adds day (number or 'last')
const EveryMonth = ScheduleBase.addProps({
every: string('month'),
day: union(string('last')).or(number().min(1).max(28))
});

// Combine all variants in a single union
const ScheduleSchema = union(EveryMinute)
.or(EveryDay)
.or(EveryWeek)
.or(EveryMonth);

type Schedule = InferType<typeof ScheduleSchema>;
// TypeScript infers a proper discriminated union on "every" +
+ +

Because each branch uses a string literal (string('minute'), string('day'), etc.) for the every field, TypeScript can narrow the full union based on that single property — exactly like zod's z.discriminatedUnion(), but without any extra API surface.

+ +

When you define an object schema, JSDoc comments on properties are preserved in the inferred TypeScript type. This means your IDE tooltips, hover documentation, and autocomplete descriptions all carry through from the schema definition — no need to maintain separate documentation:

+
const UserSchema = object({
/** Full display name of the user */
name: string().minLength(1).maxLength(200),
/** Contact email — must be unique across all users */
email: string().minLength(5),
/** Age in years. Must be a positive integer. */
age: number().min(0).max(150)
});

type User = InferType<typeof UserSchema>;
// Hovering over User.name in your IDE shows:
// "Full display name of the user"
// Hovering over User.email shows:
// "Contact email — must be unique across all users" +
+ + +

▶ Open in Playground

+

.deepPartial() recursively marks all properties at every nesting level as optional. It is the deep-object equivalent of a common DeepPartial<T> helper type in TypeScript, and is the recommended way to build PATCH API bodies or partial form state.

+ + + + + + + + + + + + + + + + + + + + + +
Schema typeEffect
object(…).deepPartial()All top-level and nested object properties become optional
Nested object(…) inside an objectRecursed — its properties are made optional too
array(…), union(…), primitivesThe property itself is made optional; internals are not modified
+
import { object, string, number, array, type InferType } from '@cleverbrush/schema';

const CreateUser = object({
name: string(),
address: object({
street: string(),
city: string()
})
});

const PatchUser = CreateUser.deepPartial();

type PatchUserPayload = InferType<typeof PatchUser>;
// {
// name?: string;
// address?: { street?: string; city?: string };
// }

// All three are valid:
PatchUser.validate({}); // { valid: true }
PatchUser.validate({ address: {} }); // { valid: true }
PatchUser.validate({ address: { city: 'Paris' } }); // { valid: true } +
+ +

Contrast with .partial(), which only affects the top level:

+
const ShallowPartial = CreateUser.partial();
// { name?: string; address?: { street: string; city: string } }
// ↑ still required inside

ShallowPartial.validate({ address: {} });
// { valid: false } — street and city are still required +
+ +

Chains naturally with other modifiers:

+
const Schema = CreateUser.deepPartial().readonly();
type T = InferType<typeof Schema>;
// Readonly<{ name?: string; address?: { street?: string; city?: string } }> +
+ +
+

Note: .deepPartial() recurses only into nested object() schemas. Array element schemas and union option schemas are not modified — array(object({…})) becomes an optional array but its element shape is unchanged. If you need deep-partialed array elements, apply .deepPartial() to the element schema before passing it to array():

+
array(InnerSchema.deepPartial()).optional()
+
+ +
+ +

▶ Open in Playground

+

Every schema builder has two validation methods:

+
    +
  • validate(data) — synchronous. Returns a ValidationResult directly. Throws if any preprocessor, validator, or error message provider returns a Promise.
  • +
  • validateAsync(data) — asynchronous. Returns a Promise<ValidationResult>. Supports async preprocessors, validators, and error message providers.
  • +
+

Use validate() by default for the best performance. Switch to validateAsync() only when your schema includes async operations (e.g. database lookups, API calls in validators).

+
// Synchronous validation (default — use when all validators are sync)
const result = UserSchema.validate(someObject);

if (result.valid) {
console.log(result.object); // typed as InferType<typeof UserSchema>
} else {
// For object schemas, prefer getErrorsFor() for per-property error inspection (see below)
console.log(result.errors); // deprecated for object schemas — Array of { message: string }
}

// Async validation (use when validators/preprocessors are async)
const asyncResult = await UserSchema.validateAsync(someObject); +
+ + +

By default, validation stops at the first error. Pass { doNotStopOnFirstError: true } to collect all errors at once:

+
const result = UserSchema.validate(
{ name: 'A', email: '', age: -5, isActive: true },
{ doNotStopOnFirstError: true }
);

console.log(result.errors);
// [
// { message: 'Name must be at least 2 characters' },
// { message: 'Please enter a valid email' },
// { message: 'Age cannot be negative' }
// ] +
+ + +

▶ Open in Playground

+

Every constraint accepts an optional error message — either a plain string or a function:

+
const Name = string()
.minLength(2, 'Name is too short')
.maxLength(50, (seen) => `"${seen}" exceeds 50 characters`);

const Age = number()
.min(0, 'Age cannot be negative')
.max(150, 'Age seems unrealistic'); +
+ + +

▶ Open in Playground

+

Add custom synchronous or asynchronous validators to any schema:

+
const EmailSchema = string()
.minLength(5, 'Email is too short')
.addValidator(async (value) => {
if (value === 'taken@example.com') {
return {
valid: false,
errors: [{ message: 'This email is already registered' }]
};
}
return { valid: true };
}); +
+ +

Object-level validators can validate cross-field constraints:

+
const SignupSchema = object({
password: string().minLength(8),
confirmPassword: string().minLength(8)
}).addValidator(async (value) => {
if (value.password !== value.confirmPassword) {
return {
valid: false,
errors: [{ message: 'Passwords do not match' }]
};
}
return { valid: true };
}); +
+ + +

By default, errors returned from object-level validators are attached to the root object. You can target an error to a specific property by providing a property selector — the same selector used by getErrorsFor() and react-form's forProperty:

+
const SignupSchema = object({
password: string().minLength(8),
confirmPassword: string().minLength(8)
}).addValidator((value) => {
if (value.password !== value.confirmPassword) {
return {
valid: false,
errors: [{
message: 'Passwords do not match',
property: (t) => t.confirmPassword
}]
};
}
return { valid: true };
});

const result = SignupSchema.validate(
{ password: 'secret1', confirmPassword: 'secret2' },
{ doNotStopOnFirstError: true }
);

// Error is routed to confirmPassword:
result.getErrorsFor((t) => t.confirmPassword).errors;
// → ['Passwords do not match']

// Other properties are unaffected:
result.getErrorsFor((t) => t.password).errors;
// → [] +
+ +

You can target multiple properties from a single validator by returning multiple errors with different property selectors. Errors without a property selector are attached to the root object as before.

+ +

ObjectSchemaBuilder.validate() returns an extended result with a getErrorsFor() method for inspecting errors on individual properties — perfect for showing inline form errors. This is the recommended way to inspect validation errors on object schemas and replaces the deprecated errors array on ObjectSchemaValidationResult:

+
const PersonSchema = object({
name: string().minLength(1),
address: object({
city: string(),
zip: number()
})
});

const result = PersonSchema.validate(person, {
doNotStopOnFirstError: true
});

if (!result.valid) {
// Get errors for a single property
const nameErrors = result.getErrorsFor((p) => p.name);
console.log(nameErrors.isValid); // false
console.log(nameErrors.errors); // ['must be at least 1 character']
console.log(nameErrors.seenValue); // the value that was validated

// Works with nested properties too
const cityErrors = result.getErrorsFor((p) => p.address.city);
console.log(cityErrors.errors);
} +
+ + +

PropertyDescriptors are a runtime metadata tree attached to each property in an object schema. They provide type-safe access to property values, schema builders, and parent descriptors. This is what makes the entire Cleverbrush ecosystem work:

+
    +
  • @cleverbrush/mapper uses them as selectors (like C# expression trees) to point at source and target properties type-safely.
  • +
  • @cleverbrush/react-form uses them to bind form fields to schema properties and read their validation constraints automatically.
  • +
+
import {
object,
string,
number,
ObjectSchemaBuilder
} from '@cleverbrush/schema';

const UserSchema = object({
name: string().minLength(2),
address: object({
city: string(),
zip: number()
})
});

// Get the PropertyDescriptor tree
const tree = ObjectSchemaBuilder.getPropertiesFor(UserSchema);

// Use descriptors as selectors in mapper and react-form:
// mapper: .for((t) => t.name).from((s) => s.name)
// react-form: <Field selector={(t) => t.address.city} form={form} /> +
+ + +

Every schema builder supports .default(value). When the input is undefined, the default value is used instead — and the result is still validated against the schema's constraints.

+
import { string, number, array, object, InferType } from '@cleverbrush/schema';

// Static default
const Name = string().default('Anonymous');
Name.validate(undefined); // { valid: true, object: 'Anonymous' }
Name.validate('Alice'); // { valid: true, object: 'Alice' }

// Factory function — useful for mutable defaults
const Tags = array(string()).default(() => []);

// Works with .optional() — removes undefined from the type
const Port = number().optional().default(3000);
type Port = InferType<typeof Port>; // number (not number | undefined) +
+ +

Use a factory function for mutable values (arrays, objects) to avoid shared references:

+
const Config = object({
host: string().default('localhost'),
port: number().default(8080),
tags: array(string()).default(() => [])
});

type Config = InferType<typeof Config>;
// { host: string; port: number; tags: string[] }
// All fields are non-optional — defaults fill in missing values +
+ +

Default values are exposed via .introspect():

+
const schema = string().default('hello');
const info = schema.introspect();
console.log(info.hasDefault); // true
console.log(info.defaultValue); // 'hello' +
+ + +

Attach example values to any schema with .example(value). The example is typed to the schema's result type, so the compiler catches mismatches. Examples are purely metadata — validation is unaffected.

+
import { string, number, object } from '@cleverbrush/schema';

const Email = string().example('user@example.com');
const Age = number().example(30);

const User = object({
email: Email,
age: Age,
}).example({ email: 'alice@example.com', age: 25 }); +
+ +

Examples are exposed via .introspect() and consumed by @cleverbrush/schema-json (emitted as the JSON Schema examples keyword) and @cleverbrush/server-openapi (pre-fills parameter and response schemas in generated specs).

+
Email.introspect().example; // 'user@example.com'
+
+ + +

Every schema builder supports .catch(value). When validation fails for any reason — wrong type, constraint violation, missing required value — the fallback is returned as a successful result instead of errors.

+

Unlike .default(), which only fires when the input is undefined, .catch() fires on any validation failure.

+
import { string, number, array, object } from '@cleverbrush/schema';

// Static fallback
const Name = string().catch('unknown');
Name.validate(42); // { valid: true, object: 'unknown' }
Name.validate(null); // { valid: true, object: 'unknown' }
Name.validate('Alice'); // { valid: true, object: 'Alice' }

// Constraint violation also triggers catch
const Age = number().min(0).catch(-1);
Age.validate(-5); // { valid: true, object: -1 }

// .parse() and .parseAsync() never throw when .catch() is set
Name.parse(42); // 'unknown' (no SchemaValidationError thrown) +
+ +

Use a factory function for mutable fallback values to avoid shared references:

+
const Tags = array(string()).catch(() => []);

const r1 = Tags.validate(null); // { valid: true, object: [] }
const r2 = Tags.validate(null); // { valid: true, object: [] }
// r1.object !== r2.object — separate array instances each time +
+ +

The fallback state is exposed via .introspect():

+
const schema = string().catch('unknown');
const info = schema.introspect();
console.log(info.hasCatch); // true
console.log(info.catchValue); // 'unknown' +
+ + +

Every schema builder supports .readonly(). This is a type-level-only modifier — it marks the inferred TypeScript type as immutable, but does not alter validation behaviour or freeze the validated value at runtime.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BuilderEffect on InferType<T>
object(…).readonly()Readonly<{ … }> — all top-level properties become readonly
array(…).readonly()ReadonlyArray<T> — no push, pop, etc. at the type level
string().readonly()string (identity — primitives are already immutable)
number().readonly()number (identity)
boolean().readonly()boolean (identity)
date().readonly()Readonly<Date>
+
import { object, array, string, number, InferType } from '@cleverbrush/schema';

// Readonly object
const UserSchema = object({ name: string(), age: number() }).readonly();
type User = InferType<typeof UserSchema>;
// Readonly<{ name: string; age: number }>

// Readonly array
const TagsSchema = array(string()).readonly();
type Tags = InferType<typeof TagsSchema>;
// ReadonlyArray<string>

// Validation behaviour is unchanged
const result = UserSchema.validate({ name: 'Alice', age: 30 });
// { valid: true, object: { name: 'Alice', age: 30 } } +
+ +

Chains naturally with .optional() and .default():

+
const Schema = object({ id: number() }).readonly().optional();
type T = InferType<typeof Schema>;
// Readonly<{ id: number }> | undefined +
+ +

The isReadonly flag is exposed via .introspect() for tooling:

+
const schema = object({ name: string() }).readonly();
console.log(schema.introspect().isReadonly); // true +
+ +
+

Note: .readonly() is shallow — only top-level object properties or the array itself are marked readonly. For deeply nested immutability consider applying .readonly() at each level, or use a DeepReadonly utility type post-validation.

+
+ +

Every schema builder supports .schemaName(name). This is a metadata-only modifier — it attaches a component name to the schema for use by OpenAPI tooling. It has no effect on validation or type inference.

+
import { object, string, number } from '@cleverbrush/schema';

export const UserSchema = object({
id: number(),
name: string(),
}).schemaName('User');

// Accessible at runtime
UserSchema.introspect().schemaName; // 'User' +
+ +

Chains naturally with all other modifiers:

+
const ProductSchema = object({
sku: string().nonempty(),
price: number().min(0),
})
.schemaName('Product')
.describe('A product in the catalogue'); +
+ +

When used with @cleverbrush/server-openapi, any schema that carries a schemaName is automatically extracted into components/schemas and all usages in the document are replaced with $ref pointers — eliminating repeated inline definitions:

+
import { generateOpenApiSpec } from '@cleverbrush/server-openapi';

// UserSchema is emitted once under components.schemas.User
// Every endpoint that references it gets: { $ref: '#/components/schemas/User' }
generateOpenApiSpec({ registrations, info: { title: 'My API', version: '1.0.0' } }); +
+ +
+

Name uniqueness: Registering two different schema instances under the same name throws an error. Always export named schemas as constants and reuse the same reference everywhere.

+
+ + + + + + + + + + + + + + + + + + + + +
Method / PropertySignatureNotes
.schemaName(name)schemaName(name: string): thisReturns a new builder; original is unchanged
.introspect().schemaNamestring | undefinedThe name passed to .schemaName(), or undefined
+ +

Every schema builder supports .describe(text). This is a metadata-only modifier — it stores a human-readable description on the schema at runtime with no effect on validation.

+
const UserSchema = object({
name: string().describe("The user's full name"),
age: number().optional().describe('Age in years'),
}).describe('A user object');

// Read the description back at runtime
UserSchema.introspect().description; // 'A user object' +
+ +

The description is accessible via .introspect().description and chains naturally with all other modifiers:

+
string().describe('A name').optional().readonly()
// ^ InferType is string | undefined, isReadonly: true, description: 'A name' +
+ +

When using @cleverbrush/schema-json, descriptions round-trip through JSON Schema's standard description field:

+
import { toJsonSchema, fromJsonSchema } from '@cleverbrush/schema-json';

const spec = toJsonSchema(string().describe('A name'), { $schema: false });
// { type: 'string', description: 'A name' }

const schema = fromJsonSchema({ type: 'string', description: 'A name' } as const);
schema.introspect().description; // 'A name' +
+ + +

▶ Open in Playground

+

The extension system lets you add custom methods to any schema builder type without modifying the core library. Define an extension once, apply it with withExtensions(), and every builder produced by the returned factories includes your new methods — fully typed and chainable.

+ +

Use defineExtension() to declare which builder types your extension targets and what methods it adds. Extension methods receive this bound to the builder instance and must return a builder to support fluent chaining:

+
import {
defineExtension,
withExtensions,
StringSchemaBuilder,
NumberSchemaBuilder,
DateSchemaBuilder
} from '@cleverbrush/schema';

// Email extension — adds .email() to string builders
const emailExt = defineExtension({
string: {
email(this: StringSchemaBuilder) {
return this.addValidator((val) => {
const valid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val as string);
return {
valid,
errors: valid
? []
: [{ message: 'Invalid email address' }]
};
});
}
}
});

// Port extension — adds .port() to number builders
const portExt = defineExtension({
number: {
port(this: NumberSchemaBuilder) {
return this.isInteger().min(1).max(65535);
}
}
});

// Slug extension — adds .slug() to string builders
const slugExt = defineExtension({
string: {
slug(this: StringSchemaBuilder) {
return this.addValidator((val) => {
const valid = /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(val as string);
return {
valid,
errors: valid
? []
: [{ message: 'Must be a valid URL slug' }]
};
});
}
}
}); +
+ + +

Pass one or more extension descriptors to withExtensions() to get augmented factory functions. All original builder methods remain available and fully chainable alongside the new ones:

+
const s = withExtensions(emailExt, portExt, slugExt);

// .email() and .slug() are now available on string builders
const EmailSchema = s.string().email().minLength(5);
const SlugSchema = s.string().slug().minLength(1).maxLength(200);

// .port() is now available on number builders
const PortSchema = s.number().port();

// Use in object schemas — just like normal builders
const ServerConfig = s.object({
adminEmail: s.string().email(),
port: s.number().port(),
slug: s.string().slug(),
name: s.string().minLength(1)
});

// Validate as usual
const result = ServerConfig.validate({
adminEmail: 'admin@example.com',
port: 8080,
slug: 'my-server',
name: 'Production'
}); +
+ + +

A single extension can target multiple builder types:

+
const timestampsExt = defineExtension({
string: {
/** Marks this string property as an ISO timestamp */
isoTimestamp(this: StringSchemaBuilder) {
return this.addValidator((val) => {
const valid = !isNaN(Date.parse(val as string));
return {
valid,
errors: valid
? []
: [{ message: 'Must be a valid ISO timestamp' }]
};
});
}
},
date: {
/** Adds a validator that rejects dates in the future */
pastOnly(this: DateSchemaBuilder) {
return this.addValidator((val) => {
const valid = (val as Date) <= new Date();
return {
valid,
errors: valid ? [] : [{ message: 'Date must be in the past' }]
};
});
}
}
}); +
+ + +

Extension methods automatically record metadata that can be inspected at runtime via .introspect().extensions. The system auto-infers the metadata value based on the arguments passed to the extension method:

+
    +
  • Zero-arg methods → metadata value is true
  • +
  • Single-arg methods → metadata value is the argument itself
  • +
  • Multi-arg methods → metadata value is the arguments array
  • +
+
const s = withExtensions(emailExt, portExt);

// Zero-arg method — metadata is `true`
const emailSchema = s.string().email();
console.log(emailSchema.introspect().extensions.email); // true

// Single-arg method — metadata is the argument
const rangeExt = defineExtension({
number: {
percentage(this: NumberSchemaBuilder) {
return this.min(0).max(100);
}
}
});
const s2 = withExtensions(rangeExt);
const pctSchema = s2.number().percentage();
console.log(pctSchema.introspect().extensions.percentage); // true

// Multi-arg method — metadata is the arguments array
const rangeExt2 = defineExtension({
number: {
range(this: NumberSchemaBuilder, min: number, max: number) {
return this.min(min).max(max);
}
}
});
const s3 = withExtensions(rangeExt2);
const rangeSchema = s3.number().range(0, 100);
console.log(rangeSchema.introspect().extensions.range); // [0, 100] +
+ + +

If you need structured metadata (e.g. an object with named fields rather than the raw arguments), call this.withExtension(key, value) explicitly inside the method. The auto-infer logic detects the existing key and skips automatic attachment:

+
const currencyExt = defineExtension({
number: {
currency(this: NumberSchemaBuilder, opts?: { maxDecimals?: number }) {
const maxDec = opts?.maxDecimals ?? 2;
// Explicit withExtension() call — auto-infer is skipped
return this
.withExtension('currency', { maxDecimals: maxDec })
.min(0)
.addValidator((val) => {
const decimals = (String(val).split('.')[1] ?? '').length;
const valid = decimals <= maxDec;
return {
valid,
errors: valid
? []
: [{ message: `Max ${maxDec} decimal places` }]
};
});
}
}
});

const s = withExtensions(currencyExt);
const priceSchema = s.number().currency({ maxDecimals: 4 });
console.log(priceSchema.introspect().extensions.currency);
// { maxDecimals: 4 } — structured metadata, not the raw args +
+ + +

Multiple extensions can be stacked — their methods are merged per builder type. A runtime error is thrown if two extensions define the same method name on the same builder type:

+
// All three extensions target StringSchemaBuilder
const s = withExtensions(emailExt, slugExt, trimmedExt);

// All methods are available and chainable
const schema = s.string().email().slug().trimmed().minLength(5); +
+ + +

defineExtension() validates the configuration eagerly:

+
    +
  • Unknown builder type names throw immediately (e.g. { str: { ... } } instead of { string: { ... } })
  • +
  • Reserved method names cannot be overridden — validate, introspect, optional, required, addValidator, addPreprocessor, withExtension, getExtension, etc.
  • +
  • Non-function values in the method record are rejected
  • +
+
// ❌ Throws: Unknown builder type "str"
defineExtension({ str: { foo() { return this; } } });

// ❌ Throws: Cannot override reserved method "validate"
defineExtension({ string: { validate() { return this; } } }); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function / TypeDescription
defineExtension(config)Defines an extension. config is an ExtensionConfig keyed by builder type name. Returns an ExtensionDescriptor.
withExtensions(...exts)Accepts one or more ExtensionDescriptors. Returns an object with augmented factory functions (string, number, boolean, date, object, array, union, func, any).
ExtensionConfigType for the configuration object passed to defineExtension. Maps builder type names to method records.
ExtensionDescriptorBranded type returned by defineExtension. Pass to withExtensions() to apply.
+ +

▶ Open in Playground

+

The default import from @cleverbrush/schema includes a pre-applied extension pack with common validators. You get these methods automatically — no extra setup required:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescriptionMetadata
.email(errorMessage?)Validates email formattrue
.url(opts?, errorMessage?)Validates URL format. opts.protocols narrows allowed schemes (default: http, https)true or { protocols }
.uuid(errorMessage?)Validates RFC 4122 UUID format (versions 1–5)true
.ip(opts?, errorMessage?)Validates IPv4 or IPv6 address. opts.version narrows to 'v4' or 'v6'true or { version }
.trim()Preprocessor — trims whitespace before validationtrue
.toLowerCase()Preprocessor — lowercases value before validationtrue
.nonempty(errorMessage?)Rejects empty stringstrue
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescriptionMetadata
.positive(errorMessage?)Value must be > 0true
.negative(errorMessage?)Value must be < 0true
.finite(errorMessage?)Value must be finite (not Infinity / -Infinity)true
.multipleOf(n, errorMessage?)Value must be an exact multiple of n (float-safe)n
+ + + + + + + + + + + + + + + + + + + + + +
MethodDescriptionMetadata
.nonempty(errorMessage?)Array must have at least one elementtrue
.unique(keyFn?, errorMessage?)All elements must be unique. Optional keyFn extracts comparison key for objectstrue or keyFn
+ +

.nullable() and .notNullable() are native methods available on every builder — no extension required.

+ + + + + + + + + + + + + + + + + + + + +
MethodAvailable onDescription
.nullable()all buildersMarks the schema as nullable — null is accepted as a valid value. The inferred type changes from T to T | null.
.notNullable()all buildersRemoves the nullable mark — null is no longer accepted. The inferred type changes from T | null back to T.
+
import { string, number, object, InferType } from '@cleverbrush/schema';

const name = string().nullable();
type Name = InferType<typeof name>; // string | null

// Works with any builder
const score = number().positive().nullable(); // number | null

// Chaining: validators before .nullable()
const email = string().email().nullable(); // string | null

// Optional + nullable: accepts string | null | undefined
const bio = string().optional().nullable();

// Nested inside objects
const User = object({
name: string().nonempty(),
bio: string().nullable(), // string | null
age: number().nullable(), // number | null
});

User.validate({ name: 'Alice', bio: null, age: null }); // valid

// Toggle back with .notNullable()
const strictName = string().nullable().notNullable();
type StrictName = InferType<typeof strictName>; // string (not string | null)

strictName.validate(null); // invalid
strictName.validate('Alice'); // valid

// Introspect at runtime
string().nullable().introspect().isNullable; // true
string().nullable().notNullable().introspect().isNullable; // false +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodAvailable onDescription
.oneOf(...values)string, numberConstrains the value to one of the given literals and narrows the inferred type to the literal union.
.oneOf(valuesArray, errorMessage?)string, numberArray-form with an optional custom error message (string or factory).
enumOf(...values)top-level factorySugar for string().oneOf(...). Mirrors Zod's z.enum().
enumOf(valuesArray, errorMessage?)top-level factoryArray-form with an optional custom error message.
+
import { string, number, enumOf, InferType } from '@cleverbrush/schema';

// String enum — infers 'admin' | 'user' | 'guest'
const Role = enumOf('admin', 'user', 'guest');
type Role = InferType<typeof Role>;

Role.validate('admin'); // valid
Role.validate('other'); // invalid — "must be one of: admin, user, guest"

// Equivalent long-form
const Role2 = string().oneOf('admin', 'user', 'guest');

// Number enum — infers 1 | 2 | 3
const Priority = number().oneOf(1, 2, 3);
type Priority = InferType<typeof Priority>;

// Chains with nullable / optional
const OptionalRole = enumOf('admin', 'user').nullable(); // 'admin' | 'user' | null

// Runtime access to allowed values via introspect
Role.introspect().extensions?.oneOf; // ['admin', 'user', 'guest'] +
+ + +

.oneOf() accepts a custom error message via the array form, where the allowed values are passed as an array and the error message is the second argument:

+
import { string, number, enumOf } from '@cleverbrush/schema';

// String — array form with custom string error message
const role = string().oneOf(['admin', 'user', 'guest'], 'Invalid role');
role.validate('other'); // invalid — "Invalid role"

// String — array form with factory function
const role2 = string().oneOf(
['admin', 'user'],
(val) => `"${val}" is not a valid role`
);

// enumOf — array form with custom error message
const Role = enumOf(['admin', 'user', 'guest'], 'Invalid role');

// Number — trailing error message (unambiguous since values are numbers)
const priority = number().oneOf(1, 2, 3, 'Priority must be 1, 2, or 3');
priority.validate(99); // invalid — "Priority must be 1, 2, or 3"

// Number — array form
const priority2 = number().oneOf([1, 2, 3], 'Invalid priority');

// Number — factory function
const priority3 = number().oneOf(
1, 2, 3,
(val) => `${val} is not a valid priority`
); +
+ +
+

Note on string .oneOf() error messages: Because .oneOf() accepts a variadic list of string values, a trailing string argument is treated as another allowed value (not an error message). To provide a string error message for a string enum, use the array formstring().oneOf(['a', 'b'], 'error message'). A trailing function is always unambiguously treated as an error message factory in the rest-params form.

+
+

All validator extensions accept an optional error message as the last parameter — either a string or a function (matching the same ValidationErrorMessageProvider pattern used by built-in constraints like .minLength()):

+
import { string, number, array } from '@cleverbrush/schema';

// String error messages
const email = string().email('Please enter a valid email');
const age = number().positive('Age must be positive');
const tags = array().of(string()).nonempty('At least one tag required');

// Function error messages — receive the invalid value
const name = string().nonempty((val) => `"${val}" is not allowed`);
const score = number().multipleOf(5, (val) => `${val} is not a multiple of 5`); +
+ + +

If you need bare builders without the built-in extensions (e.g. to apply only your own custom extensions), import from the /core sub-path:

+
// Bare builders — no built-in extensions
import { string, number, array, withExtensions } from '@cleverbrush/schema/core';

// Apply only your own extensions
const s = withExtensions(myCustomExtension); +
+ +

The default import (@cleverbrush/schema) re-exports everything from /core and overrides the nine factory functions (string, number, boolean, date, object, array, union, func, any) with pre-extended versions. The extension descriptors themselves are also exported (stringExtensions, numberExtensions, arrayExtensions, nullableExtension) so you can compose them with your own.

+ +

@cleverbrush/schema is the foundation of a three-library ecosystem:

+
@cleverbrush/schemaDefine once
↓ ↓ ↓
Validate data Map between schemas Render React forms
↓ ↓ ↓
.validate() @cleverbrush/mapper @cleverbrush/react-form +
+ +

Define a schema once and use it for runtime validation, object mapping between different shapes, and type-safe React forms — all from a single source of truth.

+ +

Builder functions: any, lazy, string, number, boolean, func, promise, object, date, array, union, parseString

+

Builder classes (for extending): SchemaBuilder, AnySchemaBuilder, ArraySchemaBuilder, BooleanSchemaBuilder, DateSchemaBuilder, FunctionSchemaBuilder, ParseStringSchemaBuilder, LazySchemaBuilder, NumberSchemaBuilder, ObjectSchemaBuilder, PromiseSchemaBuilder, StringSchemaBuilder, UnionSchemaBuilder

+

Extension system: defineExtension, withExtensions, stringExtensions, numberExtensions, arrayExtensions, nullableExtension

+

Sub-path exports: @cleverbrush/schema/core — bare builders without built-in extensions

+

Types: InferType, ValidationResult, ValidationError, MakeOptional, SchemaPropertySelector, PropertyDescriptor, PropertyDescriptorTree, ExtensionConfig, ExtensionDescriptor

+

See API documentation for the full reference.

+ +

Benchmarked against Zod v4 with Vitest bench. Run the benchmarks yourself from the repo root: npm run bench.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Benchmark@cleverbrush/schemaZodRatio
Array 100 objects — valid35,228 ops/s13,277 ops/s2.65× faster
Array 100 objects — invalid899,329 ops/s4,396 ops/s204× faster
Complex order — valid198,988 ops/s136,090 ops/s1.46× faster
Complex order — invalid884,706 ops/s26,106 ops/s33.9× faster
Flat object — valid1,001,194 ops/s840,725 ops/s1.19× faster
Flat object — invalid2,653,630 ops/s176,222 ops/s15.1× faster
Nested object — valid690,556 ops/s368,893 ops/s1.87× faster
Nested object — invalid2,739,319 ops/s87,245 ops/s31.4× faster
String — valid5,348,564 ops/s3,533,945 ops/s1.51× faster
String — invalid5,749,087 ops/s482,961 ops/s11.9× faster
Number — valid7,911,266 ops/s4,806,511 ops/s1.65× faster
Number — invalid5,387,475 ops/s637,513 ops/s8.45× faster
Union first branch1,925,508 ops/s1,529,547 ops/s1.26× faster
Union last branch676,107 ops/s732,682 ops/s0.92×
Union no match — invalid5,873,118 ops/s385,453 ops/s15.2× faster
+

The large gains on invalid data come from the early-exit optimization: validation stops at the first failing constraint in each field and skips the rest of the object. For APIs and form handlers where invalid submissions are common, this translates directly to measurable throughput improvements.

+ +

Already using Zod, Valibot, or ArkType? The extern() factory wraps any Standard Schema v1 compatible schema into a @cleverbrush/schema builder — so you can mix external schemas with native ones inside an object() without rewriting anything.

+
import { z } from 'zod';
import { object, number, extern, InferType } from '@cleverbrush/schema';

// Existing Zod schema — keep as-is
const ZodAddress = z.object({
street: z.string().min(1),
city: z.string(),
zip: z.string().length(5),
});

// Compose with @cleverbrush/schema
const OrderSchema = object({
address: extern(ZodAddress),
totalCents: number().min(1),
});

// Type is inferred from *both* libraries:
type Order = InferType<typeof OrderSchema>;
// { address: { street: string; city: string; zip: string }; totalCents: number }

const result = OrderSchema.validate({
address: { street: '5th Ave', city: 'NYC', zip: '10001' },
totalCents: 4999,
});

if (!result.valid) {
// Navigate into the extern property — no type annotation needed
const zipErrors = result.getErrorsFor(t => t.address.zip);
console.log(zipErrors.errors);
} +
+ +

Key points:

+
    +
  • One parameter: extern(standardSchema) — types and property descriptors are derived automatically.
  • +
  • getErrorsFor() works through extern boundaries: t => t.address.city navigates into the Zod schema.
  • +
  • Validation is delegated to the external schema’s ['~standard'].validate() — @cleverbrush/schema never re-implements the external library’s validation logic.
  • +
  • Works with any library that implements Standard Schema v1 (Zod ≥ 3.24, Valibot ≥ 1.0, ArkType, etc.).
  • +
+ +

@cleverbrush/schema implements Standard Schema v1. Every builder exposes a ['~standard'] getter, which means schemas work as-is with any Standard Schema consumer — no adapters, no wrappers, no configuration:

+
import { object, string, number } from '@cleverbrush/schema';

const UserSchema = object({
name: string().nonempty(),
age: number().min(18),
});

// Works with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, Elysia, …
const standardSchema = UserSchema['~standard']; +
+ +

The ['~standard'].validate() method returns a Promise, supporting both sync +and async preprocessors, validators, and error message providers:

+
const result = await UserSchema['~standard'].validate(input);
if ('issues' in result) {
console.error(result.issues[0].message);
} +
+ +

Confirmed integrations: tRPC, TanStack Form, React Hook Form, T3 Env, Hono, Elysia, next-safe-action, and 50+ others listed on standardschema.dev.

+ +
    +
  • Linting: Biome — strict rules enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode (strictNullChecks, noImplicitAny, full coverage)
  • +
  • Unit tests: Vitest — runtime tests + type-level tests (expectTypeOf) covering all builders, extensions, edge cases, and error paths
  • +
  • Type-level tests: expectTypeOf assertions validate that inferred types are exactly correct, not just assignable
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Namespaces

StandardSchemaV1
StandardTypedV1

Classes

AnySchemaBuilder
ArraySchemaBuilder
BooleanSchemaBuilder
DateSchemaBuilder
ExternSchemaBuilder
FunctionSchemaBuilder
GenericSchemaBuilder
IntersectionSchemaBuilder
LazySchemaBuilder
NullSchemaBuilder
NumberSchemaBuilder
ObjectSchemaBuilder
ParseStringSchemaBuilder
PromiseSchemaBuilder
RecordSchemaBuilder
SchemaBuilder
SchemaValidationError
StringSchemaBuilder
TupleSchemaBuilder
UnionSchemaBuilder

Interfaces

ArrayBuiltinExtensions
NumberBuiltinExtensions
StandardSchemaV1
StandardTypedV1
StringBuiltinExtensions

Type Aliases

ArraySchemaValidationResult
Brand
BRAND
CleanExtended
ElementValidationResult
ExtendedAny
ExtendedArray
ExtendedBoolean
ExtendedDate
ExtendedFunc
ExtendedNumber
ExtendedObject
ExtendedPromise
ExtendedRecord
ExtendedString
ExtendedTuple
ExtendedUnion
ExtensionConfig
ExtensionDescriptor
ExtraTypeBrandSymbol
FixedMethods
HiddenExtensionMethods
InferType
IntersectionSchemaValidationResult
MakeOptional
MethodLiteralBrandSymbol
NestedValidationResult
NumberOneOfExtension
ObjectSchemaValidationResult
OptionValidationResults
ParseStringTemplateTag
PropertyDescriptor
PropertyDescriptorInner
PropertyDescriptorTree
PropertySetterOptions
RecordSchemaValidationResult
SchemaPropertySelector
SchemaTypeBrand
StringOneOfExtension
TupleElementValidationResults
TupleSchemaValidationResult
UnionSchemaValidationResult
ValidationError
ValidationErrorMessageProvider
ValidationResult

Variables

any
array
arrayExtensions
boolean
date
EXTRA_TYPE_BRAND
func
METHOD_LITERAL_BRAND
number
numberExtensions
object
promise
record
string
stringExtensions
SYMBOL_HAS_PROPERTIES
SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR
tuple
union

Functions

defineExtension
enumOf
extern
generic
intersection
lazy
nul
parseString
withExtensions
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server-openapi.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server-openapi.html new file mode 100644 index 00000000..a056da5e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server-openapi.html @@ -0,0 +1,209 @@ +@cleverbrush/server-openapi | Libraries

Module @cleverbrush/server-openapi

@cleverbrush/server-openapi

+

CI +License: BSD-3-Clause

+

OpenAPI 3.1 specification generation for @cleverbrush/server. Converts endpoint registrations, schema definitions, and authentication configuration into a fully-formed OpenAPI document — no annotations, no decorators. Also generates AsyncAPI 3.0 documents for WebSocket subscription endpoints.

+ +
    +
  • generateOpenApiSpec() — converts @cleverbrush/server endpoint registrations into an OpenAPI 3.1 document.
  • +
  • generateAsyncApiSpec() — converts @cleverbrush/server WebSocket subscription registrations into an AsyncAPI 3.0 document.
  • +
  • serveAsyncApi() — middleware that lazily generates and caches the AsyncAPI spec; serves it at a configurable path (default: /asyncapi.json).
  • +
  • Schema conversion — maps @cleverbrush/schema builders to JSON Schema Draft 2020-12 via @cleverbrush/schema-json.
  • +
  • Path resolution — converts both colon-style paths (:id) and ParseStringSchemaBuilder templates to OpenAPI {param} format with per-parameter schemas.
  • +
  • Security mapping — translates @cleverbrush/auth authentication schemes to OpenAPI securitySchemes; maps per-endpoint authorize() to security arrays. Auto-detects OAuth 2.0 flows (authorizationCodeScheme, clientCredentialsScheme) and OpenID Connect (oidcScheme).
  • +
  • Top-level tags — pass tags: [{ name, description?, externalDocs? }] to OpenApiOptions; tag names are also auto-collected from endpoint registrations.
  • +
  • Request body examples — emit example / examples on Media Type Objects via .example() and .examples() on EndpointBuilder. Schema-level examples propagate automatically.
  • +
  • Binary / file responses.producesFile(contentType?, description?) emits binary content types instead of JSON schemas for file download endpoints.
  • +
  • Multiple content types.produces({ 'text/csv': {}, 'application/xml': { schema } }) emits a multi-entry content map for content-negotiated endpoints; an optional per-type schema override is supported.
  • +
  • Response headers.responseHeaders(schema) documents response headers (X-Total-Count, rate-limit, cache-control, etc.) across every response code; each property becomes a named header entry with schema and description.
  • +
  • External docs.externalDocs(url, description?) attaches an externalDocs object to the OpenAPI Operation Object.
  • +
  • Links.links(defs) declares follow-up links from a response; emitted under the primary 2xx response's links map. Parameters can be raw runtime expression strings or a type-safe callback (response) => Record<string, unknown> where property accesses are resolved to $response.body#/<pointer> expressions automatically.
  • +
  • Callbacks.callbacks(defs) declares async out-of-band callbacks on the Operation Object. The callback URL can be a raw expression string or a type-safe urlFrom callback resolved from the request body schema via property descriptors.
  • +
  • Webhooks — pass webhooks: [defineWebhook('name', options)] to OpenApiOptions (and register via ServerBuilder.webhook(def)) to emit a top-level webhooks map in the OpenAPI document.
  • +
  • serveOpenApi() — middleware that lazily generates and caches the spec; serves it at a configurable path (default: /openapi.json).
  • +
  • createOpenApiEndpoint() — returns a typed endpoint + handler pair for use with ServerBuilder.handle().
  • +
  • CLI / build scriptwriteOpenApiSpec() writes the spec to a file.
  • +
+ +
npm install @cleverbrush/server-openapi @cleverbrush/server @cleverbrush/schema
+
+ + +
import { ServerBuilder, endpoint } from '@cleverbrush/server';
import { serveOpenApi } from '@cleverbrush/server-openapi';
import { object, string, number } from '@cleverbrush/schema';

const GetUser = endpoint
.get('/api/users/:id')
.summary('Get a user by ID')
.tags('users');

const server = new ServerBuilder();

server
.use(serveOpenApi({
server,
info: { title: 'My API', version: '1.0.0' }
}))
.handle(GetUser, ({ params }) => ({ id: params.id }));

await server.listen(3000);
// GET /openapi.json → OpenAPI 3.1 document +
+ +

When server is provided, endpoint registrations, authentication config, and webhooks are derived automatically. You can still pass getRegistrations, authConfig, or webhooks explicitly to override any server-derived value.

+ + +
import { serveOpenApi } from '@cleverbrush/server-openapi';

server.use(serveOpenApi({
server,
info: { title: 'My API', version: '1.0.0' },
servers: [{ url: 'https://api.example.com', description: 'Production' }],
path: '/openapi.json' // default
})); +
+ + +
import { createOpenApiEndpoint } from '@cleverbrush/server-openapi';

const { endpoint: openApiEp, handler } = createOpenApiEndpoint({
server,
info: { title: 'My API', version: '1.0.0' }
});

server.handle(openApiEp, handler); +
+ + +
import { writeOpenApiSpec } from '@cleverbrush/server-openapi';

await writeOpenApiSpec({
registrations: server.getRegistrations(),
info: { title: 'My API', version: '1.0.0' },
outputPath: './openapi.json'
}); +
+ + +

When the same schema definition is used by multiple endpoints, you can mark it with .schemaName() from @cleverbrush/schema so that generateOpenApiSpec() extracts it once into components/schemas and replaces every inline occurrence with a $ref pointer.

+ +
    +
  1. Call .schemaName('ComponentName') on any @cleverbrush/schema builder you want to extract.
  2. +
  3. Export the result as a constant and reuse the same reference wherever the schema is needed.
  4. +
  5. generateOpenApiSpec() detects all named schemas via a pre-pass walk, emits them under components.schemas, and replaces inline definitions with $ref pointers.
  6. +
+
import { object, string, number, array } from '@cleverbrush/schema';
import { endpoint } from '@cleverbrush/server';
import { generateOpenApiSpec } from '@cleverbrush/server-openapi';

// Mark once — reuse everywhere
const UserSchema = object({
id: number(),
name: string(),
}).schemaName('User');

const GetUser = endpoint.get('/api/users/:id').returns(UserSchema);
const ListUsers = endpoint.get('/api/users').returns(array(UserSchema));

const spec = generateOpenApiSpec({
registrations: [GetUser.registration, ListUsers.registration],
info: { title: 'My API', version: '1.0.0' }
});
// components.schemas.User → { type: 'object', properties: { id: …, name: … } }
// GET /api/users/:id → responses.200.content['application/json'].schema: { $ref: '#/components/schemas/User' }
// GET /api/users → responses.200.content['application/json'].schema: { type: 'array', items: { $ref: '…/User' } } +
+ +

Nested named schemas inside request bodies are also resolved:

+
const AddressSchema = object({ street: string(), city: string() }).schemaName('Address');

// The wrapper is anonymous — inlined. The nested AddressSchema → $ref.
const CreateUserBody = object({ address: AddressSchema, name: string() }); +
+ + +

Registering two different schema instances under the same name throws immediately during spec generation:

+
const A = object({ x: string() }).schemaName('Thing');
const B = object({ y: number() }).schemaName('Thing'); // different instance!

generateOpenApiSpec({ registrations: [...], info: { … } });
// Error: Schema name "Thing" is already registered by a different schema instance. +
+ +

Re-registering the same instance (because it appears in multiple endpoints) is a no-op.

+ +

SchemaRegistry and walkSchemas are also exported from @cleverbrush/server-openapi for custom tooling:

+
import { SchemaRegistry, walkSchemas } from '@cleverbrush/server-openapi';

const registry = new SchemaRegistry();
walkSchemas(MySchema, registry);

registry.getName(MySchema); // 'MyComponentName' | null
registry.entries(); // IterableIterator<[name, SchemaBuilder]>
registry.isEmpty; // boolean +
+ + +

When a request body, response, or parameter schema is a discriminated union — all branches are objects sharing a required property with unique literal values — the generated spec automatically includes the OpenAPI discriminator keyword alongside anyOf.

+

If the union branches use .schemaName() and are extracted as $ref components, the discriminator also includes a mapping from each literal value to its $ref path:

+
const Cat = object({ type: string('cat'), name: string() }).schemaName('Cat');
const Dog = object({ type: string('dog'), breed: string() }).schemaName('Dog');
const PetBody = union(Cat).or(Dog);

const CreatePet = endpoint.post('/api/pets').body(PetBody);

// Generated spec:
// requestBody.content['application/json'].schema:
// {
// anyOf: [{ $ref: '#/components/schemas/Cat' }, { $ref: '#/components/schemas/Dog' }],
// discriminator: { propertyName: 'type', mapping: { cat: '#/components/schemas/Cat', dog: '#/components/schemas/Dog' } }
// } +
+ +

Code generators like openapi-generator and orval use the discriminator to produce proper tagged union types.

+ +

Self-referential schemas (tree nodes, nested menus, threaded comments) are +supported via lazy() from @cleverbrush/schema. Call .schemaName() on the +root schema and generateOpenApiSpec will:

+
    +
  1. Register the named schema in components.schemas, expanding its definition +exactly once.
  2. +
  3. Replace every recursive reference inside the definition with the appropriate +$ref pointer — breaking the cycle automatically.
  4. +
+
import { object, number, array, lazy } from '@cleverbrush/schema';

type TreeNode = { value: number; children: TreeNode[] };

// TypeScript needs an explicit annotation for recursive types
const treeNode: ReturnType<typeof object> = object({
value: number(),
children: array(lazy(() => treeNode))
}).schemaName('TreeNode');

// Use treeNode as a body / response schema — no extra configuration needed
const CreateTree = endpoint.post('/api/tree').body(treeNode); +
+ +

Generated spec (abbreviated):

+
components:
schemas:
TreeNode:
type: object
properties:
value: { type: integer }
children:
type: array
items: { $ref: '#/components/schemas/TreeNode' }
paths:
/api/tree:
post:
requestBody:
content:
application/json:
schema: { $ref: '#/components/schemas/TreeNode' } +
+ + +

Pre-fill the Try it out panel in Swagger UI by attaching examples to endpoints.

+ +
const CreateUser = endpoint
.post('/api/users')
.body(UserSchema)
.example({ name: 'Alice', email: 'alice@example.com' }); +
+ +

Emits example on the OpenAPI Media Type Object:

+
requestBody:
content:
application/json:
schema: { ... }
example: { name: Alice, email: alice@example.com } +
+ + +
const CreateUser = endpoint
.post('/api/users')
.body(UserSchema)
.examples({
minimal: { summary: 'Minimal', value: { name: 'Alice' } },
full: {
summary: 'Complete',
description: 'A fully populated user',
value: { name: 'Alice', email: 'alice@example.com', age: 30 }
}
}); +
+ + +

Examples attached directly to schemas via .example() propagate to parameter and response schemas in the generated spec:

+
const PageParam = number().example(1);
const UserResponse = object({ id: number(), name: string() }).example({ id: 1, name: 'Alice' }); +
+ + +

Use .producesFile() to declare that an endpoint returns a binary file instead of JSON. The generated spec emits the appropriate binary content type.

+
const ExportCsv = endpoint
.get('/api/export')
.producesFile('text/csv', 'CSV export');

const Download = endpoint
.get('/api/download')
.producesFile(); // defaults to application/octet-stream +
+ +

Produces:

+
responses:
'200':
description: CSV export
content:
text/csv:
schema: { type: string, format: binary } +
+ +

When both .returns() and .producesFile() are set, the binary response takes precedence.

+ +

When you pass the server option, authentication configuration is picked up automatically from server.getAuthenticationConfig(). Security schemes and per-operation security arrays are generated without any extra configuration:

+
import { jwtScheme } from '@cleverbrush/auth';

const server = new ServerBuilder()
.useAuthentication({
defaultScheme: 'jwt',
schemes: [jwtScheme({ secret: '...', mapClaims: c => c })]
})
.useAuthorization();

server.use(serveOpenApi({
server,
info: { title: 'My API', version: '1.0.0' }
})); +
+ +

You can also pass authConfig explicitly (useful when not using the server option):

+
server.use(serveOpenApi({
getRegistrations: () => server.getRegistrations(),
info: { title: 'My API', version: '1.0.0' },
authConfig: server.getAuthenticationConfig()
})); +
+ +

JWT schemes generate { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' }; cookie schemes generate { type: 'apiKey', in: 'cookie' }.

+ +

OpenAPI supports a top-level tags array where each entry can carry a description and optional externalDocs. Pass a tags array to generateOpenApiSpec() (or any serving helper) to define them:

+
generateOpenApiSpec({
registrations,
info: { title: 'My API', version: '1.0.0' },
tags: [
{
name: 'users',
description: 'User management endpoints',
externalDocs: { url: 'https://docs.example.com/users' }
},
{ name: 'orders', description: 'Order management endpoints' }
]
}); +
+ +

When tags is omitted, unique tag names are automatically collected from all registered endpoints and emitted as name-only entries — so Swagger UI and Redoc still group operations correctly. Any endpoint tag not present in the explicit list is appended alphabetically.

+ +
const info: OpenApiInfo = {
title: 'My API',
version: '2.0.0',
description: 'Full description of my API.',
termsOfService: 'https://example.com/tos',
contact: { name: 'Support', email: 'support@example.com' },
license: { name: 'MIT', url: 'https://opensource.org/licenses/MIT' }
}; +
+ + +

Both path styles are supported:

+
// Colon style — converted to {id}
endpoint.get('/api/users/:id');

// ParseStringSchemaBuilder — type-safe, with schema
import { route } from '@cleverbrush/server';
import { object, number } from '@cleverbrush/schema';

endpoint.get(route(object({ id: number().coerce() }), $t => $t`/api/users/${t => t.id}`));
// produces path "/api/users/{id}" with schema { type: 'number' } +
+ + +

generateAsyncApiSpec() and serveAsyncApi() convert @cleverbrush/server WebSocket subscription registrations into an AsyncAPI 3.0 document — no annotations required.

+ +
import { serveAsyncApi } from '@cleverbrush/server-openapi';

server.use(serveAsyncApi({
server,
info: { title: 'My API', version: '1.0.0' },
// Optional: document the WebSocket servers
servers: {
production: { host: 'api.example.com', protocol: 'wss' },
local: { host: 'localhost:3000', protocol: 'ws' },
},
path: '/asyncapi.json', // default
}));
// GET /asyncapi.json → AsyncAPI 3.0 document (lazily generated, cached) +
+ + +
import { generateAsyncApiSpec } from '@cleverbrush/server-openapi';

const spec = generateAsyncApiSpec({
subscriptions: server.getSubscriptionRegistrations(),
info: { title: 'My API', version: '1.0.0' },
servers: {
production: { host: 'api.example.com', protocol: 'wss' },
},
});

// write to file, validate, upload to AsyncAPI Studio, etc.
await fs.writeFile('asyncapi.json', JSON.stringify(spec, null, 2)); +
+ + +

Each subscription endpoint becomes:

+
    +
  • A channel (keyed by the subscription's operationId or a sanitised form of its path) with an address containing the WebSocket URL path.
  • +
  • A send operation if the endpoint has an outgoing schema (server → client events).
  • +
  • A receive operation if the endpoint has an incoming schema (client → server messages).
  • +
+

Named schemas (registered via .schemaName()) are collected into components.schemas and referenced via $ref pointers in the channel messages.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDefaultDescription
subscriptionsreadonly SubscriptionRegistration[]From server.getSubscriptionRegistrations()
infoAsyncApiInfo{ title, version, description?, ... }
serversRecord<string, AsyncApiServerEntry>{}Named WebSocket server entries
defaultHoststringFallback host when servers is empty
+ +

BSD-3-Clause — see LICENSE.

+

Classes

SchemaRegistry

Interfaces

AsyncApiInfo
AsyncApiOptions
AsyncApiServer_ServerLike
AsyncApiServerEntry
OpenApiEndpointOptions
OpenApiInfo
OpenApiOptions
OpenApiSecurityScheme
OpenApiServer
OpenApiServer_ServerLike
OpenApiTag
PathParameterInfo
ResolvedPath
ServeAsyncApiOptions
ServeOpenApiOptions

Type Aliases

AsyncApiDocument
OpenApiDocument

Functions

convertSchema
createOpenApiEndpoint
generateAsyncApiSpec
generateOpenApiSpec
mapOperationSecurity
mapSecuritySchemes
resolvePath
serveAsyncApi
serveOpenApi
walkSchemas
writeOpenApiSpec
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server..html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server..html new file mode 100644 index 00000000..34a33cd7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server..html @@ -0,0 +1 @@ + | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server.contract.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server.contract.html new file mode 100644 index 00000000..c5118e65 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server.contract.html @@ -0,0 +1,9 @@ +contract | Libraries

Browser-safe entry point for @cleverbrush/server.

+

Re-exports the endpoint builder, factory functions and type helpers +needed to define API contracts without pulling in the Node.js server +runtime. Use this entry point in shared packages that are consumed by +both the backend (Node.js) and the frontend (browser).

+
import { defineApi, endpoint, route } from '@cleverbrush/server/contract';
import { array, number, object, string } from '@cleverbrush/schema';

const TodoSchema = object({ id: number(), title: string() });

export const api = defineApi({
todos: {
list: endpoint.resource('/api/todos').get()
.responses({ 200: array(TodoSchema) }),
get: endpoint.resource('/api/todos').get(
route({ id: number().coerce() })`/${t => t.id}`
).responses({ 200: TodoSchema }),
},
}); +
+ +

Type Aliases

ApiContract
ApiGroup
MergedContracts

Functions

defineApi
mergeContracts
omitGroups
pickGroups

References

ActionContext → ActionContext
AllowedResponseReturn → AllowedResponseReturn
CacheTagDefinition → CacheTagDefinition
CacheTagPropertyAccessor → CacheTagPropertyAccessor
CallbackDefinition → CallbackDefinition
createEndpoints → createEndpoints
endpoint → endpoint
EndpointBuilder → EndpointBuilder
EndpointMetadata → EndpointMetadata
EndpointMetadataDescriptors → EndpointMetadataDescriptors
FilePart → FilePart
Handler → Handler
LinkDefinition → LinkDefinition
PropertyRefTree → PropertyRefTree
ResponsesOf → ResponsesOf
route → route
ScopedEndpointFactory → ScopedEndpointFactory
SubscriptionBuilder → SubscriptionBuilder
SubscriptionContext → SubscriptionContext
SubscriptionHandler → SubscriptionHandler
SubscriptionHandlerEntry → SubscriptionHandlerEntry
SubscriptionMetadata → SubscriptionMetadata
tracked → tracked
TrackedEvent → TrackedEvent
UploadOptions → UploadOptions
diff --git a/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server.html b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server.html new file mode 100644 index 00000000..27dca6e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/modules/_cleverbrush_server.html @@ -0,0 +1,320 @@ +@cleverbrush/server | Libraries

Module @cleverbrush/server

@cleverbrush/server

+

CI +License: BSD-3-Clause

+

A schema-first HTTP server framework for Node.js. Combines @cleverbrush/schema for request validation, @cleverbrush/di for dependency injection, and @cleverbrush/auth for authentication — all wired together through a fluent builder API.

+ +
    +
  • Fluent endpoint builderendpoint.get('/users').body(schema).query(schema).authorize() with fully typed handler context.
  • +
  • Action resultsActionResult.ok(), .created(), .noContent(), .redirect(), .file(), .stream(), .status() — no manual res.write() / res.end().
  • +
  • Content negotiation — pluggable ContentTypeHandler registry; JSON registered by default; honours the Accept request header.
  • +
  • Middleware pipelineserver.use(middleware) for global middleware; per-endpoint middleware via handle(ep, handler, { middlewares }).
  • +
  • DI integrationendpoint.inject({ db: IDbContext }) resolves services per-request from a @cleverbrush/di container.
  • +
  • Authentication & authorizationserver.useAuthentication() / server.useAuthorization() wired to @cleverbrush/auth schemes and policies.
  • +
  • RFC 9457 Problem Details — validation errors and HttpError subclasses are serialized as application/problem+json.
  • +
  • Type-safe routesroute() builds typed path parameters using ParseStringSchemaBuilder segments.
  • +
  • OpenAPI-readygetRegistrations() exposes endpoint metadata for @cleverbrush/server-openapi.
  • +
  • AsyncAPI-readygetSubscriptionRegistrations() exposes subscription metadata for generateAsyncApiSpec() in @cleverbrush/server-openapi.
  • +
  • Health check — optional /health endpoint via server.withHealthcheck().
  • +
  • WebSocket subscriptionsendpoint.subscription('/ws/path') with typed incoming/outgoing schemas, tracked() events, and async generator handlers.
  • +
  • Contract compositionmergeContracts, pickGroups, and omitGroups enable audience-scoped bundles: ship only the endpoints each consumer needs.
  • +
+ +
npm install @cleverbrush/server @cleverbrush/schema
+
+ + +
import { ServerBuilder, endpoint, ActionResult } from '@cleverbrush/server';
import { object, string, number } from '@cleverbrush/schema';

const CreateUserBody = object({ name: string(), age: number() });

const createUser = endpoint
.post('/api/users')
.body(CreateUserBody);

const server = new ServerBuilder();

server.handle(createUser, ({ body }) => {
// body is fully typed: { name: string; age: number }
return ActionResult.created({ id: 1, ...body }, '/api/users/1');
});

await server.listen(3000); +
+ + + +

Use the endpoint singleton to start a builder chain:

+
import { endpoint } from '@cleverbrush/server';

const getUser = endpoint.get('/api/users/:id');
const postUser = endpoint.post('/api/users');
const putUser = endpoint.put('/api/users/:id');
const delUser = endpoint.delete('/api/users/:id'); +
+ + +

Attach schemas for body, query string, and headers. Validation errors automatically produce a 400 Problem Details response.

+
import { object, string, number } from '@cleverbrush/schema';

const ListUsers = endpoint
.get('/api/users')
.query(object({ page: number().coerce().optional(), search: string().optional() }));

const CreateUser = endpoint
.post('/api/users')
.body(object({ name: string(), email: string() })); +
+ + +

Use route() to define path parameters with the full schema type system:

+
import { route } from '@cleverbrush/server';
import { number } from '@cleverbrush/schema';

const GetUser = endpoint.get(
route({ id: number().coerce() })`/api/users/${t => t.id}`
);

server.handle(GetUser, ({ params }) => {
params.id; // number (already coerced from the URL)
}); +
+ + +
import { object, string } from '@cleverbrush/schema';

const UserPrincipal = object({ sub: string(), role: string() });

// Any authenticated user
const ProtectedEp = endpoint.get('/api/profile').authorize(UserPrincipal);

// Specific roles
const AdminEp = endpoint.delete('/api/users/:id').authorize(UserPrincipal, 'admin'); +
+ + +
const CreateUser = endpoint
.post('/api/users')
.body(CreateUserBody)
.returns(UserSchema)
.summary('Create a new user')
.description('Creates a user and returns the full record.')
.tags('users')
.operationId('createUser'); +
+ + +

Tag-based cache invalidation. Tags declared on endpoints flow to the +cacheTags middleware for automatic HTTP caching and +invalidation on mutating requests.

+
const ListTodos = endpoint
.get('/api/todos')
.query(TodoListQuerySchema)
.cacheTag('todo-list', p => ({ page: p.query.page, limit: p.query.limit }))
.returns(array(TodoSchema));

const UpdateTodo = endpoint
.patch('/api/todos/:id')
.body(UpdateTodoBody)
.clearsCacheTag('todo-list') // clears the collection cache
.clearsCacheTag('todo', p => ({ id: p.params.id })) // clears specific entity
.returns(TodoSchema); +
+ +
    +
  • .cacheTag(name) — declares the endpoint's data belongs to a cache +group. Use on GET endpoints.
  • +
  • .clearsCacheTag(name) — declares that this mutation clears matching +cache entries on success. Use on POST / PUT / PATCH / DELETE.
  • +
  • .cacheTag(name, p => ({ ... })) — property-based tag; each selected +property becomes part of the cache key (different pages → different entries).
  • +
  • Immutability — both methods return a new builder; the original is +unchanged.
  • +
+ +
const server = new ServerBuilder();

server.handle(CreateUser, ({ body, context }) => {
return ActionResult.created({ id: 42, ...body }, `/api/users/42`);
});

// Per-endpoint middleware
server.handle(AdminEp, ({ params }) => { /* … */ }, {
middlewares: [loggingMiddleware]
});

await server.listen(3000); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodStatusNotes
ActionResult.ok(body)200Content-negotiated JSON
ActionResult.created(body, location?)201Sets Location header
ActionResult.noContent()204No body
ActionResult.redirect(url, permanent?)302 / 301
ActionResult.json(body, status?)anyForces application/json
ActionResult.file(buffer, fileName)200Attachment download
ActionResult.content(body, contentType)200Arbitrary string body
ActionResult.stream(readable, contentType)200Pipes a Readable
ActionResult.status(status)anyBare status, no body
+ +

Accept file uploads via multipart/form-data by chaining .upload() on an endpoint:

+
import { endpoint } from '@cleverbrush/server';
import { object, string } from '@cleverbrush/schema';

const UploadAvatar = endpoint
.post('/api/avatar')
.upload({ maxFileSize: 2 * 1024 * 1024, allowedMimeTypes: ['image/*'] })
.body(object({ description: string().optional() }))
.authorize(UserPrincipal);

const handler: Handler<typeof UploadAvatar> = async ({ body, files }) => {
const avatar = files['avatar'];
// avatar: FilePart { filename, mimeType, buffer, size }
return ActionResult.created({ name: avatar.filename });
}; +
+ +

The files object on the handler context contains one FilePart entry per uploaded file field. Non-file form fields are validated against the body schema and available via body.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
maxFileSizenumber10 MBMaximum file size per file in bytes
allowedMimeTypesstring[]allMIME type allowlist (supports image/* glob)
maxFileCountnumber10Maximum number of files per request
+ +
interface FilePart {
readonly filename: string;
readonly mimeType: string;
readonly buffer: Buffer;
readonly size: number;
} +
+ + +
import type { Middleware } from '@cleverbrush/server';

const logger: Middleware = async (ctx, next) => {
console.log(ctx.method, ctx.url.pathname);
await next();
};

server.use(logger); +
+ + +
import { ServiceCollection } from '@cleverbrush/di';
import { object, func, string } from '@cleverbrush/schema';

const IUserRepo = object({ findById: func() });

const GetUser = endpoint
.get('/api/users/:id')
.inject({ repo: IUserRepo });

server
.services(svc => svc.addSingleton(IUserRepo, () => new UserRepository()))
.handle(GetUser, ({ params }, { repo }) => {
return repo.findById(params.id);
}); +
+ + +
import { jwtScheme } from '@cleverbrush/auth';

server.useAuthentication({
defaultScheme: 'jwt',
schemes: [
jwtScheme({
secret: process.env.JWT_SECRET!,
mapClaims: claims => ({ sub: claims.sub as string, role: claims.role as string })
})
]
});

server.useAuthorization(); +
+ + +

Throw any HttpError subclass from a handler — it becomes a Problem Details response automatically:

+
import { NotFoundError, BadRequestError, ForbiddenError } from '@cleverbrush/server';

server.handle(GetUser, ({ params }) => {
const user = db.find(params.id);
if (!user) throw new NotFoundError(`User ${params.id} not found`);
return user;
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassStatus
BadRequestError400
UnauthorizedError401
ForbiddenError403
NotFoundError404
ConflictError409
HttpErrorany (base class)
+ +

Define real-time endpoints using endpoint.subscription():

+
import { endpoint, tracked } from '@cleverbrush/server';
import { object, string, number } from '@cleverbrush/schema';

// Server-push subscription
const liveUpdates = endpoint
.subscription('/ws/updates')
.outgoing(object({ action: string(), id: number() }))
.summary('Live updates');

// Bidirectional subscription
const chat = endpoint
.subscription('/ws/chat')
.incoming(object({ text: string() }))
.outgoing(object({ user: string(), text: string(), ts: number() }))
.authorize('user'); +
+ + +

Handlers are async generators that yield outgoing events:

+
import type { SubscriptionHandler } from '@cleverbrush/server';

const handler: SubscriptionHandler<typeof liveUpdates> = async function* () {
while (true) {
await new Promise(r => setTimeout(r, 1000));
yield { action: 'tick', id: Date.now() };
}
};

// Bidirectional — read from `incoming` async iterable
const chatHandler: SubscriptionHandler<typeof chat> = async function* ({ incoming, principal }) {
yield { user: 'system', text: `${principal.name} joined`, ts: Date.now() };
for await (const msg of incoming) {
yield { user: principal.name, text: msg.text, ts: Date.now() };
}
}; +
+ + +

Use tracked(id, data) to send events with a unique ID for client-side deduplication:

+
yield tracked('evt-123', { action: 'created', id: 42 });
+
+ + +
// Direct subscription
const sub = client.live.updates();
for await (const event of sub) {
console.log(event); // typed as { action: string, id: number }
}

// Send messages (bidirectional)
const chat = client.live.chat();
chat.send({ text: 'hello' }); +
+ + +
import { useSubscription } from '@cleverbrush/client/react';

function LiveFeed() {
const { events, state, send, close } = useSubscription(
() => client.live.updates(),
{ maxEvents: 100 }
);

return (
<div>
<p>Status: {state}</p>
{events.map((e, i) => <div key={i}>{e.action} #{e.id}</div>)}
</div>
);
} +
+ + +

Enable the server-side batch endpoint so the client can coalesce many concurrent requests into a single HTTP round-trip.

+
import { createServer } from '@cleverbrush/server';

const server = await createServer()
.useBatching() // enables POST /__batch
.handleAll(mapping)
.listen(3000); +
+ + +

The batch endpoint (POST /__batch by default) accepts a JSON body:

+
{
"requests": [
{ "method": "GET", "url": "/api/todos", "headers": { "authorization": "Bearer ..." } },
{ "method": "POST", "url": "/api/todos", "headers": { "content-type": "application/json", "authorization": "Bearer ..." }, "body": "{\"title\":\"Buy milk\"}" }
]
} +
+ +

Each sub-request is processed through the full middleware and handler pipeline (including auth and DI) in parallel by default. The response is:

+
{
"responses": [
{ "status": 200, "headers": { "content-type": "application/json" }, "body": "[{\"id\":1}]" },
{ "status": 201, "headers": { "content-type": "application/json" }, "body": "{\"id\":2,\"title\":\"Buy milk\"}" }
]
} +
+ +

One sub-request failing returns its error status in its own slot — the rest succeed normally.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
pathstring'/__batch'URL path for the batch endpoint
maxSizenumber20Maximum sub-requests per batch (400 if exceeded)
parallelbooleantrueRun sub-requests in parallel (false for sequential)
+
createServer()
.useBatching({ path: '/_batch', maxSize: 50, parallel: false })
.handleAll(mapping)
.listen(3000); +
+ + +

When building applications with distinct audiences — a public client and an admin panel, for example — you want each consumer to import only the endpoints it needs. This eliminates leaking admin schemas into the client bundle and improves tree-shaking.

+

The @cleverbrush/server/contract entry point ships three utilities for this.

+ +

Combine two ApiContract objects into one. Groups that only exist in one contract are kept as-is; groups that share a key have their endpoint maps shallowly merged.

+
import { defineApi, mergeContracts } from '@cleverbrush/server/contract';

// public-api.ts — safe to import in every consumer
export const publicApi = defineApi({
todos: { list: ..., get: ..., create: ... },
auth: { login: ..., register: ... },
});

// admin-api.ts — only imported by the admin application
const adminApi = defineApi({
admin: { activityLog: ..., banUser: ... },
});

// admin-app/contract.ts
export const fullAdminApi = mergeContracts(publicApi, adminApi);
// TypeScript sees: { todos, auth, admin } — all fully typed

// client-app/contract.ts
import { publicApi } from '../shared/public-api';
// TypeScript sees: { todos, auth } — admin is absent from the bundle +
+ + +

Returns a new contract containing only the listed groups. The TypeScript return type is Pick<T, K> — the compiler sees exactly the selected groups.

+
import { pickGroups } from '@cleverbrush/server/contract';

const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

// Only expose what the frontend needs
const clientApi = pickGroups(fullApi, 'todos', 'auth');
// TypeScript: { todos: ..., auth: ... }
// 'admin' and 'debug' do not exist on the type or at runtime +
+ + +

Inverse of pickGroups — strips the listed groups and keeps everything else. Return type is Omit<T, K>.

+
import { omitGroups } from '@cleverbrush/server/contract';

const publicApi = omitGroups(fullApi, 'admin', 'debug');
// TypeScript: { todos: ..., auth: ... } +
+ + +

The key to keeping admin endpoints out of the client bundle is file-level separation. Export different slices from different entry points:

+
packages/
shared-contracts/
src/
public.ts // export const publicApi = defineApi({ ... })
admin.ts // export const adminApi = defineApi({ ... })
full.ts // export const fullApi = mergeContracts(publicApi, adminApi)

apps/
client/ // imports publicApi — admin endpoints never bundled
admin-panel/ // imports fullApi — full set of endpoints
backend/ // imports fullApi — handles all routes +
+ + +

BSD-3-Clause — see LICENSE.

+

Modules

contract
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthenticationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthenticationResult.html new file mode 100644 index 00000000..b22ee949 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthenticationResult.html @@ -0,0 +1,3 @@ +AuthenticationResult | Libraries

Type Alias AuthenticationResult<T>

AuthenticationResult:
    | { principal: Principal<T>; succeeded: true }
    | { failure?: string; succeeded: false }

The result returned by AuthenticationScheme.authenticate. +On success, provides a typed Principal; on failure, an optional reason.

+

Type Parameters

  • T = unknown
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthorizationRequirement.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthorizationRequirement.html new file mode 100644 index 00000000..e0692a51 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthorizationRequirement.html @@ -0,0 +1,3 @@ +AuthorizationRequirement | Libraries

Type Alias AuthorizationRequirement

AuthorizationRequirement: (
    principal: Principal<any>,
) => boolean | Promise<boolean>

A predicate that a principal must satisfy. +Return true to allow, false to deny.

+

Type Declaration

    • (principal: Principal<any>): boolean | Promise<boolean>
    • Parameters

      Returns boolean | Promise<boolean>

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthorizationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthorizationResult.html new file mode 100644 index 00000000..eace5dcd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_auth.AuthorizationResult.html @@ -0,0 +1,2 @@ +AuthorizationResult | Libraries

Type Alias AuthorizationResult

AuthorizationResult: { allowed: true } | { allowed: false; reason: string }

The result of an authorization check performed by AuthorizationService.authorize.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..ApiContract.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..ApiContract.html new file mode 100644 index 00000000..97000739 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..ApiContract.html @@ -0,0 +1,7 @@ +ApiContract | Libraries

Type Alias ApiContract

ApiContract: Record<string, ApiGroup>

A typed API contract with one level of grouping.

+

Each key is a group name and each value is an ApiGroup — a +record of named endpoints.

+
const contract: ApiContract = {
todos: { list: todosResource.get(), create: todosResource.post() },
auth: { login: endpoint.post('/api/auth/login') },
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointCall.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointCall.html new file mode 100644 index 00000000..746111bc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointCall.html @@ -0,0 +1,8 @@ +EndpointCall | Libraries

Type Alias EndpointCall<E>

EndpointCall: (
    EndpointCallArgs<E> extends undefined
        ? (args?: PerCallOverrides) => Promise<EndpointResponse<E>>
        : (
            args: EndpointCallArgs<E> & PerCallOverrides,
        ) => Promise<EndpointResponse<E>>
) & {
    file: EndpointCallArgs<E> extends undefined
        ? (args?: PerCallOverrides) => Promise<Blob>
        : (args: EndpointCallArgs<E> & PerCallOverrides) => Promise<Blob>;
    stream: EndpointCallArgs<E> extends undefined
        ? (options?: { signal?: AbortSignal }) => AsyncIterable<string>
        : (
            args: EndpointCallArgs<E> & { signal?: AbortSignal },
        ) => AsyncIterable<string>;
}

The callable signature for a single endpoint on the typed client.

+

When the endpoint requires arguments (path params, body, query, or +headers) the function takes a single argument object. When no arguments +are needed the function can be called with no arguments.

+

Every endpoint call also exposes a .stream() method that returns an +AsyncIterable<string> yielding newline-delimited chunks (e.g. NDJSON). +An optional AbortSignal can be passed to cancel an in-flight stream.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointCallArgs.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointCallArgs.html new file mode 100644 index 00000000..2cb7145d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointCallArgs.html @@ -0,0 +1,15 @@ +EndpointCallArgs | Libraries

Type Alias EndpointCallArgs<E>

EndpointCallArgs: E extends EndpointBuilder<
    infer TParams,
    infer TBody,
    infer TQuery,
    infer THeaders,
    any,
    any,
    any,
    any,
    any,
    infer TUpload,
>
    ? HasKeys<
        Simplify<CallArgsParts<TParams, TBody, TQuery, THeaders, TUpload>>,
    > extends true
        ? Simplify<CallArgsParts<TParams, TBody, TQuery, THeaders, TUpload>>
        : undefined
    : never

Extracts the typed request argument shape from an EndpointBuilder.

+

The resulting type includes only the keys that carry data:

+
    +
  • params — path parameters (when the endpoint uses route())
  • +
  • body — request body (when .body() was called)
  • +
  • query — query string parameters (when .query() was called)
  • +
  • headers — request headers (when .headers() was called)
  • +
+

When no keys are required the type collapses to void so the call can +be made without arguments: client.users.me().

+

Type Parameters

  • E

    An EndpointBuilder instance type.

    +
// Endpoint with body:
type Args = EndpointCallArgs<typeof CreateTodoEndpoint>;
// ^? { body: { title: string; description?: string } }

// Endpoint with path params:
type Args = EndpointCallArgs<typeof GetTodoEndpoint>;
// ^? { params: { id: number } }

// Endpoint with no required args:
type Args = EndpointCallArgs<typeof GetProfileEndpoint>;
// ^? void +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointResponse.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointResponse.html new file mode 100644 index 00000000..873a04c7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..EndpointResponse.html @@ -0,0 +1,12 @@ +EndpointResponse | Libraries

Type Alias EndpointResponse<E>

EndpointResponse: E extends EndpointBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    infer TResponse,
    infer TResponses,
>
    ? HasKeys<TResponses> extends true
        ? FirstSuccessResponse<TResponses>
        : TResponse extends SchemaBuilder<any, any, any, any, any>
            ? InferType<TResponse>
            : TResponse
    : never

Extracts the success response type from an EndpointBuilder.

+
    +
  • When .responses() was used, returns the body type of the first +declared 2xx status code (200 → 201 → 202 → 204).
  • +
  • When .returns(schema) was used, returns the inferred schema type.
  • +
  • A null response schema (e.g. for 204) maps to void.
  • +
+

Type Parameters

  • E

    An EndpointBuilder instance type.

    +
type Resp = EndpointResponse<typeof ListTodosEndpoint>;
// ^? TodoResponse[]

type Resp = EndpointResponse<typeof DeleteTodoEndpoint>;
// ^? void +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..FetchLike.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..FetchLike.html new file mode 100644 index 00000000..bca5511c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..FetchLike.html @@ -0,0 +1,4 @@ +FetchLike | Libraries

Type Alias FetchLike

FetchLike: (url: string, init: RequestInit) => Promise<Response>

A function with the same signature as fetch.

+

Middlewares wrap and delegate to a FetchLike function, forming a chain +that terminates at the real fetch call.

+

Type Declaration

    • (url: string, init: RequestInit): Promise<Response>
    • Parameters

      • url: string
      • init: RequestInit

      Returns Promise<Response>

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..Middleware.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..Middleware.html new file mode 100644 index 00000000..eb557a2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..Middleware.html @@ -0,0 +1,6 @@ +Middleware | Libraries

Type Alias Middleware

Middleware: (next: FetchLike) => FetchLike

A middleware is a function that accepts the next handler in the chain +and returns a new handler that wraps it.

+

Type Declaration

const timing: Middleware = (next) => async (url, init) => {
const start = performance.now();
const res = await next(url, init);
console.log(`${url} took ${performance.now() - start}ms`);
return res;
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionCall.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionCall.html new file mode 100644 index 00000000..e757a9a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionCall.html @@ -0,0 +1,6 @@ +SubscriptionCall | Libraries

Type Alias SubscriptionCall<E>

SubscriptionCall: SubscriptionCallArgs<E> extends undefined
    ? (
        args?: {
            reconnect?: SubscriptionReconnectOptions | boolean;
            signal?: AbortSignal;
        },
    ) => Subscription<SubscriptionOutgoing<E>, SubscriptionIncoming<E>>
    : (
        args: SubscriptionCallArgs<E> & {
            reconnect?: SubscriptionReconnectOptions | boolean;
            signal?: AbortSignal;
        },
    ) => Subscription<SubscriptionOutgoing<E>, SubscriptionIncoming<E>>

The callable signature for a subscription endpoint on the typed client.

+

Returns a Subscription handle that is both an AsyncIterable +and has send() / close() methods.

+

Pass reconnect: false to disable automatic reconnection for this call +even when a global subscriptionReconnect is configured.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionCallArgs.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionCallArgs.html new file mode 100644 index 00000000..2bb23063 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionCallArgs.html @@ -0,0 +1,2 @@ +SubscriptionCallArgs | Libraries

Type Alias SubscriptionCallArgs<E>

SubscriptionCallArgs: E extends SubscriptionBuilder<
    infer TParams,
    infer TQuery,
    infer THeaders,
    any,
    any,
    any,
    any,
    any,
>
    ? HasKeys<Simplify<SubscriptionArgsParts<TParams, TQuery, THeaders>>> extends true
        ? Simplify<SubscriptionArgsParts<TParams, TQuery, THeaders>>
        : undefined
    : never

Extracts the subscribe call argument shape from a SubscriptionBuilder.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionIncoming.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionIncoming.html new file mode 100644 index 00000000..cfed5955 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionIncoming.html @@ -0,0 +1,2 @@ +SubscriptionIncoming | Libraries

Type Alias SubscriptionIncoming<E>

SubscriptionIncoming: E extends SubscriptionBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    infer TIncoming,
    any,
>
    ? TIncoming extends SchemaBuilder<any, any, any, any, any>
        ? InferType<TIncoming>
        : TIncoming
    : never

Extracts the incoming (client→server) message type from a SubscriptionBuilder.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionOutgoing.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionOutgoing.html new file mode 100644 index 00000000..43ea9180 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..SubscriptionOutgoing.html @@ -0,0 +1,2 @@ +SubscriptionOutgoing | Libraries

Type Alias SubscriptionOutgoing<E>

SubscriptionOutgoing: E extends SubscriptionBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    infer TOutgoing,
>
    ? TOutgoing extends SchemaBuilder<any, any, any, any, any>
        ? InferType<TOutgoing>
        : TOutgoing
    : unknown

Extracts the outgoing (server→client) event type from a SubscriptionBuilder.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..TypedClient.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..TypedClient.html new file mode 100644 index 00000000..0be33fcd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client..TypedClient.html @@ -0,0 +1,8 @@ +TypedClient | Libraries

Type Alias TypedClient<T>

TypedClient: {
    [G in keyof T]: { [E in keyof T[G]]: ContractMemberCall<T[G][E]> }
}

Maps an ApiContract to a fully typed client object.

+

Each group becomes a namespace and each endpoint within that group +becomes a callable async function (HTTP) or subscription factory (WS).

+

Type Parameters

  • T extends ApiContract

    The exact API contract type (preserving endpoint builder generics).

    +
// Given:
const api = defineApi({
todos: { list: ..., create: ..., delete: ... },
auth: { login: ... },
});

type Client = TypedClient<typeof api>;
// {
// todos: {
// list: (args: { query: ... }) => Promise<TodoResponse[]>,
// create: (args: { body: ... }) => Promise<TodoResponse>,
// delete: (args: { params: ... }) => Promise<void>,
// },
// auth: {
// login: (args: { body: ... }) => Promise<{ token: string }>,
// },
// } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.EndpointQueryHooks.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.EndpointQueryHooks.html new file mode 100644 index 00000000..3e82d7b5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.EndpointQueryHooks.html @@ -0,0 +1,7 @@ +EndpointQueryHooks | Libraries

Type Alias EndpointQueryHooks<TArgs, TData>

EndpointQueryHooks: TArgs extends undefined
    ? {
        prefetch(queryClient: QueryClient): Promise<void>;
        queryKey(): readonly unknown[];
        useMutation(
            options?: MutationHookOptions<TData, void>,
        ): UseMutationResult<TData, WebError, void>;
        useQuery(
            options?: QueryHookOptions<TData>,
        ): UseQueryResult<TData, WebError>;
        useSuspenseQuery(
            options?: SuspenseQueryHookOptions<TData>,
        ): UseSuspenseQueryResult<TData, WebError>;
    }
    : {
        prefetch(queryClient: QueryClient, args: TArgs): Promise<void>;
        queryKey(args?: TArgs): readonly unknown[];
        useInfiniteQuery<TPageParam = unknown>(
            getArgs: (pageParam: TPageParam) => TArgs,
            options: InfiniteQueryHookOptions<TData, TPageParam>,
        ): UseInfiniteQueryResult<InfiniteData<TData, TPageParam>, WebError>;
        useMutation(
            options?: MutationHookOptions<TData, TArgs>,
        ): UseMutationResult<TData, WebError, TArgs>;
        useQuery(
            args?: TArgs,
            options?: QueryHookOptions<TData>,
        ): UseQueryResult<TData, WebError>;
        useSuspenseQuery(
            args?: TArgs,
            options?: SuspenseQueryHookOptions<TData>,
        ): UseSuspenseQueryResult<TData, WebError>;
    }

The set of TanStack Query hooks and helpers exposed for each endpoint +on the typed query client.

+

When TArgs is undefined (endpoint requires no arguments), the hooks +can be called without an arguments parameter.

+

Type Parameters

  • TArgs

    The endpoint's call arguments type (EndpointCallArgs<E>).

    +
  • TData

    The endpoint's success response type (EndpointResponse<E>).

    +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.InfiniteQueryHookOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.InfiniteQueryHookOptions.html new file mode 100644 index 00000000..37478868 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.InfiniteQueryHookOptions.html @@ -0,0 +1,6 @@ +InfiniteQueryHookOptions | Libraries

Type Alias InfiniteQueryHookOptions<TData, TPageParam>

InfiniteQueryHookOptions: Omit<
    UseInfiniteQueryOptions<
        TData,
        WebError,
        InfiniteData<TData, TPageParam>,
        QueryKey,
        TPageParam,
    >,
    "queryKey" | "queryFn",
>

Options for useInfiniteQuery hooks. You must provide +initialPageParam and getNextPageParam as required by TanStack Query. +queryKey and queryFn are managed automatically.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
  • TPageParam

    The page parameter type (e.g. number).

    +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.MutationHookOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.MutationHookOptions.html new file mode 100644 index 00000000..5ff6f449 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.MutationHookOptions.html @@ -0,0 +1,4 @@ +MutationHookOptions | Libraries

Type Alias MutationHookOptions<TData, TArgs>

MutationHookOptions: Omit<
    UseMutationOptions<TData, WebError, TArgs>,
    "mutationFn",
>

Options for useMutation hooks, with mutationFn managed automatically.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
  • TArgs

    The endpoint's call arguments type.

    +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.QueryHookOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.QueryHookOptions.html new file mode 100644 index 00000000..47f2e536 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.QueryHookOptions.html @@ -0,0 +1,4 @@ +QueryHookOptions | Libraries

Type Alias QueryHookOptions<TData>

QueryHookOptions: Omit<
    UseQueryOptions<TData, WebError, TData, QueryKey>,
    "queryKey" | "queryFn",
>

Options for useQuery hooks, with queryKey and queryFn managed +automatically by the library.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.SuspenseQueryHookOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.SuspenseQueryHookOptions.html new file mode 100644 index 00000000..35b8b77a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.SuspenseQueryHookOptions.html @@ -0,0 +1,4 @@ +SuspenseQueryHookOptions | Libraries

Type Alias SuspenseQueryHookOptions<TData>

SuspenseQueryHookOptions: Omit<
    UseSuspenseQueryOptions<TData, WebError, TData, QueryKey>,
    "queryKey" | "queryFn",
>

Options for useSuspenseQuery hooks, with queryKey and queryFn +managed automatically.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.TypedQueryClient.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.TypedQueryClient.html new file mode 100644 index 00000000..60e892bb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.TypedQueryClient.html @@ -0,0 +1,8 @@ +TypedQueryClient | Libraries

Type Alias TypedQueryClient<T>

TypedQueryClient: { [G in keyof T]: TypedQueryGroup<T[G]> }

Maps an API contract to a fully typed query client.

+

Each group becomes a namespace containing endpoint hooks, plus a +group-level queryKey() method for bulk invalidation.

+

Type Parameters

  • T extends ApiContract

    The exact API contract type from defineApi().

    +
const queryApi = createQueryClient(api, { baseUrl: '/api' });

// In a component:
const { data } = queryApi.todos.list.useQuery({ query: { page: 1 } });
const mutation = queryApi.todos.create.useMutation({
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: queryApi.todos.queryKey()
});
}
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.TypedQueryGroup.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.TypedQueryGroup.html new file mode 100644 index 00000000..3ac213a5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.TypedQueryGroup.html @@ -0,0 +1,11 @@ +TypedQueryGroup | Libraries

Type Alias TypedQueryGroup<TGroup>

TypedQueryGroup: {
    [E in keyof TGroup]: EndpointQueryHooks<
        EndpointCallArgs<TGroup[E]>,
        EndpointResponse<TGroup[E]>,
    >
} & { queryKey(): readonly unknown[] }

A single API group on the typed query client.

+

Each endpoint in the group is mapped to its EndpointQueryHooks. +The group also exposes a queryKey() method for group-level +cache invalidation.

+

Type Parameters

  • TGroup extends Record<string, any>

Type Declaration

  • queryKey: function
    • Returns a query key prefix for this entire group. +Use with queryClient.invalidateQueries() to invalidate all +queries in the group at once.

      +

      Returns readonly unknown[]

      queryClient.invalidateQueries({
      queryKey: queryApi.todos.queryKey()
      }); +
      + +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedClient.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedClient.html new file mode 100644 index 00000000..530b0ea9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedClient.html @@ -0,0 +1,8 @@ +UnifiedClient | Libraries

Type Alias UnifiedClient<T>

UnifiedClient: { [G in keyof T]: UnifiedGroup<T[G]> }

Maps an API contract to a unified client where every endpoint is both +a callable function (direct HTTP fetch) and an object with TanStack +Query hooks.

+

Type Parameters

  • T extends ApiContract

    The exact API contract type from defineApi().

    +
const client = createClient(api, { baseUrl: '/api' });

// Direct fetch
const todos = await client.todos.list();

// React hooks
const { data } = client.todos.list.useQuery(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedEndpointCall.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedEndpointCall.html new file mode 100644 index 00000000..31a2033e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedEndpointCall.html @@ -0,0 +1,9 @@ +UnifiedEndpointCall | Libraries

Type Alias UnifiedEndpointCall<E>

UnifiedEndpointCall: EndpointCall<E> & EndpointQueryHooks<
    EndpointCallArgs<E>,
    EndpointResponse<E>,
>

A single endpoint on the unified client.

+

The endpoint is callable (direct HTTP fetch, same as @cleverbrush/web) +and also exposes TanStack Query hooks (useQuery, useMutation, etc.) +as properties on the same object.

+

Type Parameters

  • E

    An EndpointBuilder instance type.

    +
// Direct fetch
const todos = await client.todos.list();

// React Query hooks
const { data } = client.todos.list.useQuery();
const mutation = client.todos.create.useMutation();

// Streaming
for await (const line of client.todos.export.stream()) { ... } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedGroup.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedGroup.html new file mode 100644 index 00000000..4f7c9d7f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_client.react.UnifiedGroup.html @@ -0,0 +1,5 @@ +UnifiedGroup | Libraries

Type Alias UnifiedGroup<TGroup>

UnifiedGroup: { [E in keyof TGroup]: UnifiedMemberCall<TGroup[E]> } & {
    queryKey(): readonly unknown[];
}

A group on the unified client.

+

Each endpoint is a UnifiedEndpointCall — callable with hooks. +The group also exposes a queryKey() method for bulk cache invalidation.

+

Type Parameters

  • TGroup extends Record<string, any>

Type Declaration

  • queryKey: function
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_deep.Merge.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_deep.Merge.html new file mode 100644 index 00000000..16562b4e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_deep.Merge.html @@ -0,0 +1,2 @@ +Merge | Libraries

Type Alias Merge<T>

Merge: T["length"] extends 3
    ? MergeTwo<T[0], MergeTwo<T[1], T[2]>>
    : T["length"] extends 2
        ? MergeTwo<T[0], T[1]>
        : T["length"] extends 1
            ? T[0]
            : T extends [...(infer K), infer PL, infer L]
                ? Merge<[Merge<[...K]>, MergeTwo<PL, L>]>
                : never

Recursively merges a tuple of object types from left to right.

+

Type Parameters

  • T extends unknown[]
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_deep.MergeTwo.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_deep.MergeTwo.html new file mode 100644 index 00000000..46894083 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_deep.MergeTwo.html @@ -0,0 +1,2 @@ +MergeTwo | Libraries

Type Alias MergeTwo<T1, T2>

MergeTwo: PropsInFirstOnly<T1, T2> & PropsInFirstOnly<T2, T1> & {
    [k in keyof CommonProps<T1, T2>]: T1[k] extends Record<string, unknown>
        ? T2[k] extends Record<string, unknown>
            ? MergeTwo<T1[k], T2[k]>
            : T2[k]
        : T2[k]
}

Recursively merges two object types. Matching keys are merged; unique keys are kept.

+

Type Parameters

  • T1
  • T2
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_di.ServiceFactory.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_di.ServiceFactory.html new file mode 100644 index 00000000..7c77dd2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_di.ServiceFactory.html @@ -0,0 +1,8 @@ +ServiceFactory | Libraries

Type Alias ServiceFactory<T>

ServiceFactory: (provider: IServiceProvider) => T

A factory function that creates a service instance, optionally resolving +other services from the provided ServiceProvider.

+

Type Parameters

  • T

    The type of the service instance the factory creates.

    +

Type Declaration

const loggerFactory: ServiceFactory<Logger> = (provider) => {
const config = provider.get(IConfig);
return new Logger(config.logLevel);
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvConfig.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvConfig.html new file mode 100644 index 00000000..0a4a06c7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvConfig.html @@ -0,0 +1,2 @@ +EnvConfig | Libraries

Type Alias EnvConfig

EnvConfig: Record<string, EnvConfigNode>

Top-level config descriptor: a record of EnvConfigNodes.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvConfigNode.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvConfigNode.html new file mode 100644 index 00000000..fd397541 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvConfigNode.html @@ -0,0 +1,8 @@ +EnvConfigNode | Libraries

Type Alias EnvConfigNode

EnvConfigNode: EnvField<any> | { readonly [key: string]: EnvConfigNode }

A node in the config descriptor tree.

+
    +
  • Leaf: an EnvField (created via env())
  • +
  • Branch: a plain object whose values are themselves EnvConfigNodes
  • +
+

Schema builders without env() wrapping intentionally fail to satisfy +this type, producing a compile-time error.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvField.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvField.html new file mode 100644 index 00000000..59cf135f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.EnvField.html @@ -0,0 +1,6 @@ +EnvField | Libraries

Type Alias EnvField<T>

A branded wrapper around a schema builder that associates it with an +environment variable name. Created exclusively by the env function.

+
type EnvField<T extends SchemaBuilder<any, any, any, any, any>> = {
    "[ENV_FIELD_BRAND]": true;
    schema: T;
    varName: string;
}

Type Parameters

  • T extends SchemaBuilder<any, any, any, any, any>
Index

Properties

"[ENV_FIELD_BRAND]": true
schema: T
varName: string
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.InferEnvConfig.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.InferEnvConfig.html new file mode 100644 index 00000000..c26c8606 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_env.InferEnvConfig.html @@ -0,0 +1,6 @@ +InferEnvConfig | Libraries

Type Alias InferEnvConfig<T>

InferEnvConfig: {
    [K in keyof T]: T[K] extends EnvField<infer S>
        ? InferType<S>
        : T[K] extends Record<string, any> ? InferEnvConfig<T[K]> : never
}

Recursively infers the runtime type from an EnvConfig descriptor tree.

+
    +
  • EnvField<S> leaves resolve to InferType<S>
  • +
  • Object branches resolve to { [K]: InferEnvConfig<V> }
  • +
+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..ColumnRef.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..ColumnRef.html new file mode 100644 index 00000000..5fadebca --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..ColumnRef.html @@ -0,0 +1 @@ +ColumnRef | Libraries

Type Alias ColumnRef<T>

ColumnRef:
    | SchemaKeys<T>
    | (
        (
            tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
        ) => PropertyDescriptor<SchemaBase<T>, any, any>
    )

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityPropSelector.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityPropSelector.html new file mode 100644 index 00000000..a1c05e56 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityPropSelector.html @@ -0,0 +1,6 @@ +EntityPropSelector | Libraries

Type Alias EntityPropSelector<TSchema, TKey>

EntityPropSelector: (
    t: EntityTree<TSchema>,
) => { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

Selector callback that receives a real PropertyDescriptorTree so +t => t.someProp navigates to the property definition and preserves its +JSDoc in IDE tooltips. The return shape is matched structurally on the +[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR].propertyName field, which captures +the literal property key as TKey.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TKey extends string = string

Type Declaration

    • (
          t: EntityTree<TSchema>,
      ): { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }
    • Parameters

      Returns { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityRelationKeys.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityRelationKeys.html new file mode 100644 index 00000000..6f4bef92 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityRelationKeys.html @@ -0,0 +1,4 @@ +EntityRelationKeys | Libraries

Type Alias EntityRelationKeys<E>

EntityRelationKeys: E extends Entity<any, infer R, any>
    ? keyof R & string
    : never

Type-level helper: union of relation key names declared on an entity. +Used by SchemaQueryBuilder.insert()/update()/upsert() to omit relation +navigation properties from accepted input.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityRelations.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityRelations.html new file mode 100644 index 00000000..12dfa1b5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityRelations.html @@ -0,0 +1,2 @@ +EntityRelations | Libraries

Type Alias EntityRelations<E>

EntityRelations: E extends Entity<any, infer R, any> ? R : never

Type-level helper: extract TRels from any Entity type.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntitySchema.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntitySchema.html new file mode 100644 index 00000000..89988a3b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntitySchema.html @@ -0,0 +1,2 @@ +EntitySchema | Libraries

Type Alias EntitySchema<E>

EntitySchema: E extends Entity<infer S, any, any> ? S : never

Type-level helper: extract the underlying schema type from any Entity.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityVariantUnion.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityVariantUnion.html new file mode 100644 index 00000000..bf65bdf6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..EntityVariantUnion.html @@ -0,0 +1,3 @@ +EntityVariantUnion | Libraries

Type Alias EntityVariantUnion<E>

EntityVariantUnion: E extends Entity<any, any, infer U> ? U : never

Type-level helper: extract the accumulated variant union from any Entity. +Resolves to never for non-polymorphic entities.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..InsertType.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..InsertType.html new file mode 100644 index 00000000..d8d389bc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..InsertType.html @@ -0,0 +1 @@ +InsertType | Libraries

Type Alias InsertType<T>

InsertType: InferType<ReturnType<T["makeAllPropsOptional"]>>

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..PrimaryKeyOf.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..PrimaryKeyOf.html new file mode 100644 index 00000000..1fcc7d9d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..PrimaryKeyOf.html @@ -0,0 +1,13 @@ +PrimaryKeyOf | Libraries

Type Alias PrimaryKeyOf<S>

PrimaryKeyOf: S extends { "[COMPOSITE_PRIMARY_KEY_BRAND]"?: infer TCols }
    ? TCols extends readonly string[] ? TCols : never
    : {
        [K in keyof SchemaPropsForPk<S> & string]: IsPkBranded<
            SchemaPropsForPk<S>[K],
        > extends true
            ? K
            : never
    }[keyof SchemaPropsForPk<S> & string]

Extract the primary-key column descriptor for a schema.

+

Returns:

+
    +
  • the literal property-key string for a single-column primary key +(e.g. 'id'),
  • +
  • a tuple of property-key strings for a composite primary key +(e.g. ['userId', 'roleId']),
  • +
  • or never if no primary key is declared.
  • +
+

Composite primary keys are detected via the COMPOSITE_PRIMARY_KEY_BRAND +placed on the object schema by .hasPrimaryKey([...] as const). Use +as const on the column tuple to preserve ordering at the type level.

+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..PrimaryKeyValueOf.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..PrimaryKeyValueOf.html new file mode 100644 index 00000000..6d9318b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..PrimaryKeyValueOf.html @@ -0,0 +1,9 @@ +PrimaryKeyValueOf | Libraries

Type Alias PrimaryKeyValueOf<S>

PrimaryKeyValueOf: PrimaryKeyOf<S> extends readonly (infer _Item extends string)[]
    ? PrimaryKeyOf<S> extends readonly string[]
        ? PkTupleValue<S, PrimaryKeyOf<S>>
        : never
    : PrimaryKeyOf<S> extends string
        ? InferType<S>[PrimaryKeyOf<S> & keyof InferType<S>]
        : never

The runtime value type of a schema's primary key.

+
    +
  • For a single-column PK, the inferred type of that property +(e.g. number).
  • +
  • For a composite PK, a tuple of inferred property types in declared +order (e.g. [number, number]).
  • +
  • never if no primary key is declared.
  • +
+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..RowVersionStrategy.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..RowVersionStrategy.html new file mode 100644 index 00000000..5f553eda --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..RowVersionStrategy.html @@ -0,0 +1,7 @@ +RowVersionStrategy | Libraries

Type Alias RowVersionStrategy

RowVersionStrategy: "increment" | "timestamp" | "manual"

Concurrency-token strategy stored by .rowVersion().

+
    +
  • 'increment' — ORM increments an integer counter on each UPDATE.
  • +
  • 'timestamp' — ORM sets the value to new Date() on each UPDATE.
  • +
  • 'manual' — caller supplies the new value; ORM only enforces the check.
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SchemaKeys.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SchemaKeys.html new file mode 100644 index 00000000..51583f02 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SchemaKeys.html @@ -0,0 +1 @@ +SchemaKeys | Libraries

Type Alias SchemaKeys<T>

SchemaKeys: keyof InferType<T> & string

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SchemaProps.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SchemaProps.html new file mode 100644 index 00000000..b04e67d7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SchemaProps.html @@ -0,0 +1,3 @@ +SchemaProps | Libraries

Type Alias SchemaProps<T>

SchemaProps: T extends ObjectSchemaBuilder<
    infer P,
    any,
    any,
    any,
    any,
    any,
    any,
>
    ? P
    : never

Extract the property record { [name]: SchemaBuilder } from any +ObjectSchemaBuilder regardless of variance positions.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SelectProjection.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SelectProjection.html new file mode 100644 index 00000000..74d0b7b8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SelectProjection.html @@ -0,0 +1,5 @@ +SelectProjection | Libraries

Type Alias SelectProjection<R>

SelectProjection: { [K in keyof R]: InferType<DescriptorPropertySchema<R[K]>> }

Result row type produced by a SelectProjection selector.

+

Each entry's value is the InferType of the property schema the +descriptor points at, so .select(t => ({ id: t.id, n: t.title })) +yields { id: number; n: string }.

+

Type Parameters

  • R extends Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SelectSelector.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SelectSelector.html new file mode 100644 index 00000000..c11205ea --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..SelectSelector.html @@ -0,0 +1,4 @@ +SelectSelector | Libraries

Type Alias SelectSelector<T>

SelectSelector: (
    tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
) => Record<string, PropertyDescriptor<any, any, any>>

Callback shape accepted by the projection overload of select. The +callback receives the schema's property-descriptor tree and returns an +{ alias: descriptor } record.

+

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

Type Declaration

    • (
          tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
      ): Record<string, PropertyDescriptor<any, any, any>>
    • Parameters

      • tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>

      Returns Record<string, PropertyDescriptor<any, any, any>>

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..UnwrapNavSchema.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..UnwrapNavSchema.html new file mode 100644 index 00000000..f73e7f6a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..UnwrapNavSchema.html @@ -0,0 +1,3 @@ +UnwrapNavSchema | Libraries

Type Alias UnwrapNavSchema<TProp>

UnwrapNavSchema: TProp extends ArraySchemaBuilder<infer TEl, any, any, any>
    ? TEl extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TEl
        : never
    : TProp extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TProp
        : TProp extends SchemaBuilder<infer T, any, any, any, any>
            ? T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
                ? T
                : never
            : never

Peel .optional() / array(...) wrappers off a navigation property's +schema to recover the underlying foreign ObjectSchemaBuilder.

+

Type Parameters

  • TProp
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..ValidatedSpec.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..ValidatedSpec.html new file mode 100644 index 00000000..545fa291 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..ValidatedSpec.html @@ -0,0 +1 @@ +ValidatedSpec | Libraries
ValidatedSpec:
    | { type: "one" } & ValidatedJoinOneSpec
    | { type: "many" } & ValidatedJoinManySpec
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..VariantBranch.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..VariantBranch.html new file mode 100644 index 00000000..e35a8292 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..VariantBranch.html @@ -0,0 +1,4 @@ +VariantBranch | Libraries

Type Alias VariantBranch<TBaseSchema, TVarSchema>

VariantBranch: Omit<InferType<TBaseSchema>, keyof InferType<TVarSchema>> & InferType<
    TVarSchema,
>

Merge type for a single polymorphic variant branch: variant schema fields +overlay base schema fields (narrowing the discriminator from string to its +specific literal value).

+

Type Parameters

  • TBaseSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVarSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..VariantStorageType.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..VariantStorageType.html new file mode 100644 index 00000000..ea42e689 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..VariantStorageType.html @@ -0,0 +1,2 @@ +VariantStorageType | Libraries

Type Alias VariantStorageType

VariantStorageType: "cti" | "sti"

Storage strategy for a polymorphic variant.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithJoinedMany.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithJoinedMany.html new file mode 100644 index 00000000..84d6aef2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithJoinedMany.html @@ -0,0 +1,2 @@ +WithJoinedMany | Libraries

Type Alias WithJoinedMany<TBase, TFieldName, TForeignSchema>

WithJoinedMany: TBase & { [K in TFieldName]: InferType<TForeignSchema>[] }

Adds a joined collection field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithJoinedOne.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithJoinedOne.html new file mode 100644 index 00000000..6f3cbd58 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithJoinedOne.html @@ -0,0 +1,2 @@ +WithJoinedOne | Libraries

Type Alias WithJoinedOne<TBase, TFieldName, TForeignSchema, TRequired>

WithJoinedOne: TBase & {
    [K in TFieldName]: TRequired extends true
        ? InferType<TForeignSchema>
        : InferType<TForeignSchema> | null
}

Adds a single joined object field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRequired extends boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithRelation.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithRelation.html new file mode 100644 index 00000000..beca572f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_knex-schema..WithRelation.html @@ -0,0 +1,3 @@ +WithRelation | Libraries

Type Alias WithRelation<TSchema, TRels, TKey, TKind, TForeign, TVariantUnion>

WithRelation: Entity<
    TSchema,
    TRels & Record<TKey, RelationInfo<TKind, TForeign>>,
    TVariantUnion,
>

Return type for an Entity method that adds a relation: keeps TSchema, +extends TRels with one more entry, and preserves TVariantUnion.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRels extends Record<string, RelationInfo>
  • TKey extends string
  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVariantUnion = never
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..Enricher.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..Enricher.html new file mode 100644 index 00000000..a96dccaf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..Enricher.html @@ -0,0 +1,4 @@ +Enricher | Libraries

Type Alias Enricher

Enricher: (event: LogEvent) => LogEvent

An enricher adds or transforms properties on a log event.

+

Enrichers are pure functions that return a new event with additional +properties — they must not mutate the input event.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogFilter.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogFilter.html new file mode 100644 index 00000000..ec994347 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogFilter.html @@ -0,0 +1,3 @@ +LogFilter | Libraries

Type Alias LogFilter

LogFilter: (event: LogEvent) => boolean

A filter that determines whether a log event should be emitted.

+

Return true to keep the event, false to discard it.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogLevel.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogLevel.html new file mode 100644 index 00000000..f3b2b25d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogLevel.html @@ -0,0 +1,7 @@ +LogLevel | Libraries

Type Alias LogLevel

LogLevel: typeof LogLevel[keyof typeof LogLevel]

Log severity levels as a const object.

+

Use as values (LogLevel.Information) or as a type (LogLevel). +Levels are ordered numerically — higher values indicate greater severity.

+
if (logger.isEnabled(LogLevel.Debug)) {
logger.debug('Expensive computation: {@Result}', { Result: compute() });
} +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogLevelName.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogLevelName.html new file mode 100644 index 00000000..434427ab --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..LogLevelName.html @@ -0,0 +1,2 @@ +LogLevelName | Libraries

Type Alias LogLevelName

LogLevelName: "trace" | "debug" | "information" | "warning" | "error" | "fatal"

Log level name strings for configuration and display.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..SamplingRates.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..SamplingRates.html new file mode 100644 index 00000000..b53b5b66 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_log..SamplingRates.html @@ -0,0 +1,3 @@ +SamplingRates | Libraries

Type Alias SamplingRates

SamplingRates: Partial<Record<LogLevelName, number>>

Sampling rates per log level. Values are 0–1 where 1 = keep all, 0 = drop all. +Unspecified levels pass through unfiltered.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_mapper.SchemaToSchemaMapperResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_mapper.SchemaToSchemaMapperResult.html new file mode 100644 index 00000000..63a90c60 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_mapper.SchemaToSchemaMapperResult.html @@ -0,0 +1 @@ +SchemaToSchemaMapperResult | Libraries

Type Alias SchemaToSchemaMapperResult<TFromSchema, TToSchema>

SchemaToSchemaMapperResult: (
    from: InferType<TFromSchema>,
) => Promise<InferType<TToSchema>>

Type Parameters

  • TFromSchema extends ObjectSchemaBuilder<any, any, any>
  • TToSchema extends ObjectSchemaBuilder<any, any, any>

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ColumnRef.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ColumnRef.html new file mode 100644 index 00000000..40aa395d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ColumnRef.html @@ -0,0 +1 @@ +ColumnRef | Libraries

Type Alias ColumnRef<T>

ColumnRef:
    | SchemaKeys<T>
    | (
        (
            tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
        ) => PropertyDescriptor<SchemaBase<T>, any, any>
    )

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.DbContext.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.DbContext.html new file mode 100644 index 00000000..ddbc2f63 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.DbContext.html @@ -0,0 +1,8 @@ +DbContext | Libraries

Type Alias DbContext<TMap>

DbContext: { readonly [K in keyof TMap]: DbSet<TMap[K]> } & {
    knex: Knex;
    transaction<T>(callback: (db: DbContext<TMap>) => Promise<T>): Promise<T>;
    withTransaction(trx: Transaction): DbContext<TMap>;
}

The shape of the context object returned by createDb: every +registered entity becomes a typed DbSet property.

+

Type Parameters

Type Declaration

  • Readonlyknex: Knex

    The underlying Knex instance the context was constructed with.

    +
  • transaction: function
    • Run callback inside a Knex transaction. The callback receives a new +DbContext whose DbSets are bound to the transaction.

      +

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

  • withTransaction: function
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityMap.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityMap.html new file mode 100644 index 00000000..6286401d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityMap.html @@ -0,0 +1,2 @@ +EntityMap | Libraries

Type Alias EntityMap

EntityMap: Record<string, Entity<any, any, any>>

The map of entity name → entity definition passed to createDb.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityPropSelector.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityPropSelector.html new file mode 100644 index 00000000..885a9854 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityPropSelector.html @@ -0,0 +1,6 @@ +EntityPropSelector | Libraries

Type Alias EntityPropSelector<TSchema, TKey>

EntityPropSelector: (
    t: EntityTree<TSchema>,
) => { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

Selector callback that receives a real PropertyDescriptorTree so +t => t.someProp navigates to the property definition and preserves its +JSDoc in IDE tooltips. The return shape is matched structurally on the +[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR].propertyName field, which captures +the literal property key as TKey.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TKey extends string = string

Type Declaration

    • (
          t: EntityTree<TSchema>,
      ): { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }
    • Parameters

      Returns { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityRelationKeys.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityRelationKeys.html new file mode 100644 index 00000000..0f8986e9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityRelationKeys.html @@ -0,0 +1,4 @@ +EntityRelationKeys | Libraries

Type Alias EntityRelationKeys<E>

EntityRelationKeys: E extends Entity<any, infer R, any>
    ? keyof R & string
    : never

Type-level helper: union of relation key names declared on an entity. +Used by SchemaQueryBuilder.insert()/update()/upsert() to omit relation +navigation properties from accepted input.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityRelations.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityRelations.html new file mode 100644 index 00000000..8aaaf161 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityRelations.html @@ -0,0 +1,2 @@ +EntityRelations | Libraries

Type Alias EntityRelations<E>

EntityRelations: E extends Entity<any, infer R, any> ? R : never

Type-level helper: extract TRels from any Entity type.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityResult.html new file mode 100644 index 00000000..ac0b6a67 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityResult.html @@ -0,0 +1,8 @@ +EntityResult | Libraries

Type Alias EntityResult<TEntity>

EntityResult: TEntity extends Entity<any, any, infer U>
    ? [U] extends [never] ? InferType<EntitySchema<TEntity>> : U
    : InferType<EntitySchema<TEntity>>

The natural result row for a freshly initiated query against an entity.

+

For ordinary entities this is InferType<EntitySchema<T>>. For +polymorphic entities (declared via .withVariants()), this resolves to +the discriminated union of all variant rows, so:

+
const a = await db.activities.find(1);
if (a?.type === 'assigned') {
a.assigneeId; // narrowed
} +
+ +

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityResultByVariant.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityResultByVariant.html new file mode 100644 index 00000000..eef9584b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityResultByVariant.html @@ -0,0 +1,3 @@ +EntityResultByVariant | Libraries

Type Alias EntityResultByVariant<TEntity>

EntityResultByVariant: TEntity extends Entity<any, any, infer U>
    ? [U] extends [never] ? never : U
    : never

Discriminated-union variant rows for a polymorphic entity. Resolves to +never for non-polymorphic entities.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntitySchema.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntitySchema.html new file mode 100644 index 00000000..e1d4f53d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntitySchema.html @@ -0,0 +1,2 @@ +EntitySchema | Libraries

Type Alias EntitySchema<E>

EntitySchema: E extends Entity<infer S, any, any> ? S : never

Type-level helper: extract the underlying schema type from any Entity.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityVariantUnion.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityVariantUnion.html new file mode 100644 index 00000000..834c1cb0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntityVariantUnion.html @@ -0,0 +1,3 @@ +EntityVariantUnion | Libraries

Type Alias EntityVariantUnion<E>

EntityVariantUnion: E extends Entity<any, any, infer U> ? U : never

Type-level helper: extract the accumulated variant union from any Entity. +Resolves to never for non-polymorphic entities.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntryState.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntryState.html new file mode 100644 index 00000000..a62b2439 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.EntryState.html @@ -0,0 +1,2 @@ +EntryState | Libraries

Type Alias EntryState

EntryState: "Added" | "Unchanged" | "Modified" | "Deleted"

Entry state in the identity map. Mirrors EF Core's EntityState.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ExtractBranch.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ExtractBranch.html new file mode 100644 index 00000000..e3dd5c39 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ExtractBranch.html @@ -0,0 +1,8 @@ +ExtractBranch | Libraries

Type Alias ExtractBranch<Union, K>Internal

ExtractBranch: Union extends infer B
    ? {
        [P in keyof B]-?: B[P] extends K
            ? K extends B[P] ? true : never
            : never
    }[keyof B] extends never
        ? never
        : B
    : never

Extract the branch of a discriminated union whose discriminator +property has exactly the literal type K. Works without knowing the +discriminator property name by scanning all properties of each branch.

+

Example:

+
// Union = { type: 'assigned'; ... } | { type: 'commented'; ... }
ExtractBranch<Union, 'assigned'> // → { type: 'assigned'; ... } +
+ +

Type Parameters

  • Union
  • K extends string
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.HasVariants.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.HasVariants.html new file mode 100644 index 00000000..bb1742f4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.HasVariants.html @@ -0,0 +1,3 @@ +HasVariants | Libraries

Type Alias HasVariants<TEntity>

HasVariants: EntityResultByVariant<TEntity> extends never ? false : true

true when TEntity is a polymorphic entity (has at least one variant +declared via .stiVariant() / .ctiVariant()); false otherwise.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.InsertType.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.InsertType.html new file mode 100644 index 00000000..ea40934e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.InsertType.html @@ -0,0 +1 @@ +InsertType | Libraries

Type Alias InsertType<T>

InsertType: InferType<ReturnType<T["makeAllPropsOptional"]>>

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.PrimaryKeyOf.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.PrimaryKeyOf.html new file mode 100644 index 00000000..fea5cc25 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.PrimaryKeyOf.html @@ -0,0 +1,13 @@ +PrimaryKeyOf | Libraries

Type Alias PrimaryKeyOf<S>

PrimaryKeyOf: S extends { "[COMPOSITE_PRIMARY_KEY_BRAND]"?: infer TCols }
    ? TCols extends readonly string[] ? TCols : never
    : {
        [K in keyof SchemaPropsForPk<S> & string]: IsPkBranded<
            SchemaPropsForPk<S>[K],
        > extends true
            ? K
            : never
    }[keyof SchemaPropsForPk<S> & string]

Extract the primary-key column descriptor for a schema.

+

Returns:

+
    +
  • the literal property-key string for a single-column primary key +(e.g. 'id'),
  • +
  • a tuple of property-key strings for a composite primary key +(e.g. ['userId', 'roleId']),
  • +
  • or never if no primary key is declared.
  • +
+

Composite primary keys are detected via the COMPOSITE_PRIMARY_KEY_BRAND +placed on the object schema by .hasPrimaryKey([...] as const). Use +as const on the column tuple to preserve ordering at the type level.

+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.PrimaryKeyValueOf.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.PrimaryKeyValueOf.html new file mode 100644 index 00000000..c7fd44a0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.PrimaryKeyValueOf.html @@ -0,0 +1,9 @@ +PrimaryKeyValueOf | Libraries

Type Alias PrimaryKeyValueOf<S>

PrimaryKeyValueOf: PrimaryKeyOf<S> extends readonly (infer _Item extends string)[]
    ? PrimaryKeyOf<S> extends readonly string[]
        ? PkTupleValue<S, PrimaryKeyOf<S>>
        : never
    : PrimaryKeyOf<S> extends string
        ? InferType<S>[PrimaryKeyOf<S> & keyof InferType<S>]
        : never

The runtime value type of a schema's primary key.

+
    +
  • For a single-column PK, the inferred type of that property +(e.g. number).
  • +
  • For a composite PK, a tuple of inferred property types in declared +order (e.g. [number, number]).
  • +
  • never if no primary key is declared.
  • +
+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.RelKeyTree.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.RelKeyTree.html new file mode 100644 index 00000000..a39aa0ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.RelKeyTree.html @@ -0,0 +1,4 @@ +RelKeyTree | Libraries

Type Alias RelKeyTree<TEntity>

RelKeyTree: { readonly [K in keyof EntityRelations<TEntity> & string]: K }

{ [relName]: relName } — the accessor object passed to t => t.relName +selectors on .include(). Restricted to the relation keys declared on +TEntity.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ResolvedRel.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ResolvedRel.html new file mode 100644 index 00000000..d18ff707 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ResolvedRel.html @@ -0,0 +1,3 @@ +ResolvedRel | Libraries

Type Alias ResolvedRel<R>

ResolvedRel: R extends RelationInfo<infer Kind, infer F>
    ? F extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? Kind extends "hasMany"
        | "belongsToMany"
            ? InferType<F>[]
            : InferType<F> | undefined
        : never
    : never

Project the navigation-property type added by a single relation: arrays +for one-to-many / many-to-many, optional singletons for to-one.

+

Type Parameters

  • R
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.RowVersionStrategy.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.RowVersionStrategy.html new file mode 100644 index 00000000..fbe4675c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.RowVersionStrategy.html @@ -0,0 +1,7 @@ +RowVersionStrategy | Libraries

Type Alias RowVersionStrategy

RowVersionStrategy: "increment" | "timestamp" | "manual"

Concurrency-token strategy stored by .rowVersion().

+
    +
  • 'increment' — ORM increments an integer counter on each UPDATE.
  • +
  • 'timestamp' — ORM sets the value to new Date() on each UPDATE.
  • +
  • 'manual' — caller supplies the new value; ORM only enforces the check.
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SaveGraph.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SaveGraph.html new file mode 100644 index 00000000..605e249c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SaveGraph.html @@ -0,0 +1,10 @@ +SaveGraph | Libraries

Type Alias SaveGraph<TEntity>

SaveGraph: Partial<EntityResult<TEntity>> & {
    [K in keyof EntityRelations<TEntity>]?: EntityRelations<TEntity>[K] extends RelationInfo<
        infer Kind,
        infer F,
    >
        ? Kind extends "hasMany"
        | "belongsToMany"
            ? ReadonlyArray<SaveGraph<EntityFromForeign<F>>>
            : SaveGraph<EntityFromForeign<F>>
        : never
}

Shape accepted by DbSet.save(graph) — a partial of the entity row +plus optional nested relation values:

+
    +
  • belongsTo / hasOne relations accept a single nested object.
  • +
  • hasMany / belongsToMany relations accept an array of nested objects.
  • +
+

Each nested object is itself a SaveGraph of the foreign entity, +so belongsToMany can pass { id } to attach an existing row, or a +full nested graph to create a new row and link it.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SavingChangesHook.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SavingChangesHook.html new file mode 100644 index 00000000..a13a03ea --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SavingChangesHook.html @@ -0,0 +1,3 @@ +SavingChangesHook | Libraries

Type Alias SavingChangesHook

SavingChangesHook: (entry: EntityEntry<object>) => void | Promise<void>

Pre-save hook callback signature registered via +TrackedDbContext.onSavingChanges(hook).

+

Type Declaration

    • (entry: EntityEntry<object>): void | Promise<void>
    • Parameters

      Returns void | Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SchemaKeys.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SchemaKeys.html new file mode 100644 index 00000000..d6cdbde2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SchemaKeys.html @@ -0,0 +1 @@ +SchemaKeys | Libraries

Type Alias SchemaKeys<T>

SchemaKeys: keyof InferType<T> & string

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SchemaProps.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SchemaProps.html new file mode 100644 index 00000000..c1c4dfb5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SchemaProps.html @@ -0,0 +1,3 @@ +SchemaProps | Libraries

Type Alias SchemaProps<T>

SchemaProps: T extends ObjectSchemaBuilder<
    infer P,
    any,
    any,
    any,
    any,
    any,
    any,
>
    ? P
    : never

Extract the property record { [name]: SchemaBuilder } from any +ObjectSchemaBuilder regardless of variance positions.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SelectProjection.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SelectProjection.html new file mode 100644 index 00000000..7a727896 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SelectProjection.html @@ -0,0 +1,5 @@ +SelectProjection | Libraries

Type Alias SelectProjection<R>

SelectProjection: { [K in keyof R]: InferType<DescriptorPropertySchema<R[K]>> }

Result row type produced by a SelectProjection selector.

+

Each entry's value is the InferType of the property schema the +descriptor points at, so .select(t => ({ id: t.id, n: t.title })) +yields { id: number; n: string }.

+

Type Parameters

  • R extends Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SelectSelector.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SelectSelector.html new file mode 100644 index 00000000..c57e3a7d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.SelectSelector.html @@ -0,0 +1,4 @@ +SelectSelector | Libraries

Type Alias SelectSelector<T>

SelectSelector: (
    tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
) => Record<string, PropertyDescriptor<any, any, any>>

Callback shape accepted by the projection overload of select. The +callback receives the schema's property-descriptor tree and returns an +{ alias: descriptor } record.

+

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

Type Declaration

    • (
          tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
      ): Record<string, PropertyDescriptor<any, any, any>>
    • Parameters

      • tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>

      Returns Record<string, PropertyDescriptor<any, any, any>>

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.TrackedDbContext.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.TrackedDbContext.html new file mode 100644 index 00000000..98a69c6d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.TrackedDbContext.html @@ -0,0 +1,26 @@ +TrackedDbContext | Libraries

Type Alias TrackedDbContext<TMap>

TrackedDbContext: DbContext<TMap> & {
    "[asyncDispose]"(): Promise<void>;
    attach<T extends object>(entitySetKey: string, entity: T): T;
    detach(entity: object): void;
    discardChanges(): void;
    entry<T extends object>(entity: T): EntityEntry<T>;
    onSavingChanges(hook: SavingChangesHook): void;
    reload(entity: object): Promise<void>;
    remove(entity: object): void;
    saveChanges(): Promise<
        { deleted: number; inserted: number; updated: number },
    >;
}

Extended context returned when { tracking: true } is passed to +createDb. Adds identity-map tracking, unit-of-work saveChanges, +and [Symbol.asyncDispose] support for await using blocks.

+

Type Parameters

Type Declaration

  • [asyncDispose]: function
    • Implements Symbol.asyncDispose for await using blocks.

      +

      Throws PendingChangesError when there are unsaved changes at +the time of disposal — callers must call saveChanges() or +discardChanges() before the scope exits.

      +

      Returns Promise<void>

  • attach: function
    • Attach an entity to the identity map so its changes will be tracked. +If an entity with the same primary key is already tracked, the existing +tracked object is returned (identity-map guarantee).

      +

      Type Parameters

      • T extends object

      Parameters

      • entitySetKey: string

        — the property name used when registering the entity +(e.g. 'todos' for createDb(knex, { todos: TodoEntity })).

        +
      • entity: T

      Returns T

  • detach: function
    • Remove an entity from the identity map. Any subsequent changes to the +object will not be persisted by saveChanges.

      +

      Parameters

      • entity: object

      Returns void

  • discardChanges: function
    • Discard all pending changes. Modified entries are reset to their +snapshots; Added entries are detached; Deleted entries are restored +to Unchanged.

      +

      Returns void

  • entry: function
  • onSavingChanges: function
  • reload: function
    • Reload a tracked entity from the database, overwriting its current +values and refreshing the internal snapshot.

      +

      Parameters

      • entity: object

      Returns Promise<void>

  • remove: function
    • Mark a tracked entity for deletion on the next saveChanges() call.

      +

      Parameters

      • entity: object

      Returns void

  • saveChanges: function
    • Flush all pending changes to the database inside a single transaction.

      +

      Returns Promise<{ deleted: number; inserted: number; updated: number }>

      Counts of inserted, updated, and deleted rows.

      +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.UnwrapNavSchema.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.UnwrapNavSchema.html new file mode 100644 index 00000000..7d8dcc79 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.UnwrapNavSchema.html @@ -0,0 +1,3 @@ +UnwrapNavSchema | Libraries

Type Alias UnwrapNavSchema<TProp>

UnwrapNavSchema: TProp extends ArraySchemaBuilder<infer TEl, any, any, any>
    ? TEl extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TEl
        : never
    : TProp extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TProp
        : TProp extends SchemaBuilder<infer T, any, any, any, any>
            ? T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
                ? T
                : never
            : never

Peel .optional() / array(...) wrappers off a navigation property's +schema to recover the underlying foreign ObjectSchemaBuilder.

+

Type Parameters

  • TProp
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ValidatedSpec.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ValidatedSpec.html new file mode 100644 index 00000000..2a08e9a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.ValidatedSpec.html @@ -0,0 +1 @@ +ValidatedSpec | Libraries

Type Alias ValidatedSpec

ValidatedSpec:
    | { type: "one" } & ValidatedJoinOneSpec
    | { type: "many" } & ValidatedJoinManySpec
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantBranch.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantBranch.html new file mode 100644 index 00000000..2959be82 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantBranch.html @@ -0,0 +1,4 @@ +VariantBranch | Libraries

Type Alias VariantBranch<TBaseSchema, TVarSchema>

VariantBranch: Omit<InferType<TBaseSchema>, keyof InferType<TVarSchema>> & InferType<
    TVarSchema,
>

Merge type for a single polymorphic variant branch: variant schema fields +overlay base schema fields (narrowing the discriminator from string to its +specific literal value).

+

Type Parameters

  • TBaseSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVarSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantInsertPayload.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantInsertPayload.html new file mode 100644 index 00000000..a00a5e4e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantInsertPayload.html @@ -0,0 +1,8 @@ +VariantInsertPayload | Libraries

Type Alias VariantInsertPayload<TEntity, K>

VariantInsertPayload: VariantResult<TEntity, K> extends infer B extends
    Record<string, unknown>
    ? Omit<
        { [P in keyof B]?: B[P] },
        { [P in keyof B]-?: B[P] extends K ? K extends B[P] ? P : never : never }[keyof B],
    >
    : never

Write payload for DbSet.insertVariant(key, payload).

+

All columns from the matching variant branch are optional (so +auto-generated PKs and columns with DB defaults can be omitted), and the +discriminator field is excluded (it is set automatically from key).

+

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string
// Only valid fields for the 'assigned' variant; type-checked at compile time:
await db.activities.insertVariant('assigned', {
todoId: 42,
userId: 7,
assigneeId: 9,
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantResult.html new file mode 100644 index 00000000..a42bf247 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantResult.html @@ -0,0 +1,8 @@ +VariantResult | Libraries

Type Alias VariantResult<TEntity, K>

The concrete result shape for a specific polymorphic variant.

+

For a polymorphic entity that uses .withVariants(), resolves to the +branch of the discriminated union where the discriminator equals K. +Resolves to never for non-polymorphic entities or unknown keys.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string
type AssignedActivity = VariantResult<typeof ActivityEntity, 'assigned'>;
// → { type: 'assigned'; id: number; todoId: number; assigneeId: number; … } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantStorageType.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantStorageType.html new file mode 100644 index 00000000..f7153871 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantStorageType.html @@ -0,0 +1,2 @@ +VariantStorageType | Libraries

Type Alias VariantStorageType

VariantStorageType: "cti" | "sti"

Storage strategy for a polymorphic variant.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantUpdatePayload.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantUpdatePayload.html new file mode 100644 index 00000000..4d54a431 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.VariantUpdatePayload.html @@ -0,0 +1,4 @@ +VariantUpdatePayload | Libraries

Type Alias VariantUpdatePayload<TEntity, K>

VariantUpdatePayload: VariantInsertPayload<TEntity, K>

Write payload for EntityQuery.updateVariant(key, set).

+

Same shape as VariantInsertPayload — partial of the variant +branch with the discriminator excluded.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithIncluded.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithIncluded.html new file mode 100644 index 00000000..9e000405 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithIncluded.html @@ -0,0 +1,2 @@ +WithIncluded | Libraries

Type Alias WithIncluded<TEntity, TResult, K>

WithIncluded: TResult & { [P in K]: ResolvedRel<EntityRelations<TEntity>[P]> }

Result type after .include('rel') is applied.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithJoinedMany.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithJoinedMany.html new file mode 100644 index 00000000..37cbec13 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithJoinedMany.html @@ -0,0 +1,2 @@ +WithJoinedMany | Libraries

Type Alias WithJoinedMany<TBase, TFieldName, TForeignSchema>

WithJoinedMany: TBase & { [K in TFieldName]: InferType<TForeignSchema>[] }

Adds a joined collection field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithJoinedOne.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithJoinedOne.html new file mode 100644 index 00000000..30e4edd0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithJoinedOne.html @@ -0,0 +1,2 @@ +WithJoinedOne | Libraries

Type Alias WithJoinedOne<TBase, TFieldName, TForeignSchema, TRequired>

WithJoinedOne: TBase & {
    [K in TFieldName]: TRequired extends true
        ? InferType<TForeignSchema>
        : InferType<TForeignSchema> | null
}

Adds a single joined object field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRequired extends boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithRelation.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithRelation.html new file mode 100644 index 00000000..48aba20c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithRelation.html @@ -0,0 +1,3 @@ +WithRelation | Libraries

Type Alias WithRelation<TSchema, TRels, TKey, TKind, TForeign, TVariantUnion>

WithRelation: Entity<
    TSchema,
    TRels & Record<TKey, RelationInfo<TKind, TForeign>>,
    TVariantUnion,
>

Return type for an Entity method that adds a relation: keeps TSchema, +extends TRels with one more entry, and preserves TVariantUnion.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRels extends Record<string, RelationInfo>
  • TKey extends string
  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVariantUnion = never
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithVariantIncluded.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithVariantIncluded.html new file mode 100644 index 00000000..b468f161 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_orm.WithVariantIncluded.html @@ -0,0 +1,4 @@ +WithVariantIncluded | Libraries

Type Alias WithVariantIncluded<TEntity, TResult, Variant, Rel>

WithVariantIncluded: TResult extends infer U
    ? U extends Record<string, unknown>
        ? Extract<U, Record<string, Variant>> extends never
            ? U
            : Extract<U, Record<string, Variant>> extends U
                ? U & { [P in Rel]: ResolvedRel<EntityRelations<TEntity>[P]> }
                :
                    | Exclude<U, Extract<U, Record<string, Variant>>>
                    | Extract<U, Record<string, Variant>> & {
                        [P in Rel]: ResolvedRel<EntityRelations<(...)>[P]>
                    }
        : U
    : never

Result type after .includeVariant(variant, rel) is applied — adds +Rel only on the discriminated branch matching Variant, leaving +other branches untouched.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_otel.client.ClientMiddleware.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_otel.client.ClientMiddleware.html new file mode 100644 index 00000000..87c337a8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_otel.client.ClientMiddleware.html @@ -0,0 +1,2 @@ +ClientMiddleware | Libraries

Type Alias ClientMiddleware

ClientMiddleware: (next: FetchLike) => FetchLike

Middleware shape accepted by @cleverbrush/client.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_otel.client.FetchLike.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_otel.client.FetchLike.html new file mode 100644 index 00000000..8d82f0c2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_otel.client.FetchLike.html @@ -0,0 +1,4 @@ +FetchLike | Libraries
FetchLike: (url: string, init: RequestInit) => Promise<Response>

A function with the same shape as fetch.

+

Kept local instead of importing from @cleverbrush/client so this +entrypoint remains structurally compatible without a runtime dependency.

+

Type Declaration

    • (url: string, init: RequestInit): Promise<Response>
    • Parameters

      • url: string
      • init: RequestInit

      Returns Promise<Response>

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldProps.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldProps.html new file mode 100644 index 00000000..3a29d926 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldProps.html @@ -0,0 +1,16 @@ +FieldProps | Libraries

Type Alias FieldProps<TSchema>

type FieldProps<TSchema extends ObjectSchemaBuilder<any, any, any>> = {
    fieldProps?: Record<string, unknown>;
    form: SchemaFormInstance<TSchema>;
    forProperty: (
        tree: PropertyDescriptorTree<TSchema, TSchema>,
    ) => PropertyDescriptor<TSchema, any, any>;
    label?: string;
    name?: string;
    renderer?: FieldRenderer;
    variant?: string;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any>
Index

Properties

fieldProps?: Record<string, unknown>

Bag of extra renderer-specific props forwarded to the renderer via +FieldRenderProps.fieldProps (e.g. placeholder, autoComplete).

+
forProperty: (
    tree: PropertyDescriptorTree<TSchema, TSchema>,
) => PropertyDescriptor<TSchema, any, any>
label?: string

Visible label text forwarded to the renderer via FieldRenderProps.label.

+
name?: string

HTML name attribute forwarded to the renderer via FieldRenderProps.name.

+
renderer?: FieldRenderer
variant?: string

Rendering variant hint. Participates in renderer resolution: +the registry is checked for "type:variant" (e.g. "string:password") +before falling back to the base "type" key. +Also forwarded to the renderer via FieldRenderProps.variant.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldRenderProps.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldRenderProps.html new file mode 100644 index 00000000..d06f1e65 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldRenderProps.html @@ -0,0 +1,41 @@ +FieldRenderProps | Libraries

Type Alias FieldRenderProps

Props passed to a field renderer.

+
type FieldRenderProps = {
    dirty: boolean;
    error: string | undefined;
    fieldProps?: Record<string, unknown>;
    initialValue: any;
    label?: string;
    name?: string;
    onBlur: () => void;
    onChange: (value: any) => void;
    schema: SchemaBuilder<any, any, any>;
    setValue: (value: any) => void;
    touched: boolean;
    validating: boolean;
    value: any;
    variant?: string;
}
Index

Properties

dirty: boolean
error: string | undefined
fieldProps?: Record<string, unknown>

Bag of extra renderer-specific props forwarded from the Field component. +Useful for passing HTML attributes (placeholder, autoComplete, type) +or UI-library-specific options without extending FieldRenderProps itself.

+
<Field
forProperty={(t) => t.email}
form={form}
fieldProps={{ placeholder: "you@example.com", autoComplete: "email" }}
/> +
+ +
initialValue: any
label?: string

Visible label text forwarded from the Field component. +Renderers can use this to render a <label> element.

+
<Field forProperty={(t) => t.name} form={form} label="Full name" />
+
+ +
name?: string

HTML name attribute forwarded from the Field component. +Renderers can apply this to the underlying input for FormData submission.

+
<Field forProperty={(t) => t.email} form={form} name="email" />
+
+ +
onBlur: () => void
onChange: (value: any) => void
schema: SchemaBuilder<any, any, any>
setValue: (value: any) => void
touched: boolean
validating: boolean
value: any
variant?: string

Rendering variant hint passed from the Field component. +Used by renderers to select a sub-variant of the base schema type +(e.g. "password" for a string field rendered as a password input).

+

Also participates in renderer resolution: when set, the renderer +registry is first checked for "type:variant" (e.g. "string:password") +before falling back to the base "type" key.

+
<Field forProperty={(t) => t.secret} form={form} variant="password" />
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldRenderer.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldRenderer.html new file mode 100644 index 00000000..c1514218 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldRenderer.html @@ -0,0 +1,2 @@ +FieldRenderer | Libraries

Type Alias FieldRenderer

FieldRenderer: (props: FieldRenderProps) => ReactNode

A renderer function that receives field state and returns a React node.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldState.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldState.html new file mode 100644 index 00000000..d34d322c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FieldState.html @@ -0,0 +1,8 @@ +FieldState | Libraries

Field state tracked per-field.

+
type FieldState = {
    dirty: boolean;
    error: string | undefined;
    initialValue: any;
    touched: boolean;
    validating: boolean;
    value: any;
}
Index

Properties

dirty: boolean
error: string | undefined
initialValue: any
touched: boolean
validating: boolean
value: any
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormProviderProps.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormProviderProps.html new file mode 100644 index 00000000..a37edbff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormProviderProps.html @@ -0,0 +1,3 @@ +FormProviderProps | Libraries

Type Alias FormProviderProps<TSchema>

type FormProviderProps<TSchema extends ObjectSchemaBuilder<any, any, any>> = {
    children: React.ReactNode;
    form: SchemaFormInstance<TSchema>;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any>
Index

Properties

Properties

children: React.ReactNode
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormSystemConfig.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormSystemConfig.html new file mode 100644 index 00000000..755e392e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormSystemConfig.html @@ -0,0 +1,3 @@ +FormSystemConfig | Libraries

Type Alias FormSystemConfig

Configuration for FormSystemProvider.

+
type FormSystemConfig = {
    renderers?: Record<string, FieldRenderer>;
}
Index

Properties

Properties

renderers?: Record<string, FieldRenderer>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormSystemProviderProps.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormSystemProviderProps.html new file mode 100644 index 00000000..a5ac454e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.FormSystemProviderProps.html @@ -0,0 +1,8 @@ +FormSystemProviderProps | Libraries

Type Alias FormSystemProviderProps

type FormSystemProviderProps = {
    children: React.ReactNode;
    config?: FormSystemConfig;
    renderers?: Record<string, FieldRenderer>;
}
Index

Properties

children: React.ReactNode

Full configuration object (for future extensibility). +If both renderers and config.renderers are provided, renderers takes precedence.

+
renderers?: Record<string, FieldRenderer>

Renderer registry mapping schema types to renderer functions. +Example: { string: (props) => <input .../>, number: (props) => <input type="number" .../> }

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.SchemaFormInstance.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.SchemaFormInstance.html new file mode 100644 index 00000000..e6c379d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.SchemaFormInstance.html @@ -0,0 +1,11 @@ +SchemaFormInstance | Libraries

Type Alias SchemaFormInstance<TSchema>

Return type for useSchemaForm — fully typed for IntelliSense. +The useField method infers the field value type from the schema via PropertyDescriptor.

+
type SchemaFormInstance<TSchema extends ObjectSchemaBuilder<any, any, any>> = {
    _getFormContext: () => FormContextValue;
    getValue: () => InferType<TSchema>;
    reset: (values?: Partial<InferType<TSchema>>) => void;
    setValue: (values: Partial<InferType<TSchema>>) => void;
    submit: () => Promise<ValidationResult<InferType<TSchema>>>;
    useField: <TPropertySchema extends SchemaBuilder<any, any, any>>(
        forProperty: (
            tree: PropertyDescriptorTree<TSchema, TSchema>,
        ) => PropertyDescriptor<TSchema, TPropertySchema, any>,
    ) => UseFieldResult<InferType<TPropertySchema>>;
    validate: () => Promise<ValidationResult<InferType<TSchema>>>;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any>
Index

Properties

_getFormContext: () => FormContextValue

— Used by FormProvider and Field to access internal context

+
getValue: () => InferType<TSchema>
reset: (values?: Partial<InferType<TSchema>>) => void
setValue: (values: Partial<InferType<TSchema>>) => void
submit: () => Promise<ValidationResult<InferType<TSchema>>>
useField: <TPropertySchema extends SchemaBuilder<any, any, any>>(
    forProperty: (
        tree: PropertyDescriptorTree<TSchema, TSchema>,
    ) => PropertyDescriptor<TSchema, TPropertySchema, any>,
) => UseFieldResult<InferType<TPropertySchema>>
validate: () => Promise<ValidationResult<InferType<TSchema>>>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.UseFieldResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.UseFieldResult.html new file mode 100644 index 00000000..cf4bbc49 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.UseFieldResult.html @@ -0,0 +1,13 @@ +UseFieldResult | Libraries

Type Alias UseFieldResult<T>

Return type for useField — strongly typed with the inferred property value type. +When the value type cannot be inferred, falls back to any.

+
type UseFieldResult<T = any> = {
    dirty: boolean;
    error: string | undefined;
    initialValue: T | undefined;
    onBlur: () => void;
    onChange: (value: T) => void;
    schema: SchemaBuilder<any, any, any>;
    setValue: (value: T) => void;
    touched: boolean;
    validating: boolean;
    value: T | undefined;
}

Type Parameters

  • T = any
Index

Properties

dirty: boolean
error: string | undefined
initialValue: T | undefined
onBlur: () => void
onChange: (value: T) => void
schema: SchemaBuilder<any, any, any>
setValue: (value: T) => void
touched: boolean
validating: boolean
value: T | undefined
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.UseSchemaFormOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.UseSchemaFormOptions.html new file mode 100644 index 00000000..800a63e2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_react-form.UseSchemaFormOptions.html @@ -0,0 +1,19 @@ +UseSchemaFormOptions | Libraries

Type Alias UseSchemaFormOptions

Options for useSchemaForm.

+
type UseSchemaFormOptions = {
    createMissingStructure?: boolean;
    validateOnMount?: boolean;
    validationDebounceMs?: number;
}
Index

Properties

createMissingStructure?: boolean
validateOnMount?: boolean

When true, runs full schema validation on mount and marks all fields +as touched so that error messages (e.g. for required fields) are visible +immediately without waiting for user interaction.

+
false
+
+ +
validationDebounceMs?: number

Debounce delay in milliseconds for onChange-triggered validation. +When set, rapid field changes only trigger one validation run after +the user stops typing for the specified duration.

+

Explicit calls to form.validate(), form.submit(), and +validateOnMount are not debounced — they always run immediately.

+
const form = useSchemaForm(Schema, { validationDebounceMs: 300 });
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_scheduler.TaskSchedule.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_scheduler.TaskSchedule.html new file mode 100644 index 00000000..fe1883f1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_scheduler.TaskSchedule.html @@ -0,0 +1,13 @@ +TaskSchedule | Libraries

Type Alias TaskSchedule

TaskSchedule: InferType<typeof ScheduleSchema>

Schedule for job. Can be one of:

+
    +
  • every N minutes
  • +
  • every N days
  • +
  • every N weeks
  • +
  • every N months
  • +
  • every N years
  • +
  • every N days of week
  • +
  • every N months on N day
  • +
  • every N years on N day of N month
  • +
  • every N years on last day of N month
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.InferFromJsonSchema.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.InferFromJsonSchema.html new file mode 100644 index 00000000..f0ee72c8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.InferFromJsonSchema.html @@ -0,0 +1,8 @@ +InferFromJsonSchema | Libraries

Type Alias InferFromJsonSchema<S>

InferFromJsonSchema: S extends { const: infer V }
    ? V
    : S extends { enum: readonly (infer V)[] }
        ? V
        : S extends { type: "string" }
            ? string
            : S extends { type: "number"
            | "integer" }
                ? number
                : S extends { type: "boolean" }
                    ? boolean
                    : S extends { type: "null" }
                        ? null
                        : S extends { items: infer I; type: "array" }
                            ? InferFromJsonSchema<I>[]
                            : S extends { type: "array" }
                                ? unknown[]
                                : S extends {
                                    properties: infer P;
                                    required: readonly (...);
                                    type: "object";
                                }
                                    ? { [K in (...) as (...)]: (...) } & {
                                        [K in (...) as (...)]?: (...)
                                    }
                                    : S extends { properties: ...; type: ... }
                                        ? { [K in (...)]?: (...) }
                                        : (...) extends (...) ? (...) : (...)

Recursively infers a TypeScript type from a statically-known JSON Schema node.

+

Requires as const on the input object for precise inference — +without it TypeScript widens string literals to string and inference +collapses to unknown.

+

Type Parameters

  • S
type User = InferFromJsonSchema<typeof UserJsonSchema>;
// { name: string; age?: number } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.JsonSchemaNode.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.JsonSchemaNode.html new file mode 100644 index 00000000..84f48fb8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.JsonSchemaNode.html @@ -0,0 +1,4 @@ +JsonSchemaNode | Libraries
JsonSchemaNode:
    | {
        format?: string;
        maxLength?: number;
        minLength?: number;
        pattern?: string;
        type: "string";
        [k: string]: unknown;
    }
    | {
        exclusiveMaximum?: number;
        exclusiveMinimum?: number;
        maximum?: number;
        minimum?: number;
        multipleOf?: number;
        type: "number"
        | "integer";
        [k: string]: unknown;
    }
    | { type: "boolean"; [k: string]: unknown }
    | { type: "null"; [k: string]: unknown }
    | {
        items?: JsonSchemaNode;
        maxItems?: number;
        minItems?: number;
        type: "array";
        [k: string]: unknown;
    }
    | {
        additionalProperties?: boolean;
        properties?: Readonly<Record<string, JsonSchemaNode>>;
        required?: readonly string[];
        type: "object";
        [k: string]: unknown;
    }
    | { const: unknown; [k: string]: unknown }
    | { enum: readonly unknown[]; [k: string]: unknown }
    | {
        anyOf: readonly JsonSchemaNode[];
        discriminator?: {
            mapping?: Readonly<Record<string, string>>;
            propertyName: string;
        };
        [k: string]: unknown;
    }
    | { allOf: readonly JsonSchemaNode[]; [k: string]: unknown }
    | Record<string, never>

Subset of JSON Schema (Draft 7 / 2020-12) accepted as input.

+

For accurate TypeScript type inference via InferFromJsonSchema, +pass schema literals with as const.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.JsonSchemaNodeToBuilder.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.JsonSchemaNodeToBuilder.html new file mode 100644 index 00000000..e70328b2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.JsonSchemaNodeToBuilder.html @@ -0,0 +1,19 @@ +JsonSchemaNodeToBuilder | Libraries

Type Alias JsonSchemaNodeToBuilder<S, TRequired>

JsonSchemaNodeToBuilder: S extends { const: infer V }
    ? ConstToBuilder<V, TRequired>
    : S extends { enum: infer Vals extends readonly unknown[] }
        ? UnionSchemaBuilder<EnumTupleToBuilders<Vals>, TRequired>
        : S extends { anyOf: infer Opts extends readonly unknown[] }
            ? UnionSchemaBuilder<SchemaNodesTupleToBuilders<Opts>, TRequired>
            : S extends { allOf: infer Opts extends readonly unknown[] }
                ? AllOfNodesToBuilder<Opts, TRequired>
                : S extends { type: "string" }
                    ? ExtendedStringBuilder<string, TRequired>
                    : S extends { type: "number" }
                        ? ExtendedNumberBuilder<number, TRequired>
                        : S extends { type: "integer" }
                            ? ExtendedNumberBuilder<number, TRequired>
                            : S extends { type: "boolean" }
                                ? BooleanSchemaBuilder<boolean, TRequired>
                                : S extends { type: "null" }
                                    ? SchemaBuilder<null, TRequired>
                                    : S extends { items: ...; type: ... }
                                        ? ExtendedArrayBuilder<(...), (...)>
                                        : (...) extends (...) ? (...) : (...)

Recursively maps a statically-known JSON Schema node (passed with +as const) to the exact @cleverbrush/schema builder type, including:

+
    +
  • StringSchemaBuilder, NumberSchemaBuilder, BooleanSchemaBuilder +for primitive types and const literals
  • +
  • ArraySchemaBuilder<ElementBuilder> with the element builder inferred +from items
  • +
  • ObjectSchemaBuilder<PropertyDescriptors> where each property is a +typed builder with TRequired = true/false driven by the required +array
  • +
  • UnionSchemaBuilder<[...Builders]> for enum and anyOf
  • +
+

Type Parameters

  • S

    The JSON Schema node type (inferred from as const).

    +
  • TRequired extends boolean = true

    Whether this node represents a required (true) or +optional (false) value in its parent context. Defaults to true.

    +
import { fromJsonSchema } from '@cleverbrush/schema-json';
import type { JsonSchemaNodeToBuilder } from '@cleverbrush/schema-json';

const S = {
type: 'object',
properties: {
name: { type: 'string' },
score: { type: 'number' },
},
required: ['name'],
} as const;

type Builder = JsonSchemaNodeToBuilder<typeof S>;
// ObjectSchemaBuilder<
// { name: ExtendedStringBuilder<string, true> } &
// { score: ExtendedNumberBuilder<number, false> }
// >

const schema = fromJsonSchema(S);
// TypeScript knows schema is ObjectSchemaBuilder<...>
// with full intellisense on .parse(), .addProp(), etc. +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferInput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferInput.html new file mode 100644 index 00000000..ba1c737f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries

Infers the input type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferOutput.html new file mode 100644 index 00000000..f5e31556 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries

Infers the output type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.Target.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.Target.html new file mode 100644 index 00000000..62ac260d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardJSONSchemaV1.Target.html @@ -0,0 +1,4 @@ +Target | Libraries
Target: "draft-2020-12" | "draft-07" | "openapi-3.0" | {} & string

The target version of the generated JSON Schema.

+

It is strongly recommended that implementers support "draft-2020-12" and "draft-07", as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.

+

The "openapi-3.0" target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema "draft-04".

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardTypedV1.InferInput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardTypedV1.InferInput.html new file mode 100644 index 00000000..3e8c44e1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardTypedV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries
InferInput: NonNullable<Schema["~standard"]["types"]>["input"]

Infers the input type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardTypedV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardTypedV1.InferOutput.html new file mode 100644 index 00000000..26da1343 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.StandardTypedV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries
InferOutput: NonNullable<Schema["~standard"]["types"]>["output"]

Infers the output type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.ToJsonSchemaOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.ToJsonSchemaOptions.html new file mode 100644 index 00000000..fc5eaa56 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema-json.ToJsonSchemaOptions.html @@ -0,0 +1,26 @@ +ToJsonSchemaOptions | Libraries

Type Alias ToJsonSchemaOptions

Options accepted by toJsonSchema.

+
type ToJsonSchemaOptions = {
    $schema?: boolean;
    draft?: "2020-12" | "07";
    nameResolver?: (schema: SchemaBuilder) => string | null;
}
Index

Properties

$schema?: boolean

Whether to include the $schema header in the output. +Set to false when embedding in an OpenAPI spec.

+
true
+
+ +
draft?: "2020-12" | "07"

JSON Schema draft version to reference in the $schema header.

+
'2020-12'
+
+ +
nameResolver?: (schema: SchemaBuilder) => string | null

Optional hook called for every schema node before conversion.

+

When provided, the function receives each SchemaBuilder instance +encountered during recursive conversion (including nested ones inside +objects, arrays, and unions). If the function returns a non-null string, +conversion of that node is short-circuited and a +{ $ref: '#/components/schemas/<name>' } object is returned instead of +the full inline JSON Schema.

+

Return null to let conversion proceed normally.

+

Primarily used by @cleverbrush/server-openapi to emit $ref pointers +for schemas registered via .schemaName().

+

Type Declaration

    • (schema: SchemaBuilder): string | null
    • Parameters

      • schema: SchemaBuilder

        The schema node currently being converted.

        +

      Returns string | null

      The component name to reference, or null to inline.

      +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ArraySchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ArraySchemaValidationResult.html new file mode 100644 index 00000000..e4cd8d14 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ArraySchemaValidationResult.html @@ -0,0 +1,9 @@ +ArraySchemaValidationResult | Libraries

Type Alias ArraySchemaValidationResult<TResult, TElementSchema>

ArraySchemaValidationResult: ValidationResult<TResult> & {
    getNestedErrors(): ElementValidationResult<TElementSchema>[] & NestedValidationResult<
        any,
        any,
        any,
    >;
}

Validation result type returned by ArraySchemaBuilder.validate(). +Extends ValidationResult with getNestedErrors for root-level array +errors and per-element validation results.

+

Type Parameters

  • TResult
  • TElementSchema extends SchemaBuilder<any, any, any, any, any>

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.BRAND-1.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.BRAND-1.html new file mode 100644 index 00000000..64bcbe0f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.BRAND-1.html @@ -0,0 +1,2 @@ +BRAND | Libraries

Type Alias BRAND

BRAND: typeof __brand

Symbol used as the key for branded/opaque types.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.Brand.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.Brand.html new file mode 100644 index 00000000..077dcbb7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.Brand.html @@ -0,0 +1,6 @@ +Brand | Libraries

Type Alias Brand<T, TBrand>

Brand: T & { readonly [K in BRAND]: TBrand }

Intersects a base type with a phantom brand tag. +The brand exists only at the type level — zero runtime cost.

+

Type Parameters

  • T
  • TBrand extends string | symbol
type Email = Brand<string, 'Email'>;
type UserId = Brand<number, 'UserId'>; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.CleanExtended.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.CleanExtended.html new file mode 100644 index 00000000..305f18bf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.CleanExtended.html @@ -0,0 +1,5 @@ +CleanExtended | Libraries

Type Alias CleanExtended<TBuilder, TExt>

Produces the consumer-facing type for an extended builder: the base +builder intersected with its fixed extension methods, with +withExtension / getExtension overridden to never so they +don't appear as callable in consumer code.

+

Type Parameters

  • TBuilder
  • TExt
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ElementValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ElementValidationResult.html new file mode 100644 index 00000000..04df3b85 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ElementValidationResult.html @@ -0,0 +1,5 @@ +ElementValidationResult | Libraries

Type Alias ElementValidationResult<TElementSchema>

ElementValidationResult: TElementSchema extends UnionSchemaBuilder<
    infer UOptions extends readonly SchemaBuilder<any, any, any, any, any>[],
    any,
    any,
>
    ? UnionSchemaValidationResult<InferType<TElementSchema>, UOptions>
    : TElementSchema extends ObjectSchemaBuilder<any, any, any, any, any>
        ? ObjectSchemaValidationResult<
            InferType<TElementSchema>,
            TElementSchema,
        >
        : ValidationResult<InferType<TElementSchema>>

Maps an element schema type to the appropriate validation result type. +Union schema elements get UnionSchemaValidationResult, +Object schema elements get ObjectSchemaValidationResult, +other types get ValidationResult.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedAny.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedAny.html new file mode 100644 index 00000000..f44d23b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedAny.html @@ -0,0 +1,2 @@ +ExtendedAny | Libraries

Type Alias ExtendedAny

ExtendedAny: AnySchemaBuilder<true, false, undefined, false, {}> & HiddenExtensionMethods

An AnySchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedArray.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedArray.html new file mode 100644 index 00000000..b8b1d812 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedArray.html @@ -0,0 +1,2 @@ +ExtendedArray | Libraries

Type Alias ExtendedArray<TElementSchema>

ExtendedArray: ArraySchemaBuilder<
    TElementSchema,
    true,
    false,
    undefined,
    false,
    ArrayBuiltinExtensions<TElementSchema>,
> & ArrayBuiltinExtensions<TElementSchema> & HiddenExtensionMethods

An ArraySchemaBuilder with built-in extension methods.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedBoolean.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedBoolean.html new file mode 100644 index 00000000..d63797e6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedBoolean.html @@ -0,0 +1,2 @@ +ExtendedBoolean | Libraries

Type Alias ExtendedBoolean

ExtendedBoolean: BooleanSchemaBuilder<
    boolean,
    true,
    false,
    undefined,
    false,
    {},
> & HiddenExtensionMethods

A BooleanSchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedDate.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedDate.html new file mode 100644 index 00000000..43a4805d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedDate.html @@ -0,0 +1,2 @@ +ExtendedDate | Libraries

Type Alias ExtendedDate

ExtendedDate: DateSchemaBuilder<Date, true, false, false, {}> & HiddenExtensionMethods

A DateSchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedFunc.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedFunc.html new file mode 100644 index 00000000..da13581b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedFunc.html @@ -0,0 +1,2 @@ +ExtendedFunc | Libraries

Type Alias ExtendedFunc

ExtendedFunc: FunctionSchemaBuilder<true, false, undefined, false, {}> & HiddenExtensionMethods

A FunctionSchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedNumber.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedNumber.html new file mode 100644 index 00000000..5baa6cdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedNumber.html @@ -0,0 +1,2 @@ +ExtendedNumber | Libraries

Type Alias ExtendedNumber<T>

ExtendedNumber: NumberSchemaBuilder<
    T,
    true,
    false,
    false,
    NumberBuiltinExtensions<T>,
> & NumberBuiltinExtensions<T> & HiddenExtensionMethods

A NumberSchemaBuilder with built-in extension methods.

+

Type Parameters

  • T extends number = number
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedObject.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedObject.html new file mode 100644 index 00000000..fa9ffd3d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedObject.html @@ -0,0 +1,2 @@ +ExtendedObject | Libraries

Type Alias ExtendedObject<TProps>

ExtendedObject: ObjectSchemaBuilder<
    TProps,
    true,
    false,
    undefined,
    false,
    {},
    [],
> & HiddenExtensionMethods

An ObjectSchemaBuilder with built-in extension methods.

+

Type Parameters

  • TProps extends Record<string, SchemaBuilder<any, any, any, any, any>> = {}
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedPromise.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedPromise.html new file mode 100644 index 00000000..81923205 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedPromise.html @@ -0,0 +1,2 @@ +ExtendedPromise | Libraries

Type Alias ExtendedPromise<TResolvedTypeSchema>

ExtendedPromise: PromiseSchemaBuilder<
    true,
    false,
    undefined,
    false,
    {},
    TResolvedTypeSchema,
> & HiddenExtensionMethods

A PromiseSchemaBuilder with built-in extension methods.

+

Type Parameters

  • TResolvedTypeSchema extends SchemaBuilder<any, any, any, any, any> | undefined = undefined
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedRecord.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedRecord.html new file mode 100644 index 00000000..9210ae62 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedRecord.html @@ -0,0 +1,2 @@ +ExtendedRecord | Libraries

Type Alias ExtendedRecord<TKeySchema, TValueSchema>

ExtendedRecord: RecordSchemaBuilder<
    TKeySchema,
    TValueSchema,
    true,
    false,
    undefined,
    false,
    {},
> & HiddenExtensionMethods

A RecordSchemaBuilder with built-in extension methods.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedString.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedString.html new file mode 100644 index 00000000..d4785c34 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedString.html @@ -0,0 +1,2 @@ +ExtendedString | Libraries

Type Alias ExtendedString<T>

ExtendedString: StringSchemaBuilder<
    T,
    true,
    false,
    false,
    StringBuiltinExtensions<T>,
> & StringBuiltinExtensions<T> & HiddenExtensionMethods

A StringSchemaBuilder with built-in extension methods.

+

Type Parameters

  • T extends string = string
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedTuple.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedTuple.html new file mode 100644 index 00000000..d0368488 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedTuple.html @@ -0,0 +1,2 @@ +ExtendedTuple | Libraries

Type Alias ExtendedTuple<TElements>

ExtendedTuple: TupleSchemaBuilder<TElements, true, false, undefined, false, {}> & HiddenExtensionMethods

A TupleSchemaBuilder with built-in extension methods.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedUnion.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedUnion.html new file mode 100644 index 00000000..8bb40298 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtendedUnion.html @@ -0,0 +1,2 @@ +ExtendedUnion | Libraries

Type Alias ExtendedUnion<TOptions>

ExtendedUnion: UnionSchemaBuilder<TOptions, true, false, undefined, false, {}> & HiddenExtensionMethods

A UnionSchemaBuilder with built-in extension methods.

+

Type Parameters

  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtensionConfig.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtensionConfig.html new file mode 100644 index 00000000..41575af9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtensionConfig.html @@ -0,0 +1,19 @@ +ExtensionConfig | Libraries

Type Alias ExtensionConfig

ExtensionConfig: {
    [K in BuilderTypeName]?: Record<
        string,
        (this: BuilderMap[K], ...args: any[]) => any,
    >
}

Defines the shape of an extension configuration object passed to +defineExtension.

+

Each key is a builder type name — one of "string", "number", +"boolean", "date", "object", "array", "union", "func", or +"any". The value is a record of method implementations to add to +that builder type.

+

Method implementations receive this bound to the target builder instance +(e.g. StringSchemaBuilder for the "string" key) and must return a +builder of the same type to support fluent chaining.

+

Extension methods that only add validators/preprocessors do not need to +call this.withExtension() — the system will auto-attach metadata using +the method name as the key and the arguments as the value. Call +this.withExtension(key, value) explicitly only when you need custom +metadata (e.g. a transformed value or a different key).

+
// Minimal extension config — auto-inferred metadata
const config: ExtensionConfig = {
string: {
slug(this: StringSchemaBuilder) {
return this.addValidator((v) => ({ valid: /^[a-z0-9-]+$/.test(v), errors: [] }));
}
},
number: {
port(this: NumberSchemaBuilder) {
return this.isInteger().min(1).max(65535);
}
}
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtensionDescriptor.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtensionDescriptor.html new file mode 100644 index 00000000..a7c0614f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtensionDescriptor.html @@ -0,0 +1,19 @@ +ExtensionDescriptor | Libraries

Type Alias ExtensionDescriptor<T>

A branded descriptor returned by defineExtension.

+

The descriptor captures the extension's method signatures at the type +level so that withExtensions can produce correctly-typed factory +functions. At runtime it holds the (possibly wrapped) configuration object.

+

Extension descriptors are intentionally opaque — consumers should not +access config directly. Instead, pass descriptors to +withExtensions to obtain augmented builder factories.

+
// The type is inferred — no need to annotate
const myExt: ExtensionDescriptor<{ string: { slug: ... } }> = defineExtension({ ... }); +
+ +
type ExtensionDescriptor<T extends ExtensionConfig = ExtensionConfig> = {
    __brand: unique symbol;
    config: T;
}

Type Parameters

Index

Properties

Properties

__brand: unique symbol
config: T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtraTypeBrandSymbol.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtraTypeBrandSymbol.html new file mode 100644 index 00000000..d2e08b90 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ExtraTypeBrandSymbol.html @@ -0,0 +1 @@ +ExtraTypeBrandSymbol | Libraries

Type Alias ExtraTypeBrandSymbol

ExtraTypeBrandSymbol: typeof EXTRA_TYPE_BRAND
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.FixedMethods.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.FixedMethods.html new file mode 100644 index 00000000..39cd7343 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.FixedMethods.html @@ -0,0 +1,21 @@ +FixedMethods | Libraries

Type Alias FixedMethods<TRawMethods, TBase, TAccum, TExtraTypes>

FixedMethods: {
    [K in keyof TRawMethods]: TRawMethods[K] extends (
        this: any,
        ...args: infer A,
    ) => infer R
        ? R extends { __cleverbrush_extra_type_brand__?: any }
            ? <const TName extends string & A[0], const TKey extends string>(
                name: TName,
                ...columns: ReadonlyArray<
                    | TKey
                    | (
                        TBase extends ObjectSchemaBuilder<any, any, any, any, any>
                            ? (t: PropertyDescriptorTree<TBase, TBase>) => any
                            : (t: any) => any
                    ),
                >,
            ) => TBase & FixedMethods<
                TRawMethods,
                TBase,
                TAccum,
                TExtraTypes & Record<TName, readonly TKey[]>,
            > & HiddenExtensionMethods & {
                __cleverbrush_extra_type_brand__?: TExtraTypes & Record<
                    TName,
                    readonly TKey[],
                >;
            } & (
                [TAccum] extends [never]
                    ? {}
                    : { __cleverbrush_method_literal_brand__?: TAccum }
            )
            : R extends { __cleverbrush_method_literal_brand__?: any }
                ? <const TName extends string & A[0]>(
                    name: TName,
                    ...rest: TailArgs<A>,
                ) => TBase & FixedMethods<
                    TRawMethods,
                    TBase,
                    TAccum
                    | TName,
                    TExtraTypes,
                > & HiddenExtensionMethods & {
                    __cleverbrush_method_literal_brand__?: TAccum | TName;
                } & (
                    [keyof TExtraTypes] extends [never]
                        ? {}
                        : { __cleverbrush_extra_type_brand__?: TExtraTypes }
                )
                : (
                    ...args: A,
                ) => TBase & FixedMethods<TRawMethods, TBase, TAccum, TExtraTypes> & HiddenExtensionMethods & (
                    [TAccum] extends [never]
                        ? {}
                        : { __cleverbrush_method_literal_brand__?: TAccum }
                ) & (
                    [keyof TExtraTypes] extends [never]
                        ? {}
                        : { __cleverbrush_extra_type_brand__?: TExtraTypes }
                )
        : TRawMethods[K]
}

Overrides extension method return types so they always return the full +extended builder type. This ensures extension methods preserve all other +extension methods through chaining (e.g. s.string().email().slug()).

+

The self-reference (FixedMethods appears in its own mapped return +types) is resolved lazily by TypeScript because the recursion sits +inside a function-return position within a conditional mapped type.

+

The optional third parameter TAccum accumulates literal string names +registered by methods whose raw return type includes +{ readonly [METHOD_LITERAL_BRAND]?: any }. Those methods are rewritten +as const-generic so the literal flows through; all other methods thread +the accumulator unchanged.

+

The optional fourth parameter TExtraTypes accumulates a +Record<name, readonly string[]> map contributed by methods whose raw +return type includes { readonly [EXTRA_TYPE_BRAND]?: any }. Those +methods are rewritten as const-generic for both the name and the keys +tuple so the mapping flows through; all other methods thread it unchanged.

+

For object-schema methods the accessor-form callback parameter is +automatically typed as PropertyDescriptorTree<TBase, TBase> when +TBase is an ObjectSchemaBuilder, giving callers IDE autocomplete over +the schema's own properties.

+

Type Parameters

  • TRawMethods
  • TBase
  • TAccum extends string = never
  • TExtraTypes extends Record<string, readonly string[]> = Record<never, never>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.HiddenExtensionMethods.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.HiddenExtensionMethods.html new file mode 100644 index 00000000..a077ef89 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.HiddenExtensionMethods.html @@ -0,0 +1,9 @@ +HiddenExtensionMethods | Libraries

Type Alias HiddenExtensionMethods

Intersected onto consumer-facing builder types to make withExtension +and getExtension uncallable (never). Using an intersection instead +of Omit preserves the class identity so extended builders remain +assignable to SchemaBuilder<any, any, any, any, any>.

+
type HiddenExtensionMethods = {
    getExtension: never;
    withExtension: never;
}
Index

Properties

getExtension: never

Extension-author only — use inside defineExtension().

+
withExtension: never

Extension-author only — use inside defineExtension().

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.InferType.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.InferType.html new file mode 100644 index 00000000..7ec53c54 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.InferType.html @@ -0,0 +1,6 @@ +InferType | Libraries

Type Alias InferType<T>

InferType: T extends {
    optimize: (
        ...args: any[],
    ) => { readonly [K in SchemaTypeBrand]: infer TOptimized };
}
    ? TOptimized
    : T extends { readonly [K in SchemaTypeBrand]: infer TType } ? TType : T

Infers the TypeScript type that a SchemaBuilder instance validates. +Takes into account type optimizations (via optimize()) and whether the schema is optional.

+

Type Parameters

  • T
const userSchema = object({ name: string(), age: number().optional() });
type User = InferType<typeof userSchema>;
// { name: string; age?: number } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.IntersectionSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.IntersectionSchemaValidationResult.html new file mode 100644 index 00000000..5ab175b4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.IntersectionSchemaValidationResult.html @@ -0,0 +1 @@ +IntersectionSchemaValidationResult | Libraries

Type Alias IntersectionSchemaValidationResult<T>

IntersectionSchemaValidationResult: ValidationResult<T>

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.MakeOptional.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.MakeOptional.html new file mode 100644 index 00000000..2f49c243 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.MakeOptional.html @@ -0,0 +1,3 @@ +MakeOptional | Libraries

Type Alias MakeOptional<T>

MakeOptional: { prop?: T }["prop"]

Utility type that makes a value T optional (i.e. T | undefined). +Used internally by InferType to represent optional schema fields.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.MethodLiteralBrandSymbol.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.MethodLiteralBrandSymbol.html new file mode 100644 index 00000000..7f1daf6f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.MethodLiteralBrandSymbol.html @@ -0,0 +1 @@ +MethodLiteralBrandSymbol | Libraries

Type Alias MethodLiteralBrandSymbol

MethodLiteralBrandSymbol: typeof METHOD_LITERAL_BRAND
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.NestedValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.NestedValidationResult.html new file mode 100644 index 00000000..9b8bbc47 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.NestedValidationResult.html @@ -0,0 +1,11 @@ +NestedValidationResult | Libraries

Type Alias NestedValidationResult<TSchema, TRootSchema, TParentPropertyDescriptor>

Used to represent a validation result for nested +objects/properties. Contains a list of errors and +the value that caused them.

+
type NestedValidationResult<
    TSchema,
    TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>,
    TParentPropertyDescriptor,
> = {
    errors: ReadonlyArray<string>;
    isValid: boolean;
    seenValue?: InferType<TSchema>;
    get descriptor(): PropertyDescriptorInner<
        TRootSchema,
        TSchema,
        TParentPropertyDescriptor,
    >;
}

Type Parameters

  • TSchema
  • TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>
  • TParentPropertyDescriptor
Index

Properties

Accessors

Properties

errors: ReadonlyArray<string>

A list of errors, empty if object satisfies a schema

+
isValid: boolean

Whether validation passed for this property and all of its children.

+
seenValue?: InferType<TSchema>

Value that property had and which caused error or errors

+

Accessors

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.NumberOneOfExtension.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.NumberOneOfExtension.html new file mode 100644 index 00000000..6d916a13 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.NumberOneOfExtension.html @@ -0,0 +1,3 @@ +NumberOneOfExtension | Libraries

Type Alias NumberOneOfExtension

NumberOneOfExtension: Pick<NumberBuiltinExtensions, "oneOf">

Subset of NumberBuiltinExtensions containing only the .oneOf() overloads. +Exported for backward compatibility.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ObjectSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ObjectSchemaValidationResult.html new file mode 100644 index 00000000..edc0610f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ObjectSchemaValidationResult.html @@ -0,0 +1,15 @@ +ObjectSchemaValidationResult | Libraries

Type Alias ObjectSchemaValidationResult<T, TRootSchema, TSchema>

ObjectSchemaValidationResult: Omit<ValidationResult<T>, "errors"> & {
    errors?: ValidationError[];
    getErrorsFor<TPropertySchema, TParentPropertyDescriptor>(
        selector?: (
            properties: PropertyDescriptorTree<TSchema, TRootSchema>,
        ) => PropertyDescriptor<
            TRootSchema,
            TPropertySchema,
            TParentPropertyDescriptor,
        >,
    ): TPropertySchema extends ObjectSchemaBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
    >
        ? PropertyValidationResult<
            TPropertySchema,
            TRootSchema,
            TParentPropertyDescriptor,
        >
        : NestedValidationResult<
            TPropertySchema,
            TRootSchema,
            TParentPropertyDescriptor,
        >;
    getInvalidProperties(): readonly NestedValidationResult<
        any,
        TRootSchema,
        any,
    >[];
}

Type Parameters

Type Declaration

  • Optionalerrors?: ValidationError[]

    A flat list of validation errors.

    +

    Use getErrorsFor() instead for +per-property error inspection with type-safe property selectors. The errors array on +ObjectSchemaBuilder validation results will be removed in a future major version.

    +
  • getErrorsFor: function
    • Returns a nested validation error for the property selected by the selector function. +This is the recommended way to inspect validation errors — it provides type-safe, +per-property error details including isValid, errors, and seenValue.

      +

      Prefer this over the deprecated errors array.

      +

      Type Parameters

      • TPropertySchema
      • TParentPropertyDescriptor

      Parameters

      Returns TPropertySchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
          ? PropertyValidationResult<
              TPropertySchema,
              TRootSchema,
              TParentPropertyDescriptor,
          >
          : NestedValidationResult<
              TPropertySchema,
              TRootSchema,
              TParentPropertyDescriptor,
          >

  • getInvalidProperties: function
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.OptionValidationResults.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.OptionValidationResults.html new file mode 100644 index 00000000..2cce5b45 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.OptionValidationResults.html @@ -0,0 +1,6 @@ +OptionValidationResults | Libraries

Type Alias OptionValidationResults<TOptions>

OptionValidationResults: {
    [K in keyof TOptions]: TOptions[K] extends UnionSchemaBuilder<
        infer UOptions extends
            readonly SchemaBuilder<any, any, any, any, any>[],
        any,
        any,
    >
        ? UnionSchemaValidationResult<InferType<TOptions[K]>, UOptions>
        : TOptions[K] extends ObjectSchemaBuilder<any, any, any, any>
            ? ObjectSchemaValidationResult<InferType<TOptions[K]>, TOptions[K]>
            : ValidationResult<InferType<TOptions[K]>>
}

Mapped tuple type that converts a tuple of SchemaBuilder options into +a tuple of their corresponding validation results. +Union schema options get UnionSchemaValidationResult with recursive +getNestedErrors navigation; object schema options get +ObjectSchemaValidationResult; other types get ValidationResult.

+

Type Parameters

  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ParseStringTemplateTag.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ParseStringTemplateTag.html new file mode 100644 index 00000000..2256a348 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ParseStringTemplateTag.html @@ -0,0 +1,7 @@ +ParseStringTemplateTag | Libraries

Type Alias ParseStringTemplateTag<TSchema>

ParseStringTemplateTag: (
    strings: TemplateStringsArray,
    ...selectors: (
        (
            tree: PropertyDescriptorTree<
                TSchema,
                TSchema,
                string
                | number
                | boolean
                | Date,
            >,
        ) => PropertyDescriptor<TSchema, any, any>
    )[],
) => ParseStringTemplateDefinition

The typed tagged-template function passed to the parseString +callback. Template expressions must be property-selector lambdas that +navigate the PropertyDescriptorTree of the object schema.

+

Only properties whose inferred type extends string | number | boolean | Date +are selectable — nested ObjectSchemaBuilder children are navigable but +not themselves endpoints.

+

Type Parameters

Type Declaration

    • (
          strings: TemplateStringsArray,
          ...selectors: (
              (
                  tree: PropertyDescriptorTree<
                      TSchema,
                      TSchema,
                      string
                      | number
                      | boolean
                      | Date,
                  >,
              ) => PropertyDescriptor<TSchema, any, any>
          )[],
      ): ParseStringTemplateDefinition
    • Parameters

      • strings: TemplateStringsArray
      • ...selectors: (
            (
                tree: PropertyDescriptorTree<
                    TSchema,
                    TSchema,
                    string
                    | number
                    | boolean
                    | Date,
                >,
            ) => PropertyDescriptor<TSchema, any, any>
        )[]

      Returns ParseStringTemplateDefinition

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptor.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptor.html new file mode 100644 index 00000000..618f5dcb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptor.html @@ -0,0 +1,5 @@ +PropertyDescriptor | Libraries

Type Alias PropertyDescriptor<TRootSchema, TPropertySchema, TParentPropertyDescriptor, TPropertyKey>

A wrapper object keyed by SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR that +holds a PropertyDescriptorInner for a particular property within +an object schema. Used to get/set property values on validated objects.

+
type PropertyDescriptor<
    TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>,
    TPropertySchema,
    TParentPropertyDescriptor,
    TPropertyKey extends string = string,
> = {
    "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": PropertyDescriptorInner<
        TRootSchema,
        TPropertySchema,
        TParentPropertyDescriptor,
        TPropertyKey,
    >;
}

Type Parameters

  • TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>
  • TPropertySchema
  • TParentPropertyDescriptor
  • TPropertyKey extends string = string
Index

Properties

"[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": PropertyDescriptorInner<
    TRootSchema,
    TPropertySchema,
    TParentPropertyDescriptor,
    TPropertyKey,
>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptorInner.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptorInner.html new file mode 100644 index 00000000..a3c4a512 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptorInner.html @@ -0,0 +1,40 @@ +PropertyDescriptorInner | Libraries

Type Alias PropertyDescriptorInner<TSchema, TPropertySchema, TParentPropertyDescriptor, TPropertyKey>

type PropertyDescriptorInner<
    TSchema extends ObjectSchemaBuilder<any, any, any, any, any>,
    TPropertySchema,
    TParentPropertyDescriptor,
    TPropertyKey extends string = string,
> = {
    getSchema: () => TPropertySchema;
    getValue: (
        obj: InferType<TSchema>,
    ) => { success: boolean; value?: InferType<TPropertySchema> };
    parent: PropertyDescriptorInnerFromPropertyDescriptor<
        TParentPropertyDescriptor,
    >;
    propertyName: TPropertyKey
    | undefined;
    setValue: (
        obj: InferType<TSchema>,
        value: InferType<TPropertySchema>,
        options?: PropertySetterOptions,
    ) => boolean;
    toJsonPointer: () => string;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any>
  • TPropertySchema
  • TParentPropertyDescriptor
  • TPropertyKey extends string = string
Index

Properties

getSchema: () => TPropertySchema

Gets the schema for the property described by the property descriptor.

+

Type Declaration

getValue: (
    obj: InferType<TSchema>,
) => { success: boolean; value?: InferType<TPropertySchema> }

Gets the value of the property from the object.

+

Type Declaration

    • (
          obj: InferType<TSchema>,
      ): { success: boolean; value?: InferType<TPropertySchema> }
    • Parameters

      Returns { success: boolean; value?: InferType<TPropertySchema> }

      an object containing a value and success properties. value is the value of the property +if it was found in the object, success is a boolean value indicating if the property was found in the object.

      +
parent: PropertyDescriptorInnerFromPropertyDescriptor<TParentPropertyDescriptor>
propertyName: TPropertyKey | undefined

The name of this property within its parent object, or undefined +for the root descriptor.

+

When the property was created from a PropertyDescriptorTree leaf the +type narrows to the literal key string (e.g. 'id'), enabling +accessor-function-based column inference in query builders.

+

The literal property name, or string for root/unknown descriptors.

+
setValue: (
    obj: InferType<TSchema>,
    value: InferType<TPropertySchema>,
    options?: PropertySetterOptions,
) => boolean

Sets a new value to the property. If the process was successful, +the method returns true, otherwise false. +It can return false if the property could not be set to the object +which can happen if the setValue method is called with an object +which does not comply with the schema. +for example, if you have a schema and property descriptopr like this:

+
const schema = object({
name: string(),
address: object({
city: string(),
country: string()
}),
id: number()
});

const addressCityDescriptor = object.getPropertiesFor(schema).address.city; +
+ +

And then you try to set a new value to the address.city property on the object +which does not have address property:

+
const obj = {
name: 'Leo'
};

const success = addressCityDescriptor.setValue(obj, 'Venyov');
// success === false +
+ +

Type Declaration

toJsonPointer: () => string

Returns a JSON Pointer (RFC 6901) string representing this +property's path from the root descriptor.

+

Property names are escaped per RFC 6901 (~~0, /~1). +The root descriptor returns an empty string ('').

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptorTree.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptorTree.html new file mode 100644 index 00000000..af6eb68a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertyDescriptorTree.html @@ -0,0 +1,3 @@ +PropertyDescriptorTree | Libraries

Type Alias PropertyDescriptorTree<TSchema, TRootSchema, TAssignableTo, TParentPropertyDescriptor>

PropertyDescriptorTree: PropertyDescriptor<
    TRootSchema,
    TSchema,
    TParentPropertyDescriptor,
> & (
    TSchema extends ObjectSchemaBuilder<infer TProperties, any, any>
        ? {
            [K in keyof TProperties]: TProperties[K] extends ObjectSchemaBuilder<
                any,
                any,
                any,
            >
                ? PropertyDescriptorTree<
                    TProperties[K],
                    TRootSchema,
                    any,
                    PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                >
                : TProperties[K] extends ExternSchemaBuilder<
                    any,
                    any,
                    any,
                    any,
                    any,
                    any,
                    infer TExternResult,
                >
                    ? PropertyDescriptor<
                        TRootSchema,
                        TProperties[K],
                        PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                        K & string,
                    > & ExternOutputPropertyDescriptors<
                        TExternResult,
                        TRootSchema,
                        PropertyDescriptor<
                            TRootSchema,
                            TProperties[K],
                            PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                            K & string,
                        >,
                    >
                    : TProperties[K] extends ArraySchemaBuilder<
                        infer TArrayElement,
                        any,
                        any,
                    >
                        ? TArrayElement extends ObjectSchemaBuilder<
                            any,
                            any,
                            any,
                            any,
                            any,
                        >
                            ? PropertyDescriptor<
                                TRootSchema,
                                TProperties[K],
                                PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                                K & string,
                            >
                            : InferType<(...)[(...)]> extends TAssignableTo
                                ? PropertyDescriptor<
                                    TRootSchema,
                                    (...)[(...)],
                                    PropertyDescriptor<(...), (...), (...)>,
                                    (...) & (...),
                                >
                                : never
                        : InferType<TProperties[K]> extends TAssignableTo
                            ? PropertyDescriptor<
                                TRootSchema,
                                TProperties[K],
                                PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                                K & string,
                            >
                            : never
        }
        : never
)

A tree of property descriptors for the schema. +Has a possibility to filter properties by the type (TAssignableTo type parameter).

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertySetterOptions.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertySetterOptions.html new file mode 100644 index 00000000..3886baed --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.PropertySetterOptions.html @@ -0,0 +1,28 @@ +PropertySetterOptions | Libraries

Type Alias PropertySetterOptions

Describes a property in a schema. And gives you +a possibility to access property value and set it. +suppose you have a schema like this:

+
const schema = object({
name: string(),
address: object({
city: string(),
country: string()
}),
id: number()
}); +
+ +

then you can get a property descriptor for the address.city property +like this:

+
const addressCityDescriptor = object.getPropertiesFor(schema).address.city;
+
+ +

And then you can use it to get and set the value of this property having the object:

+
const obj = {
name: 'Leo',
address: {
city: 'Kozelsk',
country: 'Russia'
},
id: 123
};

const success = addressCityDescriptor.setValue(obj, 'Venyov');
// this returns you a boolean value indicating if the value was set successfully +
+ +
type PropertySetterOptions = {
    createMissingStructure?: boolean;
}
Index

Properties

createMissingStructure?: boolean

If set to true, the method will create missing structure +in the object to set the value. For example, if you have a schema +and property descriptor like this:

+
const schema = object({
address: object({
city: string(),
country: string()
}),
});
const addressCityDescriptor = object.getPropertiesFor(schema).address.city; +
+ +

And then you try to set a new value to the address.city property on the object +which does not have address property:

+
const obj = {
name: 'Leo'
};
const success = addressCityDescriptor.setValue(obj, 'Venyov', { createMissingStructure: true });
// success === true
// obj === {
// name: 'Leo',
// address: {
// city: 'Venyov'
// }
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.RecordSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.RecordSchemaValidationResult.html new file mode 100644 index 00000000..6139fec8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.RecordSchemaValidationResult.html @@ -0,0 +1,34 @@ +RecordSchemaValidationResult | Libraries

Type Alias RecordSchemaValidationResult<TResult, TValueSchema>

RecordSchemaValidationResult: ValidationResult<TResult> & {
    getErrorsFor(): RecordRootValidationResult<TResult>;
    getErrorsFor(key: string): RecordKeyValidationResult<TResult, TValueSchema>;
    getNestedErrors(): Record<
        string,
        ValidationResult<InferType<TValueSchema>>,
    >;
}

Validation result type returned by RecordSchemaBuilder.validate().

+

Extends ValidationResult with:

+
    +
  • getNestedErrors() — a per-key map of ValidationResult objects.
  • +
  • getErrorsFor() — root-level errors for the record container itself.
  • +
  • getErrorsFor(key) — errors, seen value, and descriptor for a specific key.
  • +
+

Type Parameters

  • TResult
  • TValueSchema extends SchemaBuilder<any, any, any, any, any>

Type Declaration

  • getErrorsFor: function
    • Returns root-level errors for the record container itself +(e.g. "object expected" when a non-object value is passed, +or errors from custom validators added to the record schema).

      +

      Returns RecordRootValidationResult<TResult>

      const schema = record(string(), number());
      const root = schema.validate(42 as any).getErrorsFor();
      // root.errors[0] === 'object expected'
      // root.isValid === false +
      + +
    • Returns the validation result for the entry with the given key, +including error messages, the seen value, and a descriptor for +accessing and modifying the value at that key.

      +

      If the key was not reached during validation (e.g. an earlier key +already failed in stop-on-first-error mode), an empty result with +isValid: true and no errors is returned.

      +

      Parameters

      • key: string

        the key whose validation result to retrieve

        +

      Returns RecordKeyValidationResult<TResult, TValueSchema>

      const schema = record(string(), number().min(0));
      const result = schema.validate(
      { a: 5, b: -2 },
      { doNotStopOnFirstError: true }
      );

      const bErrors = result.getErrorsFor('b');
      // bErrors.isValid === false
      // bErrors.errors[0] === 'the value must be >= 0'
      // bErrors.seenValue === -2
      // bErrors.descriptor.key === 'b'
      // bErrors.descriptor.getSchema() === valueSchema +
      + +
  • getNestedErrors: function
    • Returns per-key validation results as a plain object.

      +

      Each key in the returned object corresponds to a key in the input that +failed validation (in doNotStopOnFirstError mode) or the single +first failing key (in the default stop-on-first-error mode). Keys that +passed are not included.

      +

      Returns Record<string, ValidationResult<InferType<TValueSchema>>>

      Prefer getErrorsFor for a richer per-entry result +that also includes a descriptor and seenValue.

      +
      const schema = record(string(), number().positive());
      const result = schema.validate(
      { a: 1, b: -2, c: 'oops' },
      { doNotStopOnFirstError: true }
      );

      if (!result.valid) {
      const nested = result.getNestedErrors();
      console.log(nested['b']); // ValidationResult for key 'b'
      console.log(nested['c']); // ValidationResult for key 'c'
      } +
      + +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.SchemaPropertySelector.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.SchemaPropertySelector.html new file mode 100644 index 00000000..abd564ab --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.SchemaPropertySelector.html @@ -0,0 +1,5 @@ +SchemaPropertySelector | Libraries

Type Alias SchemaPropertySelector<TSchema, TPropertySchema, TAssignableTo, TParentPropertyDescriptor>

A callback function to select properties from the schema. +Normally it's provided by the user to select property descriptors +from the schema for the further usage. e.g. to select source and destination +properties for object mappings

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TPropertySchema extends SchemaBuilder<any, any, any, any, any>
  • TAssignableTo = any
  • TParentPropertyDescriptor = undefined
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.SchemaTypeBrand.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.SchemaTypeBrand.html new file mode 100644 index 00000000..1aaae9d1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.SchemaTypeBrand.html @@ -0,0 +1 @@ +SchemaTypeBrand | Libraries

Type Alias SchemaTypeBrandInternal

SchemaTypeBrand: typeof __type
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.InferInput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.InferInput.html new file mode 100644 index 00000000..2bf25f97 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries

Infers the input type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.InferOutput.html new file mode 100644 index 00000000..3f355054 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries

Infers the output type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.Result.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.Result.html new file mode 100644 index 00000000..80195c96 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardSchemaV1.Result.html @@ -0,0 +1,2 @@ +Result | Libraries

The result interface of the validate function.

+

Type Parameters

  • Output
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardTypedV1.InferInput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardTypedV1.InferInput.html new file mode 100644 index 00000000..087e8143 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardTypedV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries
InferInput: NonNullable<Schema["~standard"]["types"]>["input"]

Infers the input type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardTypedV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardTypedV1.InferOutput.html new file mode 100644 index 00000000..aade4f54 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StandardTypedV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries

Type Alias InferOutput<Schema>

InferOutput: NonNullable<Schema["~standard"]["types"]>["output"]

Infers the output type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StringOneOfExtension.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StringOneOfExtension.html new file mode 100644 index 00000000..85c27a12 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.StringOneOfExtension.html @@ -0,0 +1,3 @@ +StringOneOfExtension | Libraries

Type Alias StringOneOfExtension

StringOneOfExtension: Pick<StringBuiltinExtensions, "oneOf">

Subset of StringBuiltinExtensions containing only the .oneOf() overloads. +Exported for backward compatibility.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.TupleElementValidationResults.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.TupleElementValidationResults.html new file mode 100644 index 00000000..d4c5ba10 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.TupleElementValidationResults.html @@ -0,0 +1,6 @@ +TupleElementValidationResults | Libraries

Type Alias TupleElementValidationResults<TElements>

TupleElementValidationResults: {
    [K in keyof TElements]: TElements[K] extends UnionSchemaBuilder<
        infer UOptions extends
            readonly SchemaBuilder<any, any, any, any, any>[],
        any,
        any,
    >
        ? UnionSchemaValidationResult<InferType<TElements[K]>, UOptions>
        : TElements[K] extends ObjectSchemaBuilder<any, any, any, any, any>
            ? ObjectSchemaValidationResult<InferType<TElements[K]>, TElements[K]>
            : ValidationResult<InferType<TElements[K]>>
}

Maps a tuple of schema builders to a tuple of their per-position +validation result types. +Union schema elements get UnionSchemaValidationResult, +object schema elements get ObjectSchemaValidationResult, +other types get ValidationResult.

+

Type Parameters

  • TElements extends readonly SchemaBuilder<any, any, any, any, any>[]
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.TupleSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.TupleSchemaValidationResult.html new file mode 100644 index 00000000..93422d12 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.TupleSchemaValidationResult.html @@ -0,0 +1,9 @@ +TupleSchemaValidationResult | Libraries

Type Alias TupleSchemaValidationResult<TResult, TElements>

TupleSchemaValidationResult: ValidationResult<TResult> & {
    getNestedErrors(): TupleElementValidationResults<TElements> & NestedValidationResult<
        any,
        any,
        any,
    >;
}

Validation result type returned by TupleSchemaBuilder.validate(). +Extends ValidationResult with getNestedErrors for root-level tuple +errors and per-position validation results.

+

Type Parameters

  • TResult
  • TElements extends readonly SchemaBuilder<any, any, any, any, any>[]

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.UnionSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.UnionSchemaValidationResult.html new file mode 100644 index 00000000..9006b500 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.UnionSchemaValidationResult.html @@ -0,0 +1,11 @@ +UnionSchemaValidationResult | Libraries

Type Alias UnionSchemaValidationResult<T, TOptions>

UnionSchemaValidationResult: ValidationResult<T> & {
    getNestedErrors(): OptionValidationResults<TOptions> & NestedValidationResult<
        any,
        any,
        any,
    >;
}

Validation result type returned by UnionSchemaBuilder.validate(). +Extends ValidationResult with:

+
    +
  • getNestedErrors for root-level union errors and per-branch validation results
  • +
+

Type Parameters

  • T
  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationError.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationError.html new file mode 100644 index 00000000..4af6624e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationError.html @@ -0,0 +1,14 @@ +ValidationError | Libraries

Type Alias ValidationError

Represents a single validation error with a human-readable error message.

+

When returned from an object-level validator (via addValidator), +the optional property selector can route the error to a specific property +so that ObjectSchemaValidationResult.getErrorsFor | getErrorsFor() reports it +on that property rather than only on the root object.

+
.addValidator((v) => ({
valid: false,
errors: [{
message: 'Passwords do not match',
property: (t) => t.confirmPassword
}]
})) +
+ +
type ValidationError = {
    message: string;
    property?: (tree: any) => any;
}
Index

Properties

Properties

message: string
property?: (tree: any) => any

Optional property selector that targets this error to a specific +property of the validated object. Uses the same selector signature +as getErrorsFor() and react-form's forProperty.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationErrorMessageProvider.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationErrorMessageProvider.html new file mode 100644 index 00000000..1555c935 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationErrorMessageProvider.html @@ -0,0 +1,5 @@ +ValidationErrorMessageProvider | Libraries

Type Alias ValidationErrorMessageProvider<TSchema>

ValidationErrorMessageProvider:
    | string
    | (
        (
            seenValue: InferType<TSchema>,
            schema: TSchema,
        ) => string | Promise<string>
    )

Type of the function that provides a validation error message for +the given seenValue and schema. Can be a string or a function +returning a string or a promise of a string. +Should be used to provide a custom validation error message.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationResult.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationResult.html new file mode 100644 index 00000000..92382368 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_schema.ValidationResult.html @@ -0,0 +1,7 @@ +ValidationResult | Libraries

Type Alias ValidationResult<T>

type ValidationResult<T> = {
    errors?: ValidationError[];
    object?: T;
    valid: boolean;
}

Type Parameters

  • T
Index

Properties

Properties

errors?: ValidationError[]
object?: T

Contains validated object. Can be different (if there are any preprocessors in the schema) from object +passed to the validate method of the SchemaBuilder class.

+
valid: boolean

If true - object satisfies schema

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server-openapi.AsyncApiDocument.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server-openapi.AsyncApiDocument.html new file mode 100644 index 00000000..e1550503 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server-openapi.AsyncApiDocument.html @@ -0,0 +1,3 @@ +AsyncApiDocument | Libraries
AsyncApiDocument: Record<string, unknown>

A generated AsyncAPI 3.0 document. Typed as a plain object map to allow +extension fields without requiring a full AsyncAPI type library.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server-openapi.OpenApiDocument.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server-openapi.OpenApiDocument.html new file mode 100644 index 00000000..f7bb0eb9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server-openapi.OpenApiDocument.html @@ -0,0 +1,3 @@ +OpenApiDocument | Libraries
OpenApiDocument: Record<string, unknown>

A generated OpenAPI 3.1 document. Typed as a plain object map to allow +any extension fields without requiring a full OpenAPI type library.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ActionContext.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ActionContext.html new file mode 100644 index 00000000..9592d4b7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ActionContext.html @@ -0,0 +1,4 @@ +ActionContext | Libraries

Type Alias ActionContext<E>

ActionContext: E extends EndpointBuilder<
    infer TParams,
    infer TBody,
    infer TQuery,
    infer THeaders,
    any,
    infer TPrincipal,
    any,
    any,
    any,
    infer TUpload,
>
    ? Simplify<
        ActionContextParts<
            TParams,
            TBody,
            TQuery,
            THeaders,
            TPrincipal,
            TUpload,
        >,
    >
    : never

The fully-typed argument object passed to endpoint handlers.

+

The shape is inferred from the EndpointBuilder chain — only the keys +actually configured (body, query, headers, params, principal) are present.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..AllowedResponseReturn.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..AllowedResponseReturn.html new file mode 100644 index 00000000..563141b3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..AllowedResponseReturn.html @@ -0,0 +1,10 @@ +AllowedResponseReturn | Libraries

Type Alias AllowedResponseReturn<TResponses>

AllowedResponseReturn:
    | {
        [K in keyof TResponses & number]: TResponses[K] extends null
            ? K extends 204 ? NoContentResult : StatusCodeResult<K>
            : JsonResult<K, TResponses[K]>
    }[keyof TResponses & number]
    | (
        200 extends keyof TResponses
            ? TResponses[200] extends null ? never : TResponses[200]
            : never
    )
    | FileResult
    | StreamResult
    | ContentResult
    | RedirectResult

The union of permitted return values for a handler whose endpoint +declared .responses(). Each member corresponds to one declared code:

+
    +
  • null schema (e.g. 204) → NoContentResult for 204, StatusCodeResult<K> otherwise
  • +
  • Non-null schema for code 200 → also allows a plain object (treated as 200 by the server)
  • +
  • Non-null schema for other codes → JsonResult<K, Body>
  • +
+

FileResult, StreamResult, ContentResult, and RedirectResult are always +permitted as an escape hatch for non-JSON responses.

+

Type Parameters

  • TResponses extends Record<number, any>
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..EndpointMetadataDescriptors.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..EndpointMetadataDescriptors.html new file mode 100644 index 00000000..5d0aef16 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..EndpointMetadataDescriptors.html @@ -0,0 +1,7 @@ +EndpointMetadataDescriptors | Libraries

Type Alias EndpointMetadataDescriptors

Optional OpenAPI metadata fields accepted by createEndpoint / createEndpoints.

+
type EndpointMetadataDescriptors = {
    deprecated?: boolean;
    description?: string;
    operationId?: string;
    summary?: string;
    tags?: string[];
}
Index

Properties

deprecated?: boolean
description?: string
operationId?: string
summary?: string
tags?: string[]
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..Handler.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..Handler.html new file mode 100644 index 00000000..a6470c1a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..Handler.html @@ -0,0 +1 @@ +Handler | Libraries

Type Alias Handler<E>

Handler: HasKeys<ServiceSchemas<E>> extends true
    ? (
        arg: ActionContext<E>,
        services: Simplify<InferServices<ServiceSchemas<E>>>,
    ) => HandlerReturn<E> | Promise<HandlerReturn<E>>
    : (arg: ActionContext<E>) => HandlerReturn<E> | Promise<HandlerReturn<E>>

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..HandlerEntry.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..HandlerEntry.html new file mode 100644 index 00000000..390930cb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..HandlerEntry.html @@ -0,0 +1,4 @@ +HandlerEntry | Libraries

Type Alias HandlerEntry<E>

HandlerEntry: Handler<E> | { handler: Handler<E>; middlewares?: Middleware[] }

A single handler entry in a HandlerMap.

+

Either a bare handler function or an object with a handler function and +optional per-endpoint middlewares.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..HandlerMap.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..HandlerMap.html new file mode 100644 index 00000000..032238e3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..HandlerMap.html @@ -0,0 +1,9 @@ +HandlerMap | Libraries

Type Alias HandlerMap<TEndpoints>

HandlerMap: {
    [G in keyof TEndpoints]: {
        [E in keyof TEndpoints[G]]: TEndpoints[G][E] extends AnySubscriptionBuilder
            ? SubscriptionHandlerEntry<TEndpoints[G][E]>
            : TEndpoints[G][E] extends AnyEndpoint
                ? HandlerEntry<TEndpoints[G][E]>
                : never
    }
}

A compile-time complete mapping from an endpoint group structure to +handler entries. Every endpoint key in every group must have a +corresponding HandlerEntry — omitting one is a type error.

+

Subscription endpoints (created via endpoint.subscription()) are +mapped to SubscriptionHandlerEntry instead of HandlerEntry.

+

Type Parameters

  • TEndpoints

    A record of groups, each a record of endpoint +builders. Typically the return type of defineApi() with server-side +extensions applied.

    +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..Middleware.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..Middleware.html new file mode 100644 index 00000000..f5c0436b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..Middleware.html @@ -0,0 +1,7 @@ +Middleware | Libraries

Type Alias Middleware

Middleware: (
    context: RequestContext,
    next: () => Promise<void>,
) => Promise<void>

A middleware function in the request pipeline.

+

Call next() to pass control to the next middleware or the endpoint +handler. If next() is not called, the pipeline short-circuits.

+

Type Declaration

    • (context: RequestContext, next: () => Promise<void>): Promise<void>
    • Parameters

      Returns Promise<void>

const logger: Middleware = async (ctx, next) => {
console.log(ctx.method, ctx.url.pathname);
await next();
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..PropertyRefTree.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..PropertyRefTree.html new file mode 100644 index 00000000..626a984d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..PropertyRefTree.html @@ -0,0 +1,7 @@ +PropertyRefTree | Libraries

Type Alias PropertyRefTree<T>

PropertyRefTree: { readonly [K in keyof T]-?: PropertyRefTree<T[K]> }

Lightweight recursive property reference tree for type-safe runtime +expression building in .links() and .callbacks().

+

At runtime the actual value is a PropertyDescriptorTree from +ObjectSchemaBuilder.getPropertiesFor(), which provides toJsonPointer() +and the SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR marker used by the OpenAPI +generator to resolve path expressions automatically.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ResponsesOf.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ResponsesOf.html new file mode 100644 index 00000000..9b4151b5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ResponsesOf.html @@ -0,0 +1,3 @@ +ResponsesOf | Libraries

Type Alias ResponsesOf<E>

ResponsesOf: E extends EndpointBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    infer TResponses,
    any,
>
    ? TResponses
    : never

Extracts the TResponses map from an EndpointBuilder type. +TResponses is a Record<number, BodyType> inferred from .responses().

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ScopedEndpointFactory.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ScopedEndpointFactory.html new file mode 100644 index 00000000..8ee1a4dc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..ScopedEndpointFactory.html @@ -0,0 +1,8 @@ +ScopedEndpointFactory | Libraries

Type Alias ScopedEndpointFactory<TRoles>

ScopedEndpointFactory: ScopedEndpointFactoryMethods<undefined, TRoles> & {
    authorize<TSchema extends SchemaBuilder<any, any, any, any, any>>(
        principalSchema: TSchema,
        ...roles: TRoles[],
    ): ScopedEndpointFactoryMethods<InferType<TSchema>, TRoles>;
    authorize(
        ...roles: TRoles[],
    ): ScopedEndpointFactoryMethods<unknown, TRoles>;
    public(): ScopedEndpointFactoryMethods<TRoles>;
}

Type Parameters

  • TRoles extends string = string

Type Declaration

  • authorize: function
    • Returns a new resource factory where all endpoints inherit +the given authorization requirements.

      +
        +
      • authorize(principalSchema, ...roles) — typed principal
      • +
      • authorize(...roles) — untyped principal
      • +
      +

      Type Parameters

      Parameters

      • principalSchema: TSchema
      • ...roles: TRoles[]

      Returns ScopedEndpointFactoryMethods<InferType<TSchema>, TRoles>

    • Parameters

      Returns ScopedEndpointFactoryMethods<unknown, TRoles>

  • public: function
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionContext.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionContext.html new file mode 100644 index 00000000..999510be --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionContext.html @@ -0,0 +1,5 @@ +SubscriptionContext | Libraries

Type Alias SubscriptionContext<E>

SubscriptionContext: E extends SubscriptionBuilder<
    infer TParams,
    infer TQuery,
    infer THeaders,
    any,
    infer TPrincipal,
    any,
    infer TIncoming,
    any,
>
    ? Simplify<
        SubscriptionContextParts<
            TParams,
            TQuery,
            THeaders,
            TPrincipal,
            TIncoming,
        >,
    >
    : never

The fully-typed argument object passed to subscription handlers.

+

The shape is inferred from the SubscriptionBuilder chain — only the keys +actually configured (query, headers, params, principal, incoming) are present. +Always includes context (RequestContext) and signal (AbortSignal).

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionHandler.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionHandler.html new file mode 100644 index 00000000..d27da7ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionHandler.html @@ -0,0 +1,7 @@ +SubscriptionHandler | Libraries

Type Alias SubscriptionHandler<E>

SubscriptionHandler: HasKeys<SubscriptionServiceSchemas<E>> extends true
    ? (
        arg: SubscriptionContext<E>,
        services: Simplify<InferServices<SubscriptionServiceSchemas<E>>>,
    ) => AsyncGenerator<OutgoingType<E>>
    : (arg: SubscriptionContext<E>) => AsyncGenerator<OutgoingType<E>>

The handler function type inferred from a SubscriptionBuilder.

+

Must be an async generator that yields outgoing events. When the endpoint +has injected services, the handler receives a second services argument.

+

Type Parameters

  • E
const handler: SubscriptionHandler<typeof chatEndpoint> =
async function* ({ incoming, principal }) {
yield tracked('welcome', { text: 'Hello!' });
for await (const msg of incoming) {
yield { text: `${principal.name}: ${msg.text}` };
}
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionHandlerEntry.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionHandlerEntry.html new file mode 100644 index 00000000..6b0ccd7e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server..SubscriptionHandlerEntry.html @@ -0,0 +1,4 @@ +SubscriptionHandlerEntry | Libraries

Type Alias SubscriptionHandlerEntry<E>

SubscriptionHandlerEntry:
    | SubscriptionHandler<E>
    | { handler: SubscriptionHandler<E>; middlewares?: Middleware[] }

A single handler entry for a subscription in a handler map.

+

Either a bare handler function or an object with a handler function +and optional per-subscription middlewares.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.ApiContract.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.ApiContract.html new file mode 100644 index 00000000..e2052ee3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.ApiContract.html @@ -0,0 +1,7 @@ +ApiContract | Libraries
ApiContract: Record<string, ApiGroup>

A typed API contract with one level of grouping.

+

Each key is a group name and each value is an ApiGroup — a +record of named endpoints.

+
const contract: ApiContract = {
todos: { list: todosResource.get(), create: todosResource.post() },
auth: { login: endpoint.post('/api/auth/login') },
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.ApiGroup.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.ApiGroup.html new file mode 100644 index 00000000..895dc500 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.ApiGroup.html @@ -0,0 +1,3 @@ +ApiGroup | Libraries
ApiGroup: Record<
    string,
    | EndpointBuilder<any, any, any, any, any, any, any, any, any>
    | SubscriptionBuilder<any, any, any, any, any, any, any, any>,
>

A record of named EndpointBuilder or SubscriptionBuilder +instances that form a single logical API group (e.g. "todos", "auth", "live").

+
diff --git a/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.MergedContracts.html b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.MergedContracts.html new file mode 100644 index 00000000..99f0f596 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/types/_cleverbrush_server.contract.MergedContracts.html @@ -0,0 +1,9 @@ +MergedContracts | Libraries

Type Alias MergedContracts<A, B>

MergedContracts: {
    readonly [K in keyof A | keyof B]: K extends keyof A
        ? K extends keyof B ? A[K] & B[K] : A[K]
        : K extends keyof B ? B[K] : never
}

Computes the merged type of two ApiContract objects.

+
    +
  • Groups that only exist in A are kept as-is.
  • +
  • Groups that only exist in B are kept as-is.
  • +
  • Groups whose key appears in both A and B have their endpoint maps +intersected (A[K] & B[K]), making all endpoints from both sources +visible on the merged group.
  • +
+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client..PER_CALL_OPTIONS.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client..PER_CALL_OPTIONS.html new file mode 100644 index 00000000..707c5b82 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client..PER_CALL_OPTIONS.html @@ -0,0 +1,6 @@ +PER_CALL_OPTIONS | Libraries

Variable PER_CALL_OPTIONSConst

PER_CALL_OPTIONS: unique symbol = ...

Symbol used to attach per-call middleware overrides to a RequestInit +object. Middlewares can read their own options from this property.

+
// Inside a middleware:
const opts = getPerCallOptions<MyOptions>(init, 'myMiddleware'); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client.optimistic-update.OPTIMISTIC_MUTATION_ID.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client.optimistic-update.OPTIMISTIC_MUTATION_ID.html new file mode 100644 index 00000000..f8ef1d38 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client.optimistic-update.OPTIMISTIC_MUTATION_ID.html @@ -0,0 +1 @@ +OPTIMISTIC_MUTATION_ID | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client.react.QUERY_KEY_PREFIX.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client.react.QUERY_KEY_PREFIX.html new file mode 100644 index 00000000..bc54ed6a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_client.react.QUERY_KEY_PREFIX.html @@ -0,0 +1,4 @@ +QUERY_KEY_PREFIX | Libraries

Variable QUERY_KEY_PREFIXConst

QUERY_KEY_PREFIX: "@cleverbrush" = ...

Prefix used for all query keys generated by @cleverbrush/react-query.

+

This ensures keys do not collide with other TanStack Query consumers +in the same application.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_deep.deepExtend.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_deep.deepExtend.html new file mode 100644 index 00000000..3497711a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_deep.deepExtend.html @@ -0,0 +1,9 @@ +deepExtend | Libraries

Variable deepExtendConst

deepExtend: <T extends unknown[]>(...args: T) => Merge<T> = ...

Deep-merges multiple objects into one. Later values override earlier ones; +nested objects are merged recursively rather than replaced.

+

Type Declaration

    • <T extends unknown[]>(...args: T): Merge<T>
    • Type Parameters

      • T extends unknown[]

      Parameters

      • ...args: T

        Two or more non-null objects to merge.

        +

      Returns Merge<T>

      A new object containing the deep-merged result.

      +
const a = { x: 1, nested: { a: true } };
const b = { y: 2, nested: { b: false } };
const result = deepExtend(a, b);
// { x: 1, y: 2, nested: { a: true, b: false } } +
+ +

If no arguments are provided or any argument is not a non-null object.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..EXTRA_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..EXTRA_TYPE_BRAND.html new file mode 100644 index 00000000..a27d1eb4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..EXTRA_TYPE_BRAND.html @@ -0,0 +1,18 @@ +EXTRA_TYPE_BRAND | Libraries

Variable EXTRA_TYPE_BRANDConst

EXTRA_TYPE_BRAND: "__cleverbrush_extra_type_brand__"

Generic accumulator brand for extension methods that want to thread +a Record<name, readonly string[]> map through the builder chain.

+

Extension authors can declare a method's return type as +this & { readonly [EXTRA_TYPE_BRAND]?: { [name]: TKeys } } +and FixedMethods will automatically:

+
    +
  • Make the first argument const-generic (to capture the literal name).
  • +
  • Make the second argument const-generic when it is a readonly string[] +tuple (to capture the literal key list).
  • +
  • Accumulate both into the 4th TExtraTypes parameter of FixedMethods +so the information survives subsequent method calls on the same builder.
  • +
+

This is deliberately projection-agnostic — any extension that follows the +(name: string, data: readonly string[] | function) signature convention +can use it. Projection-specific semantics (e.g. PROJECTION_BRAND) live +in the consuming library, not here.

+

FixedMethods for how the accumulation works.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..MAPPERS.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..MAPPERS.html new file mode 100644 index 00000000..090d0a31 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..MAPPERS.html @@ -0,0 +1,9 @@ +MAPPERS | Libraries

Variable MAPPERSConst

MAPPERS: Record<string, (value: any) => any> = ...

Built-in named value mapper functions.

+

Each entry maps a string key to a transformation function. Pass the key as +the mapper argument to mapValue instead of a custom function.

+

Currently available:

+
    +
  • date_from_json — converts a JSON date string (string | null) to a +JavaScript Date object (or passes through falsy values unchanged).
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..METHOD_LITERAL_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..METHOD_LITERAL_BRAND.html new file mode 100644 index 00000000..a7db37e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema..METHOD_LITERAL_BRAND.html @@ -0,0 +1,9 @@ +METHOD_LITERAL_BRAND | Libraries

Variable METHOD_LITERAL_BRANDConst

METHOD_LITERAL_BRAND: "__cleverbrush_method_literal_brand__"

Unique string-literal brand key used by FixedMethods to detect +extension methods whose first-argument literal should be accumulated in the +return type.

+

Declare the return type of any extension method as +this & { readonly [METHOD_LITERAL_BRAND]?: N } (where N extends string) +and FixedMethods will automatically make it generic so the literal name +flows through the type system and accumulates across multiple calls.

+

This powers scope-name autocomplete in SchemaQueryBuilder.scoped().

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.COMPOSITE_PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.COMPOSITE_PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..5a01a126 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.COMPOSITE_PRIMARY_KEY_BRAND.html @@ -0,0 +1,3 @@ +COMPOSITE_PRIMARY_KEY_BRAND | Libraries

Variable COMPOSITE_PRIMARY_KEY_BRANDConst

COMPOSITE_PRIMARY_KEY_BRAND: unique symbol = ...

Phantom-type brand placed on an object schema by .hasPrimaryKey([cols]) +to record the composite primary-key column tuple at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.POLYMORPHIC_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.POLYMORPHIC_TYPE_BRAND.html new file mode 100644 index 00000000..4a71ae9f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.POLYMORPHIC_TYPE_BRAND.html @@ -0,0 +1,5 @@ +POLYMORPHIC_TYPE_BRAND | Libraries
POLYMORPHIC_TYPE_BRAND: unique symbol = ...

Phantom-type brand placed on an ObjectSchemaBuilder by .withVariants(). +The brand carries the discriminated-union result type so that +query(db, polymorphicSchema) automatically infers the correct union type +without any extra type annotation.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..c734c194 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.PRIMARY_KEY_BRAND.html @@ -0,0 +1,4 @@ +PRIMARY_KEY_BRAND | Libraries
PRIMARY_KEY_BRAND: unique symbol = ...

Phantom-type brand placed on a column schema by .primaryKey(). +Carried on the property schema's type so that PrimaryKeyOf can +locate primary-key columns at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.any.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.any.html new file mode 100644 index 00000000..84b93442 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.any.html @@ -0,0 +1 @@ +any | Libraries
any: ExtendedAnyFactory<
    {
        hasColumnName(
            this: AnySchemaBuilder<any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.any
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.array.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.array.html new file mode 100644 index 00000000..76a52cf4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.array.html @@ -0,0 +1 @@ +array | Libraries
array: ExtendedArrayFactory<
    {
        nonempty(
            this: ArraySchemaBuilder<any>,
            errorMessage?: ValidationErrorMessageProvider<
                ArraySchemaBuilder<
                    any,
                    true,
                    false,
                    undefined,
                    false,
                    {},
                    any[]
                    | unknown[],
                >,
            >,
        ): ArraySchemaBuilder<
            any,
            true,
            false,
            undefined,
            false,
            {},
            any[]
            | unknown[],
        >;
        unique(
            this: ArraySchemaBuilder<any>,
            keyFn?: (item: any) => unknown,
            errorMessage?: ValidationErrorMessageProvider<
                ArraySchemaBuilder<
                    any,
                    true,
                    false,
                    undefined,
                    false,
                    {},
                    any[]
                    | unknown[],
                >,
            >,
        ): ArraySchemaBuilder<
            any,
            true,
            false,
            undefined,
            false,
            {},
            any[]
            | unknown[],
        >;
    } & {
        hasColumnName(
            this: ArraySchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.array
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.boolean.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.boolean.html new file mode 100644 index 00000000..155a46cf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.boolean.html @@ -0,0 +1 @@ +boolean | Libraries
boolean: ExtendedBooleanFactory<
    {
        hasColumnName(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        columnType(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            type: string,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        defaultTo(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            value: boolean,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        index(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            name?: string,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        unique(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            name?: string,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
    },
> = extended.boolean
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.date.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.date.html new file mode 100644 index 00000000..69fc9f27 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.date.html @@ -0,0 +1 @@ +date | Libraries
date: ExtendedDateFactory<
    {
        hasColumnName(
            this: DateSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        columnType(
            this: DateSchemaBuilder<any, any, any, any, any>,
            type: string,
        ): DateSchemaBuilder<any, any, any, any, any>;
        dateOnly(
            this: DateSchemaBuilder<any, any, any, any, any>,
        ): DateSchemaBuilder<any, any, any, any, any>;
        defaultTo(
            this: DateSchemaBuilder<any, any, any, any, any>,
            value: "now",
        ): DateSchemaBuilder<any, any, any, any, any>;
        defaultToRaw(
            this: DateSchemaBuilder<any, any, any, any, any>,
            expression: string,
        ): DateSchemaBuilder<any, any, any, any, any>;
        index(
            this: DateSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): DateSchemaBuilder<any, any, any, any, any>;
        rowVersion(
            this: DateSchemaBuilder<any, any, any, any, any>,
        ): DateSchemaBuilder<any, any, any, any, any>;
        timestamptz(
            this: DateSchemaBuilder<any, any, any, any, any>,
        ): DateSchemaBuilder<any, any, any, any, any>;
    },
> = extended.date
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.dbExtension.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.dbExtension.html new file mode 100644 index 00000000..ea049978 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.dbExtension.html @@ -0,0 +1,8 @@ +dbExtension | Libraries
dbExtension: ExtensionDescriptor<
    {
        any: {
            hasColumnName(
                this: AnySchemaBuilder<any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        array: {
            hasColumnName(
                this: ArraySchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        boolean: {
            hasColumnName(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        date: {
            hasColumnName(
                this: DateSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        func: {
            hasColumnName(
                this: FunctionSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        generic: {
            hasColumnName(
                this: GenericSchemaBuilder<any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        number: {
            hasColumnName(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        object: {
            hasTableName(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        };
        string: {
            hasColumnName(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        union: {
            hasColumnName(
                this: UnionSchemaBuilder<any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
    },
> = ...

Schema extension that adds database-mapping metadata to schema builders.

+

Import the typed factory functions (string, number, object, etc.) from +this package instead of from @cleverbrush/schema to gain access to the +.hasColumnName() and .hasTableName() methods.

+
import { object, string, number } from '@cleverbrush/knex-schema';

const UserSchema = object({
id: number(),
firstName: string().hasColumnName('first_name'),
lastName: string().hasColumnName('last_name'),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('users'); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.ddlExtension.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.ddlExtension.html new file mode 100644 index 00000000..aafc3c96 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.ddlExtension.html @@ -0,0 +1,10 @@ +ddlExtension | Libraries
ddlExtension: ExtensionDescriptor<
    {
        boolean: {
            columnType(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                type: string,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
            defaultTo(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                value: boolean,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
            index(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                name?: string,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
            unique(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                name?: string,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        };
        date: {
            columnType(
                this: DateSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): DateSchemaBuilder<any, any, any, any, any>;
            dateOnly(
                this: DateSchemaBuilder<any, any, any, any, any>,
            ): DateSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: DateSchemaBuilder<any, any, any, any, any>,
                value: "now",
            ): DateSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: DateSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): DateSchemaBuilder<any, any, any, any, any>;
            index(
                this: DateSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): DateSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: DateSchemaBuilder<any, any, any, any, any>,
            ): DateSchemaBuilder<any, any, any, any, any>;
            timestamptz(
                this: DateSchemaBuilder<any, any, any, any, any>,
            ): DateSchemaBuilder<any, any, any, any, any>;
        };
        number: {
            bigint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            decimal(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                precision: number,
                scale: number,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                value: number | "auto_increment",
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            index(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            references(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                opts?: { strategy?: "increment" | "manual" },
            ): NumberSchemaBuilder<any, any, any, any, any>;
            smallint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            unique(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
        };
        object: {
            afterInsert(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            beforeDelete(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            beforeInsert(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            beforeUpdate(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            belongsTo(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: { foreignKey: any; schema: any },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            belongsToMany(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: {
                    schema: any;
                    through: { foreignKey: string; localKey: string; table: string };
                },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            columnType(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                type: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            defaultScope(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasCheck(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                sql: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasIndex(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                columns: string[],
                opts?: { name?: string; unique?: boolean },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasMany(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: { foreignKey: any; schema: any },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasOne(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: { foreignKey: any; schema: any },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasRawColumn(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                definition: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasRawIndex(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                sql: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasTimestamps(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                opts?: { createdAt?: string; updatedAt?: string },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasUnique(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                columns: string[],
                name?: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            json(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            jsonb(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            projection<
                TProperties extends
                    Record<string, SchemaBuilder<any, any, any, any, any>>,
                const N extends string,
                const TKey extends string,
            >(
                this: ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                name: N,
                ...columns: readonly (
                    | TKey
                    | (
                        (
                            t: PropertyDescriptorTree<
                                ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                                ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                            >,
                        ) => PropertyDescriptor<any, any, any, TKey>
                    )
                )[],
            ): ObjectSchemaBuilder<TProperties, any, any, any, any, any, any> & {
                __cleverbrush_extra_type_brand__?: { [P in string]: readonly TKey[] };
            };
            scope<N extends string>(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: N,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any> & {
                __cleverbrush_method_literal_brand__?: N;
            };
            softDelete(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                opts?: { column?: string },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        };
        string: {
            asUuid(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            check(
                this: StringSchemaBuilder<any, any, any, any, any>,
                sql: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            citext(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: StringSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: StringSchemaBuilder<any, any, any, any, any>,
                value: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: StringSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            index(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            jsonb(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            references(
                this: StringSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            text(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            tsvector(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            unique(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
        };
    },
> = ...

DDL and ORM extension that adds database DDL metadata, relationship +definitions, and ORM conveniences to schema builders.

+

Column-level methods: .primaryKey(), .references(), .unique(), +.index(), .defaultTo(), .columnType(), .check(), .defaultToRaw().

+

Object-level methods: .hasIndex(), .hasUnique(), .hasCheck(), +.hasPrimaryKey(), .hasRawColumn(), .hasRawIndex(), .hasMany(), +.hasOne(), .belongsTo(), .belongsToMany(), .hasTimestamps(), +.softDelete(), .scope(), .defaultScope(), .beforeInsert(), +.afterInsert(), .beforeUpdate(), .beforeDelete().

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.func.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.func.html new file mode 100644 index 00000000..d1332f9b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.func.html @@ -0,0 +1 @@ +func | Libraries
func: ExtendedFuncFactory<
    {
        hasColumnName(
            this: FunctionSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.func
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.number.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.number.html new file mode 100644 index 00000000..03418084 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.number.html @@ -0,0 +1 @@ +number | Libraries
number: ExtendedNumberFactory<
    {
        finite(
            this: NumberSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        multipleOf(
            this: NumberSchemaBuilder,
            n: number,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        negative(
            this: NumberSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        oneOf(
            this: NumberSchemaBuilder,
            ...args: any[],
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        positive(
            this: NumberSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
    } & {
        hasColumnName(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        bigint(
            this: NumberSchemaBuilder<any, any, any, any, any>,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        columnType(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            type: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        decimal(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            precision: number,
            scale: number,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        defaultTo(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            value: number | "auto_increment",
        ): NumberSchemaBuilder<any, any, any, any, any>;
        defaultToRaw(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            expression: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        index(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        onDelete(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        onUpdate(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        references(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            table: string,
            column?: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        rowVersion(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            opts?: { strategy?: "increment" | "manual" },
        ): NumberSchemaBuilder<any, any, any, any, any>;
        smallint(
            this: NumberSchemaBuilder<any, any, any, any, any>,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        unique(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
    },
> = extended.number
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.object.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.object.html new file mode 100644 index 00000000..3c5cf9b7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.object.html @@ -0,0 +1 @@ +object | Libraries
object: ExtendedObjectFactory<
    {
        hasTableName(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    } & {
        afterInsert(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        beforeDelete(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        beforeInsert(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        beforeUpdate(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        belongsTo(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: { foreignKey: any; schema: any },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        belongsToMany(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: {
                schema: any;
                through: { foreignKey: string; localKey: string; table: string };
            },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        columnType(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            type: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        defaultScope(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasCheck(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            sql: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasIndex(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            columns: string[],
            opts?: { name?: string; unique?: boolean },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasMany(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: { foreignKey: any; schema: any },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasOne(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: { foreignKey: any; schema: any },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasRawColumn(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            definition: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasRawIndex(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            sql: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasTimestamps(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            opts?: { createdAt?: string; updatedAt?: string },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasUnique(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            columns: string[],
            name?: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        json(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        jsonb(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        projection<
            TProperties extends
                Record<string, SchemaBuilder<any, any, any, any, any>>,
            const N extends string,
            const TKey extends string,
        >(
            this: ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
            name: N,
            ...columns: readonly (
                | TKey
                | (
                    (
                        t: PropertyDescriptorTree<
                            ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                            ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                        >,
                    ) => PropertyDescriptor<any, any, any, TKey>
                )
            )[],
        ): ObjectSchemaBuilder<TProperties, any, any, any, any, any, any> & {
            __cleverbrush_extra_type_brand__?: { [P in string]: readonly TKey[] };
        };
        scope<N extends string>(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: N,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any> & {
            __cleverbrush_method_literal_brand__?: N;
        };
        softDelete(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            opts?: { column?: string },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    },
> = extended.object
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.string.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.string.html new file mode 100644 index 00000000..f9875a64 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.string.html @@ -0,0 +1 @@ +string | Libraries
string: ExtendedStringFactory<
    {
        email(
            this: StringSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        ip(
            this: StringSchemaBuilder,
            opts?: { version?: "v4" | "v6" },
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        nonempty(
            this: StringSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        oneOf(
            this: StringSchemaBuilder,
            ...args: any[],
        ): StringSchemaBuilder<string, true, false, false, {}>;
        toLowerCase(
            this: StringSchemaBuilder,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        trim(
            this: StringSchemaBuilder,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        url(
            this: StringSchemaBuilder,
            optsOrError?:
                | ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >
                | { protocols?: string[] },
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        uuid(
            this: StringSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
    } & {
        hasColumnName(
            this: StringSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        asUuid(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        check(
            this: StringSchemaBuilder<any, any, any, any, any>,
            sql: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        citext(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        columnType(
            this: StringSchemaBuilder<any, any, any, any, any>,
            type: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        defaultTo(
            this: StringSchemaBuilder<any, any, any, any, any>,
            value: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        defaultToRaw(
            this: StringSchemaBuilder<any, any, any, any, any>,
            expression: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        index(
            this: StringSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        jsonb(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        onDelete(
            this: StringSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): StringSchemaBuilder<any, any, any, any, any>;
        onUpdate(
            this: StringSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): StringSchemaBuilder<any, any, any, any, any>;
        references(
            this: StringSchemaBuilder<any, any, any, any, any>,
            table: string,
            column?: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        rowVersion(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        text(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        tsvector(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        unique(
            this: StringSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
    },
> = extended.string
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.union.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.union.html new file mode 100644 index 00000000..584945e6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_knex-schema.extension.union.html @@ -0,0 +1 @@ +union | Libraries
union: ExtendedUnionFactory<
    {
        hasColumnName(
            this: UnionSchemaBuilder<any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.union
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..ILogger.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..ILogger.html new file mode 100644 index 00000000..8e2d9306 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..ILogger.html @@ -0,0 +1,4 @@ +ILogger | Libraries

Variable ILoggerConst

ILogger: { __brand: "ILogger" } = ...

DI service key for the Logger instance.

+

Uses a symbol-based key for use with @cleverbrush/di ServiceCollection. +In the absence of @cleverbrush/di, this serves as a plain token.

+

Type Declaration

  • __brand: "ILogger"
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..LogContext.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..LogContext.html new file mode 100644 index 00000000..694630b8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..LogContext.html @@ -0,0 +1,22 @@ +LogContext | Libraries

Variable LogContextConst

LogContext: {
    current(): Logger | undefined;
    enrichWith<T>(properties: Record<string, unknown>, fn: () => T): T;
    getStore(): LogContextStore | undefined;
    run<T>(logger: Logger, fn: () => T): T;
    runWithCorrelationId<T>(correlationId: string, fn: () => T): T;
} = ...

Ambient logger context using AsyncLocalStorage.

+

Zero overhead when not used — the AsyncLocalStorage instance +is only created once, and getStore() is a near-zero-cost operation.

+

Type Declaration

  • current: function
  • enrichWith: function
    • Runs a callback with additional enrichment properties added +to the ambient logger context.

      +

      Type Parameters

      • T

      Parameters

      • properties: Record<string, unknown>

        additional properties to add to the context logger

        +
      • fn: () => T

        the async function to run

        +

      Returns T

      the result of the callback

      +
  • getStore: function
  • run: function
    • Runs a callback with the given logger as the ambient context.

      +

      Type Parameters

      • T

      Parameters

      • logger: Logger

        the logger to set as ambient

        +
      • fn: () => T

        the async function to run within the context

        +

      Returns T

      the result of the callback

      +
  • runWithCorrelationId: function
    • Runs a callback with a correlation ID set in the ambient context.

      +

      Type Parameters

      • T

      Parameters

      • correlationId: string

        the correlation ID to set

        +
      • fn: () => T

        the async function to run

        +

      Returns T

      the result of the callback

      +
LogContext.run(logger, async () => {
const log = LogContext.current()!;
log.info('Inside context');
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..LogLevel.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..LogLevel.html new file mode 100644 index 00000000..4feddd57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..LogLevel.html @@ -0,0 +1,7 @@ +LogLevel | Libraries

Variable LogLevelConst

LogLevel: { Debug: 1; Error: 4; Fatal: 5; Information: 2; Trace: 0; Warning: 3 } = ...

Log severity levels as a const object.

+

Use as values (LogLevel.Information) or as a type (LogLevel). +Levels are ordered numerically — higher values indicate greater severity.

+

Type Declaration

  • ReadonlyDebug: 1
  • ReadonlyError: 4
  • ReadonlyFatal: 5
  • ReadonlyInformation: 2
  • ReadonlyTrace: 0
  • ReadonlyWarning: 3
if (logger.isEnabled(LogLevel.Debug)) {
logger.debug('Expensive computation: {@Result}', { Result: compute() });
} +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..SelfLog.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..SelfLog.html new file mode 100644 index 00000000..8e25d961 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_log..SelfLog.html @@ -0,0 +1,14 @@ +SelfLog | Libraries

Variable SelfLogConst

SelfLog: {
    _enabled: boolean;
    _output: { write(s: string): void } | null;
    disable(): void;
    enable(): void;
    setOutput(output: { write(s: string): void }): void;
    write(message: string, error?: unknown): void;
} = ...

Internal diagnostic channel for the logging library's own errors.

+

Sinks use this when they fail, instead of throwing and crashing +the application. By default writes to process.stderr.

+

Type Declaration

  • _enabled: boolean
  • _output: { write(s: string): void } | null
  • disable: function
  • enable: function
  • setOutput: function
    • Sets a custom output stream for self-diagnostics.

      +

      Parameters

      • output: { write(s: string): void }

        writable stream with a write method

        +

      Returns void

  • write: function
    • Writes an internal diagnostic message. Includes optional error details.

      +

      Parameters

      • message: string

        diagnostic message

        +
      • Optionalerror: unknown

        optional associated error

        +

      Returns void

SelfLog.setOutput(fs.createWriteStream('./logs/selflog.txt'));
SelfLog.disable(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.COMPOSITE_PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.COMPOSITE_PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..756c8dba --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.COMPOSITE_PRIMARY_KEY_BRAND.html @@ -0,0 +1,3 @@ +COMPOSITE_PRIMARY_KEY_BRAND | Libraries

Variable COMPOSITE_PRIMARY_KEY_BRANDConst

COMPOSITE_PRIMARY_KEY_BRAND: unique symbol

Phantom-type brand placed on an object schema by .hasPrimaryKey([cols]) +to record the composite primary-key column tuple at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.EXTRA_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.EXTRA_TYPE_BRAND.html new file mode 100644 index 00000000..2b37badb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.EXTRA_TYPE_BRAND.html @@ -0,0 +1,18 @@ +EXTRA_TYPE_BRAND | Libraries

Variable EXTRA_TYPE_BRANDConst

EXTRA_TYPE_BRAND: "__cleverbrush_extra_type_brand__"

Generic accumulator brand for extension methods that want to thread +a Record<name, readonly string[]> map through the builder chain.

+

Extension authors can declare a method's return type as +this & { readonly [EXTRA_TYPE_BRAND]?: { [name]: TKeys } } +and FixedMethods will automatically:

+
    +
  • Make the first argument const-generic (to capture the literal name).
  • +
  • Make the second argument const-generic when it is a readonly string[] +tuple (to capture the literal key list).
  • +
  • Accumulate both into the 4th TExtraTypes parameter of FixedMethods +so the information survives subsequent method calls on the same builder.
  • +
+

This is deliberately projection-agnostic — any extension that follows the +(name: string, data: readonly string[] | function) signature convention +can use it. Projection-specific semantics (e.g. PROJECTION_BRAND) live +in the consuming library, not here.

+

FixedMethods for how the accumulation works.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.MAPPERS.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.MAPPERS.html new file mode 100644 index 00000000..0926f731 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.MAPPERS.html @@ -0,0 +1,9 @@ +MAPPERS | Libraries

Variable MAPPERSConst

MAPPERS: Record<string, (value: any) => any>

Built-in named value mapper functions.

+

Each entry maps a string key to a transformation function. Pass the key as +the mapper argument to mapValue instead of a custom function.

+

Currently available:

+
    +
  • date_from_json — converts a JSON date string (string | null) to a +JavaScript Date object (or passes through falsy values unchanged).
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.METHOD_LITERAL_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.METHOD_LITERAL_BRAND.html new file mode 100644 index 00000000..9947000f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.METHOD_LITERAL_BRAND.html @@ -0,0 +1,9 @@ +METHOD_LITERAL_BRAND | Libraries

Variable METHOD_LITERAL_BRANDConst

METHOD_LITERAL_BRAND: "__cleverbrush_method_literal_brand__"

Unique string-literal brand key used by FixedMethods to detect +extension methods whose first-argument literal should be accumulated in the +return type.

+

Declare the return type of any extension method as +this & { readonly [METHOD_LITERAL_BRAND]?: N } (where N extends string) +and FixedMethods will automatically make it generic so the literal name +flows through the type system and accumulates across multiple calls.

+

This powers scope-name autocomplete in SchemaQueryBuilder.scoped().

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.POLYMORPHIC_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.POLYMORPHIC_TYPE_BRAND.html new file mode 100644 index 00000000..2dc3b397 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.POLYMORPHIC_TYPE_BRAND.html @@ -0,0 +1,5 @@ +POLYMORPHIC_TYPE_BRAND | Libraries

Variable POLYMORPHIC_TYPE_BRANDConst

POLYMORPHIC_TYPE_BRAND: unique symbol

Phantom-type brand placed on an ObjectSchemaBuilder by .withVariants(). +The brand carries the discriminated-union result type so that +query(db, polymorphicSchema) automatically infers the correct union type +without any extra type annotation.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..df347f49 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.PRIMARY_KEY_BRAND.html @@ -0,0 +1,4 @@ +PRIMARY_KEY_BRAND | Libraries

Variable PRIMARY_KEY_BRANDConst

PRIMARY_KEY_BRAND: unique symbol

Phantom-type brand placed on a column schema by .primaryKey(). +Carried on the property schema's type so that PrimaryKeyOf can +locate primary-key columns at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.any.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.any.html new file mode 100644 index 00000000..9482c26d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.any.html @@ -0,0 +1 @@ +any | Libraries

Variable anyConst

any: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.array.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.array.html new file mode 100644 index 00000000..7dd394ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.array.html @@ -0,0 +1 @@ +array | Libraries

Variable arrayConst

array: <TElementSchema extends SchemaBuilder<any, any, any, any, any>>(
    elementSchema?: TElementSchema,
) => CleanExtended

Type Declaration

    • <TElementSchema extends SchemaBuilder<any, any, any, any, any>>(
          elementSchema?: TElementSchema,
      ): CleanExtended
    • Type Parameters

      • TElementSchema extends SchemaBuilder<any, any, any, any, any>

      Parameters

      Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.boolean.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.boolean.html new file mode 100644 index 00000000..19a1d18d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.boolean.html @@ -0,0 +1 @@ +boolean | Libraries

Variable booleanConst

boolean: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.date.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.date.html new file mode 100644 index 00000000..760f6c81 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.date.html @@ -0,0 +1 @@ +date | Libraries

Variable dateConst

date: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.dbExtension.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.dbExtension.html new file mode 100644 index 00000000..c7902316 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.dbExtension.html @@ -0,0 +1,8 @@ +dbExtension | Libraries

Variable dbExtensionConst

dbExtension: ExtensionDescriptor

Schema extension that adds database-mapping metadata to schema builders.

+

Import the typed factory functions (string, number, object, etc.) from +this package instead of from @cleverbrush/schema to gain access to the +.hasColumnName() and .hasTableName() methods.

+
import { object, string, number } from '@cleverbrush/knex-schema';

const UserSchema = object({
id: number(),
firstName: string().hasColumnName('first_name'),
lastName: string().hasColumnName('last_name'),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('users'); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.ddlExtension.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.ddlExtension.html new file mode 100644 index 00000000..6777b842 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.ddlExtension.html @@ -0,0 +1,10 @@ +ddlExtension | Libraries

Variable ddlExtensionConst

ddlExtension: ExtensionDescriptor

DDL and ORM extension that adds database DDL metadata, relationship +definitions, and ORM conveniences to schema builders.

+

Column-level methods: .primaryKey(), .references(), .unique(), +.index(), .defaultTo(), .columnType(), .check(), .defaultToRaw().

+

Object-level methods: .hasIndex(), .hasUnique(), .hasCheck(), +.hasPrimaryKey(), .hasRawColumn(), .hasRawIndex(), .hasMany(), +.hasOne(), .belongsTo(), .belongsToMany(), .hasTimestamps(), +.softDelete(), .scope(), .defaultScope(), .beforeInsert(), +.afterInsert(), .beforeUpdate(), .beforeDelete().

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.func.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.func.html new file mode 100644 index 00000000..abcdda9e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.func.html @@ -0,0 +1 @@ +func | Libraries

Variable funcConst

func: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.number.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.number.html new file mode 100644 index 00000000..e2431cdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.number.html @@ -0,0 +1 @@ +number | Libraries

Variable numberConst

number: {
    (): CleanExtended<
        NumberSchemaBuilder<
            number,
            true,
            false,
            false,
            {
                finite(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                multipleOf(
                    this: NumberSchemaBuilder,
                    n: number,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                negative(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                oneOf(
                    this: NumberSchemaBuilder,
                    ...args: any[],
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                positive(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                bigint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                decimal(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    precision: number,
                    scale: number,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    value: number | "auto_increment",
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                index(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                references(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    opts?: { strategy?: "increment" | "manual" },
                ): NumberSchemaBuilder<any, any, any, any, any>;
                smallint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            finite(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            multipleOf(
                this: NumberSchemaBuilder,
                n: number,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            negative(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            oneOf(
                this: NumberSchemaBuilder,
                ...args: any[],
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            positive(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
        } & {
            hasColumnName(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            bigint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            decimal(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                precision: number,
                scale: number,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                value: number | "auto_increment",
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            index(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            references(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                opts?: { strategy?: "increment" | "manual" },
            ): NumberSchemaBuilder<any, any, any, any, any>;
            smallint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            unique(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
        },
    >;
    <T extends number>(
        equals: T,
    ): CleanExtended<
        NumberSchemaBuilder<
            T,
            true,
            false,
            false,
            {
                finite(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                multipleOf(
                    this: NumberSchemaBuilder,
                    n: number,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                negative(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                oneOf(
                    this: NumberSchemaBuilder,
                    ...args: any[],
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                positive(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                bigint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                decimal(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    precision: number,
                    scale: number,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    value: number | "auto_increment",
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                index(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                references(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    opts?: { strategy?: "increment" | "manual" },
                ): NumberSchemaBuilder<any, any, any, any, any>;
                smallint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            finite(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            multipleOf(
                this: NumberSchemaBuilder,
                n: number,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            negative(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            oneOf(
                this: NumberSchemaBuilder,
                ...args: any[],
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            positive(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
        } & {
            hasColumnName(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            bigint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            decimal(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                precision: number,
                scale: number,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                value: number | "auto_increment",
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            index(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            references(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                opts?: { strategy?: "increment" | "manual" },
            ): NumberSchemaBuilder<any, any, any, any, any>;
            smallint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            unique(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
        },
    >;
}

Type Declaration

    • (): CleanExtended<
          NumberSchemaBuilder<
              number,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Returns CleanExtended<
          NumberSchemaBuilder<
              number,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >

    • <T extends number>(
          equals: T,
      ): CleanExtended<
          NumberSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Type Parameters

      • T extends number

      Parameters

      • equals: T

      Returns CleanExtended<
          NumberSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.object.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.object.html new file mode 100644 index 00000000..0d5dc6b2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.object.html @@ -0,0 +1 @@ +object | Libraries

Variable objectConst

object: <P extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
    properties?: P,
) => CleanExtended

Type Declaration

    • <P extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
          properties?: P,
      ): CleanExtended
    • Type Parameters

      • P extends Record<string, SchemaBuilder<any, any, any, any, any>>

      Parameters

      • Optionalproperties: P

      Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.string.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.string.html new file mode 100644 index 00000000..3eaaa15e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.string.html @@ -0,0 +1 @@ +string | Libraries

Variable stringConst

string: {
    (): CleanExtended<
        StringSchemaBuilder<
            string,
            true,
            false,
            false,
            {
                email(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                ip(
                    this: StringSchemaBuilder,
                    opts?: { version?: "v4" | "v6" },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                nonempty(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                oneOf(
                    this: StringSchemaBuilder,
                    ...args: any[],
                ): StringSchemaBuilder<string, true, false, false, {}>;
                toLowerCase(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                trim(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                url(
                    this: StringSchemaBuilder,
                    optsOrError?:
                        | ValidationErrorMessageProvider<
                            StringSchemaBuilder<string, true, false, false, {}>,
                        >
                        | { protocols?: string[] },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                uuid(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                asUuid(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                check(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    sql: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                citext(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    value: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                index(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                jsonb(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                references(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                text(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                tsvector(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            email(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            ip(
                this: StringSchemaBuilder,
                opts?: { version?: "v4" | "v6" },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            nonempty(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            oneOf(
                this: StringSchemaBuilder,
                ...args: any[],
            ): StringSchemaBuilder<string, true, false, false, {}>;
            toLowerCase(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            trim(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            url(
                this: StringSchemaBuilder,
                optsOrError?:
                    | ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >
                    | { protocols?: string[] },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            uuid(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
        } & {
            hasColumnName(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            asUuid(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            check(
                this: StringSchemaBuilder<any, any, any, any, any>,
                sql: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            citext(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: StringSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: StringSchemaBuilder<any, any, any, any, any>,
                value: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: StringSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            index(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            jsonb(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            references(
                this: StringSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            text(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            tsvector(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            unique(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
        },
    >;
    <T extends string>(
        equals: T,
    ): CleanExtended<
        StringSchemaBuilder<
            T,
            true,
            false,
            false,
            {
                email(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                ip(
                    this: StringSchemaBuilder,
                    opts?: { version?: "v4" | "v6" },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                nonempty(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                oneOf(
                    this: StringSchemaBuilder,
                    ...args: any[],
                ): StringSchemaBuilder<string, true, false, false, {}>;
                toLowerCase(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                trim(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                url(
                    this: StringSchemaBuilder,
                    optsOrError?:
                        | ValidationErrorMessageProvider<
                            StringSchemaBuilder<string, true, false, false, {}>,
                        >
                        | { protocols?: string[] },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                uuid(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                asUuid(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                check(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    sql: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                citext(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    value: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                index(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                jsonb(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                references(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                text(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                tsvector(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            email(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            ip(
                this: StringSchemaBuilder,
                opts?: { version?: "v4" | "v6" },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            nonempty(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            oneOf(
                this: StringSchemaBuilder,
                ...args: any[],
            ): StringSchemaBuilder<string, true, false, false, {}>;
            toLowerCase(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            trim(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            url(
                this: StringSchemaBuilder,
                optsOrError?:
                    | ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >
                    | { protocols?: string[] },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            uuid(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
        } & {
            hasColumnName(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            asUuid(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            check(
                this: StringSchemaBuilder<any, any, any, any, any>,
                sql: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            citext(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: StringSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: StringSchemaBuilder<any, any, any, any, any>,
                value: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: StringSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            index(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            jsonb(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            references(
                this: StringSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            text(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            tsvector(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            unique(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
        },
    >;
}

Type Declaration

    • (): CleanExtended<
          StringSchemaBuilder<
              string,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Returns CleanExtended<
          StringSchemaBuilder<
              string,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >

    • <T extends string>(
          equals: T,
      ): CleanExtended<
          StringSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Type Parameters

      • T extends string

      Parameters

      • equals: T

      Returns CleanExtended<
          StringSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.union.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.union.html new file mode 100644 index 00000000..d7af99e8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_orm.union.html @@ -0,0 +1 @@ +union | Libraries

Variable unionConst

union: <T extends SchemaBuilder<any, any, any, any, any>>(
    schema: T,
) => CleanExtended

Type Declaration

    • <T extends SchemaBuilder<any, any, any, any, any>>(schema: T): CleanExtended
    • Type Parameters

      • T extends SchemaBuilder<any, any, any, any, any>

      Parameters

      • schema: T

      Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..IMeter.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..IMeter.html new file mode 100644 index 00000000..55a69290 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..IMeter.html @@ -0,0 +1,4 @@ +IMeter | Libraries

Variable IMeterConst

IMeter: { __brand: "IMeter" } = ...

DI service key for an OpenTelemetry Meter.

+

Resolved from the global MeterProvider set by +import('./setupOtel.js').setupOtel.

+

Type Declaration

  • __brand: "IMeter"
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..ITracer.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..ITracer.html new file mode 100644 index 00000000..15cb4819 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..ITracer.html @@ -0,0 +1,5 @@ +ITracer | Libraries

Variable ITracerConst

ITracer: { __brand: "ITracer" } = ...

DI service key for an OpenTelemetry Tracer.

+

Resolved from the global TracerProvider set by +import('./setupOtel.js').setupOtel. Components that prefer +dependency injection over the global API can inject this token.

+

Type Declaration

  • __brand: "ITracer"
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..OTEL_SPAN_ITEM_KEY.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..OTEL_SPAN_ITEM_KEY.html new file mode 100644 index 00000000..7d1cd402 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_otel..OTEL_SPAN_ITEM_KEY.html @@ -0,0 +1,6 @@ +OTEL_SPAN_ITEM_KEY | Libraries

Variable OTEL_SPAN_ITEM_KEYConst

OTEL_SPAN_ITEM_KEY: "otel.span" = 'otel.span'

Attribute key under which the OTel server span is stashed on the +per-request RequestContext.items map.

+

Downstream middleware/handlers can read this with +ctx.items.get(OTEL_SPAN_ITEM_KEY) to attach custom attributes +or events to the active server span.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_scheduler.Schemas.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_scheduler.Schemas.html new file mode 100644 index 00000000..347058d4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_scheduler.Schemas.html @@ -0,0 +1,3 @@ +Schemas | Libraries

Variable SchemasConst

Schemas: {
    CreateJobRequestSchema: ExtendedObject<
        {
            id: ExtendedString<string>;
            maxConsequentFails: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxRetries: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            noConcurrentRuns: BooleanSchemaBuilder<
                boolean,
                false,
                false,
                undefined,
                false,
                {},
                boolean,
            >;
            path: StringSchemaBuilder<
                string,
                true,
                false,
                false,
                StringBuiltinExtensions<string>,
            > & StringBuiltinExtensions<string>;
            props: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<{}, true, false, undefined, false, {}, []>,
                    ExtendedFunc,
                ],
                false,
                false,
                undefined,
                false,
                {},
            >;
            schedule: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<
                        Omit<
                            Omit<
                                {
                                    endsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                    hour: (...) & (...);
                                    interval: (...) & (...);
                                    maxOccurences: (...) & (...);
                                    minute: (...) & (...);
                                    skipFirst: (...) & (...);
                                    startsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                },
                                "hour",
                            >,
                            "minute",
                        > & { every: ExtendedString<"minute"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & { every: ExtendedString<"day"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            dayOfWeek: ArraySchemaBuilder<
                                (...) & (...),
                                true,
                                false,
                                undefined,
                                false,
                                ArrayBuiltinExtensions<(...)>,
                                (...)[],
                            > & ArrayBuiltinExtensions<
                                SchemaBuilder<(...), (...), (...), (...), (...)>,
                            >;
                            every: ExtendedString<"week">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"month">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"year">;
                            month: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            timeout: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
    >;
    ScheduleDaySchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & { every: ExtendedString<"day"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleMinuteSchema: ObjectSchemaBuilder<
        Omit<
            Omit<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                },
                "hour",
            >,
            "minute",
        > & { every: ExtendedString<"minute"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleMonthSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"month">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleSchema: UnionSchemaBuilder<
        [
            ObjectSchemaBuilder<
                Omit<
                    Omit<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        },
                        "hour",
                    >,
                    "minute",
                > & { every: ExtendedString<"minute"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & { every: ExtendedString<"day"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    dayOfWeek: ArraySchemaBuilder<
                        NumberSchemaBuilder<
                            number,
                            true,
                            false,
                            false,
                            NumberBuiltinExtensions<(...)>,
                        > & NumberBuiltinExtensions<number>,
                        true,
                        false,
                        undefined,
                        false,
                        ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                        number[],
                    > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
                    every: ExtendedString<"week">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"month">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"year">;
                    month: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
        ],
        true,
        false,
        undefined,
        false,
        {},
    >;
    ScheduleSchemaBase: ExtendedObject<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        },
    >;
    ScheduleWeekSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            dayOfWeek: ArraySchemaBuilder<
                NumberSchemaBuilder<
                    number,
                    true,
                    false,
                    false,
                    NumberBuiltinExtensions<number>,
                > & NumberBuiltinExtensions<number>,
                true,
                false,
                undefined,
                false,
                ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                number[],
            > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
            every: ExtendedString<"week">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleYearSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"year">;
            month: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
} = ...

Pre-built @cleverbrush/schema schemas used internally by the scheduler. +Exported for consumers who need to validate schedule/job payloads manually.

+

Type Declaration

  • CreateJobRequestSchema: ExtendedObject<
        {
            id: ExtendedString<string>;
            maxConsequentFails: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxRetries: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            noConcurrentRuns: BooleanSchemaBuilder<
                boolean,
                false,
                false,
                undefined,
                false,
                {},
                boolean,
            >;
            path: StringSchemaBuilder<
                string,
                true,
                false,
                false,
                StringBuiltinExtensions<string>,
            > & StringBuiltinExtensions<string>;
            props: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<{}, true, false, undefined, false, {}, []>,
                    ExtendedFunc,
                ],
                false,
                false,
                undefined,
                false,
                {},
            >;
            schedule: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<
                        Omit<
                            Omit<
                                {
                                    endsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                    hour: (...) & (...);
                                    interval: (...) & (...);
                                    maxOccurences: (...) & (...);
                                    minute: (...) & (...);
                                    skipFirst: (...) & (...);
                                    startsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                },
                                "hour",
                            >,
                            "minute",
                        > & { every: ExtendedString<"minute"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & { every: ExtendedString<"day"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            dayOfWeek: ArraySchemaBuilder<
                                (...) & (...),
                                true,
                                false,
                                undefined,
                                false,
                                ArrayBuiltinExtensions<(...)>,
                                (...)[],
                            > & ArrayBuiltinExtensions<
                                SchemaBuilder<(...), (...), (...), (...), (...)>,
                            >;
                            every: ExtendedString<"week">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"month">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"year">;
                            month: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            timeout: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
    >
  • ScheduleDaySchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & { every: ExtendedString<"day"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleMinuteSchema: ObjectSchemaBuilder<
        Omit<
            Omit<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                },
                "hour",
            >,
            "minute",
        > & { every: ExtendedString<"minute"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleMonthSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"month">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleSchema: UnionSchemaBuilder<
        [
            ObjectSchemaBuilder<
                Omit<
                    Omit<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        },
                        "hour",
                    >,
                    "minute",
                > & { every: ExtendedString<"minute"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & { every: ExtendedString<"day"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    dayOfWeek: ArraySchemaBuilder<
                        NumberSchemaBuilder<
                            number,
                            true,
                            false,
                            false,
                            NumberBuiltinExtensions<(...)>,
                        > & NumberBuiltinExtensions<number>,
                        true,
                        false,
                        undefined,
                        false,
                        ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                        number[],
                    > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
                    every: ExtendedString<"week">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"month">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"year">;
                    month: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
        ],
        true,
        false,
        undefined,
        false,
        {},
    >
  • ScheduleSchemaBase: ExtendedObject<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        },
    >
  • ScheduleWeekSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            dayOfWeek: ArraySchemaBuilder<
                NumberSchemaBuilder<
                    number,
                    true,
                    false,
                    false,
                    NumberBuiltinExtensions<number>,
                > & NumberBuiltinExtensions<number>,
                true,
                false,
                undefined,
                false,
                ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                number[],
            > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
            every: ExtendedString<"week">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleYearSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"year">;
            month: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.EXTRA_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.EXTRA_TYPE_BRAND.html new file mode 100644 index 00000000..01ed146d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.EXTRA_TYPE_BRAND.html @@ -0,0 +1,18 @@ +EXTRA_TYPE_BRAND | Libraries

Variable EXTRA_TYPE_BRANDConst

EXTRA_TYPE_BRAND: "__cleverbrush_extra_type_brand__" = ...

Generic accumulator brand for extension methods that want to thread +a Record<name, readonly string[]> map through the builder chain.

+

Extension authors can declare a method's return type as +this & { readonly [EXTRA_TYPE_BRAND]?: { [name]: TKeys } } +and FixedMethods will automatically:

+
    +
  • Make the first argument const-generic (to capture the literal name).
  • +
  • Make the second argument const-generic when it is a readonly string[] +tuple (to capture the literal key list).
  • +
  • Accumulate both into the 4th TExtraTypes parameter of FixedMethods +so the information survives subsequent method calls on the same builder.
  • +
+

This is deliberately projection-agnostic — any extension that follows the +(name: string, data: readonly string[] | function) signature convention +can use it. Projection-specific semantics (e.g. PROJECTION_BRAND) live +in the consuming library, not here.

+

FixedMethods for how the accumulation works.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.METHOD_LITERAL_BRAND.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.METHOD_LITERAL_BRAND.html new file mode 100644 index 00000000..79a8dae2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.METHOD_LITERAL_BRAND.html @@ -0,0 +1,9 @@ +METHOD_LITERAL_BRAND | Libraries

Variable METHOD_LITERAL_BRANDConst

METHOD_LITERAL_BRAND: "__cleverbrush_method_literal_brand__" = ...

Unique string-literal brand key used by FixedMethods to detect +extension methods whose first-argument literal should be accumulated in the +return type.

+

Declare the return type of any extension method as +this & { readonly [METHOD_LITERAL_BRAND]?: N } (where N extends string) +and FixedMethods will automatically make it generic so the literal name +flows through the type system and accumulates across multiple calls.

+

This powers scope-name autocomplete in SchemaQueryBuilder.scoped().

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.SYMBOL_HAS_PROPERTIES.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.SYMBOL_HAS_PROPERTIES.html new file mode 100644 index 00000000..354ed4f7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.SYMBOL_HAS_PROPERTIES.html @@ -0,0 +1,9 @@ +SYMBOL_HAS_PROPERTIES | Libraries

Variable SYMBOL_HAS_PROPERTIESConst

SYMBOL_HAS_PROPERTIES: typeof SYMBOL_HAS_PROPERTIES = ...

A symbol that marks a schema as having sub-properties that can +participate in property descriptor trees. When a schema exposes +[SYMBOL_HAS_PROPERTIES] = true and its introspect() returns +a properties record, it will be recursed into by +ObjectSchemaBuilder.getPropertiesFor() — the same way nested +ObjectSchemaBuilder instances are.

+

Currently implemented by ObjectSchemaBuilder (always) and +ExternSchemaBuilder (when created with an explicit property map).

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR.html new file mode 100644 index 00000000..474feef8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR.html @@ -0,0 +1,5 @@ +SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR | Libraries

Variable SYMBOL_SCHEMA_PROPERTY_DESCRIPTORConst

SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR: typeof SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR = ...

A symbol to mark property descriptors in the schema. +Normally, you should not use it directly unless you want +to develop some advanced features or extend the library. +In normal conditions it's used internally by the library.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.any.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.any.html new file mode 100644 index 00000000..2dd2a2c8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.any.html @@ -0,0 +1 @@ +any | Libraries

Variable anyConst

any: () => ExtendedAny = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.array.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.array.html new file mode 100644 index 00000000..1e111c02 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.array.html @@ -0,0 +1 @@ +array | Libraries

Variable arrayConst

array: <TElementSchema extends SchemaBuilder<any, any, any, any, any>>(
    elementSchema?: TElementSchema,
) => ExtendedArray<TElementSchema> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.arrayExtensions.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.arrayExtensions.html new file mode 100644 index 00000000..3fdffc7e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.arrayExtensions.html @@ -0,0 +1,7 @@ +arrayExtensions | Libraries

Variable arrayExtensionsConst

arrayExtensions: ExtensionDescriptor<
    {
        array: {
            nonempty(
                this: ArraySchemaBuilder<any>,
                errorMessage?: ValidationErrorMessageProvider<
                    ArraySchemaBuilder<
                        any,
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        any[]
                        | unknown[],
                    >,
                >,
            ): ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >;
            unique(
                this: ArraySchemaBuilder<any>,
                keyFn?: (item: any) => unknown,
                errorMessage?: ValidationErrorMessageProvider<
                    ArraySchemaBuilder<
                        any,
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        any[]
                        | unknown[],
                    >,
                >,
            ): ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >;
        };
    },
> = ...

Extension descriptor that adds common array validators +to ArraySchemaBuilder.

+

Included methods: nonempty, unique.

+
import { withExtensions } from '@cleverbrush/schema/core';
import { arrayExtensions } from '@cleverbrush/schema';

const s = withExtensions(arrayExtensions);
const schema = s.array().nonempty().unique(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.boolean.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.boolean.html new file mode 100644 index 00000000..0b7b4e1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.boolean.html @@ -0,0 +1 @@ +boolean | Libraries

Variable booleanConst

boolean: () => ExtendedBoolean = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.date.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.date.html new file mode 100644 index 00000000..fdab3887 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.date.html @@ -0,0 +1 @@ +date | Libraries

Variable dateConst

date: () => ExtendedDate = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.func.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.func.html new file mode 100644 index 00000000..bce39f46 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.func.html @@ -0,0 +1 @@ +func | Libraries

Variable funcConst

func: () => ExtendedFunc = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.number.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.number.html new file mode 100644 index 00000000..cbeeacf8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.number.html @@ -0,0 +1 @@ +number | Libraries

Variable numberConst

number: { (): ExtendedNumber; <T extends number>(equals: T): ExtendedNumber<T> } = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.numberExtensions.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.numberExtensions.html new file mode 100644 index 00000000..f5a7515c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.numberExtensions.html @@ -0,0 +1,7 @@ +numberExtensions | Libraries

Variable numberExtensionsConst

numberExtensions: ExtensionDescriptor<
    {
        number: {
            finite(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            multipleOf(
                this: NumberSchemaBuilder,
                n: number,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            negative(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            oneOf(
                this: NumberSchemaBuilder,
                ...args: any[],
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            positive(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
        };
    },
> = ...

Extension descriptor that adds common number validators +to NumberSchemaBuilder.

+

Included methods: positive, negative, finite, multipleOf, oneOf.

+
import { withExtensions } from '@cleverbrush/schema/core';
import { numberExtensions } from '@cleverbrush/schema';

const s = withExtensions(numberExtensions);
const schema = s.number().positive().multipleOf(5); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.object.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.object.html new file mode 100644 index 00000000..bbfe2f9b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.object.html @@ -0,0 +1 @@ +object | Libraries

Variable objectConst

object: {
    (): ExtendedObject<{}>;
    <TProps extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
        props: TProps,
    ): ExtendedObject<TProps>;
    <TProps extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
        props?: TProps,
    ): ExtendedObject<TProps>;
} = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.promise.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.promise.html new file mode 100644 index 00000000..d710cc30 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.promise.html @@ -0,0 +1 @@ +promise | Libraries

Variable promiseConst

promise: <TWrapped extends SchemaBuilder<any, any, any, any, any>>(
    wrapped: TWrapped,
) => ExtendedPromise<TWrapped> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.record.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.record.html new file mode 100644 index 00000000..d9dd47f6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.record.html @@ -0,0 +1 @@ +record | Libraries

Variable recordConst

record: <
    TKeySchema extends StringSchemaBuilder<any, any, any, any>,
    TValueSchema extends SchemaBuilder<any, any, any, any, any>,
>(
    keySchema: TKeySchema,
    valueSchema: TValueSchema,
) => ExtendedRecord<TKeySchema, TValueSchema> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.string.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.string.html new file mode 100644 index 00000000..275d9dc6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.string.html @@ -0,0 +1 @@ +string | Libraries

Variable stringConst

string: { (): ExtendedString; <T extends string>(equals: T): ExtendedString<T> } = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.stringExtensions.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.stringExtensions.html new file mode 100644 index 00000000..97375753 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.stringExtensions.html @@ -0,0 +1,7 @@ +stringExtensions | Libraries

Variable stringExtensionsConst

stringExtensions: ExtensionDescriptor<
    {
        string: {
            email(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            ip(
                this: StringSchemaBuilder,
                opts?: { version?: "v4" | "v6" },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            nonempty(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            oneOf(
                this: StringSchemaBuilder,
                ...args: any[],
            ): StringSchemaBuilder<string, true, false, false, {}>;
            toLowerCase(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            trim(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            url(
                this: StringSchemaBuilder,
                optsOrError?:
                    | ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >
                    | { protocols?: string[] },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            uuid(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
        };
    },
> = ...

Extension descriptor that adds common string validators and preprocessors +to StringSchemaBuilder.

+

Included methods: email, url, uuid, ip, trim, toLowerCase, nonempty, oneOf.

+
import { withExtensions } from '@cleverbrush/schema/core';
import { stringExtensions } from '@cleverbrush/schema';

const s = withExtensions(stringExtensions);
const schema = s.string().email().trim(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.tuple.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.tuple.html new file mode 100644 index 00000000..fad9dfc4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.tuple.html @@ -0,0 +1 @@ +tuple | Libraries

Variable tupleConst

tuple: <
    const TElements extends
        readonly SchemaBuilder<any, any, any, any, any>[],
>(
    elements: [...TElements],
) => ExtendedTuple<TElements> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.union.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.union.html new file mode 100644 index 00000000..f04cea65 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_schema.union.html @@ -0,0 +1 @@ +union | Libraries

Variable unionConst

union: <TOptions extends SchemaBuilder<any, any, any, any, any>>(
    schema: TOptions,
) => ExtendedUnion<[TOptions]> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..DEFAULT_MAX_BODY_SIZE.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..DEFAULT_MAX_BODY_SIZE.html new file mode 100644 index 00000000..4cda7996 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..DEFAULT_MAX_BODY_SIZE.html @@ -0,0 +1,2 @@ +DEFAULT_MAX_BODY_SIZE | Libraries

Variable DEFAULT_MAX_BODY_SIZEConst

DEFAULT_MAX_BODY_SIZE: number = ...

Default maximum request body size: 5 MB.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..IRequestContext.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..IRequestContext.html new file mode 100644 index 00000000..659b5f23 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..IRequestContext.html @@ -0,0 +1,3 @@ +IRequestContext | Libraries

Variable IRequestContextConst

IRequestContext: ExtendedObject<
    {
        body: FunctionSchemaBuilder<
            true,
            false,
            undefined,
            false,
            {},
            [],
            ExtendedPromise<ExtendedAny>,
            (...args: any[]) => Promise<any>,
        >;
        headers: ExtendedRecord<ExtendedString<string>, ExtendedString<string>>;
        items: ExtendedAny;
        json: FunctionSchemaBuilder<
            true,
            false,
            undefined,
            false,
            {},
            [],
            ExtendedPromise<ExtendedAny>,
            (...args: any[]) => Promise<any>,
        >;
        method: ExtendedString<string>;
        pathParams: ExtendedRecord<ExtendedString<string>, ExtendedString<string>>;
        queryParams: ExtendedRecord<
            ExtendedString<string>,
            ExtendedString<string>,
        >;
        responded: ExtendedBoolean;
        url: ExtendedString<string>;
    },
> = ...

IRequestContext — the schema definition for the request context. +Serves as both a DI key and a type definition.

+
diff --git a/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..endpoint.html b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..endpoint.html new file mode 100644 index 00000000..4c5820ca --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.1/variables/_cleverbrush_server..endpoint.html @@ -0,0 +1,7 @@ +endpoint | Libraries

Variable endpointConst

endpoint: EndpointFactory = ...

The global endpoint factory singleton.

+

Creates EndpointBuilder instances for each HTTP method. Use +createEndpoints to get a role-constrained version.

+
import { endpoint } from '@cleverbrush/server';

const GetUsers = endpoint.get('/api/users');
const CreateUser = endpoint.post('/api/users').body(CreateUserSchema); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/.nojekyll b/websites/docs/public/api-docs/v4.3.2/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/assets/hierarchy.js b/websites/docs/public/api-docs/v4.3.2/assets/hierarchy.js new file mode 100644 index 00000000..735e523f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/hierarchy.js @@ -0,0 +1 @@ +window.hierarchyData = "eJytmd9T2zgQx/8XPwufLdmWnbeDwl07N4Ej9+Ohw3QcWzQqjpTKMlfa4X+/kZyAlDhFtvLCAJPd70e7K2lX+REIzmUbzD7CIk1jAGMMc4CiKEtAnMdxAmCEcAZgkhYYwAKpnzjPIYBJFiEAiyRCIMYJzu5AIMh9QypJOWuD2Y8gxgnC6hdWrkkwC37d0EshuAhA8EBZHcximIOgE00wC6qmbFvS/vKpasgjEUvRtatPVUMJk2G4MwxXct0EoP9wMAtkW58pT2f9P56BkkxjQ3JO5H9cPEyTNY3fkAZBtaJNLQgLZh9jnGTRXU+TRQbN9f19QxmZRmMaOwUiM2P/F10T3slp0qaxkzTODOl/yXKa7M5wZOwRBroMgI6BzkMexWZVLCq+IfWCiEdakRvBH2lN3PFqGg46cIhMHuW5yeFBMF47jhND+/0xcZhmO3HKJBH3ZTWgv29+FODFx16eVEqADojKEIxgbNbMeSmrFWWfF5Q9OIel4Z/D0LR8Oyr6dDN0/+C2pEMwtOrWbmwU9LL1+mNknVvvlgsix1BwsQ61kQOC1sPQrMRLJql8+rMj4mmsqmE6evlq1Xr5SWodlAtZsroU9aJakXX5T/zClOyI1rzumn2cVn883Lc+iqXU2s0uJEmKTYYbwTftmGAcU9eOnELTMfq1I/NyTW5KQVh/L6vQbGOUp+aJ/rQhJ+HTjk7CV2QDOVTu66kp3Bo7Z7DAJ8zgTtw7gYVqjsy6V6XWxyyL0AlzuiP2TukAcZ5uiWNo9nTsqS+k8442Y+6wLfm+vcORneSR1VUKUXoyHHhwoEijxMzcOecNKZkXx5APFxKYmiTvSkm8MA4cuDCkVh1ffpNE+AVjwIULB47MJueqY3oc8SIZdOLCUkBzp/xGGBG08kIZ8uFAksXQzM57tf9b4h+Zo45cmBC0Gq/yu98mPnDgwpBaGZp3TePFcODAhQFHhcWwXhLhSXHgwoWjyMzu4nr5hVTSi2PAhQMHhrkZj5tStGQhherofWCO+XEhSqyh7UbwNW39jtghHy4kWW6ebrek4rs+biLIgAsXjjyH1jjtQTBG225J1AkCdL0AnSOg4wNgjrIE6D4F6F4B6Lsa6HsS6JsK6HsC6BMa6NMR6LMA6N0I9F4AMI+VbZ72bwj6T6u99a7JaeWolme2jN2m8SvGQw8uFKn1vPQ3871LDj04UBTIOrR2bfCHxfV80uh49qXlLBxy4ziBFAjn/hPITzA8ZxEVsLse9BTD5E9APUcQA/RkU6VNO260VC/fp07sieZLFaG9aU2VYR+95BTz5TC2d4YHsLdDpvouwhzxdId5S9quke7nChGPRIShaTzqfiky9TVHUaSR+kKkUD/jPAUoggUCKFI3DopSXPTEGbLfL+tb8rUj7cgX9x30nr3LUZilZt90wdl9Q6uJ8pa1k7jVEFxwJgmTExNmWbuIF6n5bndFGzJR+dX0bVkURYlZo1dcLGldEzYt4ra5k7zVBvwu5Waa8ovlyM2BMqCLDuhIqG2B1RbBGbrr+QozKx/ayRv41dQlLLF1r825Xy3u2bsAQOsVec7lFe9YPS03lrWTeIGsAaGmglRTF2+bu8jbk9JClrJrL3g9dT/uO3BBSHFhd+mkXE+WfzV2kcYZslrispMrLuh3MjH7Bx7egnh+/h963qkR" \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/assets/highlight.css b/websites/docs/public/api-docs/v4.3.2/assets/highlight.css new file mode 100644 index 00000000..bc8fbd4a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/highlight.css @@ -0,0 +1,176 @@ +:root { + --light-hl-0: #000000; + --dark-hl-0: #D4D4D4; + --light-hl-1: #001080; + --dark-hl-1: #9CDCFE; + --light-hl-2: #795E26; + --dark-hl-2: #DCDCAA; + --light-hl-3: #0000FF; + --dark-hl-3: #569CD6; + --light-hl-4: #0070C1; + --dark-hl-4: #4FC1FF; + --light-hl-5: #AF00DB; + --dark-hl-5: #C586C0; + --light-hl-6: #A31515; + --dark-hl-6: #CE9178; + --light-hl-7: #098658; + --dark-hl-7: #B5CEA8; + --light-hl-8: #008000; + --dark-hl-8: #6A9955; + --light-hl-9: #267F99; + --dark-hl-9: #4EC9B0; + --light-hl-10: #000000; + --dark-hl-10: #C8C8C8; + --light-hl-11: #000000FF; + --dark-hl-11: #D4D4D4; + --light-hl-12: #800000; + --dark-hl-12: #808080; + --light-hl-13: #800000; + --dark-hl-13: #569CD6; + --light-hl-14: #E50000; + --dark-hl-14: #9CDCFE; + --light-hl-15: #0451A5; + --dark-hl-15: #9CDCFE; + --light-hl-16: #EE0000; + --dark-hl-16: #D7BA7D; + --light-hl-17: #811F3F; + --dark-hl-17: #D16969; + --light-hl-18: #EE0000; + --dark-hl-18: #DCDCAA; + --light-hl-19: #D16969; + --dark-hl-19: #CE9178; + --light-hl-20: #000000; + --dark-hl-20: #D7BA7D; + --light-hl-21: #0000FF; + --dark-hl-21: #CE9178; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); + --hl-12: var(--light-hl-12); + --hl-13: var(--light-hl-13); + --hl-14: var(--light-hl-14); + --hl-15: var(--light-hl-15); + --hl-16: var(--light-hl-16); + --hl-17: var(--light-hl-17); + --hl-18: var(--light-hl-18); + --hl-19: var(--light-hl-19); + --hl-20: var(--light-hl-20); + --hl-21: var(--light-hl-21); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); + --hl-12: var(--dark-hl-12); + --hl-13: var(--dark-hl-13); + --hl-14: var(--dark-hl-14); + --hl-15: var(--dark-hl-15); + --hl-16: var(--dark-hl-16); + --hl-17: var(--dark-hl-17); + --hl-18: var(--dark-hl-18); + --hl-19: var(--dark-hl-19); + --hl-20: var(--dark-hl-20); + --hl-21: var(--dark-hl-21); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); + --hl-12: var(--light-hl-12); + --hl-13: var(--light-hl-13); + --hl-14: var(--light-hl-14); + --hl-15: var(--light-hl-15); + --hl-16: var(--light-hl-16); + --hl-17: var(--light-hl-17); + --hl-18: var(--light-hl-18); + --hl-19: var(--light-hl-19); + --hl-20: var(--light-hl-20); + --hl-21: var(--light-hl-21); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); + --hl-12: var(--dark-hl-12); + --hl-13: var(--dark-hl-13); + --hl-14: var(--dark-hl-14); + --hl-15: var(--dark-hl-15); + --hl-16: var(--dark-hl-16); + --hl-17: var(--dark-hl-17); + --hl-18: var(--dark-hl-18); + --hl-19: var(--dark-hl-19); + --hl-20: var(--dark-hl-20); + --hl-21: var(--dark-hl-21); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +.hl-9 { color: var(--hl-9); } +.hl-10 { color: var(--hl-10); } +.hl-11 { color: var(--hl-11); } +.hl-12 { color: var(--hl-12); } +.hl-13 { color: var(--hl-13); } +.hl-14 { color: var(--hl-14); } +.hl-15 { color: var(--hl-15); } +.hl-16 { color: var(--hl-16); } +.hl-17 { color: var(--hl-17); } +.hl-18 { color: var(--hl-18); } +.hl-19 { color: var(--hl-19); } +.hl-20 { color: var(--hl-20); } +.hl-21 { color: var(--hl-21); } +pre, code { background: var(--code-background); } diff --git a/websites/docs/public/api-docs/v4.3.2/assets/icons.js b/websites/docs/public/api-docs/v4.3.2/assets/icons.js new file mode 100644 index 00000000..4fbadc5a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `MMNEPVFCICPMFPCPTTAAATR`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/assets/icons.svg b/websites/docs/public/api-docs/v4.3.2/assets/icons.svg new file mode 100644 index 00000000..be7798fc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/icons.svg @@ -0,0 +1 @@ +MMNEPVFCICPMFPCPTTAAATR \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/assets/main.js b/websites/docs/public/api-docs/v4.3.2/assets/main.js new file mode 100644 index 00000000..8182ceec --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/main.js @@ -0,0 +1,60 @@ +"use strict"; +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings.","hierarchy_expand":"Expand","hierarchy_collapse":"Collapse","folder":"Folder","search_index_not_available":"The search index is not available","search_no_results_found_for_0":"No results found for {0}","kind_1":"Project","kind_2":"Module","kind_4":"Namespace","kind_8":"Enumeration","kind_16":"Enumeration Member","kind_32":"Variable","kind_64":"Function","kind_128":"Class","kind_256":"Interface","kind_512":"Constructor","kind_1024":"Property","kind_2048":"Method","kind_4096":"Call Signature","kind_8192":"Index Signature","kind_16384":"Constructor Signature","kind_32768":"Parameter","kind_65536":"Type Literal","kind_131072":"Type Parameter","kind_262144":"Accessor","kind_524288":"Get Signature","kind_1048576":"Set Signature","kind_2097152":"Type Alias","kind_4194304":"Reference","kind_8388608":"Document"}; +"use strict";(()=>{var Ke=Object.create;var he=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var et=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var tt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ze(e))!Ye.call(t,i)&&i!==n&&he(t,i,{get:()=>e[i],enumerable:!(r=Ge(e,i))||r.enumerable});return t};var nt=(t,e,n)=>(n=t!=null?Ke(Xe(t)):{},tt(e||!t||!t.__esModule?he(n,"default",{value:t,enumerable:!0}):n,t));var ye=et((me,ge)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=(function(e){return function(n){e.console&&console.warn&&console.warn(n)}})(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,l],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(oc?d+=2:a==c&&(n+=r[l+1]*i[d+1],l+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),f=s.str.charAt(1),p;f in s.node.edges?p=s.node.edges[f]:(p=new t.TokenSet,s.node.edges[f]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}if(s.type===t.QueryLexer.TERM)return t.QueryParser.parseTerm;var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},(function(e,n){typeof define=="function"&&define.amd?define(n):typeof me=="object"?ge.exports=n():e.lunr=n()})(this,function(){return t})})()});var M,G={getItem(){return null},setItem(){}},K;try{K=localStorage,M=K}catch{K=G,M=G}var S={getItem:t=>M.getItem(t),setItem:(t,e)=>M.setItem(t,e),disableWritingLocalStorage(){M=G},disable(){localStorage.clear(),M=G},enable(){M=K}};window.TypeDoc||={disableWritingLocalStorage(){S.disableWritingLocalStorage()},disableLocalStorage:()=>{S.disable()},enableLocalStorage:()=>{S.enable()}};window.translations||={copy:"Copy",copied:"Copied!",normally_hidden:"This member is normally hidden due to your filter settings.",hierarchy_expand:"Expand",hierarchy_collapse:"Collapse",search_index_not_available:"The search index is not available",search_no_results_found_for_0:"No results found for {0}",folder:"Folder",kind_1:"Project",kind_2:"Module",kind_4:"Namespace",kind_8:"Enumeration",kind_16:"Enumeration Member",kind_32:"Variable",kind_64:"Function",kind_128:"Class",kind_256:"Interface",kind_512:"Constructor",kind_1024:"Property",kind_2048:"Method",kind_4096:"Call Signature",kind_8192:"Index Signature",kind_16384:"Constructor Signature",kind_32768:"Parameter",kind_65536:"Type Literal",kind_131072:"Type Parameter",kind_262144:"Accessor",kind_524288:"Get Signature",kind_1048576:"Set Signature",kind_2097152:"Type Alias",kind_4194304:"Reference",kind_8388608:"Document"};var pe=[];function X(t,e){pe.push({selector:e,constructor:t})}var Z=class{alwaysVisibleMember=null;constructor(){this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){pe.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!rt(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function rt(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var fe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var Ie=nt(ye(),1);async function R(t){let e=Uint8Array.from(atob(t),s=>s.charCodeAt(0)),r=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate")),i=await new Response(r).text();return JSON.parse(i)}var Y="closing",ae="tsd-overlay";function it(){let t=Math.abs(window.innerWidth-document.documentElement.clientWidth);document.body.style.overflow="hidden",document.body.style.paddingRight=`${t}px`}function st(){document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right")}function Ee(t,e){t.addEventListener("animationend",()=>{t.classList.contains(Y)&&(t.classList.remove(Y),document.getElementById(ae)?.remove(),t.close(),st())}),t.addEventListener("cancel",n=>{n.preventDefault(),ve(t)}),e?.closeOnClick&&document.addEventListener("click",n=>{t.open&&!t.contains(n.target)&&ve(t)},!0)}function xe(t){if(t.open)return;let e=document.createElement("div");e.id=ae,document.body.appendChild(e),t.showModal(),it()}function ve(t){if(!t.open)return;document.getElementById(ae)?.classList.add(Y),t.classList.add(Y)}var I=class{el;app;constructor(e){this.el=e.el,this.app=e.app}};var be=document.head.appendChild(document.createElement("style"));be.dataset.for="filters";var le={};function Le(t){for(let e of t.split(/\s+/))if(le.hasOwnProperty(e)&&!le[e])return!0;return!1}var ee=class extends I{key;value;constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),be.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=S.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){S.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),le[`tsd-is-${this.el.name}`]=this.value,this.app.filterChanged(),this.app.updateIndexVisibility()}};var we=0;async function Se(t,e){if(!window.searchData)return;let n=await R(window.searchData);t.data=n,t.index=Ie.Index.load(n.index),e.innerHTML=""}function _e(){let t=document.getElementById("tsd-search-trigger"),e=document.getElementById("tsd-search"),n=document.getElementById("tsd-search-input"),r=document.getElementById("tsd-search-results"),i=document.getElementById("tsd-search-script"),s=document.getElementById("tsd-search-status");if(!(t&&e&&n&&r&&i&&s))throw new Error("Search controls missing");let o={base:document.documentElement.dataset.base};o.base.endsWith("/")||(o.base+="/"),i.addEventListener("error",()=>{let a=window.translations.search_index_not_available;Pe(s,a)}),i.addEventListener("load",()=>{Se(o,s)}),Se(o,s),ot({trigger:t,searchEl:e,results:r,field:n,status:s},o)}function ot(t,e){let{field:n,results:r,searchEl:i,status:s,trigger:o}=t;Ee(i,{closeOnClick:!0});function a(){xe(i),n.setSelectionRange(0,n.value.length)}o.addEventListener("click",a),n.addEventListener("input",fe(()=>{at(r,n,s,e)},200)),n.addEventListener("keydown",l=>{if(r.childElementCount===0||l.ctrlKey||l.metaKey||l.altKey)return;let d=n.getAttribute("aria-activedescendant"),f=d?document.getElementById(d):null;if(f){let p=!1,v=!1;switch(l.key){case"Home":case"End":case"ArrowLeft":case"ArrowRight":v=!0;break;case"ArrowDown":case"ArrowUp":p=l.shiftKey;break}(p||v)&&ke(n)}if(!l.shiftKey)switch(l.key){case"Enter":f?.querySelector("a")?.click();break;case"ArrowUp":Te(r,n,f,-1),l.preventDefault();break;case"ArrowDown":Te(r,n,f,1),l.preventDefault();break}});function c(){ke(n)}n.addEventListener("change",c),n.addEventListener("blur",c),n.addEventListener("click",c),document.body.addEventListener("keydown",l=>{if(l.altKey||l.metaKey||l.shiftKey)return;let d=l.ctrlKey&&l.key==="k",f=!l.ctrlKey&&!ut()&&l.key==="/";(d||f)&&(l.preventDefault(),a())})}function at(t,e,n,r){if(!r.index||!r.data)return;t.innerHTML="",n.innerHTML="",we+=1;let i=e.value.trim(),s;if(i){let a=i.split(" ").map(c=>c.length?`*${c}*`:"").join(" ");s=r.index.search(a).filter(({ref:c})=>{let l=r.data.rows[Number(c)].classes;return!l||!Le(l)})}else s=[];if(s.length===0&&i){let a=window.translations.search_no_results_found_for_0.replace("{0}",` "${te(i)}" `);Pe(n,a);return}for(let a=0;ac.score-a.score);let o=Math.min(10,s.length);for(let a=0;a`,f=Ce(c.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(f+=` (score: ${s[a].score.toFixed(2)})`),c.parent&&(f=` + ${Ce(c.parent,i)}.${f}`);let p=document.createElement("li");p.id=`tsd-search:${we}-${a}`,p.role="option",p.ariaSelected="false",p.classList.value=c.classes??"";let v=document.createElement("a");v.tabIndex=-1,v.href=r.base+c.url,v.innerHTML=d+`${f}`,p.append(v),t.appendChild(p)}}function Te(t,e,n,r){let i;if(r===1?i=n?.nextElementSibling||t.firstElementChild:i=n?.previousElementSibling||t.lastElementChild,i!==n){if(!i||i.role!=="option"){console.error("Option missing");return}i.ariaSelected="true",i.scrollIntoView({behavior:"smooth",block:"nearest"}),e.setAttribute("aria-activedescendant",i.id),n?.setAttribute("aria-selected","false")}}function ke(t){let e=t.getAttribute("aria-activedescendant");(e?document.getElementById(e):null)?.setAttribute("aria-selected","false"),t.setAttribute("aria-activedescendant","")}function Ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(te(t.substring(s,o)),`${te(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(te(t.substring(s))),i.join("")}var lt={"&":"&","<":"<",">":">","'":"'",'"':"""};function te(t){return t.replace(/[&<>"'"]/g,e=>lt[e])}function Pe(t,e){t.innerHTML=e?`
${e}
`:""}var ct=["button","checkbox","file","hidden","image","radio","range","reset","submit"];function ut(){let t=document.activeElement;return t?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SEARCH"?!0:t.tagName==="INPUT"&&!ct.includes(t.type):!1}var D="mousedown",Me="mousemove",$="mouseup",ne={x:0,y:0},Qe=!1,ce=!1,dt=!1,F=!1,Oe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(Oe?"is-mobile":"not-mobile");Oe&&"ontouchstart"in document.documentElement&&(dt=!0,D="touchstart",Me="touchmove",$="touchend");document.addEventListener(D,t=>{ce=!0,F=!1;let e=D=="touchstart"?t.targetTouches[0]:t;ne.y=e.pageY||0,ne.x=e.pageX||0});document.addEventListener(Me,t=>{if(ce&&!F){let e=D=="touchstart"?t.targetTouches[0]:t,n=ne.x-(e.pageX||0),r=ne.y-(e.pageY||0);F=Math.sqrt(n*n+r*r)>10}});document.addEventListener($,()=>{ce=!1});document.addEventListener("click",t=>{Qe&&(t.preventDefault(),t.stopImmediatePropagation(),Qe=!1)});var re=class extends I{active;className;constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener($,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(D,n=>this.onDocumentPointerDown(n)),document.addEventListener($,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){F||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!F&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var ue=new Map,de=class{open;accordions=[];key;constructor(e,n){this.key=e,this.open=n}add(e){this.accordions.push(e),e.open=this.open,e.addEventListener("toggle",()=>{this.toggle(e.open)})}toggle(e){for(let n of this.accordions)n.open=e;S.setItem(this.key,e.toString())}},ie=class extends I{constructor(e){super(e);let n=this.el.querySelector("summary"),r=n.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)});let i=`tsd-accordion-${n.dataset.key??n.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`,s;if(ue.has(i))s=ue.get(i);else{let o=S.getItem(i),a=o?o==="true":this.el.open;s=new de(i,a),ue.set(i,s)}s.add(this.el)}};function He(t){let e=S.getItem("tsd-theme")||"os";t.value=e,Ae(e),t.addEventListener("change",()=>{S.setItem("tsd-theme",t.value),Ae(t.value)})}function Ae(t){document.documentElement.dataset.theme=t}var se;function Ne(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Re),Re())}async function Re(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let e=await R(window.navigationData);se=document.documentElement.dataset.base,se.endsWith("/")||(se+="/"),t.innerHTML="";for(let n of e)Ve(n,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Ve(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',De(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let c=a.appendChild(document.createElement("ul"));c.className="tsd-nested-navigation";for(let l of t.children)Ve(l,c,i)}else De(t,r,t.class)}function De(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));if(r.href=se+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&(r.classList.add("current"),r.ariaCurrent="page"),t.kind){let i=window.translations[`kind_${t.kind}`].replaceAll('"',""");r.innerHTML=``}r.appendChild(Fe(t.text,document.createElement("span")))}else{let r=e.appendChild(document.createElement("span")),i=window.translations.folder.replaceAll('"',""");r.innerHTML=``,r.appendChild(Fe(t.text,document.createElement("span")))}}function Fe(t,e){let n=t.split(/(?<=[^A-Z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|(?<=[_-])(?=[^_-])/);for(let r=0;r{let i=r.target;for(;i.parentElement&&i.parentElement.tagName!="LI";)i=i.parentElement;i.dataset.dropdown&&(i.dataset.dropdown=String(i.dataset.dropdown!=="true"))});let t=new Map,e=new Set;for(let r of document.querySelectorAll(".tsd-full-hierarchy [data-refl]")){let i=r.querySelector("ul");t.has(r.dataset.refl)?e.add(r.dataset.refl):i&&t.set(r.dataset.refl,i)}for(let r of e)n(r);function n(r){let i=t.get(r).cloneNode(!0);i.querySelectorAll("[id]").forEach(s=>{s.removeAttribute("id")}),i.querySelectorAll("[data-dropdown]").forEach(s=>{s.dataset.dropdown="false"});for(let s of document.querySelectorAll(`[data-refl="${r}"]`)){let o=gt(),a=s.querySelector("ul");s.insertBefore(o,a),o.dataset.dropdown=String(!!a),a||s.appendChild(i.cloneNode(!0))}}}function pt(){let t=document.getElementById("tsd-hierarchy-script");t&&(t.addEventListener("load",Be),Be())}async function Be(){let t=document.querySelector(".tsd-panel.tsd-hierarchy:has(h4 a)");if(!t||!window.hierarchyData)return;let e=+t.dataset.refl,n=await R(window.hierarchyData),r=t.querySelector("ul"),i=document.createElement("ul");if(i.classList.add("tsd-hierarchy"),ft(i,n,e),r.querySelectorAll("li").length==i.querySelectorAll("li").length)return;let s=document.createElement("span");s.classList.add("tsd-hierarchy-toggle"),s.textContent=window.translations.hierarchy_expand,t.querySelector("h4 a")?.insertAdjacentElement("afterend",s),s.insertAdjacentText("beforebegin",", "),s.addEventListener("click",()=>{s.textContent===window.translations.hierarchy_expand?(r.insertAdjacentElement("afterend",i),r.remove(),s.textContent=window.translations.hierarchy_collapse):(i.insertAdjacentElement("afterend",r),i.remove(),s.textContent=window.translations.hierarchy_expand)})}function ft(t,e,n){let r=e.roots.filter(i=>mt(e,i,n));for(let i of r)t.appendChild(je(e,i,n))}function je(t,e,n,r=new Set){if(r.has(e))return;r.add(e);let i=t.reflections[e],s=document.createElement("li");if(s.classList.add("tsd-hierarchy-item"),e===n){let o=s.appendChild(document.createElement("span"));o.textContent=i.name,o.classList.add("tsd-hierarchy-target")}else{for(let a of i.uniqueNameParents||[]){let c=t.reflections[a],l=s.appendChild(document.createElement("a"));l.textContent=c.name,l.href=oe+c.url,l.className=c.class+" tsd-signature-type",s.append(document.createTextNode("."))}let o=s.appendChild(document.createElement("a"));o.textContent=t.reflections[e].name,o.href=oe+i.url,o.className=i.class+" tsd-signature-type"}if(i.children){let o=s.appendChild(document.createElement("ul"));o.classList.add("tsd-hierarchy");for(let a of i.children){let c=je(t,a,n,r);c&&o.appendChild(c)}}return r.delete(e),s}function mt(t,e,n){if(e===n)return!0;let r=new Set,i=[t.reflections[e]];for(;i.length;){let s=i.pop();if(!r.has(s)){r.add(s);for(let o of s.children||[]){if(o===n)return!0;i.push(t.reflections[o])}}}return!1}function gt(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("width","20"),t.setAttribute("height","20"),t.innerHTML='',t}X(re,"a[data-toggle]");X(ie,".tsd-accordion");X(ee,".tsd-filter-item input[type=checkbox]");var qe=document.getElementById("tsd-theme");qe&&He(qe);var yt=new Z;Object.defineProperty(window,"app",{value:yt});_e();Ne();$e();"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!0);})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/websites/docs/public/api-docs/v4.3.2/assets/navigation.js b/websites/docs/public/api-docs/v4.3.2/assets/navigation.js new file mode 100644 index 00000000..34fa565b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "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" \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/assets/search.js b/websites/docs/public/api-docs/v4.3.2/assets/search.js new file mode 100644 index 00000000..89abaebb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/search.js @@ -0,0 +1 @@ +window.searchData = "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"; \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/assets/style.css b/websites/docs/public/api-docs/v4.3.2/assets/style.css new file mode 100644 index 00000000..44328e99 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/assets/style.css @@ -0,0 +1,1633 @@ +@layer typedoc { + :root { + --dim-toolbar-contents-height: 2.5rem; + --dim-toolbar-border-bottom-width: 1px; + --dim-header-height: calc( + var(--dim-toolbar-border-bottom-width) + + var(--dim-toolbar-contents-height) + ); + + /* 0rem For mobile; unit is required for calculation in `calc` */ + --dim-container-main-margin-y: 0rem; + + --dim-footer-height: 3.5rem; + + --modal-animation-duration: 0.2s; + } + + :root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + /* Not to be confused with [:active](https://developer.mozilla.org/en-US/docs/Web/CSS/:active) */ + --light-color-background-active: #d6d8da; + --light-color-background-warning: #e6e600; + --light-color-warning-text: #222; + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-background-active); + --light-color-text: #222; + --light-color-contrast-text: #000; + --light-color-text-aside: #5e5e5e; + + --light-color-icon-background: var(--light-color-background); + --light-color-icon-text: var(--light-color-text); + + --light-color-comment-tag-text: var(--light-color-text); + --light-color-comment-tag: var(--light-color-background); + + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: #9f5f30; + --light-color-ts-method: #be3989; + --light-color-ts-reference: #ff4d82; + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var( + --light-color-ts-constructor + ); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: #c73c3c; + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; + + --light-color-alert-note: #0969d9; + --light-color-alert-tip: #1a7f37; + --light-color-alert-important: #8250df; + --light-color-alert-warning: #9a6700; + --light-color-alert-caution: #cf222e; + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + } + + :root { + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + /* Not to be confused with [:active](https://developer.mozilla.org/en-US/docs/Web/CSS/:active) */ + --dark-color-background-active: #5d5d6a; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: var(--dark-color-background-active); + --dark-color-text: #f5f5f5; + --dark-color-contrast-text: #ffffff; + --dark-color-text-aside: #dddddd; + + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-icon-text: var(--dark-color-text); + + --dark-color-comment-tag-text: var(--dark-color-text); + --dark-color-comment-tag: var(--dark-color-background); + + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: #ff984d; + --dark-color-ts-method: #ff4db8; + --dark-color-ts-reference: #ff4d82; + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: #ff6060; + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; + + --dark-color-alert-note: #0969d9; + --dark-color-alert-tip: #1a7f37; + --dark-color-alert-important: #8250df; + --dark-color-alert-warning: #9a6700; + --dark-color-alert-caution: #cf222e; + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; + } + + @media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var( + --light-color-background-secondary + ); + --color-background-active: var(--light-color-background-active); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-contrast-text: var(--light-color-contrast-text); + --color-text-aside: var(--light-color-text-aside); + + --color-icon-background: var(--light-color-icon-background); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --color-alert-note: var(--light-color-alert-note); + --color-alert-tip: var(--light-color-alert-tip); + --color-alert-important: var(--light-color-alert-important); + --color-alert-warning: var(--light-color-alert-warning); + --color-alert-caution: var(--light-color-alert-caution); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } + } + + @media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var( + --dark-color-background-secondary + ); + --color-background-active: var(--dark-color-background-active); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-contrast-text: var(--dark-color-contrast-text); + --color-text-aside: var(--dark-color-text-aside); + + --color-icon-background: var(--dark-color-icon-background); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --color-alert-note: var(--dark-color-alert-note); + --color-alert-tip: var(--dark-color-alert-tip); + --color-alert-important: var(--dark-color-alert-important); + --color-alert-warning: var(--dark-color-alert-warning); + --color-alert-caution: var(--dark-color-alert-caution); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } + } + + :root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-active: var(--light-color-background-active); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-contrast-text: var(--light-color-contrast-text); + --color-text-aside: var(--light-color-text-aside); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --color-note: var(--light-color-note); + --color-tip: var(--light-color-tip); + --color-important: var(--light-color-important); + --color-warning: var(--light-color-warning); + --color-caution: var(--light-color-caution); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } + + :root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-active: var(--dark-color-background-active); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-contrast-text: var(--dark-color-contrast-text); + --color-text-aside: var(--dark-color-text-aside); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --color-note: var(--dark-color-note); + --color-tip: var(--dark-color-tip); + --color-important: var(--dark-color-important); + --color-warning: var(--dark-color-warning); + --color-caution: var(--dark-color-caution); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } + + html { + color-scheme: var(--color-scheme); + @media (prefers-reduced-motion: no-preference) { + scroll-behavior: smooth; + } + } + + *:focus-visible, + .tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); + } + + .always-visible, + .always-visible .tsd-signatures { + display: inherit !important; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.2; + } + + h1 { + font-size: 1.875rem; + margin: 0.67rem 0; + } + + h2 { + font-size: 1.5rem; + margin: 0.83rem 0; + } + + h3 { + font-size: 1.25rem; + margin: 1rem 0; + } + + h4 { + font-size: 1.05rem; + margin: 1.33rem 0; + } + + h5 { + font-size: 1rem; + margin: 1.5rem 0; + } + + h6 { + font-size: 0.875rem; + margin: 2.33rem 0; + } + + dl, + menu, + ol, + ul { + margin: 1em 0; + } + + dd { + margin: 0 0 0 34px; + } + + .container { + max-width: 1700px; + padding: 0 2rem; + } + + /* Footer */ + footer { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: var(--dim-footer-height); + } + footer > p { + margin: 0 1em; + } + + .container-main { + margin: var(--dim-container-main-margin-y) auto; + /* toolbar, footer, margin */ + min-height: calc( + 100svh - var(--dim-header-height) - var(--dim-footer-height) - + 2 * var(--dim-container-main-margin-y) + ); + } + + @keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + @keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } + } + @keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } + } + @keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } + } + body { + background: var(--color-background); + font-family: + -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-size: 16px; + color: var(--color-text); + margin: 0; + } + + a { + color: var(--color-link); + text-decoration: none; + } + a:hover { + text-decoration: underline; + } + a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; + } + a.tsd-anchor-link { + color: var(--color-text); + } + :target { + scroll-margin-block: calc(var(--dim-header-height) + 0.5rem); + } + + code, + pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; + } + + pre { + position: relative; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); + margin-bottom: 8px; + } + pre code { + padding: 0; + font-size: 100%; + } + pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; + } + pre:hover > button, + pre > button.visible, + pre > button:focus-visible { + opacity: 1; + } + + blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; + } + + img { + max-width: 100%; + } + + * { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); + } + + *::-webkit-scrollbar { + width: 0.75rem; + } + + *::-webkit-scrollbar-track { + background: var(--color-icon-background); + } + + *::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); + } + + dialog { + border: none; + outline: none; + padding: 0; + background-color: var(--color-background); + } + dialog::backdrop { + display: none; + } + #tsd-overlay { + background-color: rgba(0, 0, 0, 0.5); + position: fixed; + z-index: 9999; + top: 0; + left: 0; + right: 0; + bottom: 0; + animation: fade-in var(--modal-animation-duration) forwards; + } + #tsd-overlay.closing { + animation-name: fade-out; + } + + .tsd-typography { + line-height: 1.333em; + } + .tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; + } + .tsd-typography .tsd-index-panel h3, + .tsd-index-panel .tsd-typography h3, + .tsd-typography h4, + .tsd-typography h5, + .tsd-typography h6 { + font-size: 1em; + } + .tsd-typography h5, + .tsd-typography h6 { + font-weight: normal; + } + .tsd-typography p, + .tsd-typography ul, + .tsd-typography ol { + margin: 1em 0; + } + .tsd-typography table { + border-collapse: collapse; + border: none; + } + .tsd-typography td, + .tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); + } + .tsd-typography thead, + .tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); + } + + .tsd-alert { + padding: 8px 16px; + margin-bottom: 16px; + border-left: 0.25em solid var(--alert-color); + } + .tsd-alert blockquote > :last-child, + .tsd-alert > :last-child { + margin-bottom: 0; + } + .tsd-alert-title { + color: var(--alert-color); + display: inline-flex; + align-items: center; + } + .tsd-alert-title span { + margin-left: 4px; + } + + .tsd-alert-note { + --alert-color: var(--color-alert-note); + } + .tsd-alert-tip { + --alert-color: var(--color-alert-tip); + } + .tsd-alert-important { + --alert-color: var(--color-alert-important); + } + .tsd-alert-warning { + --alert-color: var(--color-alert-warning); + } + .tsd-alert-caution { + --alert-color: var(--color-alert-caution); + } + + .tsd-breadcrumb { + margin: 0; + margin-top: 1rem; + padding: 0; + color: var(--color-text-aside); + } + .tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; + } + .tsd-breadcrumb a:hover { + text-decoration: underline; + } + .tsd-breadcrumb li { + display: inline; + } + .tsd-breadcrumb li:after { + content: " / "; + } + + .tsd-comment-tags { + display: flex; + flex-direction: column; + } + dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; + } + dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; + } + dl.tsd-comment-tag-group dd { + margin: 0; + } + code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; + } + h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; + } + + dl.tsd-comment-tag-group dd:before, + dl.tsd-comment-tag-group dd:after { + content: " "; + } + dl.tsd-comment-tag-group dd pre, + dl.tsd-comment-tag-group dd:after { + clear: both; + } + dl.tsd-comment-tag-group p { + margin: 0; + } + + .tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; + } + .tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; + } + + .tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; + } + .tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; + } + .tsd-filter-input { + display: flex; + width: -moz-fit-content; + width: fit-content; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + } + .tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; + } + .tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; + } + .tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; + } + .tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); + } + .tsd-checkbox-background { + fill: var(--color-accent); + } + input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); + } + .tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; + } + .tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); + } + + .settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; + } + + .tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; + } + + .tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; + } + + .tsd-hierarchy h4 label:hover span { + text-decoration: underline; + } + + .tsd-hierarchy { + list-style: square; + margin: 0; + } + .tsd-hierarchy-target { + font-weight: bold; + } + .tsd-hierarchy-toggle { + color: var(--color-link); + cursor: pointer; + } + + .tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); + } + .tsd-full-hierarchy, + .tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; + } + .tsd-full-hierarchy ul { + padding-left: 1.5rem; + } + .tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); + } + .tsd-full-hierarchy svg[data-dropdown] { + cursor: pointer; + } + .tsd-full-hierarchy svg[data-dropdown="false"] { + transform: rotate(-90deg); + } + .tsd-full-hierarchy svg[data-dropdown="false"] ~ ul { + display: none; + } + + .tsd-panel-group.tsd-index-group { + margin-bottom: 0; + } + .tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; + } + @media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } + } + @media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } + } + .tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; + } + + .tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; + } + + .tsd-anchor { + position: relative; + top: -100px; + } + + .tsd-member { + position: relative; + } + .tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; + } + + .tsd-navigation.settings { + margin: 0; + margin-bottom: 1rem; + } + .tsd-navigation > a, + .tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; + } + .tsd-navigation a, + .tsd-navigation summary > span, + .tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; + } + .tsd-navigation a.current, + .tsd-page-navigation a.current { + background: var(--color-active-menu-item); + color: var(--color-contrast-text); + } + .tsd-navigation a:hover, + .tsd-page-navigation a:hover { + text-decoration: underline; + } + .tsd-navigation ul, + .tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; + } + .tsd-navigation li, + .tsd-page-navigation li { + padding: 0; + max-width: 100%; + } + .tsd-navigation .tsd-nav-link { + display: none; + } + .tsd-nested-navigation { + margin-left: 3rem; + } + .tsd-nested-navigation > li > details { + margin-left: -1.5rem; + } + .tsd-small-nested-navigation { + margin-left: 1.5rem; + } + .tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; + } + + .tsd-page-navigation-section > summary { + padding: 0.25rem; + } + .tsd-page-navigation-section > summary > svg { + margin-right: 0.25rem; + } + .tsd-page-navigation-section > div { + margin-left: 30px; + } + .tsd-page-navigation ul { + padding-left: 1.75rem; + } + + #tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; + } + #tsd-sidebar-links a:last-of-type { + margin-bottom: 0; + } + + a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); + } + .tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ + display: flex; + align-items: center; + gap: 0.25rem; + box-sizing: border-box; + } + .tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ + } + .tsd-accordion-summary, + .tsd-accordion-summary a { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + + cursor: pointer; + } + .tsd-accordion-summary a { + width: calc(100% - 1.5rem); + } + .tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; + } + /* + * We need to be careful to target the arrow indicating whether the accordion + * is open, but not any other SVGs included in the details element. + */ + .tsd-accordion:not([open]) > .tsd-accordion-summary > svg:first-child { + transform: rotate(-90deg); + } + .tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; + } + .tsd-index-summary { + margin-top: 1.5rem; + margin-bottom: 0.75rem; + display: flex; + align-content: center; + } + + .tsd-no-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; + } + .tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; + } + + .tsd-panel { + margin-bottom: 2.5rem; + } + .tsd-panel.tsd-member { + margin-bottom: 4rem; + } + .tsd-panel:empty { + display: none; + } + .tsd-panel > h1, + .tsd-panel > h2, + .tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; + } + .tsd-panel > h1.tsd-before-signature, + .tsd-panel > h2.tsd-before-signature, + .tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; + } + + .tsd-panel-group { + margin: 2rem 0; + } + .tsd-panel-group.tsd-index-group { + margin: 2rem 0; + } + .tsd-panel-group.tsd-index-group details { + margin: 2rem 0; + } + .tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; + } + + #tsd-search[open] { + animation: fade-in var(--modal-animation-duration) ease-out forwards; + } + #tsd-search[open].closing { + animation-name: fade-out; + } + + /* Avoid setting `display` on closed dialog */ + #tsd-search[open] { + display: flex; + flex-direction: column; + padding: 1rem; + width: 32rem; + max-width: 90vw; + max-height: calc(100vh - env(keyboard-inset-height, 0px) - 25vh); + /* Anchor dialog to top */ + margin-top: 10vh; + border-radius: 6px; + will-change: max-height; + } + #tsd-search-input { + box-sizing: border-box; + width: 100%; + padding: 0 0.625rem; /* 10px */ + outline: 0; + border: 2px solid var(--color-accent); + background-color: transparent; + color: var(--color-text); + border-radius: 4px; + height: 2.5rem; + flex: 0 0 auto; + font-size: 0.875rem; + transition: border-color 0.2s, background-color 0.2s; + } + #tsd-search-input:focus-visible { + background-color: var(--color-background-active); + border-color: transparent; + color: var(--color-contrast-text); + } + #tsd-search-input::placeholder { + color: inherit; + opacity: 0.8; + } + #tsd-search-results { + margin: 0; + padding: 0; + list-style: none; + flex: 1 1 auto; + display: flex; + flex-direction: column; + overflow-y: auto; + } + #tsd-search-results:not(:empty) { + margin-top: 0.5rem; + } + #tsd-search-results > li { + background-color: var(--color-background); + line-height: 1.5; + box-sizing: border-box; + border-radius: 4px; + } + #tsd-search-results > li:nth-child(even) { + background-color: var(--color-background-secondary); + } + #tsd-search-results > li:is(:hover, [aria-selected="true"]) { + background-color: var(--color-background-active); + color: var(--color-contrast-text); + } + /* It's important that this takes full size of parent `li`, to capture a click on `li` */ + #tsd-search-results > li > a { + display: flex; + align-items: center; + padding: 0.5rem 0.25rem; + box-sizing: border-box; + width: 100%; + } + #tsd-search-results > li > a > .text { + flex: 1 1 auto; + min-width: 0; + overflow-wrap: anywhere; + } + #tsd-search-results > li > a .parent { + color: var(--color-text-aside); + } + #tsd-search-results > li > a mark { + color: inherit; + background-color: inherit; + font-weight: bold; + } + #tsd-search-status { + flex: 1; + display: grid; + place-content: center; + text-align: center; + overflow-wrap: anywhere; + } + #tsd-search-status:not(:empty) { + min-height: 6rem; + } + + .tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; + } + + .tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; + } + + .tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; + } + + .tsd-signature-type { + font-style: italic; + font-weight: normal; + } + + .tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; + } + .tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; + } + .tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; + } + .tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; + } + .tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; + } + + ul.tsd-parameter-list, + ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; + } + ul.tsd-parameter-list > li.tsd-parameter-signature, + ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; + } + ul.tsd-parameter-list h5, + ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; + } + .tsd-sources { + margin-top: 1rem; + font-size: 0.875em; + } + .tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; + } + .tsd-sources ul { + list-style: none; + padding: 0; + } + + .tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: var(--dim-toolbar-border-bottom-width) + var(--color-accent) solid; + transition: transform 0.3s ease-in-out; + } + .tsd-page-toolbar a { + color: var(--color-text); + } + .tsd-toolbar-contents { + display: flex; + align-items: center; + height: var(--dim-toolbar-contents-height); + margin: 0 auto; + } + .tsd-toolbar-contents > .title { + font-weight: bold; + margin-right: auto; + } + #tsd-toolbar-links { + display: flex; + align-items: center; + gap: 1.5rem; + margin-right: 1rem; + } + + .tsd-widget { + box-sizing: border-box; + display: inline-block; + opacity: 0.8; + height: 2.5rem; + width: 2.5rem; + transition: opacity 0.1s, background-color 0.1s; + text-align: center; + cursor: pointer; + border: none; + background-color: transparent; + } + .tsd-widget:hover { + opacity: 0.9; + } + .tsd-widget:active { + opacity: 1; + background-color: var(--color-accent); + } + #tsd-toolbar-menu-trigger { + display: none; + } + + .tsd-member-summary-name { + display: inline-flex; + align-items: center; + padding: 0.25rem; + text-decoration: none; + } + + .tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + color: var(--color-text); + vertical-align: middle; + } + + .tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; + } + + .tsd-member-summary-name:hover > .tsd-anchor-icon svg, + .tsd-anchor-link:hover > .tsd-anchor-icon svg, + .tsd-anchor-icon:focus-visible svg { + visibility: visible; + } + + .deprecated { + text-decoration: line-through !important; + } + + .warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); + } + + .tsd-kind-project { + color: var(--color-ts-project); + } + .tsd-kind-module { + color: var(--color-ts-module); + } + .tsd-kind-namespace { + color: var(--color-ts-namespace); + } + .tsd-kind-enum { + color: var(--color-ts-enum); + } + .tsd-kind-enum-member { + color: var(--color-ts-enum-member); + } + .tsd-kind-variable { + color: var(--color-ts-variable); + } + .tsd-kind-function { + color: var(--color-ts-function); + } + .tsd-kind-class { + color: var(--color-ts-class); + } + .tsd-kind-interface { + color: var(--color-ts-interface); + } + .tsd-kind-constructor { + color: var(--color-ts-constructor); + } + .tsd-kind-property { + color: var(--color-ts-property); + } + .tsd-kind-method { + color: var(--color-ts-method); + } + .tsd-kind-reference { + color: var(--color-ts-reference); + } + .tsd-kind-call-signature { + color: var(--color-ts-call-signature); + } + .tsd-kind-index-signature { + color: var(--color-ts-index-signature); + } + .tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); + } + .tsd-kind-parameter { + color: var(--color-ts-parameter); + } + .tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); + } + .tsd-kind-accessor { + color: var(--color-ts-accessor); + } + .tsd-kind-get-signature { + color: var(--color-ts-get-signature); + } + .tsd-kind-set-signature { + color: var(--color-ts-set-signature); + } + .tsd-kind-type-alias { + color: var(--color-ts-type-alias); + } + + /* if we have a kind icon, don't color the text by kind */ + .tsd-kind-icon ~ span { + color: var(--color-text); + } + + /* mobile */ + @media (max-width: 769px) { + #tsd-toolbar-menu-trigger { + display: inline-block; + /* temporary fix to vertically align, for compatibility */ + line-height: 2.5; + } + #tsd-toolbar-links { + display: none; + } + + .container-main { + display: flex; + } + .col-content { + float: none; + max-width: 100%; + width: 100%; + } + .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + .col-sidebar > *:last-child { + padding-bottom: 20px; + } + .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } + } + + /* one sidebar */ + @media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + --dim-container-main-margin-y: 2rem; + } + + .tsd-breadcrumb { + margin-top: 0; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } + } + @media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc( + 100vh - var(--dim-header-height) - var(--dim-footer-height) - + 2 * var(--dim-container-main-margin-y) + ); + overflow: auto; + position: sticky; + top: calc( + var(--dim-header-height) + var(--dim-container-main-margin-y) + ); + } + .site-menu { + margin-top: 1rem; + } + } + + /* two sidebars */ + @media (min-width: 1200px) { + .container-main { + grid-template-columns: + minmax(0, 1fr) minmax(0, 2.5fr) minmax( + 0, + 20rem + ); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 0rem; + } + + .page-menu, + .site-menu { + max-height: calc( + 100vh - var(--dim-header-height) - var(--dim-footer-height) - + 2 * var(--dim-container-main-margin-y) + ); + overflow: auto; + position: sticky; + top: calc( + var(--dim-header-height) + var(--dim-container-main-margin-y) + ); + } + } +} diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_async.Collector.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_async.Collector.html new file mode 100644 index 00000000..8c32ac93 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_async.Collector.html @@ -0,0 +1,183 @@ +Collector | Libraries

Class Collector<T, K>

Allows to collect results of async operations and wait for all of them to finish +supports timeout and promise interface to wait for all results. +Also implementes EventEmitter interface.

+
const collector = new Collector(['a', 'b', 'c']);
collector.collect('a', Promise.resolve(1));
collector.collect('b', Promise.resolve(2));
collector.collect('c', Promise.resolve(3));
collector.on('end', (result) => {
console.log(result); // { a: 1, b: 2, c: 3 }
}); +
+ +

or using promise interface

+
const collector = new Collector(['a', 'b', 'c']);
collector.collect('a', Promise.resolve(1));
collector.collect('b', Promise.resolve(2));
collector.collect('c', Promise.resolve(3));
collector.toPromise().then((result) => {
console.log(result); // { a: 1, b: 2, c: 3 }
+
+ +

Type Parameters

  • T extends Record<string, unknown>
  • K extends keyof T = keyof T

Hierarchy

  • EventEmitter
    • Collector

Implements

  • ICollector<T>
Index

Constructors

  • Type Parameters

    • T extends Record<string, unknown>
    • K extends string | number | symbol = keyof T

    Parameters

    • keys: K[]

      array of keys to collect

      +
    • timeout: number = -1

      optional timeout in ms. If timeout is reached, collector will emit 'timeout' event and reject promise

      +

    Returns Collector<T, K>

Methods

  • The Symbol.for('nodejs.rejection') method is called in case a +promise rejection happens when emitting an event and +captureRejections is enabled on the emitter. +It is possible to use events.captureRejectionSymbol in +place of Symbol.for('nodejs.rejection').

    +
    import { EventEmitter, captureRejectionSymbol } from 'node:events';

    class MyClass extends EventEmitter {
    constructor() {
    super({ captureRejections: true });
    }

    [captureRejectionSymbol](err, event, ...args) {
    console.log('rejection happened for', event, 'with', err, ...args);
    this.destroy(err);
    }

    destroy(err) {
    // Tear the resource down here.
    }
    } +
    + +

    Parameters

    • error: Error
    • event: string | symbol
    • ...args: any[]

    Returns void

    v13.4.0, v12.16.0

    +
  • Alias for emitter.on(eventName, listener).

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v0.1.26

    +
  • Collects value for given key

    +

    Type Parameters

    • L extends string | number | symbol

    Parameters

    • key: L

      key to collect

      +
    • value: T[L]

      value to collect for given key. If value is Promise - it will be awaited and result will be collected

      +

    Returns this

    this to allow chaining

    +
  • Synchronously calls each of the listeners registered for the event named +eventName, in the order they were registered, passing the supplied arguments +to each.

    +

    Returns true if the event had listeners, false otherwise.

    +
    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • ...args: any[]

    Returns boolean

    v0.1.26

    +
  • Returns an array listing the events for which the emitter has registered +listeners.

    +
    import { EventEmitter } from 'node:events';

    const myEE = new EventEmitter();
    myEE.on('foo', () => {});
    myEE.on('bar', () => {});

    const sym = Symbol('symbol');
    myEE.on(sym, () => {});

    console.log(myEE.eventNames());
    // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
    + +

    Returns (string | symbol)[]

    v6.0.0

    +
  • Returns the current max listener value for the EventEmitter which is either +set by emitter.setMaxListeners(n) or defaults to +events.defaultMaxListeners.

    +

    Returns number

    v1.0.0

    +
  • Returns the number of listeners listening for the event named eventName. +If listener is provided, it will return how many times the listener is found +in the list of the listeners of the event.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      +
    • Optionallistener: (...args: any[]) => void

      The event handler function

      +

    Returns number

    v3.2.0

    +
  • Returns a copy of the array of listeners for the event named eventName.

    +
    server.on('connection', (stream) => {
    console.log('someone connected!');
    });
    console.log(util.inspect(server.listeners('connection')));
    // Prints: [ [Function] ] +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

    Returns ((...args: any[]) => void)[]

    v0.1.26

    +
  • Alias for emitter.removeListener().

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v10.0.0

    +
  • Adds the listener function to the end of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple +times.

    +
    server.on('connection', (stream) => {
    console.log('someone connected!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    By default, event listeners are invoked in the order they are added. The +emitter.prependListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

    +
    import { EventEmitter } from 'node:events';
    const myEE = new EventEmitter();
    myEE.on('foo', () => console.log('a'));
    myEE.prependListener('foo', () => console.log('b'));
    myEE.emit('foo');
    // Prints:
    // b
    // a +
    + +

    Type Parameters

    • M extends keyof CollectorEvents<T>

    Parameters

    • event: M
    • listener: CollectorEvents<T>[M]

      The callback function

      +

    Returns this

    v0.1.101

    +
  • Adds a one-time listener function for the event named eventName. The +next time eventName is triggered, this listener is removed and then invoked.

    +
    server.once('connection', (stream) => {
    console.log('Ah, we have our first user!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    By default, event listeners are invoked in the order they are added. The +emitter.prependOnceListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

    +
    import { EventEmitter } from 'node:events';
    const myEE = new EventEmitter();
    myEE.once('foo', () => console.log('a'));
    myEE.prependOnceListener('foo', () => console.log('b'));
    myEE.emit('foo');
    // Prints:
    // b
    // a +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v0.3.0

    +
  • Adds the listener function to the beginning of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple +times.

    +
    server.prependListener('connection', (stream) => {
    console.log('someone connected!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v6.0.0

    +
  • Adds a one-time listener function for the event named eventName to the +beginning of the listeners array. The next time eventName is triggered, this +listener is removed, and then invoked.

    +
    server.prependOnceListener('connection', (stream) => {
    console.log('Ah, we have our first user!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v6.0.0

    +
  • Returns a copy of the array of listeners for the event named eventName, +including any wrappers (such as those created by .once()).

    +
    import { EventEmitter } from 'node:events';
    const emitter = new EventEmitter();
    emitter.once('log', () => console.log('log once'));

    // Returns a new Array with a function `onceWrapper` which has a property
    // `listener` which contains the original listener bound above
    const listeners = emitter.rawListeners('log');
    const logFnWrapper = listeners[0];

    // Logs "log once" to the console and does not unbind the `once` event
    logFnWrapper.listener();

    // Logs "log once" to the console and removes the listener
    logFnWrapper();

    emitter.on('log', () => console.log('log persistently'));
    // Will return a new Array with a single function bound by `.on()` above
    const newListeners = emitter.rawListeners('log');

    // Logs "log persistently" twice
    newListeners[0]();
    emitter.emit('log'); +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

    Returns ((...args: any[]) => void)[]

    v9.4.0

    +
  • Removes all listeners, or those of the specified eventName.

    +

    It is bad practice to remove listeners added elsewhere in the code, +particularly when the EventEmitter instance was created by some other +component or module (e.g. sockets or file streams).

    +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • OptionaleventName: string | symbol

    Returns this

    v0.1.26

    +
  • Removes the specified listener from the listener array for the event named +eventName.

    +
    const callback = (stream) => {
    console.log('someone connected!');
    };
    server.on('connection', callback);
    // ...
    server.removeListener('connection', callback); +
    + +

    removeListener() will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified eventName, then removeListener() must be +called multiple times to remove each instance.

    +

    Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any +removeListener() or removeAllListeners() calls after emitting and +before the last listener finishes execution will not remove them from +emit() in progress. Subsequent events behave as expected.

    +
    import { EventEmitter } from 'node:events';
    class MyEmitter extends EventEmitter {}
    const myEmitter = new MyEmitter();

    const callbackA = () => {
    console.log('A');
    myEmitter.removeListener('event', callbackB);
    };

    const callbackB = () => {
    console.log('B');
    };

    myEmitter.on('event', callbackA);

    myEmitter.on('event', callbackB);

    // callbackA removes listener callbackB but it will still be called.
    // Internal listener array at time of emit [callbackA, callbackB]
    myEmitter.emit('event');
    // Prints:
    // A
    // B

    // callbackB is now removed.
    // Internal listener array [callbackA]
    myEmitter.emit('event');
    // Prints:
    // A +
    + +

    Because listeners are managed using an internal array, calling this will +change the position indexes of any listener registered after the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the emitter.listeners() method will need to be recreated.

    +

    When a single function has been added as a handler multiple times for a single +event (as in the example below), removeListener() will remove the most +recently added instance. In the example the once('ping') +listener is removed:

    +
    import { EventEmitter } from 'node:events';
    const ee = new EventEmitter();

    function pong() {
    console.log('pong');
    }

    ee.on('ping', pong);
    ee.once('ping', pong);
    ee.removeListener('ping', pong);

    ee.emit('ping');
    ee.emit('ping'); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v0.1.26

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The emitter.setMaxListeners() method allows the limit to be +modified for this specific EventEmitter instance. The value can be set to +Infinity (or 0) to indicate an unlimited number of listeners.

    +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Parameters

    • n: number

    Returns this

    v0.3.5

    +
  • Returns promise that will be resolved when all items are collected or rejected if timeout is reached.

    +

    Returns Promise<T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_async.TimeoutError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_async.TimeoutError.html new file mode 100644 index 00000000..a71d5439 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_async.TimeoutError.html @@ -0,0 +1,38 @@ +TimeoutError | Libraries

Error thrown by withTimeout when the operation exceeds the +specified duration.

+

Hierarchy

  • Error
    • TimeoutError
Index

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
timeout: number

The timeout duration in milliseconds that was exceeded.

+
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.AuthorizationService.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.AuthorizationService.html new file mode 100644 index 00000000..715a9cc9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.AuthorizationService.html @@ -0,0 +1,16 @@ +AuthorizationService | Libraries

Class AuthorizationService

Evaluates authorization requirements or named policies against a principal.

+

Instantiated internally by ServerBuilder.useAuthorization() or directly +for use outside the server framework.

+
Index

Constructors

Methods

Constructors

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.PolicyBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.PolicyBuilder.html new file mode 100644 index 00000000..d480337f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.PolicyBuilder.html @@ -0,0 +1,12 @@ +PolicyBuilder | Libraries

Fluent builder for composing AuthorizationPolicy instances.

+
const policy = new PolicyBuilder()
.requireRole('admin')
.require(p => p.hasClaim('verified', 'true'))
.build('admin-only'); +
+ +
Index

Constructors

Methods

Constructors

Methods

  • Add a role requirement: at least one of roles must be held by the principal.

    +

    Parameters

    • ...roles: string[]

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.Principal.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.Principal.html new file mode 100644 index 00000000..42121f59 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_auth.Principal.html @@ -0,0 +1,17 @@ +Principal | Libraries

Class Principal<T>

Principal — represents an authenticated (or anonymous) user identity.

+

Generic over T — the user-defined principal shape, typically +declared as a @cleverbrush/schema object schema.

+

Type Parameters

  • T = unknown
Index

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • T = unknown

    Parameters

    • isAuthenticated: boolean
    • value: T | undefined
    • Optionalclaims: Map<string, string | string[]>

    Returns Principal<T>

Properties

claims: Map<string, string | string[]>
isAuthenticated: boolean
value: T | undefined

Methods

  • Returns true if the principal has a claim with the given type. +If value is provided, also checks the claim value matches.

    +

    Parameters

    • type: string
    • Optionalvalue: string

    Returns boolean

  • Returns true if the principal has the given role. +Checks the "role" claim by default; supports both single-value +and array-value claims.

    +

    Parameters

    • role: string
    • claimKey: string = 'role'

    Returns boolean

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..ApiError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..ApiError.html new file mode 100644 index 00000000..11a960d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..ApiError.html @@ -0,0 +1,25 @@ +ApiError | Libraries

Error thrown by the typed HTTP client when the server responds with a +non-2xx status code.

+
try {
await client.todos.get({ params: { id: 999 } });
} catch (err) {
if (err instanceof ApiError && err.status === 404) {
console.log('Not found:', err.message);
}
} +
+ +

Hierarchy (View Summary)

Index

Constructors

Properties

Constructors

  • Parameters

    • status: number

      The HTTP status code (e.g. 404, 500).

      +
    • message: string

      A human-readable error description.

      +
    • body: unknown = undefined

      The parsed response body, if the server returned JSON.

      +
    • OptionaltraceId: string

      The X-Trace-Id response header value, if the server +set one. Useful for correlating client-side errors with backend traces +in observability tools (SigNoz, Jaeger, etc.).

      +

    Returns ApiError

Properties

body: unknown = undefined

The parsed response body, if the server returned JSON.

+
cause?: unknown
message: string
name: string
stack?: string
status: number

The HTTP status code (e.g. 404, 500).

+
traceId?: string

The X-Trace-Id response header value, if the server +set one. Useful for correlating client-side errors with backend traces +in observability tools (SigNoz, Jaeger, etc.).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..NetworkError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..NetworkError.html new file mode 100644 index 00000000..914a0c0a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..NetworkError.html @@ -0,0 +1,12 @@ +NetworkError | Libraries

Error thrown when a request fails due to a network-level issue +(e.g. DNS failure, connection refused, offline).

+

The original error is available via the standard cause property.

+
try {
await client.todos.list();
} catch (err) {
if (err instanceof NetworkError) {
console.log('Network issue:', err.cause);
}
} +
+ +

Hierarchy (View Summary)

Index

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..OfflineError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..OfflineError.html new file mode 100644 index 00000000..56d59e36 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..OfflineError.html @@ -0,0 +1,12 @@ +OfflineError | Libraries

Error thrown when a request is attempted while the client is offline.

+

Extends NetworkError so offline errors are caught by +isNetworkError() checks.

+
try {
await client.todos.list();
} catch (err) {
if (isOfflineError(err)) {
console.log('Cannot make requests while offline');
}
} +
+ +

Hierarchy (View Summary)

Index

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..TimeoutError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..TimeoutError.html new file mode 100644 index 00000000..3443443d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..TimeoutError.html @@ -0,0 +1,13 @@ +TimeoutError | Libraries

Error thrown when a request exceeds the configured timeout.

+
try {
await client.todos.list({ timeout: 5000 });
} catch (err) {
if (err instanceof TimeoutError) {
console.log('Request timed out after', err.timeout, 'ms');
}
} +
+ +

Hierarchy (View Summary)

Index

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
timeout: number

The timeout duration in milliseconds that was exceeded.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..WebError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..WebError.html new file mode 100644 index 00000000..1b2ce941 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_client..WebError.html @@ -0,0 +1,12 @@ +WebError | Libraries

Base error class for all errors thrown by the @cleverbrush/web client.

+

Provides a common prototype chain so consumers can catch any client +error with a single instanceof WebError check.

+
try {
await client.todos.list();
} catch (err) {
if (err instanceof WebError) {
console.log('Client error:', err.message);
}
} +
+ +

Hierarchy (View Summary)

Index

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ScopedServiceProvider.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ScopedServiceProvider.html new file mode 100644 index 00000000..2e9d160a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ScopedServiceProvider.html @@ -0,0 +1,38 @@ +ScopedServiceProvider | Libraries

Class ScopedServiceProvider

A service provider scoped to a ServiceScope. Resolves scoped +services from the scope's cache and singletons from the root cache.

+

This class is not instantiated directly — obtain it via +scope.serviceProvider.

+

Implements

Index

Methods

  • Resolves a service within this scope.

    +
      +
    • Singleton services are resolved from the root provider's cache.
    • +
    • Scoped services are created once per scope and cached.
    • +
    • Transient services are created fresh on every call.
    • +
    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema>

    The resolved service, typed as InferType<typeof schema>.

    +

    If the schema is not registered.

    +

    If a circular dependency is detected.

    +
    using scope = provider.createScope();
    const db = scope.serviceProvider.get(IDbContext); +
    + +
  • Resolves a service within this scope, or returns undefined if not +registered.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema> | undefined

    The resolved service or undefined.

    +
  • Resolves the dependencies described by a FunctionSchemaBuilder +and calls implementation with the resolved values. Scoped services +are resolved within this scope.

    +

    Type Parameters

    • TFuncSchema extends FunctionSchemaBuilder<any, any, any, any, any, any, undefined, any>

    Parameters

    • funcSchema: TFuncSchema

      A FunctionSchemaBuilder whose parameters +describe the services to inject.

      +
    • implementation: InferType<TFuncSchema>

      A function whose parameters match the +funcSchema parameter types.

      +

    Returns ReturnType<InferType<TFuncSchema>>

    The return value of implementation.

    +
    using scope = provider.createScope();
    const result = scope.serviceProvider.invoke(handler, (logger, db) => {
    logger.info('Handling request');
    return db.query('SELECT 1');
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceCollection.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceCollection.html new file mode 100644 index 00000000..7d97def1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceCollection.html @@ -0,0 +1,150 @@ +ServiceCollection | Libraries

Class ServiceCollection

A mutable collection of service registrations. Build up the collection by +calling addSingleton, addScoped, or addTransient, +then call buildServiceProvider to create an immutable +ServiceProvider.

+

Schema instances act as service keys via reference equality — the same +schema object used during registration must be used during resolution.

+
import { ServiceCollection } from '@cleverbrush/di';
import { object, string, number, func } from '@cleverbrush/schema';

const IConfig = object({ port: number(), host: string() });
const ILogger = object({ info: func() });

const services = new ServiceCollection();
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addSingleton(ILogger, () => ({ info: console.log }));

const provider = services.buildServiceProvider();
const config = provider.get(IConfig); // { port: number; host: string } +
+ +
const IGreeter = object({ greet: func() });
const greeterFactory = func()
.addParameter(IConfig)
.addParameter(ILogger);

services.addSingletonFromSchema(
IGreeter,
greeterFactory,
(config, logger) => ({
greet() { logger.info(`Hello from ${config.host}`); }
})
); +
+ +
Index

Constructors

Methods

  • Registers a service with Singleton +lifetime. The factory (or value) is called at most once; every +subsequent resolution returns the same instance.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    Returns this

    this for chaining.

    +
    services.addSingleton(ILogger, (provider) => {
    const config = provider.get(IConfig);
    return new ConsoleLogger(config.logLevel);
    }); +
    + +
    services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
    +
    + +
  • Registers a Singleton service whose +dependencies are described by a FunctionSchemaBuilder. The +container resolves each parameter schema from the registry and passes +the resolved values to implementation.

    +

    Type Parameters

    • TTargetSchema extends SchemaBuilder<any, any, any, any, any>
    • TFuncSchema extends FunctionSchemaBuilder<any, any, any, any, any, any, undefined, any>

    Parameters

    Returns this

    this for chaining.

    +
    const IGreeter = object({ greet: func() });

    const greeterDeps = func()
    .addParameter(IConfig)
    .addParameter(ILogger);

    services.addSingletonFromSchema(
    IGreeter,
    greeterDeps,
    (config, logger) => ({
    greet() { logger.info(`Hello from ${config.host}`); }
    })
    ); +
    + +
  • Registers a pre-created instance as a Singleton. +Unlike addSingleton, the second argument is always treated as the +service value — never as a factory function. This makes it safe to +register a function-typed service (e.g. a schema backed by func()) +without the container accidentally invoking it as a factory.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    Returns this

    this for chaining.

    +
    const config = { port: 3000, host: 'localhost' };
    services.addSingletonInstance(IConfig, config); +
    + +
    const IHandler = func();
    const myHandler = (req: Request) => new Response('ok');
    services.addSingletonInstance(IHandler, myHandler); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceProvider.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceProvider.html new file mode 100644 index 00000000..5ff2d7d4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceProvider.html @@ -0,0 +1,83 @@ +ServiceProvider | Libraries

Class ServiceProvider

An immutable service provider that resolves services from a frozen set of +descriptors. Obtain an instance by calling +ServiceCollection.buildServiceProvider.

+

Supports three service lifetimes:

+
    +
  • Singleton — one instance per provider, cached after first resolution.
  • +
  • Scoped — one instance per ServiceScope, created via +createScope.
  • +
  • Transient — a new instance on every call to get.
  • +
+
const provider = services.buildServiceProvider();

// Typed via the schema — no explicit generic needed
const config = provider.get(IConfig);
config.port; // number

// Optional resolution (returns undefined if not registered)
const maybeMail = provider.getOptional(IMailer); +
+ +
// Per-request scope (e.g. in an HTTP handler)
using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db is disposed when scope exits +
+ +
const handlerSchema = func()
.addParameter(ILogger)
.addParameter(IDbContext)
.hasReturnType(string());

const result = provider.invoke(handlerSchema, (logger, db) => {
logger.info('Handling request');
return db.query('SELECT 1');
}); +
+ +

Implements

Index

Methods

  • Creates a new ServiceScope. Scoped services resolved from the +scope's serviceProvider are +cached per-scope and disposed when the scope is disposed.

    +

    The returned scope implements both Symbol.dispose and +Symbol.asyncDispose, so it works with the using keyword:

    +

    Returns ServiceScope

    A new ServiceScope.

    +
    // Sync disposal
    using scope = provider.createScope();
    const db = scope.serviceProvider.get(IDbContext);

    // Async disposal
    await using scope = provider.createScope();
    const db = scope.serviceProvider.get(IDbContext); +
    + +
  • Resolves a service by its schema key.

    +
      +
    • Singleton: returns the cached instance, or creates and caches it.
    • +
    • Scoped: throws if called from the root provider when +validateScopes is true (default). Use +createScope to obtain a scoped provider.
    • +
    • Transient: creates a new instance on every call.
    • +
    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier. +Must be the same reference used during registration.

      +

    Returns InferType<TSchema>

    The resolved service, typed as InferType<typeof schema>.

    +

    If the schema is not registered.

    +

    If a scoped service is resolved from the root provider +with validateScopes enabled.

    +

    If a circular dependency is detected.

    +
    const logger = provider.get(ILogger);
    logger.info('Hello'); // fully typed +
    + +
  • Resolves a service by its schema key, or returns undefined if the +schema is not registered.

    +

    Unlike get, this method does not throw for unregistered +schemas. All other behaviour (lifetime, scope validation, circular +dependency detection) is the same.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema> | undefined

    The resolved service or undefined.

    +
    const mailer = provider.getOptional(IMailer);
    if (mailer) {
    mailer.send('test@example.com', 'Hello');
    } +
    + +
  • Resolves the dependencies described by a FunctionSchemaBuilder +and calls implementation with the resolved values.

    +

    Each parameter schema in funcSchema.introspect().parameters is +resolved from this provider. The implementation receives the resolved +values in the same order as the parameter schemas.

    +

    Type Parameters

    • TFuncSchema extends FunctionSchemaBuilder<any, any, any, any, any, any, undefined, any>

    Parameters

    • funcSchema: TFuncSchema

      A FunctionSchemaBuilder whose parameters +describe the services to inject.

      +
    • implementation: InferType<TFuncSchema>

      A function whose parameters match the +funcSchema parameter types and whose return type matches the +funcSchema return type.

      +

    Returns ReturnType<InferType<TFuncSchema>>

    The return value of implementation.

    +
    const handler = func()
    .addParameter(ILogger)
    .addParameter(IConfig)
    .hasReturnType(string());

    const result = provider.invoke(handler, (logger, config) => {
    logger.info(`Running on port ${config.port}`);
    return 'ok';
    });
    // result: string +
    + +
      +
    • FunctionSchemaBuilder.addParameter
    • +
    • FunctionSchemaBuilder.hasReturnType
    • +
    +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceScope.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceScope.html new file mode 100644 index 00000000..bb180665 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_di.ServiceScope.html @@ -0,0 +1,64 @@ +ServiceScope | Libraries

Class ServiceScope

A scoped service container that caches Scoped +services for the duration of its lifetime. Obtain instances via +ServiceProvider.createScope.

+

The scope tracks all created scoped services that implement Disposable or +AsyncDisposable and disposes them in reverse creation order (LIFO) when the +scope is disposed. This matches .NET's scope disposal semantics.

+

Supports the using keyword via Symbol.dispose and Symbol.asyncDispose:

+
using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db is automatically disposed when the block exits +
+ +
await using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db is asynchronously disposed when the block exits +
+ +
const scope = provider.createScope();
try {
const db = scope.serviceProvider.get(IDbContext);
// use db...
} finally {
await scope.asyncDispose();
} +
+ +

Implements

  • Disposable
  • AsyncDisposable
Index

Properties

serviceProvider: ScopedServiceProvider

A child IServiceProvider that resolves services within this scope.

+
    +
  • Singleton services are resolved from the root provider's cache.
  • +
  • Scoped services are resolved from this scope's cache (created on +first access, reused within the scope).
  • +
  • Transient services create a new instance on every call.
  • +
+
const scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext); // scoped
const logger = scope.serviceProvider.get(ILogger); // singleton from root +
+ +

Methods

  • Implements the asynchronous AsyncDisposable protocol. Delegates to +asyncDispose.

    +

    Returns Promise<void>

    await using scope = provider.createScope();
    +
    + +
  • Implements the synchronous Disposable protocol. Delegates to +dispose.

    +

    Returns void

    using scope = provider.createScope();
    +
    + +
  • Asynchronously disposes all scoped services that implement +Symbol.asyncDispose or Symbol.dispose, in reverse creation order +(LIFO).

    +

    For each service:

    +
      +
    • If it implements Symbol.asyncDispose, that method is awaited.
    • +
    • Otherwise, if it implements Symbol.dispose, that method is called +synchronously.
    • +
    +

    Returns Promise<void>

    Re-throws the first error encountered during disposal, but +still attempts to dispose remaining services.

    +
  • Synchronously disposes all scoped services that implement +Symbol.dispose, in reverse creation order (LIFO).

    +

    Services that only implement Symbol.asyncDispose are skipped during +synchronous disposal. Use asyncDispose to properly dispose all +services including async ones.

    +

    Returns void

    Re-throws the first error encountered during disposal, but +still attempts to dispose remaining services.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_env.EnvValidationError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_env.EnvValidationError.html new file mode 100644 index 00000000..f107df7b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_env.EnvValidationError.html @@ -0,0 +1,40 @@ +EnvValidationError | Libraries

Class EnvValidationError

Thrown by parseEnv() when one or more environment variables are missing +or fail validation.

+

The structured missing and invalid properties allow programmatic +inspection, while the formatted message provides a human-readable +summary suitable for CI logs and startup output.

+

Hierarchy

  • Error
    • EnvValidationError
Index

Constructors

Properties

cause?: unknown
invalid: readonly InvalidEnvVar[]
message: string
missing: readonly MissingEnvVar[]
name: string
stack?: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-clickhouse.ClickhouseKnexClient.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-clickhouse.ClickhouseKnexClient.html new file mode 100644 index 00000000..e0d1655d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-clickhouse.ClickhouseKnexClient.html @@ -0,0 +1,363 @@ +ClickhouseKnexClient | Libraries

Hierarchy

  • KnexClient
    • ClickhouseKnexClient
Index

Constructors

Properties

canCancelQuery: boolean
config: Config
connectionConfigExpirationChecker: (() => boolean) | null
connectionConfigProvider: any
connectionSettings: object
dialect: string
driver: any
driverName: string
logger: Logger
pool: Pool<any> | undefined
valueForUndefined: any
version?: string
captureRejections: boolean

Value: boolean

+

Change the default captureRejections option on all new EventEmitter objects.

+

v13.4.0, v12.16.0

+
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

+

See how to write a custom rejection handler.

+

v13.4.0, v12.16.0

+
defaultMaxListeners: number

By default, a maximum of 10 listeners can be registered for any single +event. This limit can be changed for individual EventEmitter instances +using the emitter.setMaxListeners(n) method. To change the default +for allEventEmitter instances, the events.defaultMaxListeners property +can be used. If this value is not a positive number, a RangeError is thrown.

+

Take caution when setting the events.defaultMaxListeners because the +change affects all EventEmitter instances, including those created before +the change is made. However, calling emitter.setMaxListeners(n) still has +precedence over events.defaultMaxListeners.

+

This is not a hard limit. The EventEmitter instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to +temporarily avoid this warning:

+
import { EventEmitter } from 'node:events';
const emitter = new EventEmitter();
emitter.setMaxListeners(emitter.getMaxListeners() + 1);
emitter.once('event', () => {
// do stuff
emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
}); +
+ +

The --trace-warnings command-line flag can be used to display the +stack trace for such warnings.

+

The emitted warning can be inspected with process.on('warning') and will +have the additional emitter, type, and count properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its name property is set to 'MaxListenersExceededWarning'.

+

v0.11.2

+
errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

+

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no +regular 'error' listener is installed.

+

v13.6.0, v12.17.0

+

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • ...args: AnyRest

    Returns void

  • Returns any

  • Alias for emitter.on(eventName, listener).

    +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v0.1.26

    +
  • Returns void

  • Returns void

  • Parameters

    • tableBuilder: any
    • type: any
    • args: any

    Returns ColumnBuilder

  • Parameters

    • tableBuilder: any
    • columnBuilder: any

    Returns any

  • Parameters

    • value: any
    • origImpl: any
    • queryContext: any

    Returns any

  • Returns any

  • Parameters

    • callback: any

    Returns any

  • Parameters

    • connection: any

    Returns Promise<void>

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +to each.

    +

    Returns true if the event had listeners, false otherwise.

    +
    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener +
    + +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • ...args: AnyRest

    Returns boolean

    v0.1.26

    +
  • Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or Symbols.

    +
    import { EventEmitter } from 'node:events';

    const myEE = new EventEmitter();
    myEE.on('foo', () => {});
    myEE.on('bar', () => {});

    const sym = Symbol('symbol');
    myEE.on(sym, () => {});

    console.log(myEE.eventNames());
    // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
    + +

    Returns (string | symbol)[]

    v6.0.0

    +
  • Parameters

    • builder: any

    Returns any

  • Returns the current max listener value for the EventEmitter which is either +set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.

    +

    Returns number

    v1.0.0

    +
  • Parameters

    • poolConfig: any

    Returns any

  • Returns void

  • Parameters

    • Optionalconfig: {}

    Returns void

  • Returns the number of listeners listening for the event named eventName. +If listener is provided, it will return how many times the listener is found +in the list of the listeners of the event.

    +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      +
    • Optionallistener: Function

      The event handler function

      +

    Returns number

    v3.2.0

    +
  • Returns a copy of the array of listeners for the event named eventName.

    +
    server.on('connection', (stream) => {
    console.log('someone connected!');
    });
    console.log(util.inspect(server.listeners('connection')));
    // Prints: [ [Function] ] +
    + +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

    Returns Function[]

    v0.1.26

    +
  • Alias for emitter.removeListener().

    +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v10.0.0

    +
  • Adds the listener function to the end of the listeners array for the event +named eventName. No checks are made to see if the listener has already +been added. Multiple calls passing the same combination of eventName and +listener will result in the listener being added, and called, multiple times.

    +
    server.on('connection', (stream) => {
    console.log('someone connected!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

    +
    import { EventEmitter } from 'node:events';
    const myEE = new EventEmitter();
    myEE.on('foo', () => console.log('a'));
    myEE.prependListener('foo', () => console.log('b'));
    myEE.emit('foo');
    // Prints:
    // b
    // a +
    + +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v0.1.101

    +
  • Adds a one-time listener function for the event named eventName. The +next time eventName is triggered, this listener is removed and then invoked.

    +
    server.once('connection', (stream) => {
    console.log('Ah, we have our first user!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

    +
    import { EventEmitter } from 'node:events';
    const myEE = new EventEmitter();
    myEE.once('foo', () => console.log('a'));
    myEE.prependOnceListener('foo', () => console.log('b'));
    myEE.emit('foo');
    // Prints:
    // b
    // a +
    + +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v0.3.0

    +
  • Returns { max: number; min: number; propagateCreateError: boolean }

  • Parameters

    • sql: any

    Returns any

  • Parameters

    • resp: any
    • queryContext: any

    Returns any

  • Parameters

    • bindings: any

    Returns any

  • Adds the listener function to the beginning of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple times.

    +
    server.prependListener('connection', (stream) => {
    console.log('someone connected!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v6.0.0

    +
  • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +listener is removed, and then invoked.

    +
    server.prependOnceListener('connection', (stream) => {
    console.log('Ah, we have our first user!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v6.0.0

    +
  • Parameters

    • connection: any
    • obj: any

    Returns any

  • Returns QueryBuilder

  • Parameters

    • builder: any

    Returns any

  • Parameters

    • ...args: any[]

    Returns any

  • Returns a copy of the array of listeners for the event named eventName, +including any wrappers (such as those created by .once()).

    +
    import { EventEmitter } from 'node:events';
    const emitter = new EventEmitter();
    emitter.once('log', () => console.log('log once'));

    // Returns a new Array with a function `onceWrapper` which has a property
    // `listener` which contains the original listener bound above
    const listeners = emitter.rawListeners('log');
    const logFnWrapper = listeners[0];

    // Logs "log once" to the console and does not unbind the `once` event
    logFnWrapper.listener();

    // Logs "log once" to the console and removes the listener
    logFnWrapper();

    emitter.on('log', () => console.log('log persistently'));
    // Will return a new Array with a single function bound by `.on()` above
    const newListeners = emitter.rawListeners('log');

    // Logs "log persistently" twice
    newListeners[0]();
    emitter.emit('log'); +
    + +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

    Returns Function[]

    v9.4.0

    +
  • Parameters

    • ...args: any[]

    Returns Ref<any, any>

  • Parameters

    • connection: any

    Returns any

  • Removes all listeners, or those of the specified eventName.

    +

    It is bad practice to remove listeners added elsewhere in the code, +particularly when the EventEmitter instance was created by some other +component or module (e.g. sockets or file streams).

    +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Parameters

    • OptionaleventName: string | symbol

    Returns this

    v0.1.26

    +
  • Removes the specified listener from the listener array for the event named eventName.

    +
    const callback = (stream) => {
    console.log('someone connected!');
    };
    server.on('connection', callback);
    // ...
    server.removeListener('connection', callback); +
    + +

    removeListener() will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified eventName, then removeListener() must be +called multiple times to remove each instance.

    +

    Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution +will not remove them fromemit() in progress. Subsequent events behave as expected.

    +
    import { EventEmitter } from 'node:events';
    class MyEmitter extends EventEmitter {}
    const myEmitter = new MyEmitter();

    const callbackA = () => {
    console.log('A');
    myEmitter.removeListener('event', callbackB);
    };

    const callbackB = () => {
    console.log('B');
    };

    myEmitter.on('event', callbackA);

    myEmitter.on('event', callbackB);

    // callbackA removes listener callbackB but it will still be called.
    // Internal listener array at time of emit [callbackA, callbackB]
    myEmitter.emit('event');
    // Prints:
    // A
    // B

    // callbackB is now removed.
    // Internal listener array [callbackA]
    myEmitter.emit('event');
    // Prints:
    // A +
    + +

    Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered after the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the emitter.listeners() method will need to be recreated.

    +

    When a single function has been added as a handler multiple times for a single +event (as in the example below), removeListener() will remove the most +recently added instance. In the example the once('ping') listener is removed:

    +
    import { EventEmitter } from 'node:events';
    const ee = new EventEmitter();

    function pong() {
    console.log('pong');
    }

    ee.on('ping', pong);
    ee.once('ping', pong);
    ee.removeListener('ping', pong);

    ee.emit('ping');
    ee.emit('ping'); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v0.1.26

    +
  • Parameters

    • builder: any

    Returns any

  • Returns SchemaBuilder

  • Parameters

    • builder: SchemaBuilder

    Returns any

  • By default EventEmitters will print a warning if more than 10 listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The emitter.setMaxListeners() method allows the limit to be +modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

    +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Parameters

    • n: number

    Returns this

    v0.3.5

    +
  • Parameters

    • connection: any
    • obj: any
    • stream: any
    • options: any

    Returns any

  • Parameters

    • type: any
    • tableName: any
    • tableNameLike: any
    • fn: any

    Returns TableBuilder

  • Parameters

    • tableBuilder: any

    Returns any

  • Parameters

    • container: any
    • config: any
    • outerTx: any

    Returns Transaction

  • Parameters

    • connection: any

    Returns Promise<boolean>

  • Parameters

    • value: any
    • queryContext: any

    Returns any

  • Parameters

    • value: any

    Returns string

  • Listens once to the abort event on the provided signal.

    +

    Listening to the abort event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call e.stopImmediatePropagation(). Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners.

    +

    This API allows safely using AbortSignals in Node.js APIs by solving these +two issues by listening to the event such that stopImmediatePropagation does +not prevent the listener from running.

    +

    Returns a disposable so that it may be unsubscribed from more easily.

    +
    import { addAbortListener } from 'node:events';

    function example(signal) {
    let disposable;
    try {
    signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
    disposable = addAbortListener(signal, (e) => {
    // Do something when signal is aborted.
    });
    } finally {
    disposable?.[Symbol.dispose]();
    }
    } +
    + +

    Parameters

    • signal: AbortSignal
    • resource: (event: Event) => void

    Returns Disposable

    Disposable that removes the abort listener.

    +

    v20.5.0

    +
  • Returns a copy of the array of listeners for the event named eventName.

    +

    For EventEmitters this behaves exactly the same as calling .listeners on +the emitter.

    +

    For EventTargets this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes.

    +
    import { getEventListeners, EventEmitter } from 'node:events';

    {
    const ee = new EventEmitter();
    const listener = () => console.log('Events are fun');
    ee.on('foo', listener);
    console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
    }
    {
    const et = new EventTarget();
    const listener = () => console.log('Events are fun');
    et.addEventListener('foo', listener);
    console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
    } +
    + +

    Parameters

    • emitter: EventTarget | EventEmitter<DefaultEventMap>
    • name: string | symbol

    Returns Function[]

    v15.2.0, v14.17.0

    +
  • Returns the currently set max amount of listeners.

    +

    For EventEmitters this behaves exactly the same as calling .getMaxListeners on +the emitter.

    +

    For EventTargets this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning.

    +
    import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';

    {
    const ee = new EventEmitter();
    console.log(getMaxListeners(ee)); // 10
    setMaxListeners(11, ee);
    console.log(getMaxListeners(ee)); // 11
    }
    {
    const et = new EventTarget();
    console.log(getMaxListeners(et)); // 10
    setMaxListeners(11, et);
    console.log(getMaxListeners(et)); // 11
    } +
    + +

    Parameters

    • emitter: EventTarget | EventEmitter<DefaultEventMap>

    Returns number

    v19.9.0

    +
  • A class method that returns the number of listeners for the given eventName registered on the given emitter.

    +
    import { EventEmitter, listenerCount } from 'node:events';

    const myEmitter = new EventEmitter();
    myEmitter.on('event', () => {});
    myEmitter.on('event', () => {});
    console.log(listenerCount(myEmitter, 'event'));
    // Prints: 2 +
    + +

    Parameters

    • emitter: EventEmitter

      The emitter to query

      +
    • eventName: string | symbol

      The event name

      +

    Returns number

    v0.9.12

    +

    Since v3.2.0 - Use listenerCount instead.

    +
  • import { on, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ee = new EventEmitter();

    // Emit later on
    process.nextTick(() => {
    ee.emit('foo', 'bar');
    ee.emit('foo', 42);
    });

    for await (const event of on(ee, 'foo')) {
    // The execution of this inner block is synchronous and it
    // processes one event at a time (even with await). Do not use
    // if concurrent execution is required.
    console.log(event); // prints ['bar'] [42]
    }
    // Unreachable here +
    + +

    Returns an AsyncIterator that iterates eventName events. It will throw +if the EventEmitter emits 'error'. It removes all listeners when +exiting the loop. The value returned by each iteration is an array +composed of the emitted event arguments.

    +

    An AbortSignal can be used to cancel waiting on events:

    +
    import { on, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ac = new AbortController();

    (async () => {
    const ee = new EventEmitter();

    // Emit later on
    process.nextTick(() => {
    ee.emit('foo', 'bar');
    ee.emit('foo', 42);
    });

    for await (const event of on(ee, 'foo', { signal: ac.signal })) {
    // The execution of this inner block is synchronous and it
    // processes one event at a time (even with await). Do not use
    // if concurrent execution is required.
    console.log(event); // prints ['bar'] [42]
    }
    // Unreachable here
    })();

    process.nextTick(() => ac.abort()); +
    + +

    Use the close option to specify an array of event names that will end the iteration:

    +
    import { on, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ee = new EventEmitter();

    // Emit later on
    process.nextTick(() => {
    ee.emit('foo', 'bar');
    ee.emit('foo', 42);
    ee.emit('close');
    });

    for await (const event of on(ee, 'foo', { close: ['close'] })) {
    console.log(event); // prints ['bar'] [42]
    }
    // the loop will exit after 'close' is emitted
    console.log('done'); // prints 'done' +
    + +

    Parameters

    • emitter: EventEmitter
    • eventName: string | symbol
    • Optionaloptions: StaticEventEmitterIteratorOptions

    Returns AsyncIterator<any[]>

    An AsyncIterator that iterates eventName events emitted by the emitter

    +

    v13.6.0, v12.16.0

    +
  • import { on, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ee = new EventEmitter();

    // Emit later on
    process.nextTick(() => {
    ee.emit('foo', 'bar');
    ee.emit('foo', 42);
    });

    for await (const event of on(ee, 'foo')) {
    // The execution of this inner block is synchronous and it
    // processes one event at a time (even with await). Do not use
    // if concurrent execution is required.
    console.log(event); // prints ['bar'] [42]
    }
    // Unreachable here +
    + +

    Returns an AsyncIterator that iterates eventName events. It will throw +if the EventEmitter emits 'error'. It removes all listeners when +exiting the loop. The value returned by each iteration is an array +composed of the emitted event arguments.

    +

    An AbortSignal can be used to cancel waiting on events:

    +
    import { on, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ac = new AbortController();

    (async () => {
    const ee = new EventEmitter();

    // Emit later on
    process.nextTick(() => {
    ee.emit('foo', 'bar');
    ee.emit('foo', 42);
    });

    for await (const event of on(ee, 'foo', { signal: ac.signal })) {
    // The execution of this inner block is synchronous and it
    // processes one event at a time (even with await). Do not use
    // if concurrent execution is required.
    console.log(event); // prints ['bar'] [42]
    }
    // Unreachable here
    })();

    process.nextTick(() => ac.abort()); +
    + +

    Use the close option to specify an array of event names that will end the iteration:

    +
    import { on, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ee = new EventEmitter();

    // Emit later on
    process.nextTick(() => {
    ee.emit('foo', 'bar');
    ee.emit('foo', 42);
    ee.emit('close');
    });

    for await (const event of on(ee, 'foo', { close: ['close'] })) {
    console.log(event); // prints ['bar'] [42]
    }
    // the loop will exit after 'close' is emitted
    console.log('done'); // prints 'done' +
    + +

    Parameters

    • emitter: EventTarget
    • eventName: string
    • Optionaloptions: StaticEventEmitterIteratorOptions

    Returns AsyncIterator<any[]>

    An AsyncIterator that iterates eventName events emitted by the emitter

    +

    v13.6.0, v12.16.0

    +
  • Creates a Promise that is fulfilled when the EventEmitter emits the given +event or that is rejected if the EventEmitter emits 'error' while waiting. +The Promise will resolve with an array of all the arguments emitted to the +given event.

    +

    This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event +semantics and does not listen to the 'error' event.

    +
    import { once, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ee = new EventEmitter();

    process.nextTick(() => {
    ee.emit('myevent', 42);
    });

    const [value] = await once(ee, 'myevent');
    console.log(value);

    const err = new Error('kaboom');
    process.nextTick(() => {
    ee.emit('error', err);
    });

    try {
    await once(ee, 'myevent');
    } catch (err) {
    console.error('error happened', err);
    } +
    + +

    The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the +'error' event itself, then it is treated as any other kind of event without +special handling:

    +
    import { EventEmitter, once } from 'node:events';

    const ee = new EventEmitter();

    once(ee, 'error')
    .then(([err]) => console.log('ok', err.message))
    .catch((err) => console.error('error', err.message));

    ee.emit('error', new Error('boom'));

    // Prints: ok boom +
    + +

    An AbortSignal can be used to cancel waiting for the event:

    +
    import { EventEmitter, once } from 'node:events';

    const ee = new EventEmitter();
    const ac = new AbortController();

    async function foo(emitter, event, signal) {
    try {
    await once(emitter, event, { signal });
    console.log('event emitted!');
    } catch (error) {
    if (error.name === 'AbortError') {
    console.error('Waiting for the event was canceled!');
    } else {
    console.error('There was an error', error.message);
    }
    }
    }

    foo(ee, 'foo', ac.signal);
    ac.abort(); // Abort waiting for the event
    ee.emit('foo'); // Prints: Waiting for the event was canceled! +
    + +

    Parameters

    • emitter: EventEmitter
    • eventName: string | symbol
    • Optionaloptions: StaticEventEmitterOptions

    Returns Promise<any[]>

    v11.13.0, v10.16.0

    +
  • Creates a Promise that is fulfilled when the EventEmitter emits the given +event or that is rejected if the EventEmitter emits 'error' while waiting. +The Promise will resolve with an array of all the arguments emitted to the +given event.

    +

    This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event +semantics and does not listen to the 'error' event.

    +
    import { once, EventEmitter } from 'node:events';
    import process from 'node:process';

    const ee = new EventEmitter();

    process.nextTick(() => {
    ee.emit('myevent', 42);
    });

    const [value] = await once(ee, 'myevent');
    console.log(value);

    const err = new Error('kaboom');
    process.nextTick(() => {
    ee.emit('error', err);
    });

    try {
    await once(ee, 'myevent');
    } catch (err) {
    console.error('error happened', err);
    } +
    + +

    The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the +'error' event itself, then it is treated as any other kind of event without +special handling:

    +
    import { EventEmitter, once } from 'node:events';

    const ee = new EventEmitter();

    once(ee, 'error')
    .then(([err]) => console.log('ok', err.message))
    .catch((err) => console.error('error', err.message));

    ee.emit('error', new Error('boom'));

    // Prints: ok boom +
    + +

    An AbortSignal can be used to cancel waiting for the event:

    +
    import { EventEmitter, once } from 'node:events';

    const ee = new EventEmitter();
    const ac = new AbortController();

    async function foo(emitter, event, signal) {
    try {
    await once(emitter, event, { signal });
    console.log('event emitted!');
    } catch (error) {
    if (error.name === 'AbortError') {
    console.error('Waiting for the event was canceled!');
    } else {
    console.error('There was an error', error.message);
    }
    }
    }

    foo(ee, 'foo', ac.signal);
    ac.abort(); // Abort waiting for the event
    ee.emit('foo'); // Prints: Waiting for the event was canceled! +
    + +

    Parameters

    • emitter: EventTarget
    • eventName: string
    • Optionaloptions: StaticEventEmitterOptions

    Returns Promise<any[]>

    v11.13.0, v10.16.0

    +
  • import { setMaxListeners, EventEmitter } from 'node:events';

    const target = new EventTarget();
    const emitter = new EventEmitter();

    setMaxListeners(5, target, emitter); +
    + +

    Parameters

    • Optionaln: number

      A non-negative number. The maximum number of listeners per EventTarget event.

      +
    • ...eventTargets: (EventTarget | EventEmitter<DefaultEventMap>)[]

      Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects.

      +

    Returns void

    v15.4.0

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-schema..Entity.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-schema..Entity.html new file mode 100644 index 00000000..846f1ec5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-schema..Entity.html @@ -0,0 +1,56 @@ +Entity | Libraries

Class Entity<TSchema, TRels, TVariantUnion>

A typed wrapper around an ObjectSchemaBuilder that tracks declared +relations in its TRels generic. Use defineEntity to create one.

+

Relations are declared via .hasOne() / .hasMany() / .belongsTo() / +.belongsToMany() on the entity (NOT on the underlying schema). Each +call returns a new Entity whose TRels includes the new relation, so +query(db, entity).include(t => t.assignee) is fully typed.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRels extends Record<string, RelationInfo> = {}
  • TVariantUnion = never
Index

Constructors

Properties

schema: TSchema

The underlying schema (relations registered via withExtension('relations', ...)).

+

Methods

  • Declare a CTI (Class Table Inheritance) variant. Only valid after +.discriminator(). Returns a new Entity whose schema carries the +updated 'variants' extension.

    +

    Type Parameters

    • TVarSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Parameters

    • key: string

      Discriminator literal (e.g. 'image').

      +
    • variant: Entity<TVarSchema, any>

      Entity wrapping the variant table schema.

      +
    • fkSel: (t: EntityTree<TVarSchema>) => any

      Accessor returning the FK property on the variant +schema that joins back to the base PK.

      +
    • Optionalopts: {
          allowOrphan?: boolean;
          relations?: Record<string, VariantRelationInput<TVarSchema>>;
      }

      { allowOrphan?: boolean; relations?: ... } — see CTI docs.

      +

    Returns Entity<TSchema, TRels, TVariantUnion | VariantBranch<TSchema, TVarSchema>>

  • Mark this entity as polymorphic by selecting the discriminator +property. Returns a new Entity whose .ctiVariant() / +.stiVariant() methods declare each variant.

    +

    Declare ordinary relations (.belongsTo() etc.) on this entity BEFORE +.discriminator(). After .discriminator() you are in the +polymorphic-builder phase: .hasOne/.hasMany/.belongsTo/.belongsToMany +still work, but the per-variant relations live on the .ctiVariant() +/ .stiVariant() calls.

    +

    Type Parameters

    • TKey extends string

    Parameters

    Returns Entity<TSchema, TRels, never>

    const FileEntity = defineEntity(FileSchema)
    .discriminator(t => t.type)
    .ctiVariant('image', ImageEntity, t => t.fileId)
    .ctiVariant('document', DocumentEntity, t => t.fileId); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-schema..SchemaQueryBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-schema..SchemaQueryBuilder.html new file mode 100644 index 00000000..4c387b57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_knex-schema..SchemaQueryBuilder.html @@ -0,0 +1,72 @@ +SchemaQueryBuilder | Libraries

Class SchemaQueryBuilder<TLocalSchema, TResult>

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TResult
Index

Constructors

Methods

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_log..BatchingSink.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_log..BatchingSink.html new file mode 100644 index 00000000..f0a6efe2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_log..BatchingSink.html @@ -0,0 +1,18 @@ +BatchingSink | Libraries

Production-grade batching wrapper for log sinks.

+

Provides buffering, retry with exponential backoff, and circuit +breaking. All network/file sinks use this internally.

+
const sink = new BatchingSink({
batchSize: 100,
flushInterval: 2000,
emit: async (batch) => {
await fetch('/logs', { method: 'POST', body: JSON.stringify(batch) });
},
}); +
+ +

Implements

Index

Constructors

Methods

Constructors

Methods

  • Buffers events and triggers a background flush when the batch +size threshold is reached. Returns immediately — callers are +never blocked by network I/O.

    +

    Parameters

    Returns Promise<void>

  • Flushes buffered events to the underlying sink.

    +

    If a flush is already in progress, returns that same promise so +that multiple concurrent callers share a single write rather than +spawning concurrent network requests.

    +

    Returns Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_log..Logger.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_log..Logger.html new file mode 100644 index 00000000..5e119883 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_log..Logger.html @@ -0,0 +1,57 @@ +Logger | Libraries

Structured logger with per-level methods, child context support, +and AsyncDisposable for graceful shutdown.

+

Log methods are synchronous and fire-and-forget — they push events +into an internal async microtask pipeline.

+

Accepts both plain string templates and typed TypedTemplate +objects (produced by ParseStringSchemaBuilder from @cleverbrush/schema). +Typed templates carry a template property with the raw {Property} pattern, +which the logger uses as messageTemplate so all events of the same shape +are grouped correctly in Seq, SigNoz, ClickHouse, etc.

+
logger.info('Server started on port {Port}', { Port: 3000 });

const child = logger.forContext('SourceContext', 'OrderService');
child.info('Processing order {OrderId}', { OrderId: 42 });

// Typed template — structured grouping
import { s } from '@cleverbrush/schema';
const tmpl = s.parseString('Order #{OrderId} placed by {UserId}');
child.info(tmpl, { OrderId: 1, UserId: 'u-99' }); +
+ +

Implements

  • AsyncDisposable
Index

Constructors

  • Parameters

    • pipeline: LoggerPipeline
    • OptionalcontextProperties: Record<string, unknown>

    Returns Logger

Methods

  • Returns Promise<void>

  • Log a debug-level message.

    +

    Parameters

    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log a debug-level message.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Log an error-level message with an optional exception.

    +

    Parameters

    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log an error-level message with an optional exception.

    +

    Parameters

    • error: Error
    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log an error-level message with an optional exception.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Log an error-level message with an optional exception.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Log a fatal-level message with an optional exception.

    +

    Parameters

    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log a fatal-level message with an optional exception.

    +

    Parameters

    • error: Error
    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log a fatal-level message with an optional exception.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Log a fatal-level message with an optional exception.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Flushes all pending events through the pipeline to sinks.

    +

    Returns Promise<void>

  • Creates a child logger with additional context properties.

    +

    Parameters

    • key: string | Record<string, unknown>

      property name, or an object of key-value pairs

      +
    • Optionalvalue: unknown

      property value (when key is a string)

      +

    Returns Logger

    a new Logger with merged context properties

    +
  • Log an information-level message.

    +

    Parameters

    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log an information-level message.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Checks whether the given level is enabled for this logger.

    +

    Parameters

    Returns boolean

    true if events at this level would be processed

    +
  • Log a trace-level message.

    +

    Parameters

    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log a trace-level message.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Log a warning-level message.

    +

    Parameters

    • template: string
    • Optionalproperties: Record<string, unknown>

    Returns void

  • Log a warning-level message.

    +

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns void

  • Polls an environment variable for log level changes.

    +

    Parameters

    • envVar: string

      environment variable name to watch

      +
    • intervalMs: number = 30_000

      polling interval in milliseconds (default: 30000)

      +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.Mapper.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.Mapper.html new file mode 100644 index 00000000..99dc9b69 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.Mapper.html @@ -0,0 +1,40 @@ +Mapper | Libraries

Class Mapper<TFromSchema, TToSchema, TUnmapped, TRegistered>

A fluent builder for configuring how each target property is populated +from a source schema. Uses PropertyDescriptors as pointers to properties +(similar to expressions in C# .NET).

+

The TUnmapped type parameter tracks which target properties have not +yet been mapped or ignored. getMapper() is only callable (without +arguments) when TUnmapped is never — i.e. all properties have been +accounted for. If any property is missing, TypeScript will produce a +compile-time type error (a type-assignability mismatch that includes +the unmapped property names in its type parameters).

+

Type Parameters

  • TFromSchema extends ObjectSchemaBuilder<any, any, any>

    source ObjectSchemaBuilder

    +
  • TToSchema extends ObjectSchemaBuilder<any, any, any>

    target ObjectSchemaBuilder

    +
  • TUnmapped extends string = SchemaKeys<TToSchema>

    union of target property key names not yet mapped

    +
  • TRegistered = never
Index

Constructors

Properties

Methods

Constructors

Properties

"[SYMBOL_UNMAPPED]": TUnmapped

Phantom property for structural type-checking of TUnmapped.

+

Methods

  • Returns the configured async mapping function.

    +

    Compile-time safety: This method is only callable without +arguments when all target properties have been mapped or explicitly +ignored. If any property is unmapped, TypeScript will require +a string argument describing the unmapped properties, producing +a clear compile-time error.

    +

    Runtime safety: Even if TypeScript checks are bypassed (e.g. +via as any), a MapperConfigurationError is thrown at runtime +listing the unmapped properties.

    +

    Parameters

    Returns SchemaToSchemaMapperResult<TFromSchema, TToSchema>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.MapperConfigurationError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.MapperConfigurationError.html new file mode 100644 index 00000000..3f04e909 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.MapperConfigurationError.html @@ -0,0 +1,6 @@ +MapperConfigurationError | Libraries

Class MapperConfigurationError

Hierarchy

  • Error
    • MapperConfigurationError
Index

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.MappingRegistry.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.MappingRegistry.html new file mode 100644 index 00000000..831ef8bf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.MappingRegistry.html @@ -0,0 +1,24 @@ +MappingRegistry | Libraries

Class MappingRegistry<TRegistered>

Type Parameters

  • TRegistered = never
Index

Constructors

Properties

Methods

Constructors

Properties

_mappers: Map<
    ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>,
    Map<
        ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>,
        SchemaToSchemaMapperResult<any, any>,
    >,
> = ...

Methods

  • Gets a mapper function that will map from the fromSchema to the toSchema. +Throws an error if no mapper is found for the given schemas pair.

    +

    Type Parameters

    • TFromSchema extends ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>
    • TToSchema extends ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>

    Parameters

    Returns SchemaToSchemaMapperResult<TFromSchema, TToSchema>

    a function that will take a value of the fromSchema type as an argument and +return a promise resolving to a value of the toSchema type

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.PropertyMappingBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.PropertyMappingBuilder.html new file mode 100644 index 00000000..9355ab31 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_mapper.PropertyMappingBuilder.html @@ -0,0 +1,29 @@ +PropertyMappingBuilder | Libraries

Class PropertyMappingBuilder<TFromSchema, TToSchema, TKey, TUnmapped, TRegistered>

Intermediate builder returned by for(). Provides three strategies +to configure how the selected target property is populated:

+
    +
  • from() — copy from a source property
  • +
  • compute() — compute from the entire source object
  • +
  • ignore() — explicitly skip the property
  • +
+

Type Parameters

  • TFromSchema extends ObjectSchemaBuilder<any, any, any>
  • TToSchema extends ObjectSchemaBuilder<any, any, any>
  • TKey extends string
  • TUnmapped extends string
  • TRegistered = never
Index

Constructors

Methods

Constructors

Methods

  • Maps the target property from a source property. The selector +receives the source schema's PropertyDescriptorTree and supports +nested paths (e.g. (s) => s.address.city).

    +

    Type compatibility is enforced: only source properties whose +inferred type is assignable to the target property type will +appear in the selector callback.

    +

    Under strictFunctionTypes, the setValue and getValue constraints +provide bidirectional type checking:

    +
      +
    • setValue contravariance rejects source schemas with extra properties
    • +
    • getValue covariance rejects source schemas with missing properties
    • +
    • registered mappings widen the constraint via intersection
    • +
    +

    Type Parameters

    • TReturn extends {
          "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": {
              getValue: (obj: any) => { success: boolean; value?: any };
              setValue: (obj: any, value: any) => any;
              getSchema(): SchemaBuilder<any, any, any>;
          };
      }

    Parameters

    • selector: (
          tree: PropertyDescriptorTree<
              TFromSchema,
              TFromSchema,
              SchemaPropertyInferredType<TToSchema, TKey>,
          >,
      ) => TReturn
    • ..._args: [TReturn] extends [never]
          ? [
              error: `Property '${TKey}': source property type is not assignable to the target property type. Use compute() instead.`,
          ]
          : IsFromCompatible<TReturn, TToSchema, TKey, TRegistered> extends true
              ? []
              : [
                  error: `Property '${TKey}': source property type is not assignable to the target property type. Use compute() instead.`,
              ]

    Returns Mapper<TFromSchema, TToSchema, Exclude<TUnmapped, TKey>, TRegistered>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.ConcurrencyError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.ConcurrencyError.html new file mode 100644 index 00000000..77a9f230 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.ConcurrencyError.html @@ -0,0 +1,42 @@ +ConcurrencyError | Libraries

Class ConcurrencyError

Thrown by DbContext.saveChanges when an UPDATE or DELETE detects +that the row's row-version column (.rowVersion()) has changed since the +entity was last loaded — indicating a concurrent modification.

+

Hierarchy

  • Error
    • ConcurrencyError
Index

Constructors

Properties

cause?: unknown
entity: string

Table name or entity label.

+
expected: unknown

The row-version value the ORM expected.

+
message: string
name: string
pk: unknown

Primary-key value(s) of the conflicting row.

+
stack?: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.Entity.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.Entity.html new file mode 100644 index 00000000..2c7e4cae --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.Entity.html @@ -0,0 +1,56 @@ +Entity | Libraries

Class Entity<TSchema, TRels, TVariantUnion>

A typed wrapper around an ObjectSchemaBuilder that tracks declared +relations in its TRels generic. Use defineEntity to create one.

+

Relations are declared via .hasOne() / .hasMany() / .belongsTo() / +.belongsToMany() on the entity (NOT on the underlying schema). Each +call returns a new Entity whose TRels includes the new relation, so +query(db, entity).include(t => t.assignee) is fully typed.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRels extends Record<string, RelationInfo> = {}
  • TVariantUnion = never
Index

Constructors

  • Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
    • TRels extends Record<
          string,
          RelationInfo<any, ObjectSchemaBuilder<any, any, any, any, any, any, any>>,
      > = {}
    • TVariantUnion = never

    Parameters

    Returns Entity<TSchema, TRels, TVariantUnion>

Properties

schema: TSchema

The underlying schema (relations registered via withExtension('relations', ...)).

+

Methods

  • Declare a CTI (Class Table Inheritance) variant. Only valid after +.discriminator(). Returns a new Entity whose schema carries the +updated 'variants' extension.

    +

    Type Parameters

    • TVarSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Parameters

    • key: string

      Discriminator literal (e.g. 'image').

      +
    • variant: Entity<TVarSchema, any>

      Entity wrapping the variant table schema.

      +
    • fkSel: (t: EntityTree<TVarSchema>) => any

      Accessor returning the FK property on the variant +schema that joins back to the base PK.

      +
    • Optionalopts: {
          allowOrphan?: boolean;
          relations?: Record<string, VariantRelationInput<TVarSchema>>;
      }

      { allowOrphan?: boolean; relations?: ... } — see CTI docs.

      +

    Returns Entity<TSchema, TRels, TVariantUnion | VariantBranch<TSchema, TVarSchema>>

  • Mark this entity as polymorphic by selecting the discriminator +property. Returns a new Entity whose .ctiVariant() / +.stiVariant() methods declare each variant.

    +

    Declare ordinary relations (.belongsTo() etc.) on this entity BEFORE +.discriminator(). After .discriminator() you are in the +polymorphic-builder phase: .hasOne/.hasMany/.belongsTo/.belongsToMany +still work, but the per-variant relations live on the .ctiVariant() +/ .stiVariant() calls.

    +

    Type Parameters

    • TKey extends string

    Parameters

    Returns Entity<TSchema, TRels, never>

    const FileEntity = defineEntity(FileSchema)
    .discriminator(t => t.type)
    .ctiVariant('image', ImageEntity, t => t.fileId)
    .ctiVariant('document', DocumentEntity, t => t.fileId); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.EntityNotFoundError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.EntityNotFoundError.html new file mode 100644 index 00000000..cb8ccca2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.EntityNotFoundError.html @@ -0,0 +1,39 @@ +EntityNotFoundError | Libraries

Class EntityNotFoundError

Thrown by DbSet.findOrFail when no row matches the supplied +primary key value(s). The entity field carries the SQL table name (or +the entity's schema name when a table name is unavailable); pk is the +exact value (scalar or tuple) that was looked up.

+

Hierarchy

  • Error
    • EntityNotFoundError
Index

Constructors

Properties

cause?: unknown
entity: string
message: string
name: string
pk: unknown
stack?: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.InvariantViolationError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.InvariantViolationError.html new file mode 100644 index 00000000..3505b3ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.InvariantViolationError.html @@ -0,0 +1,38 @@ +InvariantViolationError | Libraries

Class InvariantViolationError

Thrown by DbContext.saveChanges when an invariant is violated on +a tracked entity — e.g. the primary key or discriminator column was mutated.

+

Hierarchy

  • Error
    • InvariantViolationError
Index

Constructors

Properties

cause?: unknown
entity: string
field: string
message: string
name: string
pk: unknown
stack?: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.PendingChangesError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.PendingChangesError.html new file mode 100644 index 00000000..6380b924 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.PendingChangesError.html @@ -0,0 +1,39 @@ +PendingChangesError | Libraries

Class PendingChangesError

Thrown by the [Symbol.asyncDispose] implementation on a tracked +DbContext when there are unsaved changes at scope exit.

+

Callers must explicitly call await db.saveChanges() or +db.discardChanges() before the await using block exits.

+

Hierarchy

  • Error
    • PendingChangesError
Index

Constructors

Properties

cause?: unknown
message: string
name: string
pendingCount: number

Number of dirty / added / deleted entries.

+
stack?: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.SchemaQueryBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.SchemaQueryBuilder.html new file mode 100644 index 00000000..c92fc79f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_orm.SchemaQueryBuilder.html @@ -0,0 +1,72 @@ +SchemaQueryBuilder | Libraries

Class SchemaQueryBuilder<TLocalSchema, TResult>

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TResult
Index

Constructors

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    Returns Promise<number>

  • Returns Promise<number>

  • Returns Promise<TResult[]>

  • Returns Promise<TResult | undefined>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    • variantKey: string
    • relationName: string
    • Optionalcustomize: (q: SchemaQueryBuilder<any, any>) => void

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • opts: { page: number; pageSize: number }

    Returns Promise<PaginationResult<TResult>>

  • Returns Promise<TResult[]>

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • raw: Raw
    • operator: string
    • value: any

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_scheduler.JobScheduler.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_scheduler.JobScheduler.html new file mode 100644 index 00000000..5c038654 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_scheduler.JobScheduler.html @@ -0,0 +1,206 @@ +JobScheduler | Libraries

Job scheduler class that handles all the scheduling and running of jobs.

+

Hierarchy

  • EventEmitter
    • JobScheduler

Implements

  • IJobScheduler
Index

Constructors

  • Parameters

    • props: JobSchedulerProps

      {JobSchedulerProps} - scheduler properties

      +

    Returns JobScheduler

Properties

_checkTimer: Timeout | undefined
_defaultTimezone: string
_jobProps: Map<string, any> = ...
_jobsRepository: IJobRepository = ...
_rootFolder: string
_status: SchedulerStatus = 'stopped'

Accessors

  • get status(): SchedulerStatus

    Status of the scheduler.

    +

    Returns SchedulerStatus

  • set status(val: SchedulerStatus): void

    Parameters

    • val: SchedulerStatus

    Returns void

Methods

  • The Symbol.for('nodejs.rejection') method is called in case a +promise rejection happens when emitting an event and +captureRejections is enabled on the emitter. +It is possible to use events.captureRejectionSymbol in +place of Symbol.for('nodejs.rejection').

    +
    import { EventEmitter, captureRejectionSymbol } from 'node:events';

    class MyClass extends EventEmitter {
    constructor() {
    super({ captureRejections: true });
    }

    [captureRejectionSymbol](err, event, ...args) {
    console.log('rejection happened for', event, 'with', err, ...args);
    this.destroy(err);
    }

    destroy(err) {
    // Tear the resource down here.
    }
    } +
    + +

    Parameters

    • error: Error
    • event: string | symbol
    • ...args: any[]

    Returns void

    v13.4.0, v12.16.0

    +
  • Adds job to the scheduler

    +

    Parameters

    • job: {
          id: string;
          maxConsequentFails?: number;
          maxRetries?: number;
          noConcurrentRuns?: boolean;
          path: string;
          props?: ((...args: any[]) => any) | {};
          schedule:
              | {
                  endsOn?: Date;
                  every: "minute";
                  interval: number;
                  maxOccurences?: number;
                  skipFirst?: number;
                  startsOn?: Date;
              }
              | {
                  endsOn?: Date;
                  every: "day";
                  hour?: number;
                  interval: number;
                  maxOccurences?: number;
                  minute?: number;
                  skipFirst?: number;
                  startsOn?: Date;
              }
              | {
                  dayOfWeek: number[];
                  endsOn?: Date;
                  every: "week";
                  hour?: number;
                  interval: number;
                  maxOccurences?: number;
                  minute?: number;
                  skipFirst?: number;
                  startsOn?: Date;
              }
              | {
                  day: number
                  | "last";
                  endsOn?: Date;
                  every: "month";
                  hour?: number;
                  interval: number;
                  maxOccurences?: number;
                  minute?: number;
                  skipFirst?: number;
                  startsOn?: Date;
              }
              | {
                  day: number
                  | "last";
                  endsOn?: Date;
                  every: "year";
                  hour?: number;
                  interval: number;
                  maxOccurences?: number;
                  minute?: number;
                  month: number;
                  skipFirst?: number;
                  startsOn?: Date;
              };
          timeout?: number;
      }

      {CreateJobRequest} - job to add

      +
      • id: string

        Id of job, must be uniq

        +
      • OptionalmaxConsequentFails?: number

        Job will be considered as disabled when more than that count of runs fails consequently +unlimited if negative

        +
      • OptionalmaxRetries?: number

        Job will be retried right away this times. Job will be retried on next schedule run if this number is exceeded.

        +
      • OptionalnoConcurrentRuns?: boolean

        If true, job will not be runned if previous run is not finished yet.

        +
      • path: string

        Path to js file (relative to root folder)

        +
      • Optionalprops?: ((...args: any[]) => any) | {}

        Arbitrary props for job (can be a callback returning props or Promise)

        +
      • schedule:
            | {
                endsOn?: Date;
                every: "minute";
                interval: number;
                maxOccurences?: number;
                skipFirst?: number;
                startsOn?: Date;
            }
            | {
                endsOn?: Date;
                every: "day";
                hour?: number;
                interval: number;
                maxOccurences?: number;
                minute?: number;
                skipFirst?: number;
                startsOn?: Date;
            }
            | {
                dayOfWeek: number[];
                endsOn?: Date;
                every: "week";
                hour?: number;
                interval: number;
                maxOccurences?: number;
                minute?: number;
                skipFirst?: number;
                startsOn?: Date;
            }
            | {
                day: number
                | "last";
                endsOn?: Date;
                every: "month";
                hour?: number;
                interval: number;
                maxOccurences?: number;
                minute?: number;
                skipFirst?: number;
                startsOn?: Date;
            }
            | {
                day: number
                | "last";
                endsOn?: Date;
                every: "year";
                hour?: number;
                interval: number;
                maxOccurences?: number;
                minute?: number;
                month: number;
                skipFirst?: number;
                startsOn?: Date;
            }

        Job's schedule

        +
      • Optionaltimeout?: number

        Timeout for job (in milliseconds)

        +

    Returns Promise<void>

  • Alias for emitter.on(eventName, listener).

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v0.1.26

    +
  • Returns Promise<void>

  • Synchronously calls each of the listeners registered for the event named +eventName, in the order they were registered, passing the supplied arguments +to each.

    +

    Returns true if the event had listeners, false otherwise.

    +
    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • ...args: any[]

    Returns boolean

    v0.1.26

    +
  • Returns an array listing the events for which the emitter has registered +listeners.

    +
    import { EventEmitter } from 'node:events';

    const myEE = new EventEmitter();
    myEE.on('foo', () => {});
    myEE.on('bar', () => {});

    const sym = Symbol('symbol');
    myEE.on(sym, () => {});

    console.log(myEE.eventNames());
    // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
    + +

    Returns (string | symbol)[]

    v6.0.0

    +
  • Returns the current max listener value for the EventEmitter which is either +set by emitter.setMaxListeners(n) or defaults to +events.defaultMaxListeners.

    +

    Returns number

    v1.0.0

    +
  • Checks if job exists by id

    +

    Parameters

    • jobId: string

      id of the job

      +

    Returns Promise<boolean>

      +
    • true if job exists, false otherwise
    • +
    +
  • Returns the number of listeners listening for the event named eventName. +If listener is provided, it will return how many times the listener is found +in the list of the listeners of the event.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      +
    • Optionallistener: (...args: any[]) => void

      The event handler function

      +

    Returns number

    v3.2.0

    +
  • Returns a copy of the array of listeners for the event named eventName.

    +
    server.on('connection', (stream) => {
    console.log('someone connected!');
    });
    console.log(util.inspect(server.listeners('connection')));
    // Prints: [ [Function] ] +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

    Returns ((...args: any[]) => void)[]

    v0.1.26

    +
  • Alias for emitter.removeListener().

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v10.0.0

    +
  • Adds the listener function to the end of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple +times.

    +
    server.on('connection', (stream) => {
    console.log('someone connected!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    By default, event listeners are invoked in the order they are added. The +emitter.prependListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

    +
    import { EventEmitter } from 'node:events';
    const myEE = new EventEmitter();
    myEE.on('foo', () => console.log('a'));
    myEE.prependListener('foo', () => console.log('b'));
    myEE.emit('foo');
    // Prints:
    // b
    // a +
    + +

    Type Parameters

    • T extends keyof Events

    Parameters

    • name: T
    • callback: Events[T]

    Returns this

    v0.1.101

    +
  • Adds a one-time listener function for the event named eventName. The +next time eventName is triggered, this listener is removed and then invoked.

    +
    server.once('connection', (stream) => {
    console.log('Ah, we have our first user!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    By default, event listeners are invoked in the order they are added. The +emitter.prependOnceListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

    +
    import { EventEmitter } from 'node:events';
    const myEE = new EventEmitter();
    myEE.once('foo', () => console.log('a'));
    myEE.prependOnceListener('foo', () => console.log('b'));
    myEE.emit('foo');
    // Prints:
    // b
    // a +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v0.3.0

    +
  • Adds the listener function to the beginning of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple +times.

    +
    server.prependListener('connection', (stream) => {
    console.log('someone connected!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v6.0.0

    +
  • Adds a one-time listener function for the event named eventName to the +beginning of the listeners array. The next time eventName is triggered, this +listener is removed, and then invoked.

    +
    server.prependOnceListener('connection', (stream) => {
    console.log('Ah, we have our first user!');
    }); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

      The name of the event.

      +
    • listener: (...args: any[]) => void

      The callback function

      +

    Returns this

    v6.0.0

    +
  • Returns a copy of the array of listeners for the event named eventName, +including any wrappers (such as those created by .once()).

    +
    import { EventEmitter } from 'node:events';
    const emitter = new EventEmitter();
    emitter.once('log', () => console.log('log once'));

    // Returns a new Array with a function `onceWrapper` which has a property
    // `listener` which contains the original listener bound above
    const listeners = emitter.rawListeners('log');
    const logFnWrapper = listeners[0];

    // Logs "log once" to the console and does not unbind the `once` event
    logFnWrapper.listener();

    // Logs "log once" to the console and removes the listener
    logFnWrapper();

    emitter.on('log', () => console.log('log persistently'));
    // Will return a new Array with a single function bound by `.on()` above
    const newListeners = emitter.rawListeners('log');

    // Logs "log persistently" twice
    newListeners[0]();
    emitter.emit('log'); +
    + +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol

    Returns ((...args: any[]) => void)[]

    v9.4.0

    +
  • Removes all listeners, or those of the specified eventName.

    +

    It is bad practice to remove listeners added elsewhere in the code, +particularly when the EventEmitter instance was created by some other +component or module (e.g. sockets or file streams).

    +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • OptionaleventName: string | symbol

    Returns this

    v0.1.26

    +
  • Removes job by its id

    +

    Parameters

    • jobId: string

      {string} - id of the job

      +

    Returns Promise<void>

  • Removes the specified listener from the listener array for the event named +eventName.

    +
    const callback = (stream) => {
    console.log('someone connected!');
    };
    server.on('connection', callback);
    // ...
    server.removeListener('connection', callback); +
    + +

    removeListener() will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified eventName, then removeListener() must be +called multiple times to remove each instance.

    +

    Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any +removeListener() or removeAllListeners() calls after emitting and +before the last listener finishes execution will not remove them from +emit() in progress. Subsequent events behave as expected.

    +
    import { EventEmitter } from 'node:events';
    class MyEmitter extends EventEmitter {}
    const myEmitter = new MyEmitter();

    const callbackA = () => {
    console.log('A');
    myEmitter.removeListener('event', callbackB);
    };

    const callbackB = () => {
    console.log('B');
    };

    myEmitter.on('event', callbackA);

    myEmitter.on('event', callbackB);

    // callbackA removes listener callbackB but it will still be called.
    // Internal listener array at time of emit [callbackA, callbackB]
    myEmitter.emit('event');
    // Prints:
    // A
    // B

    // callbackB is now removed.
    // Internal listener array [callbackA]
    myEmitter.emit('event');
    // Prints:
    // A +
    + +

    Because listeners are managed using an internal array, calling this will +change the position indexes of any listener registered after the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the emitter.listeners() method will need to be recreated.

    +

    When a single function has been added as a handler multiple times for a single +event (as in the example below), removeListener() will remove the most +recently added instance. In the example the once('ping') +listener is removed:

    +
    import { EventEmitter } from 'node:events';
    const ee = new EventEmitter();

    function pong() {
    console.log('pong');
    }

    ee.on('ping', pong);
    ee.once('ping', pong);
    ee.removeListener('ping', pong);

    ee.emit('ping');
    ee.emit('ping'); +
    + +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Type Parameters

    • E extends string | symbol

    Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

    v0.1.26

    +
  • Parameters

    • file: string
    • props: any
    • timeout: number

    Returns { promise: Promise<WorkerResult>; worker: Worker }

  • Parameters

    • job: Job
    • date: Date
    • index: number

    Returns Promise<JobInstance | null>

  • By default EventEmitters will print a warning if more than 10 listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The emitter.setMaxListeners() method allows the limit to be +modified for this specific EventEmitter instance. The value can be set to +Infinity (or 0) to indicate an unlimited number of listeners.

    +

    Returns a reference to the EventEmitter, so that calls can be chained.

    +

    Parameters

    • n: number

    Returns this

    v0.3.5

    +
  • Starts the scheduler (all jobs will be scheduled and executed when it's time).

    +

    Returns Promise<void>

  • Start a job instance. This will run the job and update the status of the instance.

    +

    Parameters

    • instance: JobInstance

      The job instance to start.

      +

    Returns Promise<void>

  • Stops the scheduler (all jobs will be stopped and no new jobs will be scheduled).

    +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_scheduler.ScheduleCalculator.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_scheduler.ScheduleCalculator.html new file mode 100644 index 00000000..74985550 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_scheduler.ScheduleCalculator.html @@ -0,0 +1,68 @@ +ScheduleCalculator | Libraries

Iterates over the dates defined by a Schedule.

+

Given a schedule configuration (e.g. every 2 days, every week on Monday/Friday, +every month on the 15th) the calculator produces the sequence of Date objects +that match that schedule. Use hasNext / next to walk through +the sequence.

+
const calc = new ScheduleCalculator({
every: 'day',
interval: 1,
hour: 9,
minute: 0,
startsOn: new Date('2025-01-01T00:00:00Z'),
maxOccurences: 5
});

while (calc.hasNext()) {
const { date, index } = calc.next();
console.log(`Run #${index} at ${date.toISOString()}`);
} +
+ +
Index

Constructors

Methods

Constructors

  • Parameters

    • schedule:
          | {
              endsOn?: Date;
              every: "minute";
              interval: number;
              maxOccurences?: number;
              skipFirst?: number;
              startsOn?: Date;
          }
          | {
              endsOn?: Date;
              every: "day";
              hour?: number;
              interval: number;
              maxOccurences?: number;
              minute?: number;
              skipFirst?: number;
              startsOn?: Date;
          }
          | {
              dayOfWeek: number[];
              endsOn?: Date;
              every: "week";
              hour?: number;
              interval: number;
              maxOccurences?: number;
              minute?: number;
              skipFirst?: number;
              startsOn?: Date;
          }
          | {
              day: number
              | "last";
              endsOn?: Date;
              every: "month";
              hour?: number;
              interval: number;
              maxOccurences?: number;
              minute?: number;
              skipFirst?: number;
              startsOn?: Date;
          }
          | {
              day: number
              | "last";
              endsOn?: Date;
              every: "year";
              hour?: number;
              interval: number;
              maxOccurences?: number;
              minute?: number;
              month: number;
              skipFirst?: number;
              startsOn?: Date;
          }

      The schedule definition to iterate over.

      +
      • {
            endsOn?: Date;
            every: "minute";
            interval: number;
            maxOccurences?: number;
            skipFirst?: number;
            startsOn?: Date;
        }
        • OptionalendsOn?: Date

          Do not repeat after this date

          +
        • every: "minute"

          Repeat every minute

          +
        • interval: number

          Number of intervals (days, months, minutes or weeks) +between repeats. Interval type depends of every value

          +
        • OptionalmaxOccurences?: number

          Max number of repeats (min 1)

          +
        • OptionalskipFirst?: number

          Skip this number of repeats. Min value is 1.

          +
        • OptionalstartsOn?: Date

          Do not start earlier than this date

          +
      • {
            endsOn?: Date;
            every: "day";
            hour?: number;
            interval: number;
            maxOccurences?: number;
            minute?: number;
            skipFirst?: number;
            startsOn?: Date;
        }
        • OptionalendsOn?: Date

          Do not repeat after this date

          +
        • every: "day"

          Repeat every day

          +
        • Optionalhour?: number

          Hour (0-23)

          +
        • interval: number

          Number of intervals (days, months, minutes or weeks) +between repeats. Interval type depends of every value

          +
        • OptionalmaxOccurences?: number

          Max number of repeats (min 1)

          +
        • Optionalminute?: number

          Minute (0-59)

          +
        • OptionalskipFirst?: number

          Skip this number of repeats. Min value is 1.

          +
        • OptionalstartsOn?: Date

          Do not start earlier than this date

          +
      • {
            dayOfWeek: number[];
            endsOn?: Date;
            every: "week";
            hour?: number;
            interval: number;
            maxOccurences?: number;
            minute?: number;
            skipFirst?: number;
            startsOn?: Date;
        }
        • dayOfWeek: number[]

          Days of week for schedule

          +
        • OptionalendsOn?: Date

          Do not repeat after this date

          +
        • every: "week"

          Repeat every week

          +
        • Optionalhour?: number

          Hour (0-23)

          +
        • interval: number

          Number of intervals (days, months, minutes or weeks) +between repeats. Interval type depends of every value

          +
        • OptionalmaxOccurences?: number

          Max number of repeats (min 1)

          +
        • Optionalminute?: number

          Minute (0-59)

          +
        • OptionalskipFirst?: number

          Skip this number of repeats. Min value is 1.

          +
        • OptionalstartsOn?: Date

          Do not start earlier than this date

          +
      • {
            day: number | "last";
            endsOn?: Date;
            every: "month";
            hour?: number;
            interval: number;
            maxOccurences?: number;
            minute?: number;
            skipFirst?: number;
            startsOn?: Date;
        }
        • day: number | "last"

          Day - 'last' or number from 1 to 28

          +
        • OptionalendsOn?: Date

          Do not repeat after this date

          +
        • every: "month"

          Repeat every month

          +
        • Optionalhour?: number

          Hour (0-23)

          +
        • interval: number

          Number of intervals (days, months, minutes or weeks) +between repeats. Interval type depends of every value

          +
        • OptionalmaxOccurences?: number

          Max number of repeats (min 1)

          +
        • Optionalminute?: number

          Minute (0-59)

          +
        • OptionalskipFirst?: number

          Skip this number of repeats. Min value is 1.

          +
        • OptionalstartsOn?: Date

          Do not start earlier than this date

          +
      • {
            day: number | "last";
            endsOn?: Date;
            every: "year";
            hour?: number;
            interval: number;
            maxOccurences?: number;
            minute?: number;
            month: number;
            skipFirst?: number;
            startsOn?: Date;
        }
        • day: number | "last"

          Day - 'last' or number from 1 to 28

          +
        • OptionalendsOn?: Date

          Do not repeat after this date

          +
        • every: "year"

          Repeat every year

          +
        • Optionalhour?: number

          Hour (0-23)

          +
        • interval: number

          Number of intervals (days, months, minutes or weeks) +between repeats. Interval type depends of every value

          +
        • OptionalmaxOccurences?: number

          Max number of repeats (min 1)

          +
        • Optionalminute?: number

          Minute (0-59)

          +
        • month: number

          Month - number from 1 to 12

          +
        • OptionalskipFirst?: number

          Skip this number of repeats. Min value is 1.

          +
        • OptionalstartsOn?: Date

          Do not start earlier than this date

          +

    Returns ScheduleCalculator

    If schedule is falsy.

    +

Methods

  • Returns true when the schedule has at least one more date.

    +

    Parameters

    • Optionalspan: number

      Optional millisecond window. When provided the method +returns true only if the next date falls within span ms from now.

      +

    Returns boolean

  • Advances to the next scheduled date and returns it together with +its 1-based index in the sequence.

    +

    Returns { date: Date; index: number }

    An object with the scheduled date and its index.

    +

    If the schedule has no more dates (hasNext is false).

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.AnySchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.AnySchemaBuilder.html new file mode 100644 index 00000000..257c5aa6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.AnySchemaBuilder.html @@ -0,0 +1,272 @@ +AnySchemaBuilder | Libraries

Class AnySchemaBuilder<TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TResult>

Any schema builder class. Similar to the any type +in TypeScript. Allows to define a schema for any value. +Use it when you don't know the type of the value.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use any() function instead.

+
const schema = any();
const result = schema.validate(123);
// result.valid === true
// result.object === 123 +
+ +

Type Parameters

  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • TExplicitType = undefined
  • THasDefault extends boolean = false
  • TExtensions = {}
  • TResult = TExplicitType extends undefined ? any : TExplicitType

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: AnySchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform synchronous schema validation on object. +Throws at runtime if any preprocessor, validator, or error message +provider returns a Promise — use validateAsync instead.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns ValidationResult<TResult>

  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ArraySchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ArraySchemaBuilder.html new file mode 100644 index 00000000..5119aa05 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ArraySchemaBuilder.html @@ -0,0 +1,297 @@ +ArraySchemaBuilder | Libraries

Class ArraySchemaBuilder<TElementSchema, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TResult>

Similar to the Array type in TypeScript. It can be used to validate arrays of any type. +It can also be used to validate arrays of specific type. +For example, if you want to validate an array of numbers, +you can use array(number()) to create a schema builder. +If you want to validate an array of users, you can use +array().of(object({ name: string(), age: number() })) to create a schema builder. +If you want to validate an array of numbers or strings, +you can use array(union(number()).or(string())).

+

Also you can limit the length of the array by using minLength +and maxLength methods.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use array() function instead.

+

array

+

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        elementSchema: TElementSchema | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        maxLength: number | undefined;
        maxLengthValidationErrorMessageProvider: ValidationErrorMessageProvider<
            ArraySchemaBuilder<
                TElementSchema,
                TRequired,
                TNullable,
                TExplicitType,
                false,
                {},
                TExplicitType extends undefined
                    ? TElementSchema extends undefined
                        ? any[]
                        : TElementSchema extends SchemaBuilder<T1, T2, false, false, {}>
                            ? (T2 extends true ? T1 : T1 | undefined)[]
                            : never
                    : TExplicitType,
            >,
        >;
        minLength: number | undefined;
        minLengthValidationErrorMessageProvider: ValidationErrorMessageProvider<
            ArraySchemaBuilder<
                TElementSchema,
                TRequired,
                TNullable,
                TExplicitType,
                false,
                {},
                TExplicitType extends undefined
                    ? TElementSchema extends undefined
                        ? any[]
                        : TElementSchema extends SchemaBuilder<T1, T2, false, false, {}>
                            ? (T2 extends true ? T1 : T1 | undefined)[]
                            : never
                    : TExplicitType,
            >,
        >;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • elementSchema: TElementSchema | undefined

      Schema of array item (if defined)

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • maxLength: number | undefined

      Max length of a valid array

      +
    • maxLengthValidationErrorMessageProvider: ValidationErrorMessageProvider<
          ArraySchemaBuilder<
              TElementSchema,
              TRequired,
              TNullable,
              TExplicitType,
              false,
              {},
              TExplicitType extends undefined
                  ? TElementSchema extends undefined
                      ? any[]
                      : TElementSchema extends SchemaBuilder<T1, T2, false, false, {}>
                          ? (T2 extends true ? T1 : T1 | undefined)[]
                          : never
                  : TExplicitType,
          >,
      >

      Max length validation error message provider. +If not provided, default error message provider is used.

      +
    • minLength: number | undefined

      Min length of a valid array

      +
    • minLengthValidationErrorMessageProvider: ValidationErrorMessageProvider<
          ArraySchemaBuilder<
              TElementSchema,
              TRequired,
              TNullable,
              TExplicitType,
              false,
              {},
              TExplicitType extends undefined
                  ? TElementSchema extends undefined
                      ? any[]
                      : TElementSchema extends SchemaBuilder<T1, T2, false, false, {}>
                          ? (T2 extends true ? T1 : T1 | undefined)[]
                          : never
                  : TExplicitType,
          >,
      >

      Min length validation error message provider. +If not provided, default error message provider is used.

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.BooleanSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.BooleanSchemaBuilder.html new file mode 100644 index 00000000..d278b3a1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.BooleanSchemaBuilder.html @@ -0,0 +1,303 @@ +BooleanSchemaBuilder | Libraries

Class BooleanSchemaBuilder<TResult, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TFinalResult>

Similar to boolean type in TypeScript. +Allows to define a schema for a boolean value. It can be required or optional. +It can be restricted to be equal to a certain value.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use boolean() function instead.

+

boolean

+

Type Parameters

  • TResult = boolean
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • TExplicitType = undefined
  • THasDefault extends boolean = false
  • TExtensions = {}
  • TFinalResult = TExplicitType extends undefined ? TResult : TExplicitType

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TFinalResult | null : TFinalResult
    : (TNullable extends true ? TFinalResult | null : TFinalResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: BooleanSchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TFinalResult | (() => TFinalResult) | undefined;
        defaultValue: TFinalResult | (() => TFinalResult) | undefined;
        description: string | undefined;
        equalsTo: boolean | undefined;
        equalsToValidationErrorMessageProvider: ValidationErrorMessageProvider<
            BooleanSchemaBuilder<
                TResult,
                TRequired,
                false,
                undefined,
                false,
                {},
                TResult,
            >,
        >;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TFinalResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TFinalResult>[];
    }

    • catchValue: TFinalResult | (() => TFinalResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TFinalResult | (() => TFinalResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • equalsTo: boolean | undefined

      If set, restrict object to be equal to a certain value.

      +
    • equalsToValidationErrorMessageProvider: ValidationErrorMessageProvider<
          BooleanSchemaBuilder<
              TResult,
              TRequired,
              false,
              undefined,
              false,
              {},
              TResult,
          >,
      >

      Equals to validation error message provider. +If not provided, default error message will be used.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TFinalResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TFinalResult>[]

      Array of validator functions

      +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.DateSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.DateSchemaBuilder.html new file mode 100644 index 00000000..ed969c16 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.DateSchemaBuilder.html @@ -0,0 +1,354 @@ +DateSchemaBuilder | Libraries

Class DateSchemaBuilder<TResult, TRequired, TNullable, THasDefault, TExtensions>

Allows to create Date schema. It can be required or optional. +It can be restricted to be: equal to a certain value, in future, in past, in a certain range. +Supports parsing from JSON string and UNIX epoch (using preprocessors).

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use date() function instead.

+

date

+

Type Parameters

  • TResult = Date
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        ensureIsInFuture: boolean;
        ensureIsInFutureValidationErrorMessageProvider: ValidationErrorMessageProvider<
            DateSchemaBuilder<TResult, TRequired, false, false, {}>,
        >;
        ensureIsInPast: boolean;
        ensureIsInPastValidationErrorMessageProvider: ValidationErrorMessageProvider<
            DateSchemaBuilder<TResult, TRequired, false, false, {}>,
        >;
        equalsTo: Date | undefined;
        equalsToValidationErrorMessageProvider: ValidationErrorMessageProvider<
            DateSchemaBuilder<TResult, TRequired, false, false, {}>,
        >;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        max: Date | undefined;
        maxValidationErrorMessageProvider: ValidationErrorMessageProvider<
            DateSchemaBuilder<TResult, TRequired, false, false, {}>,
        >;
        min: Date | undefined;
        minValidationErrorMessageProvider: ValidationErrorMessageProvider<
            DateSchemaBuilder<TResult, TRequired, false, false, {}>,
        >;
        parseFromEpoch: boolean;
        parseFromJson: boolean;
        preprocessors: PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • ensureIsInFuture: boolean

      Make sure that date is in future. false by default.

      +
    • ensureIsInFutureValidationErrorMessageProvider: ValidationErrorMessageProvider<
          DateSchemaBuilder<TResult, TRequired, false, false, {}>,
      >

      Ensure in future validation error message provider. +If not provided, default error message will be used.

      +
    • ensureIsInPast: boolean

      Make sure that date is in past. false by default.

      +
    • ensureIsInPastValidationErrorMessageProvider: ValidationErrorMessageProvider<
          DateSchemaBuilder<TResult, TRequired, false, false, {}>,
      >

      Ensure in past validation error message provider. +If not provided, default error message will be used.

      +
    • equalsTo: Date | undefined

      If set, restrict date to be equal to a certain value.

      +
    • equalsToValidationErrorMessageProvider: ValidationErrorMessageProvider<
          DateSchemaBuilder<TResult, TRequired, false, false, {}>,
      >

      Equals to validation error message provider. +If not provided, default error message will be used.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • max: Date | undefined

      Max valid value (if defined).

      +
    • maxValidationErrorMessageProvider: ValidationErrorMessageProvider<
          DateSchemaBuilder<TResult, TRequired, false, false, {}>,
      >

      Max value validation error message provider. +If not provided, default error message will be used.

      +
    • min: Date | undefined

      Min valid value (if defined).

      +
    • minValidationErrorMessageProvider: ValidationErrorMessageProvider<
          DateSchemaBuilder<TResult, TRequired, false, false, {}>,
      >

      Min value validation error message provider. +If not provided, default error message will be used.

      +
    • parseFromEpoch: boolean

      If set, schema will try to parse date from the UNIX epoch (number). +false by default.

      +
    • parseFromJson: boolean

      If set, schema will try to parse date from JSON string. +false by default.

      +
    • preprocessors: PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ExternSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ExternSchemaBuilder.html new file mode 100644 index 00000000..56f58647 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ExternSchemaBuilder.html @@ -0,0 +1,292 @@ +ExternSchemaBuilder | Libraries

Class ExternSchemaBuilder<TStandardSchema, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TResult>

Schema builder that wraps an external +Standard Schema v1 compatible schema +(e.g. Zod, Valibot, ArkType) into a @cleverbrush/schema builder.

+

This enables cross-library schema composition — you can use a Zod schema +as a property inside a @cleverbrush/schema object schema, and the +inferred TypeScript type will be correct.

+

Validation is delegated entirely to the external schema's +['~standard'].validate() method. Standard Schema issues are mapped to +@cleverbrush/schema ValidationError objects, with any issue paths +formatted as dotted prefixes (e.g. "address.city: must be a string").

+

When used inside an object() schema, the property descriptor tree is +built dynamically (via Proxy) from the external schema's output type, +so getErrorsFor(t => t.order.id) works without any additional +configuration.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use the extern() factory function instead.

+
import { z } from 'zod';
import { object, date, extern, InferType } from '@cleverbrush/schema';

const zodUser = z.object({ first: z.string(), last: z.string() });

const order = object({
user: extern(zodUser),
date: date(),
});

type Order = InferType<typeof order>;
// { user: { first: string; last: string }; date: Date } +
+ +

extern

+

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+
"[SYMBOL_HAS_PROPERTIES]": true

Always true for extern schemas — enables Proxy-based property +descriptor trees and nested error propagation in +ObjectSchemaBuilder.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: ExternSchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Returns a snapshot of the builder's internal state. +Includes the wrapped standardSchema reference.

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        standardSchema: TStandardSchema;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • standardSchema: TStandardSchema
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.FunctionSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.FunctionSchemaBuilder.html new file mode 100644 index 00000000..606c0d5a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.FunctionSchemaBuilder.html @@ -0,0 +1,308 @@ +FunctionSchemaBuilder | Libraries

Class FunctionSchemaBuilder<TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TParameters, TReturnTypeSchema, TResult>

Schema builder for functions. Allows to define a schema for a function. +It can be required or optional, and may carry typed parameter and return-type +schemas so that the inferred TypeScript function signature is fully typed.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use func() function instead.

+
const schema = func();
const result = schema.validate(() => {});
// result.valid === true
// result.object === () => {} +
+ +
const schema = func().optional();
const result = schema.validate(undefined);
// result.valid === true
// result.object === undefined +
+ +
import { func, string, number, InferType } from '@cleverbrush/schema';

const greet = func()
.addParameter(string()) // first param: string
.addParameter(number().optional()) // second param: number | undefined
.hasReturnType(string()); // return type: string

type Greet = InferType<typeof greet>;
// → (param0: string, param1: number | undefined) => string

// Introspect at runtime
const info = greet.introspect();
// info.parameters → [StringSchemaBuilder, NumberSchemaBuilder]
// info.returnType → StringSchemaBuilder +
+ +

func

+

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: FunctionSchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Returns an object describing the current schema configuration.

    +

    In addition to the base fields exposed by SchemaBuilder.introspect, +the following fields are included:

    +
      +
    • parameters — an array of SchemaBuilder instances accumulated via +addParameter. Each element describes one positional parameter of the +function in the order they were added.
    • +
    • returnType — the SchemaBuilder set via hasReturnType, or +undefined when no return-type schema has been configured.
    • +
    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        parameters: SchemaBuilder<any, any, any, any, any>[];
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        returnType: SchemaBuilder<any, any, any, any, any> | undefined;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • parameters: SchemaBuilder<any, any, any, any, any>[]

      List of parameter schemas added via addParameter.

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • returnType: SchemaBuilder<any, any, any, any, any> | undefined

      Return type schema set via hasReturnType, or undefined if not set.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
    const schema = func()
    .addParameter(string())
    .addParameter(number())
    .hasReturnType(boolean());

    const info = schema.introspect();
    // info.parameters.length === 2
    // info.returnType instanceof BooleanSchemaBuilder +
    + +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.GenericSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.GenericSchemaBuilder.html new file mode 100644 index 00000000..f4129d51 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.GenericSchemaBuilder.html @@ -0,0 +1,325 @@ +GenericSchemaBuilder | Libraries

Class GenericSchemaBuilder<TFn, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TResult>

Schema builder that wraps a generic template function, enabling reusable +parameterized schemas. Call .apply() +with concrete schema arguments to obtain a fully typed concrete schema +builder whose TypeScript type is inferred from the template function's +generic signature.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use generic() function instead.

+
import { generic, object, array, number, string, InferType } from '@cleverbrush/schema';

const PaginatedList = generic(
<T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
object({
items: array(itemSchema),
total: number(),
page: number(),
})
);

const userSchema = object({ name: string(), age: number() });
const PaginatedUsers = PaginatedList.apply(userSchema);

type PaginatedUsersType = InferType<typeof PaginatedUsers>;
// → { items: { name: string; age: number }[]; total: number; page: number } +
+ +
const Result = generic(
<T extends SchemaBuilder<any, any, any, any, any>,
E extends SchemaBuilder<any, any, any, any, any>>(
valueSchema: T,
errorSchema: E
) =>
object({
ok: boolean(),
value: valueSchema.optional(),
error: errorSchema.optional(),
})
);

const StringResult = Result.apply(string(), number());
// InferType → { ok: boolean; value?: string; error?: number } +
+ +
const AnyList = generic(
[any()], // default args — one per template parameter
<T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
object({ items: array(itemSchema), total: number() })
);

// Validate directly using defaults:
AnyList.validate({ items: [1, 'two', true], total: 3 }); // valid

// Or apply concrete schemas first:
AnyList.apply(string()).validate({ items: ['a', 'b'], total: 2 }); // valid +
+ +

generic

+

Type Parameters

  • TFn extends (...args: any[]) => SchemaBuilder<any, any, any, any, any>

    The generic template function type. Its return type +determines TResult (the validated value type) when no explicit type +override has been applied via .hasType<T>().

    +
  • TRequired extends boolean = true

    true when the schema is required (default), +false after calling .optional(). Governs whether undefined is a +valid value.

    +
  • TNullable extends boolean = false

    true after calling .nullable(). Governs whether +null is a valid value.

    +
  • TExplicitType = undefined

    Type override set via .hasType<T>(). When +undefined (the default), TResult is derived from TFn's return type.

    +
  • THasDefault extends boolean = false

    true after calling .default(value). Governs +whether InferType emits T instead of T | undefined for optional +schemas with a default.

    +
  • TExtensions = {}

    Object type carrying extension methods added via +withExtensions(). Defaults to {}.

    +
  • TResult = TExplicitType extends undefined
        ? ReturnType<TFn> extends SchemaBuilder<infer R, any, any, any, any>
            ? R
            : any
        : TExplicitType

    The inferred result type: TExplicitType when set, +otherwise the value type inferred from ReturnType<TFn>.

    +

Hierarchy (View Summary)

Index

Constructors

  • Type Parameters

    • TFn extends (...args: any[]) => SchemaBuilder<any, any, any, any, any>

      The generic template function type. Its return type +determines TResult (the validated value type) when no explicit type +override has been applied via .hasType<T>().

      +
    • TRequired extends boolean = true

      true when the schema is required (default), +false after calling .optional(). Governs whether undefined is a +valid value.

      +
    • TNullable extends boolean = false

      true after calling .nullable(). Governs whether +null is a valid value.

      +
    • TExplicitType = undefined

      Type override set via .hasType<T>(). When +undefined (the default), TResult is derived from TFn's return type.

      +
    • THasDefault extends boolean = false

      true after calling .default(value). Governs +whether InferType emits T instead of T | undefined for optional +schemas with a default.

      +
    • TExtensions = {}

      Object type carrying extension methods added via +withExtensions(). Defaults to {}.

      +
    • TResult = TExplicitType extends undefined
          ? ReturnType<TFn> extends SchemaBuilder<R, any, any, any, any> ? R : any
          : TExplicitType

      The inferred result type: TExplicitType when set, +otherwise the value type inferred from ReturnType<TFn>.

      +

    Parameters

    • props: GenericSchemaBuilderCreateProps<TRequired>

    Returns GenericSchemaBuilder<
        TFn,
        TRequired,
        TNullable,
        TExplicitType,
        THasDefault,
        TExtensions,
        TResult,
    >

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+
apply: TFn

Applies the template function with concrete schema arguments, returning +a fully typed concrete schema builder. TypeScript infers the result type +from the template function's own generic signature.

+

The returned builder is independent of this GenericSchemaBuilder and +can be used like any other schema: .validate(), .optional(), etc.

+
const Wrapper = generic(
<T extends SchemaBuilder<any, any, any, any, any>>(schema: T) =>
object({ data: schema })
);

const s = Wrapper.apply(string());
// InferType<typeof s> → { data: string }
s.validate({ data: 'hello' }); // { valid: true } +
+ +

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: GenericSchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Returns an object describing the current schema configuration.

    +

    In addition to the base fields exposed by SchemaBuilder.introspect, +the following fields are included:

    +
      +
    • templateFn — the template function passed to generic.
    • +
    • defaults — the default argument list passed to the two-argument +form of generic, or undefined when no defaults were provided.
    • +
    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaults: readonly any[] | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        templateFn:
            | ((...args: any[]) => SchemaBuilder<any, any, any, any, any>)
            | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaults: readonly any[] | undefined

      Default positional arguments for the template function, or undefined.

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • templateFn: ((...args: any[]) => SchemaBuilder<any, any, any, any, any>) | undefined

      Template function passed to generic.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
    const schema = generic([string()], <T>(s: T) => object({ data: s }));

    const info = schema.introspect();
    // info.type → 'generic'
    // info.templateFn → [Function]
    // info.defaults → [StringSchemaBuilder] +
    + +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.IntersectionSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.IntersectionSchemaBuilder.html new file mode 100644 index 00000000..b78bd85b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.IntersectionSchemaBuilder.html @@ -0,0 +1,265 @@ +IntersectionSchemaBuilder | Libraries

Class IntersectionSchemaBuilder<TLeft, TRight, TRequired, TNullable, TExplicitType, THasDefault, TExtensions>

Base class for all schema builders. Provides basic functionality for schema building.

+

Note: this class is not intended to be used directly, use one of the subclasses instead.

+

TResult Type of the object that will be returned by validate() method.

+

TRequired If true, object will be required. If false, object will be optional.

+

Type Parameters

  • TLeft extends SchemaBuilder<any, any, any, any, any>
  • TRight extends SchemaBuilder<any, any, any, any, any>
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • TExplicitType = undefined
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true
        ? | (
            TExplicitType extends undefined
                ? SchemaIntersection<TLeft, TRight>
                : TExplicitType
        )
        | null
        : TExplicitType extends undefined
            ? SchemaIntersection<TLeft, TRight>
            : TExplicitType
    :
        | (
            TNullable extends true
                ? | (
                    TExplicitType extends undefined
                        ? SchemaIntersection<TLeft, TRight>
                        : TExplicitType
                )
                | null
                : TExplicitType extends undefined
                    ? SchemaIntersection<TLeft, TRight>
                    : TExplicitType
        )
        | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value:
          | (
              TExplicitType extends undefined
                  ? SchemaIntersection<TLeft, TRight>
                  : TExplicitType
          )
          | (
              () => TExplicitType extends undefined
                  ? SchemaIntersection<TLeft, TRight>
                  : TExplicitType
          )

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue:
            | (
                TExplicitType extends undefined
                    ? SchemaIntersection<TLeft, TRight>
                    : TExplicitType
            )
            | (
                () => TExplicitType extends undefined
                    ? SchemaIntersection<TLeft, TRight>
                    : TExplicitType
            )
            | undefined;
        defaultValue:
            | (
                TExplicitType extends undefined
                    ? SchemaIntersection<TLeft, TRight>
                    : TExplicitType
            )
            | (
                () => TExplicitType extends undefined
                    ? SchemaIntersection<TLeft, TRight>
                    : TExplicitType
            )
            | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        left: TLeft;
        preprocessors: readonly PreprocessorEntry<
            TExplicitType extends undefined
                ? SchemaIntersection<TLeft, TRight>
                : TExplicitType,
        >[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        right: TRight;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<
            TExplicitType extends undefined
                ? SchemaIntersection<TLeft, TRight>
                : TExplicitType,
        >[];
    }

    • catchValue:
          | (
              TExplicitType extends undefined
                  ? SchemaIntersection<TLeft, TRight>
                  : TExplicitType
          )
          | (
              () => TExplicitType extends undefined
                  ? SchemaIntersection<TLeft, TRight>
                  : TExplicitType
          )
          | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue:
          | (
              TExplicitType extends undefined
                  ? SchemaIntersection<TLeft, TRight>
                  : TExplicitType
          )
          | (
              () => TExplicitType extends undefined
                  ? SchemaIntersection<TLeft, TRight>
                  : TExplicitType
          )
          | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • left: TLeft
    • preprocessors: readonly PreprocessorEntry<
          TExplicitType extends undefined
              ? SchemaIntersection<TLeft, TRight>
              : TExplicitType,
      >[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • right: TRight
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<
          TExplicitType extends undefined
              ? SchemaIntersection<TLeft, TRight>
              : TExplicitType,
      >[]

      Array of validator functions

      +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.LazySchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.LazySchemaBuilder.html new file mode 100644 index 00000000..d961d889 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.LazySchemaBuilder.html @@ -0,0 +1,277 @@ +LazySchemaBuilder | Libraries

Class LazySchemaBuilder<TResult, TRequired, TNullable, THasDefault, TExtensions>

Lazy schema builder class. Allows defining recursive/self-referential schemas +by wrapping a getter function that returns the target schema. The getter is +called once on first validation and the result is cached.

+

This is the primary mechanism for building recursive data structures such as +tree nodes, nested menus, and threaded comments.

+

NOTE TypeScript cannot infer recursive types automatically, so you must +provide an explicit type annotation on the variable holding the schema:

+
type TreeNode = { value: number; children: TreeNode[] };

const treeNode: SchemaBuilder<TreeNode, true> = object({
value: number(),
children: array(lazy(() => treeNode))
});

treeNode.validate({ value: 1, children: [{ value: 2, children: [] }] });
// { valid: true, object: { value: 1, children: [{ value: 2, children: [] }] } } +
+ +
type Comment = { text: string; replies: Comment[] };

const commentSchema: SchemaBuilder<Comment, true> = object({
text: string(),
replies: array(lazy(() => commentSchema))
}); +
+ +

Type Parameters

  • TResult = any
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: LazySchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        getter: () => SchemaBuilder<TResult, any, any>;
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • getter: () => SchemaBuilder<TResult, any, any>

      The getter function that returns the lazily-resolved schema. +Call LazySchemaBuilder.resolve to obtain the schema instance.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.NullSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.NullSchemaBuilder.html new file mode 100644 index 00000000..7748b442 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.NullSchemaBuilder.html @@ -0,0 +1,273 @@ +NullSchemaBuilder | Libraries

Class NullSchemaBuilder<TRequired, TNullable, TExplicitType, THasDefault, TExtensions>

Schema builder for null values. Validates that the input is exactly null.

+

When required (the default), only null is accepted. When optional (via +.optional()), both null and undefined are accepted; any other value +is rejected.

+

This builder is useful when you need to represent an explicitly-null field +in a typed schema, for example in discriminated-union branches or when +modelling a JSON payload that may carry a JSON null value.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use nul() function instead.

+
import { nul } from '@cleverbrush/schema';

const schema = nul();

schema.validate(null); // { valid: true, object: null }
schema.validate(undefined); // { valid: false }
schema.validate(0); // { valid: false }
schema.validate(''); // { valid: false } +
+ +
// Optional — accepts null or undefined
const schema = nul().optional();

schema.validate(null); // { valid: true, object: null }
schema.validate(undefined); // { valid: true, object: undefined }
schema.validate(false); // { valid: false } +
+ +
// Use inside a union to model a nullable string field
import { union, string, nul, InferType } from '@cleverbrush/schema';

const NullableString = union(string()).or(nul());
type NullableString = InferType<typeof NullableString>;
// string | null

NullableString.validate('hello'); // valid
NullableString.validate(null); // valid
NullableString.validate(42); // invalid +
+ +

nul

+

Type Parameters

  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • TExplicitType = undefined
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? null : null
    : (TNullable extends true ? null : null) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: (() => null) | null

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: NullSchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    • value: null

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: (() => null) | null | undefined;
        defaultValue: (() => null) | null | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<null>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<null>[];
    }

    • catchValue: (() => null) | null | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: (() => null) | null | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<null>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<null>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns null

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform synchronous schema validation on object. +Throws at runtime if any preprocessor, validator, or error message +provider returns a Promise — use validateAsync instead.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: null

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns ValidationResult<null>

  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: null

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<null>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.NumberSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.NumberSchemaBuilder.html new file mode 100644 index 00000000..1b5ec7f2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.NumberSchemaBuilder.html @@ -0,0 +1,351 @@ +NumberSchemaBuilder | Libraries

Class NumberSchemaBuilder<TResult, TRequired, TNullable, THasDefault, TExtensions>

Number schema builder class. Allows to create Number schemas. +Can be required or optional, can be restricted to be equal to a certain value, +can be restricted to be in a certain range, can be restricted to be integer.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use number() function instead.

+

number

+

Type Parameters

  • TResult = number
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • T
    • TReq extends boolean

    Parameters

    • props: NumberSchemaBuilderCreateProps<T, TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ObjectSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ObjectSchemaBuilder.html new file mode 100644 index 00000000..d4af1104 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ObjectSchemaBuilder.html @@ -0,0 +1,448 @@ +ObjectSchemaBuilder | Libraries

Class ObjectSchemaBuilder<TProperties, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TConstructorSchemas>

Object schema builder class. Similar to the object type +in JS. Allows to define a schema for object value. +Should be used to validate objects with specific properties. +Properties should be defined as their own schema builders. +You can use any SchemaBuilder e.g. string(), number(), +boolean(), array(), object(), etc. to define properties. +Which means that you can define nested objects and arrays of +any complexity.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use object() function instead.

+
const schema = object({
name: string(),
age: number()
});

const result = schema.validate({
name: 'John',
age: 30
});

// result.valid === true
// result.object === { name: 'John', age: 30 } +
+ +
const schema = object({
name: string(),
age: number().optional()
});

const result = schema.validate({
name: 'John'
});
// result.valid === true
// result.object === { name: 'John' } +
+ +
const schema = object({
name: string(),
age: number();
});
const result = schema.validate({
name: 'John'
});

// result.valid === false
// result.errors is deprecated — use result.getErrorsFor() instead
// result.getErrorsFor((p) => p.age).errors // ["is expected to have property 'age'"] +
+ +
const schema = object({
name: string(),
address: object({
city: string(),
country: string()
})
});
const result = schema.validate({
name: 'John',
address: {
city: 'New York',
country: 'USA'
}
});
// result.valid === true
// result.object === {
// name: 'John',
// address: {
// city: 'New York',
// country: 'USA'
// }
// } +
+ +

object

+

Type Parameters

  • TProperties extends Record<string, SchemaBuilder<any, any, any, any, any>> = {}
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • TExplicitType = undefined
  • THasDefault extends boolean = false
  • TExtensions = {}
  • TConstructorSchemas extends SchemaBuilder<any, any, any, any, any>[] = []

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true
        ? | (
            undefined extends TExplicitType
                ? WithConstructors<
                    TConstructorSchemas,
                    RespectPropsOptionality<TProperties>,
                >
                : TExplicitType
        )
        | null
        : undefined extends TExplicitType
            ? WithConstructors<
                TConstructorSchemas,
                RespectPropsOptionality<TProperties>,
            >
            : TExplicitType
    :
        | (
            TNullable extends true
                ? | (
                    undefined extends TExplicitType
                        ? WithConstructors<
                            TConstructorSchemas,
                            RespectPropsOptionality<TProperties>,
                        >
                        : TExplicitType
                )
                | null
                : undefined extends TExplicitType
                    ? WithConstructors<
                        TConstructorSchemas,
                        RespectPropsOptionality<TProperties>,
                    >
                    : TExplicitType
        )
        | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+
"[SYMBOL_HAS_PROPERTIES]": true

Marks this builder as having sub-properties for descriptor tree recursion.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Appends a constructor overload to the object schema.

    +

    Each call extends the set of construct signatures on the inferred type by +one overload. The accumulated argument lists are taken from the +FunctionSchemaBuilder passed in — specifically from the positional +parameter schemas registered via .addParameter().

    +

    At runtime the schema continues to validate plain objects; the +constructor information is purely a TypeScript-level annotation and is +stored in introspect().constructorSchemas for tooling use.

    +

    Multiple calls are supported and produce overloaded construct +signatures in the inferred type, modelling a class that exposes several +constructor overloads.

    +

    Type Parameters

    Parameters

    • schema: TFunc

      A FunctionSchemaBuilder describing one constructor +overload. Use .addParameter() on the function schema to declare the +parameter types. The return type, if set via .hasReturnType(), is +ignored — the return type of a constructor is always the instance type +derived from the object schema's properties.

      +

    Returns ObjectSchemaBuilder<
        TProperties,
        TRequired,
        TNullable,
        TExplicitType,
        THasDefault,
        TExtensions,
        [...TConstructorSchemas[], TFunc],
    > & TExtensions

    A new ObjectSchemaBuilder whose TConstructorSchemas tuple has +been extended by schema, updating InferType to include the new +construct signature.

    +
    import { object, string, number, func, InferType } from '@cleverbrush/schema';

    // Single constructor
    const PersonSchema = object({ name: string(), age: number() })
    .addConstructor(
    func().addParameter(string()).addParameter(number())
    );

    type Person = InferType<typeof PersonSchema>;
    // → { new (p0: string, p1: number): { name: string; age: number } }
    // & { name: string; age: number } +
    + +
    import { object, string, number, func, InferType } from '@cleverbrush/schema';

    // Multiple constructors via chained calls → overloaded signatures
    const PointSchema = object({ x: number(), y: number() })
    .addConstructor(func()) // no-arg ctor
    .addConstructor(func().addParameter(number()).addParameter(number())); // (x, y) ctor

    type Point = InferType<typeof PointSchema>;
    // → { new (): { x: number; y: number } }
    // & { new (p0: number, p1: number): { x: number; y: number } }
    // & { x: number; y: number }

    // Validation still operates on plain objects — the constructor type is
    // a compile-time annotation only.
    const result = PointSchema.validate({ x: 1, y: 2 });
    // result.valid === true

    // Introspect the registered constructor schemas at runtime:
    const info = PointSchema.introspect();
    // info.constructorSchemas.length === 2 +
    + +
  • Adds a validator to validators list.

    +

    Object-level validators can return errors with a property selector +to route the error to a specific property, making it visible via +getErrorsFor().

    +
    schema.addValidator((value) => ({
    valid: false,
    errors: [{
    message: 'Passwords do not match',
    property: (t) => t.confirmPassword
    }]
    })); +
    + +

    The property selector uses the same PropertyDescriptorTree +as getErrorsFor() and react-form's forProperty.

    +

    Parameters

    • validator: (
          object: undefined extends TExplicitType
              ? WithConstructors<
                  TConstructorSchemas,
                  RespectPropsOptionality<TProperties>,
              >
              : TExplicitType,
      ) =>
          | {
              errors?: {
                  message: string;
                  property?: (
                      properties: PropertyDescriptorTree<
                          ObjectSchemaBuilder<
                              TProperties,
                              true,
                              false,
                              undefined,
                              false,
                              {},
                              [],
                          >,
                      >,
                  ) => PropertyDescriptor<any, any, any>;
              }[];
              valid: boolean;
          }
          | Promise<
              {
                  errors?: {
                      message: string;
                      property?: (
                          properties: PropertyDescriptorTree<
                              ObjectSchemaBuilder<
                                  (...),
                                  (...),
                                  (...),
                                  (...),
                                  (...),
                                  (...),
                                  (...),
                              >,
                          >,
                      ) => PropertyDescriptor<any, any, any>;
                  }[];
                  valid: boolean;
              },
          >
    • Optionaloptions: { mutates?: boolean }

    Returns this

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value:
          | (
              undefined extends TExplicitType
                  ? WithConstructors<
                      TConstructorSchemas,
                      RespectPropsOptionality<TProperties>,
                  >
                  : TExplicitType
          )
          | (
              () => undefined extends TExplicitType
                  ? WithConstructors<
                      TConstructorSchemas,
                      RespectPropsOptionality<TProperties>,
                  >
                  : TExplicitType
          )

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Removes all constructor overloads previously registered via +.addConstructor(), resetting the TConstructorSchemas tuple to [].

    +

    After calling this method InferType reverts to the plain object type +derived from the schema's properties — no construct signatures are +included.

    +

    introspect().constructorSchemas will return an empty array.

    +

    Returns ObjectSchemaBuilder<
        TProperties,
        TRequired,
        TNullable,
        TExplicitType,
        THasDefault,
        TExtensions,
        [],
    > & TExtensions

    A new ObjectSchemaBuilder with TConstructorSchemas = [].

    +
    import { object, string, func, InferType } from '@cleverbrush/schema';

    const WithCtor = object({ name: string() })
    .addConstructor(func().addParameter(string()));

    type WithCtorType = InferType<typeof WithCtor>;
    // → { new (p0: string): { name: string } } & { name: string }

    const Plain = WithCtor.clearConstructors();

    type PlainType = InferType<typeof Plain>;
    // → { name: string }

    Plain.introspect().constructorSchemas; // [] +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • T extends Record<string, SchemaBuilder<any, true, false, false, {}>>
    • R extends boolean = true

    Parameters

    • props: ObjectSchemaBuilderCreateProps<T, R>

      arbitrary props object

      +

    Returns this

  • Recursively marks all properties — and all properties of nested +object() schemas — as optional. Useful for PATCH API bodies +and partial form state where every field at every level is optional.

    +

    Only nested ObjectSchemaBuilder schemas are recursed into. +Other schema types (arrays, unions, primitives, lazy) are made +optional at the top level but their internals are not modified.

    +

    Returns ObjectSchemaBuilder<
        DeepMakeChildrenOptional<TProperties>,
        TRequired,
        TNullable,
        TExplicitType,
        THasDefault,
        TExtensions,
        TConstructorSchemas,
    > & TExtensions

    const Address = object({
    street: string(),
    city: string()
    });

    const User = object({
    name: string(),
    address: Address
    });

    const PatchUser = User.deepPartial();
    // PatchUser infers as:
    // { name?: string; address?: { street?: string; city?: string } }

    PatchUser.validate({ address: { city: 'Paris' } }); // valid
    PatchUser.validate({}); // valid +
    + +
    // Three-level nesting
    const schema = object({
    a: object({
    b: object({ c: string() })
    })
    }).deepPartial();

    schema.validate({}); // valid
    schema.validate({ a: {} }); // valid
    schema.validate({ a: { b: {} } }); // valid +
    + +
    // PATCH API body
    const CreateBody = object({
    profile: object({ displayName: string(), bio: string() }),
    settings: object({ theme: string(), language: string() })
    });

    const PatchBody = CreateBody.deepPartial();
    // All fields are optional at every level —
    // send only what you want to update. +
    + +

    partial for shallow-only property optionality.

    +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        acceptUnknownProps: boolean;
        catchValue:
            | (
                undefined extends TExplicitType
                    ? WithConstructors<
                        TConstructorSchemas,
                        RespectPropsOptionality<TProperties>,
                    >
                    : TExplicitType
            )
            | (
                () => undefined extends TExplicitType
                    ? WithConstructors<
                        TConstructorSchemas,
                        RespectPropsOptionality<TProperties>,
                    >
                    : TExplicitType
            )
            | undefined;
        constructorSchemas: TConstructorSchemas;
        defaultValue:
            | (
                undefined extends TExplicitType
                    ? WithConstructors<
                        TConstructorSchemas,
                        RespectPropsOptionality<TProperties>,
                    >
                    : TExplicitType
            )
            | (
                () => undefined extends TExplicitType
                    ? WithConstructors<
                        TConstructorSchemas,
                        RespectPropsOptionality<TProperties>,
                    >
                    : TExplicitType
            )
            | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<
            undefined extends TExplicitType
                ? WithConstructors<
                    TConstructorSchemas,
                    RespectPropsOptionality<TProperties>,
                >
                : TExplicitType,
        >[];
        properties: TProperties;
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<
            undefined extends TExplicitType
                ? WithConstructors<
                    TConstructorSchemas,
                    RespectPropsOptionality<TProperties>,
                >
                : TExplicitType,
        >[];
    }

    • acceptUnknownProps: boolean

      If set to true, schema validation will not +return errors if object contains fields which +are not defined in the schema properties. +Set to false by default

      +
    • catchValue:
          | (
              undefined extends TExplicitType
                  ? WithConstructors<
                      TConstructorSchemas,
                      RespectPropsOptionality<TProperties>,
                  >
                  : TExplicitType
          )
          | (
              () => undefined extends TExplicitType
                  ? WithConstructors<
                      TConstructorSchemas,
                      RespectPropsOptionality<TProperties>,
                  >
                  : TExplicitType
          )
          | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • constructorSchemas: TConstructorSchemas

      The list of constructor schemas registered via .addConstructor(). +Each element is a FunctionSchemaBuilder whose inferred function +type provides one overloaded construct signature in InferType. +Empty array when no constructors have been added.

      +
    • defaultValue:
          | (
              undefined extends TExplicitType
                  ? WithConstructors<
                      TConstructorSchemas,
                      RespectPropsOptionality<TProperties>,
                  >
                  : TExplicitType
          )
          | (
              () => undefined extends TExplicitType
                  ? WithConstructors<
                      TConstructorSchemas,
                      RespectPropsOptionality<TProperties>,
                  >
                  : TExplicitType
          )
          | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<
          undefined extends TExplicitType
              ? WithConstructors<
                  TConstructorSchemas,
                  RespectPropsOptionality<TProperties>,
              >
              : TExplicitType,
      >[]

      Array of preprocessor functions

      +
    • properties: TProperties

      Properties defined in schema

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<
          undefined extends TExplicitType
              ? WithConstructors<
                  TConstructorSchemas,
                  RespectPropsOptionality<TProperties>,
              >
              : TExplicitType,
      >[]

      Array of validator functions

      +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    Returns Promise<
        PreValidationResult<
            TRequired extends true
                ? undefined extends TExplicitType
                    ? Id<RespectPropsOptionality<TProperties>>
                    : TExplicitType
                :
                    | (
                        undefined extends TExplicitType
                            ? Id<RespectPropsOptionality<TProperties>>
                            : TExplicitType
                    )
                    | undefined,
            { validatedObject: any },
        >,
    >

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ParseStringSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ParseStringSchemaBuilder.html new file mode 100644 index 00000000..8d9cf54d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.ParseStringSchemaBuilder.html @@ -0,0 +1,293 @@ +ParseStringSchemaBuilder | Libraries

Class ParseStringSchemaBuilder<TResult, TRequired, TNullable, THasDefault, TExtensions>

Validates a string against a template pattern and parses it +into a strongly-typed object.

+

Created via the parseString factory:

+
const RouteSchema = parseString(
object({ userId: string().uuid(), id: number() }),
$t => $t`/orders/${t => t.id}/${t => t.userId}`
);

const result = RouteSchema.validate('/orders/42/550e8400-...');
// result.object === { id: 42, userId: '550e8400-...' } +
+ +

Type Parameters

  • TResult = any
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

  • get template(): string

    The human-readable message template pattern with {property} holes, +e.g. "Todo created: #{TodoId} \"{Title}\" by user {UserId}".

    +

    Useful for structured logging — pass this as the log messageTemplate +so events with the same shape can be grouped, and pass +serialize(params) as the rendered message.

    +

    Returns string

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • T
    • TReq extends boolean

    Parameters

    • props: ParseStringSchemaBuilderCreateProps<T, TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Return a snapshot of this builder's configuration.

    +

    Includes all base-class fields plus:

    +
      +
    • objectSchema — the object schema defining the result shape.
    • +
    • templateDefinition — the parsed template (literals and selector segments).
    • +
    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        objectSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        templateDefinition: ParseStringTemplateDefinition;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • objectSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      The object schema defining the result shape.

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • templateDefinition: ParseStringTemplateDefinition

      The template definition (literals + segments).

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Builds a string from the template by substituting parameter values.

    +

    This is the reverse of validate: where validate parses a +string into a typed object, serialize takes a params object and +produces the string.

    +

    Parameters

    • params: TResult

      An object matching the template's parsed result type. +Nested properties are resolved via dot-paths (e.g. order.id). +Values are coerced to strings via String().

      +

    Returns string

    The reconstructed string with all segments replaced.

    +

    If a required parameter is missing (undefined).

    +
    const Route = parseString(
    object({ id: number().coerce() }),
    $t => $t`/todos/${t => t.id}`
    );

    Route.serialize({ id: 42 }); // '/todos/42' +
    + +
  • Perform synchronous schema validation on object. +Throws at runtime if any preprocessor, validator, or error message +provider returns a Promise — use validateAsync instead.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: string

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns ValidationResult<TResult>

  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: string

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.PromiseSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.PromiseSchemaBuilder.html new file mode 100644 index 00000000..93c0b229 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.PromiseSchemaBuilder.html @@ -0,0 +1,292 @@ +PromiseSchemaBuilder | Libraries

Class PromiseSchemaBuilder<TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TResolvedTypeSchema, TResult>

Schema builder for promise-like values. Validates that a value is a +thenable (for example, an actual Promise or any object with a then +function) and optionally carries a typed resolved-value schema so that +the inferred TypeScript type is Promise<T> instead of Promise<any>.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use promise() function instead.

+
const schema = promise();
const result = schema.validate(Promise.resolve(42));
// result.valid === true +
+ +
const schema = promise().optional();
const result = schema.validate(undefined);
// result.valid === true
// result.object === undefined +
+ +
import { promise, string, InferType } from '@cleverbrush/schema';

const schema = promise(string());

type PromiseResult = InferType<typeof schema>;
// → Promise<string>

// Introspect at runtime
const info = schema.introspect();
// info.resolvedType → StringSchemaBuilder +
+ +

promise

+

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • TReq extends boolean

    Parameters

    • props: PromiseSchemaBuilderCreateProps<TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Returns an object describing the current schema configuration.

    +

    In addition to the base fields exposed by SchemaBuilder.introspect, +the following field is included:

    + +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        resolvedType: SchemaBuilder<any, any, any, any, any> | undefined;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • resolvedType: SchemaBuilder<any, any, any, any, any> | undefined

      Resolved-value schema set via hasResolvedType, or undefined if not set.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
    const schema = promise(string());

    const info = schema.introspect();
    // info.resolvedType instanceof StringSchemaBuilder +
    + +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.RecordSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.RecordSchemaBuilder.html new file mode 100644 index 00000000..fe258a98 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.RecordSchemaBuilder.html @@ -0,0 +1,281 @@ +RecordSchemaBuilder | Libraries

Class RecordSchemaBuilder<TKeySchema, TValueSchema, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TResult>

Schema builder for objects with dynamic string keys.

+

Every key in the validated object must be accepted by keySchema (a +StringSchemaBuilder) and every value must satisfy valueSchema.

+

The inferred TypeScript type mirrors Record<K, V> where K is the +string type produced by keySchema and V is the type produced by +valueSchema.

+

NOTE — this class is exported to allow extension by inheritance. Use +the record() factory function instead of instantiating it +directly.

+
import { record, string, number } from '@cleverbrush/schema';

// Basic: string keys, number values
const scores = record(string(), number().min(0));
// InferType<typeof scores> → Record<string, number>

scores.validate({ alice: 95, bob: 87 }); // valid
scores.validate({ alice: 95, bob: -1 }); // invalid (negative) +
+ +
// Restrict keys to a specific set of literals with .equals()
const locales = record(
string().matches(/^[a-z]{2}(-[A-Z]{2})?$/),
string().nonempty()
);
// accepts: { en: 'Hello', fr: 'Bonjour' }
// rejects: { 123: 'oops' } ← key doesn't match pattern +
+ +

record

+

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Returns an introspection object describing the record schema.

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        keySchema: TKeySchema;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
        valueSchema: TValueSchema;
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • keySchema: TKeySchema

      The schema every key must satisfy (a StringSchemaBuilder).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
    • valueSchema: TValueSchema

      The schema every value must satisfy.

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Marks the inferred type as readonly. For objects, produces Readonly<T>. +For arrays, produces ReadonlyArray<T>. Primitives are unchanged. +Type-level only — no runtime enforcement.

    +

    Returns any

    const schema = object({ name: string(), age: number() }).readonly();
    type T = InferType<typeof schema>; // Readonly<{ name: string; age: number }> +
    + +
    const schema = array(string()).readonly();
    type T = InferType<typeof schema>; // ReadonlyArray<string> +
    + +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.SchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.SchemaBuilder.html new file mode 100644 index 00000000..3f42281f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.SchemaBuilder.html @@ -0,0 +1,310 @@ +SchemaBuilder | Libraries

Class SchemaBuilder<TResult, TRequired, TNullable, THasDefault, TExtensions>Abstract

Base class for all schema builders. Provides basic functionality for schema building.

+

Note: this class is not intended to be used directly, use one of the subclasses instead.

+

TResult Type of the object that will be returned by validate() method.

+

TRequired If true, object will be required. If false, object will be optional.

+

Type Parameters

  • TResult = any
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Adds a preprocessor to a preprocessors list

    +

    Parameters

    • preprocessor: Preprocessor<TResult>
    • Optionaloptions: { mutates?: boolean }

    Returns this

  • Brands the schema with a phantom type tag, preventing structural mixing +of semantically different values at the type level. Zero runtime cost.

    +

    The optional _name parameter is only needed when using plain JavaScript +(where generic type parameters are unavailable). In TypeScript, prefer +the generic form: schema.brand<'Email'>().

    +

    Type Parameters

    • TBrand extends string | symbol

    Parameters

    Returns any

    const Email = string().brand<'Email'>();
    const Username = string().brand<'Username'>();
    type Email = InferType<typeof Email>; // string & { readonly [BRAND]: 'Email' }
    type Username = InferType<typeof Username>; // string & { readonly [BRAND]: 'Username' } +
    + +
  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Parameters

    • props: any

      arbitrary props object

      +

    Returns this

  • Sets a default value for this schema. When the input is undefined, +the default value is used instead. The default is still validated +against the schema's constraints.

    +

    Accepts either a static value or a factory function (useful for +mutable defaults like () => new Date() or () => []).

    +

    Parameters

    Returns any

    const schema = string().default('hello');
    schema.validate(undefined); // { valid: true, object: 'hello' }
    schema.validate('world'); // { valid: true, object: 'world' } +
    + +
    // Factory function for mutable defaults
    const schema = array(string()).default(() => []); +
    + +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Internal

    Retrieves extension metadata by key. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string

    Returns unknown

  • Set type of schema explicitly. notUsed param is needed only for case when JS is used. E.g. when you +can't call method like schema.hasType<Date>(), so instead you can call schema.hasType(new Date()) +with the same result.

    +

    Type Parameters

    • T

    Parameters

    • OptionalnotUsed: T

    Returns any

  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Makes schema nullable — null is accepted as a valid value.

    +

    Unlike .optional() which accepts undefined, .nullable() accepts +null. The inferred type changes from T to T | null. Combine with +.optional() to accept both null and undefined.

    +

    Returns any

  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Parameters

    • object: any
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    Use preValidateAsync instead. This alias will be removed in a future version.

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Marks the inferred type as readonly. For objects, produces Readonly<T>. +For arrays, produces ReadonlyArray<T>. Primitives are unchanged. +Type-level only — no runtime enforcement.

    +

    Returns any

    const schema = object({ name: string(), age: number() }).readonly();
    type T = InferType<typeof schema>; // Readonly<{ name: string; age: number }> +
    + +
    const schema = array(string()).readonly();
    type T = InferType<typeof schema>; // ReadonlyArray<string> +
    + +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform synchronous schema validation on object. +Throws at runtime if any preprocessor, validator, or error message +provider returns a Promise — use validateAsync instead.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: any

      Object to validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      Optional ValidationContext settings

      +

    Returns ValidationResult<any>

  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: any

      Object to validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<any>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.SchemaValidationError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.SchemaValidationError.html new file mode 100644 index 00000000..cc35472f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.SchemaValidationError.html @@ -0,0 +1,10 @@ +SchemaValidationError | Libraries

Class SchemaValidationError

Error thrown by parse() and +parseAsync() when validation fails. +Carries the full array of validation errors.

+

Hierarchy

  • Error
    • SchemaValidationError
Index

Constructors

Properties

Constructors

Properties

cause?: unknown
errors: ValidationError[]
message: string
name: string
stack?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.StringSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.StringSchemaBuilder.html new file mode 100644 index 00000000..ec705050 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.StringSchemaBuilder.html @@ -0,0 +1,353 @@ +StringSchemaBuilder | Libraries

Class StringSchemaBuilder<TResult, TRequired, TNullable, THasDefault, TExtensions>

Allows to define a schema for a string. It can be: required or optional, +restricted to be equal to a certain value, restricted to have a certain +length, restricted to start with a certain value, restricted to end with +a certain value, restricted to match a certain regular expression.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use string() function instead.

+

string

+

Type Parameters

  • TResult = string
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • T
    • TReq extends boolean

    Parameters

    • props: StringSchemaBuilderCreateProps<T, TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Perform asynchronous schema validation on object. +Supports async preprocessors, validators, and error message providers.

    +

    If a fallback has been set via catch, a failed validation result +is replaced by a successful result built from the fallback value, preserving +the specialized result shape (e.g. getErrorsFor / getNestedErrors methods).

    +

    Parameters

    • object: TResult

      Object to validate

      +
    • Optionalcontext: ValidationContext

      Optional ValidationContext settings

      +

    Returns Promise<ValidationResult<TResult>>

  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.TupleSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.TupleSchemaBuilder.html new file mode 100644 index 00000000..7fa05707 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.TupleSchemaBuilder.html @@ -0,0 +1,299 @@ +TupleSchemaBuilder | Libraries

Class TupleSchemaBuilder<TElements, TRequired, TNullable, TExplicitType, THasDefault, TExtensions, TRestSchema, TResult>

Fixed-length array schema builder with per-position type validation. +Similar to TypeScript's tuple types — each element at a specific array index +is validated against its own schema.

+

Use it when you need to validate function arguments, CSV rows, coordinate +pairs, structured event payloads, or any other fixed-structure array.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use tuple() function instead.

+
const schema = tuple([string(), number(), boolean()]);
// Inferred TypeScript type: [string, number, boolean]

schema.validate(['hello', 42, true]);
// result.valid === true
// result.object === ['hello', 42, true]

schema.validate(['hello', 42]);
// result.valid === false (too few elements)

schema.validate(['hello', 'oops', true]);
// result.valid === false (wrong type at position 1) +
+ +
// Tuple with variadic rest elements
const schema = tuple([string(), number()]).rest(boolean());
// Inferred TypeScript type: [string, number, ...boolean[]]

schema.validate(['hello', 42, true, false]);
// result.valid === true — any number of extra booleans allowed +
+ +
// Nested tuple combining with object schemas
const point = tuple([number(), number()]);
const segment = tuple([point, point]);

segment.validate([[0, 0], [10, 20]]);
// result.valid === true +
+ +

tuple

+

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true ? TResult | null : TResult
    : (TNullable extends true ? TResult | null : TResult) | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean
    Protected

    Whether null should count as a required-constraint violation.

    +

    By default null is treated the same as undefined for the purposes +of the required check — i.e. a required schema rejects both. +Subclasses that may legally receive null as a value (e.g. +UnionSchemaBuilder when a NullSchemaBuilder option is present) +can override this to false so that null bypasses the required +check and is passed directly to their option-validation logic.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value: TResult | (() => TResult)

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue: TResult | (() => TResult) | undefined;
        defaultValue: TResult | (() => TResult) | undefined;
        description: string | undefined;
        elements: TElements;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        preprocessors: readonly PreprocessorEntry<TResult>[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        restSchema:
            | TRestSchema & SchemaBuilder<any, any, any, any, any>
            | undefined;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<TResult>[];
    }

    • catchValue: TResult | (() => TResult) | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue: TResult | (() => TResult) | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • elements: TElements

      Per-position element schemas defining the fixed tuple structure.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • preprocessors: readonly PreprocessorEntry<TResult>[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • restSchema: TRestSchema & SchemaBuilder<any, any, any, any, any> | undefined

      Optional schema for elements beyond the fixed positions. +When set, additional elements are validated against this schema. +Mirrors TypeScript's rest element syntax: [string, number, ...boolean[]].

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<TResult>[]

      Array of validator functions

      +
  • Synchronously validates the value and returns it if valid. +Throws a SchemaValidationError if validation fails.

    +

    Parameters

    • object: any

      the value to parse

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context

      +

    Returns TResult

    the validated value

    +

    SchemaValidationError if validation fails

    +

    Error if the schema contains async preprocessors, validators, or error message providers

    +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Marks the inferred type as readonly. For objects, produces Readonly<T>. +For arrays, produces ReadonlyArray<T>. Primitives are unchanged. +Type-level only — no runtime enforcement.

    +

    Returns any

    const schema = object({ name: string(), age: number() }).readonly();
    type T = InferType<typeof schema>; // Readonly<{ name: string; age: number }> +
    + +
    const schema = array(string()).readonly();
    type T = InferType<typeof schema>; // ReadonlyArray<string> +
    + +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.UnionSchemaBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.UnionSchemaBuilder.html new file mode 100644 index 00000000..8f5d80c9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_schema.UnionSchemaBuilder.html @@ -0,0 +1,295 @@ +UnionSchemaBuilder | Libraries

Class UnionSchemaBuilder<TOptions, TRequired, TNullable, TExplicitType, THasDefault, TExtensions>

Union schema builder class. Allows to create schemas +containing alternatives. E.g. string | number | Date. +Use it when you want to define a schema for a value +that can be of different types. The type of the value +will be determined by the first schema that succeeds +validation. Any schema type can be supplied as variant. +Which means that you are not limited to primitive types and +can construct complex types as well, e.g. object | array.

+

NOTE this class is exported only to give opportunity to extend it +by inheriting. It is not recommended to create an instance of this class +directly. Use union() function instead.

+
const schema = union(string('foo')).or(string('bar'));
const result = schema.validate('foo');
// result.valid === true
// result.object === 'foo' +
+ +
const schema = union(string('foo')).or(string('bar'));
const result = schema.validate('baz');
// result.valid === false +
+ +
const schema = union(string('yes')).or(string('no')).or(number(0)).or(number(1));
// equals to 'yes' | 'no' | 0 | 1 in TS
const result = schema.validate('yes');
// result.valid === true
// result.object === 'yes'

const result2 = schema.validate(0);
// result2.valid === true
// result2.object === 0

const result3 = schema.validate('baz');
// result3.valid === false

const result4 = schema.validate(2);
// result4.valid === false +
+ +

union

+

Type Parameters

  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]
  • TRequired extends boolean = true
  • TNullable extends boolean = false
  • TExplicitType = undefined
  • THasDefault extends boolean = false
  • TExtensions = {}

Hierarchy (View Summary)

Index

Constructors

Properties

"[___hasDefault]": THasDefault

Type-level brand encoding whether this schema has a default value. +Not emitted at runtime — used by input type inference.

+
"[___type]": TRequired extends true
    ? TNullable extends true
        ? | (
            TExplicitType extends undefined
                ? SchemaArrayToUnion<TOptions>
                : TExplicitType
        )
        | null
        : TExplicitType extends undefined
            ? SchemaArrayToUnion<TOptions>
            : TExplicitType
    :
        | (
            TNullable extends true
                ? | (
                    TExplicitType extends undefined
                        ? SchemaArrayToUnion<TOptions>
                        : TExplicitType
                )
                | null
                : TExplicitType extends undefined
                    ? SchemaArrayToUnion<TOptions>
                    : TExplicitType
        )
        | undefined

Type-level brand encoding the inferred type of this schema. +Not emitted at runtime — used only by InferType.

+

Accessors

  • get "~standard"(): StandardSchemaV1.Props<
        ResolvedSchemaType<TResult, TRequired, TNullable>,
    >

    Standard Schema v1 interface.

    +

    Exposes this schema as a Standard Schema v1 +validator, enabling out-of-the-box interoperability with any library that +consumes the spec — including tRPC, TanStack Form, React Hook Form, T3 Env, +Hono, Elysia, next-safe-action, and 50+ other tools.

    +

    Every SchemaBuilder subclass (all 13 builders) inherits this property +automatically — no additional setup required.

    +

    Shape of the returned object:

    +
      +
    • version — always 1 (Standard Schema spec version)
    • +
    • vendor'@cleverbrush/schema'
    • +
    • validate(value) — synchronous; wraps this builder's own .validate() +and converts its result to the Standard Schema Result<Output> format: +
        +
      • Success: { value: <validated output> }
      • +
      • Failure: { issues: [{ message: string }, …] }
      • +
      +
    • +
    +

    The returned object is cached after the first access so repeated reads +return the same reference (required by the spec).

    +

    Returns StandardSchemaV1.Props<ResolvedSchemaType<TResult, TRequired, TNullable>>

    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(2),
    email: string().email(),
    age: number().min(18).optional(),
    });

    // Grab the Standard Schema interface
    const std = UserSchema['~standard'];
    // std.version === 1
    // std.vendor === '@cleverbrush/schema'

    const ok = std.validate({ name: 'Alice', email: 'alice@example.com' });
    // { value: { name: 'Alice', email: 'alice@example.com', age: undefined } }

    const fail = std.validate({ name: 'A', email: 'not-an-email' });
    // { issues: [{ message: 'minLength' }, { message: 'email' }] }

    // Pass directly to TanStack Form, T3 Env, tRPC, etc.:
    // validators: { onChange: UserSchema, onBlur: UserSchema } +
    + +
  • get canSkipPreValidation(): boolean

    Whether preValidateSync can be skipped entirely. +True when there are no preprocessors and no validators, +so the only work would be the required check and wrapping +in a noop transaction — which subclasses can do inline.

    +

    Returns boolean

  • get hasDefault(): boolean

    Whether this schema has a default value configured via .default(). +Exposed for fast-path validation in subclasses.

    +

    Returns boolean

  • get isNullRequiredViolation(): boolean

    Null is a legitimate JavaScript value that a union option (e.g. +NullSchemaBuilder) may accept. Override the base-class behaviour so +that a required union does not reject null during pre-validation; +instead, each option gets the opportunity to validate it.

    +

    Returns boolean

Methods

  • Sets a fallback value for this schema. When validation fails for any reason, +the fallback value is returned as a successful result instead of validation errors.

    +

    This is useful for graceful degradation — for example, providing a safe default +when parsing untrusted input that might not conform to the schema.

    +

    Accepts either a static value or a factory function. Factory functions are called +each time the fallback is needed (useful for mutable values like () => []).

    +

    Unlike default, which only fires when the input is undefined, .catch() +fires on any validation failure — type mismatch, constraint violation, etc.

    +

    When .catch() is set, parse and parseAsync will never throw.

    +

    Parameters

    • value:
          | (
              TExplicitType extends undefined
                  ? SchemaArrayToUnion<TOptions>
                  : TExplicitType
          )
          | (
              () => TExplicitType extends undefined
                  ? SchemaArrayToUnion<TOptions>
                  : TExplicitType
          )

      the fallback value, or a factory function producing the fallback

      +

    Returns this

    const schema = string().catch('unknown');
    schema.validate(42); // { valid: true, object: 'unknown' }
    schema.validate('hello'); // { valid: true, object: 'hello' }
    schema.parse(42); // 'unknown' (no throw) +
    + +
    // Factory function for mutable fallbacks
    const schema = array(string()).catch(() => []);
    schema.validate(null); // { valid: true, object: [] } +
    + +
    // Contrast with .default() — default fires only on undefined
    const d = string().default('anon');
    d.validate(undefined); // { valid: true, object: 'anon' } ← fires
    d.validate(42); // { valid: false, errors: [...] } ← does NOT fire

    const c = string().catch('anon');
    c.validate(undefined); // { valid: true, object: 'anon' } ← fires
    c.validate(42); // { valid: true, object: 'anon' } ← also fires +
    + +
  • Protected method used to create a new instance of the Builder +defined by the props object. Should be used to instantiate new +builders to keep builder's immutability.

    +

    Type Parameters

    • T extends readonly SchemaBuilder<any, any, any, any, any>[]
    • TReq extends boolean

    Parameters

    • props: UnionSchemaBuilderCreateProps<T, TReq>

      arbitrary props object

      +

    Returns this

  • Attaches a human-readable description to this schema as runtime metadata.

    +

    The description has no effect on validation — it is purely informational. +It is accessible via .introspect().description and is emitted as the +description field by toJsonSchema() from @cleverbrush/schema-json.

    +

    Useful for documentation generation, form labels, and AI tool descriptions.

    +

    Parameters

    • text: string

    Returns this

    const schema = object({
    name: string().describe('The user\'s full name'),
    age: number().optional().describe('Age in years'),
    }).describe('A user object');

    schema.introspect().description; // 'A user object' +
    + +
  • Attaches an example value to this schema instance.

    +

    The example is purely metadata — it has no effect on validation. +It is accessible via .introspect().example and is emitted as the +example keyword in JSON Schema output and OpenAPI spec generation.

    +

    Parameters

    Returns this

    import { string } from '@cleverbrush/schema';

    const Email = string().example('user@example.com');

    Email.introspect().example; // 'user@example.com' +
    + +
  • Generates a serializable object describing the defined schema

    +

    Returns {
        catchValue:
            | (
                TExplicitType extends undefined
                    ? SchemaArrayToUnion<TOptions>
                    : TExplicitType
            )
            | (
                () => TExplicitType extends undefined
                    ? SchemaArrayToUnion<TOptions>
                    : TExplicitType
            )
            | undefined;
        defaultValue:
            | (
                TExplicitType extends undefined
                    ? SchemaArrayToUnion<TOptions>
                    : TExplicitType
            )
            | (
                () => TExplicitType extends undefined
                    ? SchemaArrayToUnion<TOptions>
                    : TExplicitType
            )
            | undefined;
        description: string | undefined;
        discriminatorPropertyName: string | undefined;
        example: unknown;
        extensions: { [key: string]: unknown };
        hasCatch: boolean;
        hasDefault: boolean;
        isNullable: boolean;
        isReadonly: boolean;
        isRequired: boolean;
        options: TOptions;
        preprocessors: readonly PreprocessorEntry<
            TExplicitType extends undefined
                ? SchemaArrayToUnion<TOptions>
                : TExplicitType,
        >[];
        requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<
            SchemaBuilder<any, any, any, any, any>,
        >;
        schemaName: string | undefined;
        type: string;
        validators: readonly ValidatorEntry<
            TExplicitType extends undefined
                ? SchemaArrayToUnion<TOptions>
                : TExplicitType,
        >[];
    }

    • catchValue:
          | (
              TExplicitType extends undefined
                  ? SchemaArrayToUnion<TOptions>
                  : TExplicitType
          )
          | (
              () => TExplicitType extends undefined
                  ? SchemaArrayToUnion<TOptions>
                  : TExplicitType
          )
          | undefined

      The catch/fallback value or factory function set via .catch().

      +
    • defaultValue:
          | (
              TExplicitType extends undefined
                  ? SchemaArrayToUnion<TOptions>
                  : TExplicitType
          )
          | (
              () => TExplicitType extends undefined
                  ? SchemaArrayToUnion<TOptions>
                  : TExplicitType
          )
          | undefined

      The default value or factory function.

      +
    • description: string | undefined

      The human-readable description attached to this schema via .describe(), +or undefined if none was set.

      +
    • discriminatorPropertyName: string | undefined

      When the union is a discriminated union (all branches are objects +sharing a required property with unique literal values), this is +the name of that property. undefined otherwise.

      +
    • example: unknown

      An example value attached to this schema via .example(), +or undefined if none was set.

      +
    • extensions: { [key: string]: unknown }

      Extension metadata. Stores custom state set by schema extensions.

      +
    • hasCatch: boolean

      Whether a catch/fallback value has been set on this schema via .catch().

      +
    • hasDefault: boolean

      Whether a default value (or factory) has been set on this schema.

      +
    • isNullable: boolean

      If set to true, schema values of null are considered valid.

      +
    • isReadonly: boolean

      If set to true, the inferred type is marked as readonly. +Type-level only — no runtime enforcement.

      +
    • isRequired: boolean

      If set to false, schema will be optional (null or undefined values +will be considered as valid).

      +
    • options: TOptions

      Array of schemas participating in the union.

      +
    • preprocessors: readonly PreprocessorEntry<
          TExplicitType extends undefined
              ? SchemaArrayToUnion<TOptions>
              : TExplicitType,
      >[]

      Array of preprocessor functions

      +
    • requiredValidationErrorMessageProvider: ValidationErrorMessageProvider<SchemaBuilder<any, any, any, any, any>>

      Custom error message provider for the 'is required' validation error.

      +
    • schemaName: string | undefined

      The logical name attached to this schema via .schemaName(), +or undefined if none was set.

      +
    • type: string

      String id of schema type, e.g. string', numberorobject`.

      +
    • validators: readonly ValidatorEntry<
          TExplicitType extends undefined
              ? SchemaArrayToUnion<TOptions>
              : TExplicitType,
      >[]

      Array of validator functions

      +
  • Async version of pre-validation. Runs preprocessors, validators, and the +required/optional check on object. Supports async preprocessors, +validators, and error message providers.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns Promise<PreValidationResult<any, { validatedObject: any }>>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +
  • Synchronous version of preValidateAsync. +Throws at runtime if any preprocessor or validator returns a Promise.

    +

    Parameters

    • object: any

      the value to pre-validate

      +
    • Optionalcontext: ValidationContext<SchemaBuilder<any, any, any, any, {}>>

      optional validation context settings

      +

    Returns PreValidationResult<any, { validatedObject: any }>

    a PreValidationResult containing the preprocessed transaction, context, and any errors

    +

    Error if a preprocessor or validator returns a Promise (use preValidateAsync instead)

    +
  • Attaches a logical name to this schema instance.

    +

    The name is purely metadata — it has no effect on validation. It is +accessible via .introspect().schemaName and can be consumed by any +tool that introspects schemas at runtime, such as OpenAPI spec +generators, documentation tools, form libraries, or code generators.

    +

    Uniqueness is the responsibility of the consuming tool. Passing the +same constant (same object reference) to multiple consumers is always +safe; how conflicts between different instances with the same name are +handled depends on the tool.

    +

    Parameters

    • name: string

    Returns this

    import { object, string, number } from '@cleverbrush/schema';

    export const UserSchema = object({
    id: number(),
    name: string(),
    }).schemaName('User');

    UserSchema.introspect().schemaName; // 'User' +
    + +
  • Internal

    Sets extension metadata by key. Returns a new schema instance with the +extension data stored. The data survives fluent chaining. +Used by extension authors inside defineExtension() callbacks.

    +

    Parameters

    • key: string
    • value: unknown

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server-openapi.SchemaRegistry.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server-openapi.SchemaRegistry.html new file mode 100644 index 00000000..d8e20c32 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server-openapi.SchemaRegistry.html @@ -0,0 +1,33 @@ +SchemaRegistry | Libraries

Collects schemas that carry an explicit component name (set via +.schemaName()) and provides a reference-based lookup used during OpenAPI +spec generation to replace inline schema objects with +$ref: '#/components/schemas/<name>' pointers.

+

Conflict rule: registering two different schema instances (different +object references) under the same name throws immediately. Re-registering +the same instance is a no-op.

+
const registry = new SchemaRegistry();
registry.register(UserSchema); // UserSchema.schemaName('User')
registry.getName(UserSchema); // 'User'
registry.getName(someOtherSchema); // null +
+ +
Index

Constructors

Accessors

Methods

Constructors

Accessors

  • get isEmpty(): boolean

    Returns true when at least one schema has been registered.

    +

    Returns boolean

Methods

  • Iterates over all registered [name, schema] pairs in insertion order.

    +

    Used to emit the components.schemas section of an OpenAPI document.

    +

    Returns IterableIterator<[string, SchemaBuilder<any, any, any, false, {}>]>

  • Returns the component name for a given schema instance, or null if it +was not registered.

    +

    Parameters

    • schema: SchemaBuilder<any, any, any>

      The schema builder to look up.

      +

    Returns string | null

    The registered name, or null.

    +
  • Attempts to register schema in the registry.

    +
      +
    • If the schema has no schemaName in its introspect output, it is +silently skipped.
    • +
    • If the same instance is already registered, this is a no-op.
    • +
    • If a different instance is already registered under the same name, +an error is thrown.
    • +
    +

    Parameters

    • schema: SchemaBuilder<any, any, any>

      The schema builder to register.

      +

    Returns void

    When two distinct schema instances share the same name.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ActionResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ActionResult.html new file mode 100644 index 00000000..f13abde6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ActionResult.html @@ -0,0 +1,47 @@ +ActionResult | Libraries

Class ActionResultAbstract

Abstract base for all HTTP action results.

+

Instead of writing directly to res, handlers return an ActionResult +instance. The server calls executeAsync() after the middleware pipeline +completes, ensuring consistent error handling and content negotiation.

+

Use the static factory methods (ActionResult.ok(), .created(), etc.) +rather than constructing subclasses directly.

+
server.handle(GetUser, ({ params }) => {
const user = db.find(params.id);
if (!user) throw new NotFoundError();
return ActionResult.ok(user);
}); +
+ +

Hierarchy (View Summary)

Index

Constructors

Methods

  • Parameters

    • req: IncomingMessage
    • res: ServerResponse
    • contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • 201 Created — serializes value using content negotiation.

    +

    Type Parameters

    • T

    Parameters

    • body: T
    • Optionallocation: string
    • Optionalheaders: Record<string, string>

    Returns JsonResult<201, T>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..BadRequestError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..BadRequestError.html new file mode 100644 index 00000000..e769ffce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..BadRequestError.html @@ -0,0 +1,40 @@ +BadRequestError | Libraries

Thrown when the request is malformed or fails validation. Produces a 400 response.

+

Hierarchy (View Summary)

Index

Constructors

Properties

cause?: unknown
detail?: string
extensions?: Record<string, unknown>
message: string
name: string
stack?: string
status: number
title: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ConflictError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ConflictError.html new file mode 100644 index 00000000..a76ed51b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ConflictError.html @@ -0,0 +1,40 @@ +ConflictError | Libraries

Thrown when the request conflicts with the current state of the resource. Produces a 409 response.

+

Hierarchy (View Summary)

Index

Constructors

Properties

cause?: unknown
detail?: string
extensions?: Record<string, unknown>
message: string
name: string
stack?: string
status: number
title: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ContentResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ContentResult.html new file mode 100644 index 00000000..6749d84f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ContentResult.html @@ -0,0 +1,43 @@ +ContentResult | Libraries

Writes an arbitrary string body with a specific content type and status. +Created by ActionResult.content().

+

Hierarchy (View Summary)

Index

Constructors

Properties

body: string
contentType: string
status: number

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..EndpointBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..EndpointBuilder.html new file mode 100644 index 00000000..dcad0f7a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..EndpointBuilder.html @@ -0,0 +1,175 @@ +EndpointBuilder | Libraries

Class EndpointBuilder<TParams, TBody, TQuery, THeaders, TServices, TPrincipal, TRoles, TResponse, TResponses, TUpload>

Type Parameters

  • TParams = {}
  • TBody = undefined
  • TQuery = {}
  • THeaders = {}
  • TServices = {}
  • TPrincipal = undefined
  • TRoles extends string = string
  • TResponse = any
  • TResponses extends Record<number, any> = {}
  • TUpload extends boolean = false
Index

Constructors

  • Type Parameters

    • TParams = {}
    • TBody = undefined
    • TQuery = {}
    • THeaders = {}
    • TServices = {}
    • TPrincipal = undefined
    • TRoles extends string = string
    • TResponse = any
    • TResponses extends Record<number, any> = {}
    • TUpload extends boolean = false

    Parameters

    • method: string
    • basePath: string
    • pathTemplate: RoutePath
    • bodySchema: SchemaBuilder<any, any, any, any, any> | null
    • querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
    • headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
    • serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null = null
    • authRoles: readonly string[] | null = null
    • summary: string | null = null
    • description: string | null = null
    • tags: readonly string[] = []
    • operationId: string | null = null
    • deprecated: boolean = false
    • responseSchema: SchemaBuilder<any, any, any, any, any> | null = null
    • responsesSchemas: Record<number, SchemaBuilder<any, any, any, any, any> | null> | null = null
    • example: unknown = null
    • examples:
          | Record<
              string,
              { description?: string; summary?: string; value: unknown },
          >
          | null = null
    • producesFile: { contentType?: string; description?: string } | null = null
    • produces: Record<string, { schema?: SchemaBuilder<any, any, any, any, any> }> | null = null
    • responseHeaderSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null = null
    • externalDocs: { description?: string; url: string } | null = null
    • links: Record<string, LinkDefinition<any>> | null = null
    • callbacks: Record<string, CallbackDefinition<any>> | null = null
    • fileUpload: UploadOptions | null = null
    • cacheTags: readonly CacheTagDefinition[] = []

    Returns EndpointBuilder<
        TParams,
        TBody,
        TQuery,
        THeaders,
        TServices,
        TPrincipal,
        TRoles,
        TResponse,
        TResponses,
        TUpload,
    >

Accessors

  • get path(): string

    The full path for this endpoint, combining basePath and pathTemplate.

    +

    For static routes this is the exact URL path (e.g. "/todos"). +For dynamic routes the template placeholders are included +(e.g. "/todos/:id").

    +

    Returns string

Methods

  • Declare that this endpoint can produce responses in multiple content types.

    +

    Each key is a MIME type. Provide an optional schema to override the +default response schema for that type; otherwise the schema from +.returns() / .responses() is reused for every declared content type.

    +

    When used alongside .producesFile(), the binary response takes precedence.

    +

    Parameters

    • contentTypes: Record<string, { schema?: SchemaBuilder<any, any, any, any, any> }>

      Map of MIME type → optional schema override.

      +

    Returns EndpointBuilder<
        TParams,
        TBody,
        TQuery,
        THeaders,
        TServices,
        TPrincipal,
        TRoles,
        TResponse,
        TResponses,
        TUpload,
    >

    endpoint.get('/api/items')
    .returns(object({ id: number(), name: string() }))
    .produces({
    'text/csv': {},
    'application/xml': { schema: string() }
    }) +
    + +
  • Declare per-status-code response schemas for OpenAPI generation and +handler return-type enforcement.

    +

    Pass null as the schema for body-less codes (e.g. 204).

    +

    Type Parameters

    • const T extends Record<number, SchemaBuilder<any, any, any, any, any> | null>

    Parameters

    • map: T

    Returns EndpointBuilder<
        TParams,
        TBody,
        TQuery,
        THeaders,
        TServices,
        TPrincipal,
        TRoles,
        TResponse,
        InferResponsesMap<T>,
        TUpload,
    >

    const ep = endpoint
    .get('/api/todos/:id')
    .responses({
    200: object({ id: number(), title: string() }),
    404: object({ message: string() }),
    });

    const handler: Handler<typeof ep> = ({ params }) => {
    const todo = todos.get(params.id);
    if (!todo) return ActionResult.notFound({ message: 'Not found' });
    return todo; // plain object → 200
    }; +
    + +
  • Mark this endpoint as accepting multipart/form-data file uploads.

    +

    When set, the server parses the request body with a streaming multipart +parser instead of the default JSON deserializer. File fields are made +available to the handler via arg.files (a Record<string, FilePart>), +while non-file form fields are validated against the body schema and +available via arg.body.

    +

    Parameters

    • Optionaloptions: UploadOptions

      Upload configuration (max file size, allowed MIME types, etc.).

      +

    Returns EndpointBuilder<
        TParams,
        TBody,
        TQuery,
        THeaders,
        TServices,
        TPrincipal,
        TRoles,
        TResponse,
        TResponses,
        true,
    >

    const UploadAvatar = endpoint
    .post('/api/avatar')
    .upload({ maxFileSize: 2 * 1024 * 1024, allowedMimeTypes: ['image/*'] })
    .authorize(PrincipalSchema)
    .responses({ 200: AvatarSchema });

    const handler: Handler<typeof UploadAvatar> = async ({ files }) => {
    const avatar = files['avatar'];
    // avatar: { filename, mimeType, buffer, size }
    }; +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..FileResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..FileResult.html new file mode 100644 index 00000000..f564d7d2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..FileResult.html @@ -0,0 +1,43 @@ +FileResult | Libraries

Sends a binary buffer as a file download attachment. +Created by ActionResult.file().

+

Hierarchy (View Summary)

Index

Constructors

Properties

content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
contentType: string
fileName: string

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ForbiddenError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ForbiddenError.html new file mode 100644 index 00000000..0e6cfabf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ForbiddenError.html @@ -0,0 +1,40 @@ +ForbiddenError | Libraries

Thrown when the authenticated principal lacks permission. Produces a 403 response.

+

Hierarchy (View Summary)

Index

Constructors

Properties

cause?: unknown
detail?: string
extensions?: Record<string, unknown>
message: string
name: string
stack?: string
status: number
title: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..HttpError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..HttpError.html new file mode 100644 index 00000000..dd5fc165 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..HttpError.html @@ -0,0 +1,45 @@ +HttpError | Libraries

Base class for HTTP errors thrown from endpoint handlers.

+

Instances are automatically caught by the server and serialized as +RFC 9457 Problem Details (application/problem+json) responses.

+
throw new HttpError(429, 'Too Many Requests', 'Rate limit exceeded.');
+
+ +

Hierarchy (View Summary)

Index

Constructors

  • Parameters

    • status: number
    • Optionaltitle: string
    • Optionaldetail: string
    • Optionalextensions: Record<string, unknown>

    Returns HttpError

Properties

cause?: unknown
detail?: string
extensions?: Record<string, unknown>
message: string
name: string
stack?: string
status: number
title: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..JsonResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..JsonResult.html new file mode 100644 index 00000000..35fb53e5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..JsonResult.html @@ -0,0 +1,46 @@ +JsonResult | Libraries

Class JsonResult<TStatus, TBody>

Serializes a value and writes it as JSON with content-type: application/json, +bypassing content negotiation entirely.

+

Created by ActionResult.json(). +ActionResult.ok() and ActionResult.created() produce a JsonResult +that goes through content negotiation instead.

+

Type Parameters

  • TStatus extends number = number
  • TBody = unknown

Hierarchy (View Summary)

Index

Constructors

Properties

body: TBody
headers: Record<string, string>
status: TStatus

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..NoContentResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..NoContentResult.html new file mode 100644 index 00000000..f82a20db --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..NoContentResult.html @@ -0,0 +1,40 @@ +NoContentResult | Libraries

Responds with 204 No Content and no body. +Created by ActionResult.noContent().

+

Hierarchy (View Summary)

Index

Constructors

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..NotFoundError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..NotFoundError.html new file mode 100644 index 00000000..51d99630 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..NotFoundError.html @@ -0,0 +1,40 @@ +NotFoundError | Libraries

Thrown when a requested resource cannot be found. Produces a 404 response.

+

Hierarchy (View Summary)

Index

Constructors

Properties

cause?: unknown
detail?: string
extensions?: Record<string, unknown>
message: string
name: string
stack?: string
status: number
title: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..RedirectResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..RedirectResult.html new file mode 100644 index 00000000..dbe106c9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..RedirectResult.html @@ -0,0 +1,43 @@ +RedirectResult | Libraries

Redirects the client to a new URL. +Uses 302 (temporary) by default; pass permanent = true for 301. +Created by ActionResult.redirect().

+

Hierarchy (View Summary)

Index

Constructors

Properties

permanent: boolean
url: string

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..RequestContext.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..RequestContext.html new file mode 100644 index 00000000..c6cc3cbb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..RequestContext.html @@ -0,0 +1,27 @@ +RequestContext | Libraries
Index

Constructors

Properties

_queryParams?: Record<string, string>

— overridable for testing

+
headers: Record<string, string>
items: Map<string, unknown> = ...
maxBodySize: number
method: string
principal: unknown = undefined

The authenticated principal for this request. +Set by authentication middleware; typed as unknown at the +RequestContext level — handlers receive a fully typed version +via ActionContext.principal.

+
request: IncomingMessage
responded: boolean = false
response: ServerResponse
url: URL

Accessors

Methods

  • Read and buffer the raw request body. Result is cached after the first call.

    +

    Returns Promise<Buffer<ArrayBufferLike>>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..Server.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..Server.html new file mode 100644 index 00000000..47f2798e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..Server.html @@ -0,0 +1,10 @@ +Server | Libraries
Index

Constructors

Accessors

Methods

Constructors

Accessors

  • get address(): { host: string; port: number } | null

    The bound address after listen() resolves. +Returns null if the server has been closed or not yet started.

    +

    Returns { host: string; port: number } | null

Methods

  • Start listening. Called internally by ServerBuilder.listen() after +the server is fully configured.

    +

    Parameters

    Returns Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ServerBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ServerBuilder.html new file mode 100644 index 00000000..8ac17038 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..ServerBuilder.html @@ -0,0 +1,72 @@ +ServerBuilder | Libraries

Fluent builder for constructing and starting an HTTP server.

+
const server = new ServerBuilder();

server
.services(svc => svc.addSingleton(IDb, () => new Db()))
.use(loggingMiddleware)
.handle(GetUser, ({ params }) => db.find(params.id));

await server.listen(3000); +
+ +
Index

Constructors

Methods

  • Register an endpoint and its handler.

    +

    Type Parameters

    • E extends EndpointBuilder<any, any, any, any, any, any, any, any, any, false>

    Parameters

    • endpointDef: E

      An EndpointBuilder instance (e.g. from endpoint.get(...)).

      +
    • handler: Handler<E>

      The typed handler function.

      +
    • Optionaloptions: { middlewares?: Middleware[] }

      Optional per-endpoint middleware.

      +

    Returns this

  • Start listening on the given port and host. Resolves with the running +Server instance.

    +

    Parameters

    • Optionalport: number

      TCP port (default: ServerOptions.port ?? 3000).

      +
    • Optionalhost: string

      Bind address (default: ServerOptions.host ?? '0.0.0.0').

      +

    Returns Promise<Server>

  • Enable authorization enforcement. +Registers a global middleware that checks endpoint authorize() +metadata against the authenticated principal. +Must be called after useAuthentication().

    +

    Parameters

    Returns this

  • Enable the server-side request batching endpoint.

    +

    Once enabled, the server accepts POST <path> (default /__batch) +containing an array of sub-requests and processes each one through the +full middleware and handler pipeline, returning an array of +sub-responses in a single HTTP reply.

    +

    Pair this with the batching() middleware from @cleverbrush/client/batching +on the client side.

    +

    Parameters

    Returns this

    new ServerBuilder()
    .useBatching()
    .handleAll(mapping)
    .listen(3000); +
    + +
  • Enable the GET /health endpoint that returns { ok: true } (200). +Useful for load balancer and container readiness probes.

    +

    The path is available as HEALTHCHECK_PATH.

    +

    Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..StatusCodeResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..StatusCodeResult.html new file mode 100644 index 00000000..e44e7bcb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..StatusCodeResult.html @@ -0,0 +1,42 @@ +StatusCodeResult | Libraries

Class StatusCodeResult<TStatus>

Responds with a bare HTTP status code and no body. +Created by ActionResult.status().

+

Type Parameters

  • TStatus extends number = number

Hierarchy (View Summary)

Index

Constructors

Properties

headers: Record<string, string>
status: TStatus

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..StreamResult.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..StreamResult.html new file mode 100644 index 00000000..5249f6bb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..StreamResult.html @@ -0,0 +1,43 @@ +StreamResult | Libraries

Pipes a Readable stream to the HTTP response. +Created by ActionResult.stream().

+

Hierarchy (View Summary)

Index

Constructors

Properties

contentType: string
fileName: string | undefined
readable: Readable

Methods

  • Parameters

    • _req: IncomingMessage
    • res: ServerResponse
    • _contentNegotiator: ContentNegotiator

    Returns Promise<void>

  • Send a file buffer as a download attachment.

    +

    Parameters

    • content: Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
    • fileName: string
    • contentType: string = 'application/octet-stream'

    Returns FileResult

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • T

    Parameters

    • body: T

    Returns JsonResult<200, T>

  • Explicit JSON response with a specific status code. +Use the named factories (ok, notFound, etc.) for common codes. +This overload is an escape hatch for uncommon status codes.

    +

    Type Parameters

    • S extends number
    • T

    Parameters

    • body: T
    • status: S
    • Optionalheaders: Record<string, string>

    Returns JsonResult<S, T>

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..SubscriptionBuilder.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..SubscriptionBuilder.html new file mode 100644 index 00000000..831ad15c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..SubscriptionBuilder.html @@ -0,0 +1,51 @@ +SubscriptionBuilder | Libraries

Class SubscriptionBuilder<TParams, TQuery, THeaders, TServices, TPrincipal, TRoles, TIncoming, TOutgoing>

Immutable, fluent builder for WebSocket subscription endpoint definitions.

+

All methods return a new builder instance — the original is never mutated. +Use endpoint.subscription() to obtain the first builder in the chain.

+
const ChatRoom = endpoint
.subscription('/ws/chat')
.incoming(object({ text: string() }))
.outgoing(object({ user: string(), text: string(), timestamp: number() }))
.authorize(PrincipalSchema)
.summary('Real-time chat room'); +
+ +

Type Parameters

  • TParams = {}
  • TQuery = {}
  • THeaders = {}
  • TServices = {}
  • TPrincipal = undefined
  • TRoles extends string = string
  • TIncoming = undefined
  • TOutgoing = undefined
Index

Constructors

  • Type Parameters

    • TParams = {}
    • TQuery = {}
    • THeaders = {}
    • TServices = {}
    • TPrincipal = undefined
    • TRoles extends string = string
    • TIncoming = undefined
    • TOutgoing = undefined

    Parameters

    • basePath: string
    • pathTemplate: RoutePath = '/'
    • incomingSchema: SchemaBuilder<any, any, any, any, any> | null = null
    • outgoingSchema: SchemaBuilder<any, any, any, any, any> | null = null
    • querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null = null
    • headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null = null
    • serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null = null
    • authRoles: readonly string[] | null = null
    • summary: string | null = null
    • description: string | null = null
    • tags: readonly string[] = []
    • operationId: string | null = null
    • deprecated: boolean = false
    • externalDocs: { description?: string; url: string } | null = null

    Returns SubscriptionBuilder<
        TParams,
        TQuery,
        THeaders,
        TServices,
        TPrincipal,
        TRoles,
        TIncoming,
        TOutgoing,
    >

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..UnauthorizedError.html b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..UnauthorizedError.html new file mode 100644 index 00000000..302e94c3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/classes/_cleverbrush_server..UnauthorizedError.html @@ -0,0 +1,40 @@ +UnauthorizedError | Libraries

Thrown when the request lacks valid authentication credentials. Produces a 401 response.

+

Hierarchy (View Summary)

Index

Constructors

Properties

cause?: unknown
detail?: string
extensions?: Record<string, unknown>
message: string
name: string
stack?: string
status: number
title: string
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

+

The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

+

If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

+

Methods

  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

    +
    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack; // Similar to `new Error().stack` +
    + +

    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

    +

    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

    +

    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

    +
    function a() {
    b();
    }

    function b() {
    c();
    }

    function c() {
    // Create an error without stack trace to avoid calculating the stack trace twice.
    const { stackTraceLimit } = Error;
    Error.stackTraceLimit = 0;
    const error = new Error();
    Error.stackTraceLimit = stackTraceLimit;

    // Capture the stack trace above function b
    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
    throw error;
    }

    a(); +
    + +

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/enums/_cleverbrush_di.ServiceLifetime.html b/websites/docs/public/api-docs/v4.3.2/enums/_cleverbrush_di.ServiceLifetime.html new file mode 100644 index 00000000..00623b57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/enums/_cleverbrush_di.ServiceLifetime.html @@ -0,0 +1,21 @@ +ServiceLifetime | Libraries

Enumeration ServiceLifetime

Defines the lifetime of a service within the dependency injection container.

+

The lifetime determines when a new instance is created versus when a cached +instance is returned.

+
import { ServiceCollection, ServiceLifetime } from '@cleverbrush/di';
import { object, string } from '@cleverbrush/schema';

const ILogger = object({ info: func() });

const services = new ServiceCollection();
// Equivalent to services.addSingleton(ILogger, ...)
services.add(ILogger, () => console, ServiceLifetime.Singleton); +
+ +
Index

Enumeration Members

Enumeration Members

Scoped: "Scoped"

One instance is created per ServiceScope. The same instance is +returned for every resolution within that scope.

+

Use for services that should be shared within a single unit of work +(e.g. an HTTP request) but isolated between units.

+
Singleton: "Singleton"

One instance is created for the entire lifetime of the +ServiceProvider. All subsequent resolutions return the same instance.

+

Use for expensive-to-create or truly global services (loggers, +configuration, connection pools).

+
Transient: "Transient"

A new instance is created every time the service is resolved.

+

Use for lightweight, stateless services.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.debounce.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.debounce.html new file mode 100644 index 00000000..f3afb61c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.debounce.html @@ -0,0 +1,8 @@ +debounce | Libraries
  • A debounce function ensures that a function is not called too frequently. +It only allows the function to be executed after a specified delay has passed since the last call.

    +

    Type Parameters

    • T extends (...args: any[]) => void

    Parameters

    • func: T

      The function to debounce.

      +
    • wait: number

      The delay before the function is called.

      +
    • opts: { immediate?: boolean } = ...
      • Optionalimmediate?: boolean

        Whether the function should be called immediately. Default is false. +If true, the function will be called immediately and then debounced. +If the function is called multiple times during the timeout, it will only be called once.

        +

    Returns (...args: Parameters<T>) => void

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.dedupe.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.dedupe.html new file mode 100644 index 00000000..64e4ff27 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.dedupe.html @@ -0,0 +1,14 @@ +dedupe | Libraries
  • Wraps an async function so that concurrent calls with the same key +share a single in-flight promise instead of starting duplicate operations.

    +

    Once the shared promise resolves (or rejects), subsequent calls will +start a new operation.

    +

    Type Parameters

    • TArgs extends any[]

      The argument types of the wrapped function.

      +
    • T

      The return type of the wrapped function.

      +

    Parameters

    • keyFn: (...args: TArgs) => string

      A function that computes a cache key from the arguments. +Calls with the same key will be deduplicated.

      +
    • fn: (...args: TArgs) => Promise<T>

      The async function to wrap.

      +

    Returns (...args: TArgs) => Promise<T>

    A deduplicated version of fn.

    +
    import { dedupe } from '@cleverbrush/async';

    const fetchUser = dedupe(
    (id: number) => `user-${id}`,
    (id: number) => fetch(`/api/users/${id}`).then(r => r.json())
    );

    // These two calls share a single fetch:
    const [a, b] = await Promise.all([fetchUser(1), fetchUser(1)]); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.retry.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.retry.html new file mode 100644 index 00000000..242cf287 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.retry.html @@ -0,0 +1,4 @@ +retry | Libraries
  • Retry a async function up to maxRetries times with exponential backoff.

    +

    Type Parameters

    • T

    Parameters

    • fn: () => Promise<T>

      The async function to retry.

      +
    • Optionaloptions: RetryOptions

      Options.

      +

    Returns Promise<T>

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.throttle.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.throttle.html new file mode 100644 index 00000000..f0dfb0d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.throttle.html @@ -0,0 +1,5 @@ +throttle | Libraries
  • A throttle function ensures that a function is not called more frequently than a specified interval. +It allows the function to be called at most once every specified delay.

    +

    Type Parameters

    • T extends (...args: any[]) => void

    Parameters

    • func: T

      The function to throttle.

      +
    • limit: number

      The minimum delay between function calls.

      +

    Returns (...args: Parameters<T>) => void

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.withTimeout.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.withTimeout.html new file mode 100644 index 00000000..4ff3da40 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_async.withTimeout.html @@ -0,0 +1,15 @@ +withTimeout | Libraries

Function withTimeout

  • Executes an async function with a timeout.

    +

    If the function does not resolve within ms milliseconds, the returned +promise rejects with a TimeoutError. If an AbortSignal is +provided it is aborted on timeout, allowing the wrapped operation to +clean up.

    +

    Type Parameters

    • T

      The resolved value type of the wrapped function.

      +

    Parameters

    • fn: (signal: AbortSignal) => Promise<T>

      The async function to execute. Receives an AbortSignal +that fires when the timeout elapses.

      +
    • ms: number

      Maximum allowed duration in milliseconds.

      +

    Returns Promise<T>

    The value returned by fn, if it resolves in time.

    +

    TimeoutError if ms elapses before fn resolves.

    +
    import { withTimeout } from '@cleverbrush/async';

    const data = await withTimeout(
    (signal) => fetch('/api/data', { signal }).then(r => r.json()),
    5000
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.authorizationCodeScheme.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.authorizationCodeScheme.html new file mode 100644 index 00000000..2aacf040 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.authorizationCodeScheme.html @@ -0,0 +1,7 @@ +authorizationCodeScheme | Libraries

Function authorizationCodeScheme

  • Create an OAuth 2.0 Authorization Code authentication scheme.

    +

    The returned scheme exposes a flows property that the OpenAPI generator +uses to automatically emit the correct oauth2 security scheme.

    +

    Type Parameters

    • T

    Parameters

    Returns AuthenticationScheme<T>

    const oauth = authorizationCodeScheme({
    authorizationUrl: 'https://auth.example.com/authorize',
    tokenUrl: 'https://auth.example.com/token',
    scopes: { 'read:items': 'Read items' },
    authenticate: async (ctx) => {
    // validate Bearer token from ctx.headers.authorization
    return { succeeded: false };
    }
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.clientCredentialsScheme.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.clientCredentialsScheme.html new file mode 100644 index 00000000..3e532c87 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.clientCredentialsScheme.html @@ -0,0 +1,7 @@ +clientCredentialsScheme | Libraries

Function clientCredentialsScheme

  • Create an OAuth 2.0 Client Credentials authentication scheme.

    +

    Used for machine-to-machine (M2M) authentication. The returned scheme +exposes a flows property for automatic OpenAPI security scheme detection.

    +

    Type Parameters

    • T

    Parameters

    Returns AuthenticationScheme<T>

    const m2m = clientCredentialsScheme({
    tokenUrl: 'https://auth.example.com/token',
    scopes: { 'service:read': 'Read service data' },
    authenticate: async (ctx) => {
    // validate Bearer token
    return { succeeded: false };
    }
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.cookieScheme.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.cookieScheme.html new file mode 100644 index 00000000..021f0e73 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.cookieScheme.html @@ -0,0 +1,2 @@ +cookieScheme | Libraries

Function cookieScheme

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.defineRoles.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.defineRoles.html new file mode 100644 index 00000000..96cd3879 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.defineRoles.html @@ -0,0 +1,7 @@ +defineRoles | Libraries

Function defineRoles

  • Define application roles as a typed constant object. +The returned object is frozen and its values form the role +string-literal union used by createEndpoints().

    +

    Type Parameters

    • const T extends Record<string, string>

    Parameters

    • roles: T

    Returns Readonly<T>

    const Roles = defineRoles({ admin: 'admin', editor: 'editor' });
    const ep = createEndpoints(Roles);
    ep.get('/api/admin').authorize(IPrincipal, 'admin'); // ✓ +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.jwtScheme.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.jwtScheme.html new file mode 100644 index 00000000..e145d2dd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.jwtScheme.html @@ -0,0 +1,2 @@ +jwtScheme | Libraries

Function jwtScheme

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.oidcScheme.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.oidcScheme.html new file mode 100644 index 00000000..413ff290 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.oidcScheme.html @@ -0,0 +1,8 @@ +oidcScheme | Libraries

Function oidcScheme

  • Create an OpenID Connect authentication scheme.

    +

    The returned scheme exposes an openIdConnectUrl property that the OpenAPI +generator uses to automatically emit the correct openIdConnect security +scheme.

    +

    Type Parameters

    • T

    Parameters

    Returns AuthenticationScheme<T>

    const oidc = oidcScheme({
    openIdConnectUrl: 'https://auth.example.com/.well-known/openid-configuration',
    authenticate: async (ctx) => {
    // validate token from ctx.headers.authorization
    return { succeeded: false };
    }
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.parseCookies.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.parseCookies.html new file mode 100644 index 00000000..764a1c42 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.parseCookies.html @@ -0,0 +1,5 @@ +parseCookies | Libraries

Function parseCookies

  • Parse a Cookie header string into a Record.

    +

    Parameters

    • header: string

    Returns Record<string, string>

    parseCookies('name1=val1; name2=val2') → { name1: 'val1', name2: 'val2' }
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.requireRole.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.requireRole.html new file mode 100644 index 00000000..d9051f9a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.requireRole.html @@ -0,0 +1,3 @@ +requireRole | Libraries

Function requireRole

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.serializeCookie.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.serializeCookie.html new file mode 100644 index 00000000..458ea508 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.serializeCookie.html @@ -0,0 +1,2 @@ +serializeCookie | Libraries

Function serializeCookie

  • Serialize a Set-Cookie header value.

    +

    Parameters

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.signJwt.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.signJwt.html new file mode 100644 index 00000000..7959dcba --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_auth.signJwt.html @@ -0,0 +1,3 @@ +signJwt | Libraries

Function signJwt

  • Sign a JWT payload. Utility for tests and token generation. +Supports HS256/HS384/HS512 (HMAC) and RS256/RS384/RS512 (RSA).

    +

    Parameters

    • payload: JwtPayload
    • secret: string | Buffer<ArrayBufferLike>
    • algorithm: string = 'HS256'

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..composeMiddleware.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..composeMiddleware.html new file mode 100644 index 00000000..070672a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..composeMiddleware.html @@ -0,0 +1,11 @@ +composeMiddleware | Libraries

Function composeMiddleware

  • Composes an array of middlewares into a single wrapper around a +FetchLike function.

    +

    Middlewares are applied in array order — the first middleware is the +outermost wrapper (executes first on the way in, last on the way out).

    +

    Parameters

    • middlewares: Middleware[]

      An array of middleware functions to compose.

      +
    • fetch: FetchLike

      The inner fetch implementation to wrap.

      +

    Returns FetchLike

    A FetchLike function that runs through the full middleware chain.

    +
    const enhanced = composeMiddleware([retry(), timeout()], globalThis.fetch);
    const response = await enhanced('/api/data', { method: 'GET' }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..createClient.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..createClient.html new file mode 100644 index 00000000..3ff0b4e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..createClient.html @@ -0,0 +1,20 @@ +createClient | Libraries

Function createClient

  • Creates a fully typed HTTP client from an API contract.

    +

    The returned object mirrors the shape of the contract: each group becomes +a namespace and each endpoint within that group becomes an async callable +function.

    +

    At runtime, endpoint metadata (HTTP method, path template, schemas) is +read from each EndpointBuilder via .introspect(). Path parameters +are serialized through the ParseStringSchemaBuilder.serialize() method +when a route() template is used; query parameters are serialized to a +query string; and the request body is JSON-encoded for methods that +accept a body.

    +

    Type Parameters

    • T extends ApiContract

      The exact API contract type, preserving all endpoint +builder generics so that params, body, query, and response types +are fully inferred.

      +

    Parameters

    • contract: T

      The API contract created with defineApi().

      +
    • options: ClientOptions = {}

      Client configuration (base URL, auth token, custom fetch, etc.).

      +

    Returns TypedClient<T>

    A TypedClient whose shape mirrors the contract.

    +
    import { api } from 'todo-shared';
    import { createClient } from '@cleverbrush/web';

    const client = createClient(api, {
    baseUrl: 'https://api.example.com',
    getToken: () => localStorage.getItem('token'),
    onUnauthorized: () => { window.location.href = '/login'; },
    });

    // Fully typed — params, body, and response types are inferred.
    const todos = await client.todos.list();
    const todo = await client.todos.get({ params: { id: 1 } });
    const created = await client.todos.create({ body: { title: 'Buy milk' } }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..getPerCallOptions.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..getPerCallOptions.html new file mode 100644 index 00000000..07853134 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..getPerCallOptions.html @@ -0,0 +1,5 @@ +getPerCallOptions | Libraries

Function getPerCallOptions

  • Reads per-call middleware overrides from a RequestInit object.

    +

    Type Parameters

    • T

    Parameters

    • init: RequestInit

      The request init object (may have per-call overrides attached).

      +
    • key: string

      The middleware key (e.g. 'retry', 'timeout').

      +

    Returns T | undefined

    The per-call options for the given key, or undefined if not set.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isApiError.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isApiError.html new file mode 100644 index 00000000..decdee2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isApiError.html @@ -0,0 +1,5 @@ +isApiError | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isNetworkError.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isNetworkError.html new file mode 100644 index 00000000..3284bf88 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isNetworkError.html @@ -0,0 +1 @@ +isNetworkError | Libraries

Function isNetworkError

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isOfflineError.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isOfflineError.html new file mode 100644 index 00000000..d588c278 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isOfflineError.html @@ -0,0 +1,5 @@ +isOfflineError | Libraries

Function isOfflineError

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isTimeoutError.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isTimeoutError.html new file mode 100644 index 00000000..954d6f18 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isTimeoutError.html @@ -0,0 +1,5 @@ +isTimeoutError | Libraries

Function isTimeoutError

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isWebError.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isWebError.html new file mode 100644 index 00000000..be6bf23e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client..isWebError.html @@ -0,0 +1,5 @@ +isWebError | Libraries
  • Type guard for WebError (any client error).

    +

    Parameters

    • error: unknown

    Returns error is WebError

    catch (err) {
    if (isWebError(err)) {
    // err is ApiError | TimeoutError | NetworkError | WebError
    }
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.batching.batching.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.batching.batching.html new file mode 100644 index 00000000..78c1b96b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.batching.batching.html @@ -0,0 +1,21 @@ +batching | Libraries
  • Creates a request batching middleware.

    +

    Concurrent calls made through the same client are transparently coalesced +into a single POST to the batch endpoint. Each individual call site +receives its own typed response — the batching is completely invisible to +application code.

    +

    Placement: place batching() as the last middleware in the array +(closest to the actual fetch). Wrapping it with retry() and timeout() +lets those middlewares operate on each logical call's promise independently.

    +

    Requests that are never batched:

    +
      +
    • The batch endpoint itself (prevents infinite recursion).
    • +
    • FormData or ReadableStream bodies (binary / streaming).
    • +
    • Any request matching the skip predicate.
    • +
    • Single-item flushes (sent directly, no batch overhead).
    • +
    +

    Parameters

    Returns Middleware

    A Middleware that batches concurrent requests.

    +
    import { retry } from '@cleverbrush/client/retry';
    import { timeout } from '@cleverbrush/client/timeout';
    import { batching } from '@cleverbrush/client/batching';

    const client = createClient(api, {
    middlewares: [
    retry(),
    timeout(),
    batching({ maxSize: 10, windowMs: 10 }),
    ],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.cache.cacheTags.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.cache.cacheTags.html new file mode 100644 index 00000000..ae750e48 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.cache.cacheTags.html @@ -0,0 +1,9 @@ +cacheTags | Libraries
  • Creates a tag-based cache middleware.

    +

    On GET requests, the middleware inspects __endpointMeta.cacheTags to +compute cache keys. If a valid (non-expired) cache entry exists, the +cached response is returned immediately (cloned).

    +

    On mutating requests (POST, PUT, DELETE, PATCH), all cache entries whose +key starts with any of the endpoint's tag names are invalidated.

    +

    Parameters

    Returns Middleware

    A Middleware that caches and invalidates by tag.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.cache.throttlingCache.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.cache.throttlingCache.html new file mode 100644 index 00000000..2b5a60f6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.cache.throttlingCache.html @@ -0,0 +1,10 @@ +throttlingCache | Libraries
  • Creates a throttling cache middleware.

    +

    Successful GET responses are cached for a configurable TTL (throttle). +Subsequent requests with the same key within the TTL receive a cloned +cached response without hitting the network.

    +

    Parameters

    Returns Middleware

    A Middleware that caches responses.

    +
    // 2-second TTL with cache invalidation on mutations:
    const client = createClient(api, {
    middlewares: [throttlingCache({
    throttle: 2000,
    invalidate: (_url, _init, meta) => {
    if (meta && meta.method !== 'GET')
    return `GET@${meta.collectionPath}`;
    return null;
    },
    })],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.dedupe.dedupe.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.dedupe.dedupe.html new file mode 100644 index 00000000..ca84f0d5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.dedupe.dedupe.html @@ -0,0 +1,10 @@ +dedupe | Libraries
  • Creates a request deduplication middleware.

    +

    When multiple identical requests are made concurrently, only one +actual fetch is performed. All callers receive a cloned copy +of the response so each consumer can read the body independently.

    +

    Parameters

    Returns Middleware

    A Middleware that deduplicates concurrent requests.

    +
    // Default settings (dedupe GET only, key = method + url):
    const client = createClient(api, {
    middlewares: [dedupe()],
    });

    // Custom key including query string:
    const client = createClient(api, {
    middlewares: [dedupe({
    key: (url) => url,
    })],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.idempotency.idempotency.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.idempotency.idempotency.html new file mode 100644 index 00000000..c531bde6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.idempotency.idempotency.html @@ -0,0 +1,11 @@ +idempotency | Libraries
  • Creates an idempotency middleware for the client.

    +

    Mutating requests automatically receive an X-Idempotency-Key header +with a UUID v4 value. The key is generated once per request and reused +across retries — so the server sees the same key for the same logical +operation even when the client retries.

    +

    Parameters

    Returns Middleware

    A Middleware that adds idempotency keys.

    +
    const client = createClient(api, {
    middlewares: [idempotency(), retry({ limit: 3 })],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.offline-queue.offlineQueue.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.offline-queue.offlineQueue.html new file mode 100644 index 00000000..c31ba469 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.offline-queue.offlineQueue.html @@ -0,0 +1 @@ +offlineQueue | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.optimistic-update.optimisticUpdate.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.optimistic-update.optimisticUpdate.html new file mode 100644 index 00000000..cbd71fc7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.optimistic-update.optimisticUpdate.html @@ -0,0 +1 @@ +optimisticUpdate | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.buildGroupQueryKey.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.buildGroupQueryKey.html new file mode 100644 index 00000000..116523af --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.buildGroupQueryKey.html @@ -0,0 +1,10 @@ +buildGroupQueryKey | Libraries
  • Builds a query key array for an entire API group.

    +

    Use this with queryClient.invalidateQueries() to invalidate +all cached queries belonging to a group at once.

    +

    Parameters

    • group: string

      The API group name (e.g. 'todos').

      +

    Returns readonly unknown[]

    A readonly query key array that is a prefix of all endpoint +keys within the group.

    +
    buildGroupQueryKey('todos');
    // ['@cleverbrush', 'todos']

    // Invalidate all todo-related queries:
    queryClient.invalidateQueries({ queryKey: buildGroupQueryKey('todos') }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.buildQueryKey.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.buildQueryKey.html new file mode 100644 index 00000000..f08a8325 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.buildQueryKey.html @@ -0,0 +1,11 @@ +buildQueryKey | Libraries
  • Builds a query key array for a specific endpoint call.

    +

    Parameters

    • group: string

      The API group name (e.g. 'todos').

      +
    • endpoint: string

      The endpoint name within the group (e.g. 'list').

      +
    • Optionalargs: unknown

      Optional request arguments (params, query, body, headers). +Included in the key when provided so that different argument +combinations produce distinct cache entries.

      +

    Returns readonly unknown[]

    A readonly query key array suitable for TanStack Query.

    +
    buildQueryKey('todos', 'list');
    // ['@cleverbrush', 'todos', 'list']

    buildQueryKey('todos', 'list', { query: { page: 2 } });
    // ['@cleverbrush', 'todos', 'list', { query: { page: 2 } }]

    buildQueryKey('todos', 'get', { params: { id: 42 } });
    // ['@cleverbrush', 'todos', 'get', { params: { id: 42 } }] +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.createClient.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.createClient.html new file mode 100644 index 00000000..6035adc3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.createClient.html @@ -0,0 +1,25 @@ +createClient | Libraries
  • Creates a unified typed client from an API contract.

    +

    Each endpoint on the returned object is callable (direct HTTP fetch, +identical to @cleverbrush/web's createClient) and also exposes +TanStack Query hooks as properties:

    +
      +
    • Call directly: await client.todos.list() — returns a Promise
    • +
    • useQuery: client.todos.list.useQuery(args?, options?) — reactive fetch
    • +
    • useSuspenseQuery: client.todos.list.useSuspenseQuery(args?, options?) — Suspense fetch
    • +
    • useInfiniteQuery: client.todos.list.useInfiniteQuery(getArgs, options) — paginated fetch
    • +
    • useMutation: client.todos.create.useMutation(options?) — mutations
    • +
    • queryKey: client.todos.list.queryKey(args?) — cache key for manual ops
    • +
    • prefetch: client.todos.list.prefetch(queryClient, args?) — pre-populate cache
    • +
    • stream: client.todos.export.stream(args?) — NDJSON streaming
    • +
    +

    Each group also exposes a queryKey() method for group-level +cache invalidation.

    +

    When the cacheTags middleware is active, useMutation hooks +automatically invalidate TanStack Query entries for the affected group.

    +

    Type Parameters

    Parameters

    • contract: T

      An API contract created with defineApi().

      +
    • Optionaloptions: ClientOptions

      Client options passed to @cleverbrush/web's createClient().

      +

    Returns UnifiedClient<T>

    A fully typed unified client proxy.

    +
    import { createClient } from '@cleverbrush/client/react';
    import { api } from './contract';

    const client = createClient(api, {
    baseUrl: 'https://api.example.com',
    getToken: () => localStorage.getItem('token'),
    });

    // Direct fetch
    const todos = await client.todos.list();

    // React Query hooks
    function TodoList() {
    const { data } = client.todos.list.useQuery();
    const mutation = client.todos.create.useMutation({
    onSuccess: () => {
    queryClient.invalidateQueries({
    queryKey: client.todos.queryKey()
    });
    }
    });
    }

    // Streaming
    for await (const line of client.todos.export.stream()) { ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.useOptimisticMutation.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.useOptimisticMutation.html new file mode 100644 index 00000000..642906f4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.useOptimisticMutation.html @@ -0,0 +1 @@ +useOptimisticMutation | Libraries

Function useOptimisticMutation

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.useSubscription.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.useSubscription.html new file mode 100644 index 00000000..09bbb2f4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.react.useSubscription.html @@ -0,0 +1,9 @@ +useSubscription | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.retry.retry.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.retry.retry.html new file mode 100644 index 00000000..cb5811fa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.retry.retry.html @@ -0,0 +1,7 @@ +retry | Libraries
  • Creates a retry middleware for the @cleverbrush/web client.

    +

    Parameters

    Returns Middleware

    A Middleware that wraps fetch calls with retry logic.

    +
    // Basic usage — retry up to 3 times on server errors:
    const client = createClient(api, {
    middlewares: [retry({ limit: 3 })],
    });

    // Advanced — custom backoff with jitter:
    const client = createClient(api, {
    middlewares: [retry({
    limit: 5,
    delay: (n) => Math.min(1000 * 2 ** n, 30000),
    jitter: true,
    statusCodes: [429, 502, 503],
    })],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.timeout.timeout.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.timeout.timeout.html new file mode 100644 index 00000000..ee712424 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_client.timeout.timeout.html @@ -0,0 +1,9 @@ +timeout | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_deep.deepEqual.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_deep.deepEqual.html new file mode 100644 index 00000000..f59837e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_deep.deepEqual.html @@ -0,0 +1,11 @@ +deepEqual | Libraries

Function deepEqual

  • Compares two objects and returns true if they +have the same structure and values. Can work +with arrays and objects, nested objects, +recursive objects, dates, etc.

    +

    Parameters

    • p1: any

      first object

      +
    • p2: any

      second object

      +
    • Optionaloptions: { disregardArrayOrder?: boolean }

      additional options

      +
      • OptionaldisregardArrayOrder?: boolean

        if true, the order of the elements in the array will be disregarded +e.g. [1, 2] and [2, 1] will be considered equal

        +

    Returns boolean

    true if the objects are equal, false otherwise

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_deep.deepFlatten.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_deep.deepFlatten.html new file mode 100644 index 00000000..004c4aab --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_deep.deepFlatten.html @@ -0,0 +1,5 @@ +deepFlatten | Libraries

Function deepFlatten

  • Flattens an object to a single level, with the nested keys separated by a delimiter.

    +

    Parameters

    • obj: Record<string, any>
    • Optionaldelimiter: string = '.'

    Returns Record<string, any>

    deepFlatten({ a: { b: 1, c: 2 } });
    // => { 'a.b': 1, 'a.c': 2 }

    deepFlatten({ a: { b: 1, c: 2 } }, '/');
    // => { 'a/b': 1, 'a/c': 2 }

    deepFlatten({ a: { b: 1, c: { d: 'some val' } }, d: 3 });
    // => { 'a.b': 1, 'a.c.d': 'some val', d: 3 }
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_di.isAsyncDisposable.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_di.isAsyncDisposable.html new file mode 100644 index 00000000..a82364fc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_di.isAsyncDisposable.html @@ -0,0 +1,8 @@ +isAsyncDisposable | Libraries

Function isAsyncDisposable

  • Checks whether a value implements the asynchronous Disposable protocol +(Symbol.asyncDispose).

    +

    Parameters

    • value: unknown

      The value to check.

      +

    Returns value is AsyncDisposable

    true if value has a Symbol.asyncDispose method.

    +
    const connection = {
    async [Symbol.asyncDispose]() { await db.close(); }
    };
    isAsyncDisposable(connection); // true
    isAsyncDisposable({}); // false +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_di.isDisposable.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_di.isDisposable.html new file mode 100644 index 00000000..071debdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_di.isDisposable.html @@ -0,0 +1,8 @@ +isDisposable | Libraries

Function isDisposable

  • Checks whether a value implements the synchronous Disposable protocol +(Symbol.dispose).

    +

    Parameters

    • value: unknown

      The value to check.

      +

    Returns value is Disposable

    true if value has a Symbol.dispose method.

    +
    const resource = {
    [Symbol.dispose]() { console.log('disposed'); }
    };
    isDisposable(resource); // true
    isDisposable({}); // false +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.env.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.env.html new file mode 100644 index 00000000..c202f0a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.env.html @@ -0,0 +1,12 @@ +env | Libraries
  • Associates a schema builder with an environment variable name.

    +

    Every leaf field in a config descriptor passed to parseEnv() must be +wrapped with env(). This is enforced at the TypeScript level — passing +a bare schema builder produces a compile-time error.

    +

    Type Parameters

    • T extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • varName: string

      The environment variable name to read (e.g. 'DB_HOST').

      +
    • schema: T

      A @cleverbrush/schema builder describing the expected +type, constraints, coercion, and defaults.

      +

    Returns EnvField<T>

    A branded EnvField descriptor.

    +
    env('DB_PORT', number().coerce().default(5432))
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.parseEnv.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.parseEnv.html new file mode 100644 index 00000000..de6fde1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.parseEnv.html @@ -0,0 +1,37 @@ +parseEnv | Libraries

Function parseEnv

  • Parses environment variables into a validated, typed config object.

    +

    Every leaf field in the config descriptor must be wrapped with env() — +this is enforced at the TypeScript level.

    +

    The function:

    +
      +
    1. Walks the descriptor tree, reading raw values from source (defaults +to process.env).
    2. +
    3. Assembles a @cleverbrush/schema object schema from the leaf schemas.
    4. +
    5. Validates and coerces the raw values via schema.validate().
    6. +
    7. Returns the typed result or throws an EnvValidationError listing +all missing and invalid variables.
    8. +
    +

    Type Parameters

    Parameters

    • config: T

      A descriptor tree where leaves are EnvFields and +branches are plain objects.

      +
    • Optionalsource: Record<string, string | undefined>

      The environment variable source. Defaults to process.env.

      +

    Returns InferEnvConfig<T>

    const config = parseEnv({
    db: {
    host: env('DB_HOST', string().default('localhost')),
    port: env('DB_PORT', number().coerce().default(5432)),
    },
    debug: env('DEBUG', boolean().coerce().default(false)),
    }); +
    + +
  • Parses environment variables into a validated, typed config object.

    +

    Every leaf field in the config descriptor must be wrapped with env() — +this is enforced at the TypeScript level.

    +

    The function:

    +
      +
    1. Walks the descriptor tree, reading raw values from source (defaults +to process.env).
    2. +
    3. Assembles a @cleverbrush/schema object schema from the leaf schemas.
    4. +
    5. Validates and coerces the raw values via schema.validate().
    6. +
    7. Returns the typed result or throws an EnvValidationError listing +all missing and invalid variables.
    8. +
    +

    Type Parameters

    • T extends EnvConfig
    • C extends Record<string, unknown>

    Parameters

    • config: T

      A descriptor tree where leaves are EnvFields and +branches are plain objects.

      +
    • compute: (base: InferEnvConfig<T>) => C
    • Optionalsource: Record<string, string | undefined>

      The environment variable source. Defaults to process.env.

      +

    Returns MergeTwo<InferEnvConfig<T>>

    const config = parseEnv({
    db: {
    host: env('DB_HOST', string().default('localhost')),
    port: env('DB_PORT', number().coerce().default(5432)),
    },
    debug: env('DEBUG', boolean().coerce().default(false)),
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.parseEnvFlat.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.parseEnvFlat.html new file mode 100644 index 00000000..1eebf936 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.parseEnvFlat.html @@ -0,0 +1,9 @@ +parseEnvFlat | Libraries

Function parseEnvFlat

  • Convenience wrapper for simple flat configs where each key is both the +config property name and the environment variable name.

    +

    Equivalent to calling parseEnv() with every entry wrapped in env().

    +

    Type Parameters

    • T extends FlatEnvSchemas

    Parameters

    • schemas: T

      A record mapping env var names to schema builders.

      +
    • Optionalsource: Record<string, string | undefined>

      The environment variable source. Defaults to process.env.

      +

    Returns InferFlatEnv<T>

    const config = parseEnvFlat({
    DB_HOST: string().default('localhost'),
    DB_PORT: number().coerce().default(5432),
    JWT_SECRET: string().minLength(32),
    });
    // Type: { DB_HOST: string, DB_PORT: number, JWT_SECRET: string } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.splitBy.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.splitBy.html new file mode 100644 index 00000000..cbb254f0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_env.splitBy.html @@ -0,0 +1,10 @@ +splitBy | Libraries

Function splitBy

  • Creates a preprocessor function that splits a string value by the given +separator and trims each resulting element.

    +

    Intended for use with array() schemas to parse comma-separated (or +similarly delimited) environment variable values.

    +

    Type Parameters

    • T = string

    Parameters

    • separator: string

      The delimiter string (e.g. ',', ';', ' ').

      +

    Returns (value: T[]) => T[]

    A preprocessor function suitable for schema.addPreprocessor().

    +
    env('ALLOWED_ORIGINS', array(string()).addPreprocessor(splitBy(','), { mutates: false }))
    // "a, b, c" → ['a', 'b', 'c'] +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-clickhouse.getClickhouseConnection.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-clickhouse.getClickhouseConnection.html new file mode 100644 index 00000000..58ad4c3d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-clickhouse.getClickhouseConnection.html @@ -0,0 +1,8 @@ +getClickhouseConnection | Libraries
  • Parameters

    • config: Config<any> & AdditionalClientOptions = {}
    • OptionalclickHouseSettings: ClickHouseSettings
    • OptionalpreQueryCallback: (connection: ClickHouseClient) => Promise<void>

      If defined, this function will be called before each query +and awaited if it returns a promise.

      +

      Could be useful in some cases. For example you want first to check +if the server is not in idle state (for example Clickhouse Cloud have idling options) +and if it is, you want to wake it up before sending the query.

      +

      if the function throws an error this error will not be caught and will propagate to the caller. +Therefore the query will not be executed.

      +

    Returns Knex<any, unknown[]>

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..applyDiff.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..applyDiff.html new file mode 100644 index 00000000..ab99377e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..applyDiff.html @@ -0,0 +1,10 @@ +applyDiff | Libraries
  • Execute a MigrationDiff directly against a live database without +writing a migration file. Intended for db push (dev-only schema sync).

    +

    Foreign-key constraint drops are executed as raw ALTER TABLE … DROP CONSTRAINT statements before the main alterTable call.

    +

    Parameters

    • knex: Knex

      A configured Knex instance or transaction.

      +
    • diff: MigrationDiff

      The diff from diffSchema.

      +
    • tableName: string

      The table to alter.

      +

    Returns Promise<void>

    const dbState = await introspectDatabase(knex, 'users');
    const diff = diffSchema(UserSchema, dbState);
    if (!isDiffEmpty(diff)) await applyDiff(knex, diff, 'users'); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..buildColumnMap.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..buildColumnMap.html new file mode 100644 index 00000000..47d77fa7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..buildColumnMap.html @@ -0,0 +1,4 @@ +buildColumnMap | Libraries
  • Build a bidirectional column map from an ObjectSchemaBuilder's properties. +Uses getExtension('columnName') per property, falling back to the property key. +Result is cached per schema instance via WeakMap.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns ColumnMapResult

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..clearRow.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..clearRow.html new file mode 100644 index 00000000..d07ffe2e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..clearRow.html @@ -0,0 +1,13 @@ +clearRow | Libraries
  • Apply value mappers to the joined fields of a result row in place.

    +

    After an eager-loaded query resolves, joined objects and arrays may contain +raw database values that need transformation (e.g. date strings → Date). +This function iterates over the one-to-one and one-to-many specs, applies +the mappers defined on each spec to the nested data, and returns the +mutated row.

    +

    This is an internal helper used by SchemaQueryBuilder's result +mapping pipeline. Exported to allow custom post-processing if needed.

    +

    Parameters

    • row: Record<string, any>

      The raw result row (mutated in place).

      +
    • oneSpecs: (ValidatedSpec & { type: "one" })[]

      Validated one-to-one join specs with optional mappers.

      +
    • manySpecs: (ValidatedSpec & { type: "many" })[]

      Validated one-to-many join specs with optional mappers.

      +

    Returns Record<string, any>

    The mutated row object.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..createQuery.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..createQuery.html new file mode 100644 index 00000000..438c9909 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..createQuery.html @@ -0,0 +1 @@ +createQuery | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..defineEntity.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..defineEntity.html new file mode 100644 index 00000000..52f9d435 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..defineEntity.html @@ -0,0 +1,6 @@ +defineEntity | Libraries
  • Wrap an ObjectSchemaBuilder in an Entity, enabling typed relation +declaration via .hasOne() / .hasMany() / .belongsTo() / .belongsToMany().

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Parameters

    Returns Entity<TSchema, {}>

    const UserEntity = defineEntity(
    object({
    id: number().primaryKey(),
    name: string(),
    posts: array(PostEntity.schema)
    }).hasTableName('users')
    ).hasMany(t => t.posts, l => l.id, r => r.userId); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..diffSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..diffSchema.html new file mode 100644 index 00000000..2ce9642d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..diffSchema.html @@ -0,0 +1,10 @@ +diffSchema | Libraries
  • Compare a code-first schema model against a live database table state and +produce a diff describing the changes needed to bring the database in sync.

    +

    Parameters

    Returns MigrationDiff

    A MigrationDiff describing columns, indexes, and foreign +keys to add, drop, or alter.

    +
    const dbState = await introspectDatabase(knex, 'users');
    const diff = diffSchema(UserSchema, dbState);
    if (diff.addColumns.length > 0) {
    const migration = generateMigration(diff, 'users');
    console.log(migration.up);
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..entitiesToSnapshot.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..entitiesToSnapshot.html new file mode 100644 index 00000000..5be193f0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..entitiesToSnapshot.html @@ -0,0 +1,10 @@ +entitiesToSnapshot | Libraries
  • Build a SchemaSnapshot from a set of entities without a live DB.

    +

    Handles polymorphic (CTI) entities by including each variant table. +Deduplicates tables so STI variants sharing a base table are only included +once.

    +

    Parameters

    • entities: Entity<any, any, never>[]

      The entities from your EntityMap.

      +

    Returns SchemaSnapshot

    A snapshot reflecting the current code-first schema state.

    +
    const snapshot = entitiesToSnapshot(Object.values(entityMap));
    writeSnapshot('./migrations/snapshot.json', snapshot); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..entitySchemaToTableState.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..entitySchemaToTableState.html new file mode 100644 index 00000000..92f64164 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..entitySchemaToTableState.html @@ -0,0 +1,12 @@ +entitySchemaToTableState | Libraries

Function entitySchemaToTableState

  • Derive a DatabaseTableState from a code-first ObjectSchemaBuilder +without connecting to the database.

    +

    The result mirrors what introspectDatabase would return after the +schema has been fully applied, so it can be fed directly into +diffSchema as the dbState argument. This is the foundation of +snapshot-based migration generation.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      An ObjectSchemaBuilder with DDL extensions.

      +

    Returns DatabaseTableState

    A DatabaseTableState representing the schema's ideal DB shape.

    +
    const state = entitySchemaToTableState(UserSchema);
    // state.columns, state.foreignKeys, state.indexes … +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreatePolymorphicTables.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreatePolymorphicTables.html new file mode 100644 index 00000000..f7c2ef57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreatePolymorphicTables.html @@ -0,0 +1,12 @@ +generateCreatePolymorphicTables | Libraries

Function generateCreatePolymorphicTables

  • Generate a series of Knex schema.createTable() calls for a polymorphic +schema and all its CTI variant tables.

    +

    Returns an array of (knex: Knex) => Knex.SchemaBuilder functions — one +for the base table and one for each CTI variant. STI variants add their +columns to the base table itself so no extra table is needed.

    +

    Execute them sequentially in a migration:

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      The base ObjectSchemaBuilder with .withVariants() applied.

      +

    Returns ((knex: Knex) => SchemaBuilder)[]

    An array of table-creation functions to execute in order.

    +
    const creators = generateCreatePolymorphicTables(FileSchema);
    for (const create of creators) {
    await create(knex);
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreateTable.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreateTable.html new file mode 100644 index 00000000..d78343d4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreateTable.html @@ -0,0 +1,12 @@ +generateCreateTable | Libraries
  • Generate a Knex schema.createTable() call from an ObjectSchemaBuilder's +introspected metadata and DDL extensions.

    +

    Returns a function that accepts a Knex instance and returns a +SchemaBuilder (thenable). Call it inside a migration or setup script:

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      An ObjectSchemaBuilder with .hasTableName() and +column-level DDL extensions (.primaryKey(), .references(), etc.).

      +

    Returns (knex: Knex) => SchemaBuilder

    (knex: Knex) => Knex.SchemaBuilder — a function that creates the +table when executed.

    +
    const createUsersTable = generateCreateTable(UserSchema);
    await createUsersTable(knex); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreateTableSource.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreateTableSource.html new file mode 100644 index 00000000..0edf171b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateCreateTableSource.html @@ -0,0 +1,12 @@ +generateCreateTableSource | Libraries

Function generateCreateTableSource

  • Generate up and down TypeScript code strings (4-space-indented\n * fragments) for creating a table from a schema.

    +

    Unlike generateCreateTable (which returns a Knex callback), the +output is plain source text suitable for writing into a migration file. The +fragments are designed to be embedded directly inside up() / down() +functions.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      An ObjectSchemaBuilder with .hasTableName() and column +DDL extensions.

      +

    Returns { down: string; up: string }

    { up, down } source fragments.

    +
    const { up, down } = generateCreateTableSource(UserSchema);
    // up: " await knex.schema.createTable('users', (table) => { … });"
    // down: " await knex.schema.dropTableIfExists('users');" +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateMigration.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateMigration.html new file mode 100644 index 00000000..05fa4c4d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateMigration.html @@ -0,0 +1,10 @@ +generateMigration | Libraries
  • Generate migration up and down code strings from a MigrationDiff.

    +

    The generated code is valid TypeScript that uses Knex's schema builder API. +Write it to a migration file and run via Knex's migration system.

    +

    Parameters

    Returns { down: string; full: string; up: string }

    An object with up and down migration code strings.

    +
    const diff = diffSchema(UserSchema, dbState);
    const migration = generateMigration(diff, 'users');
    fs.writeFileSync('migration.ts', migration.full); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateMigrationsForContext.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateMigrationsForContext.html new file mode 100644 index 00000000..16743ed0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..generateMigrationsForContext.html @@ -0,0 +1,21 @@ +generateMigrationsForContext | Libraries

Function generateMigrationsForContext

  • Generate a single combined migration (up + down) for a set of entities by +diffing the current code-first schemas against a serialized snapshot +stored in the repository — no live database connection required.

    +

    For each entity's table the function:

    +
      +
    • New tables (in entities but not in prevSnapshot): emits CREATE TABLE.
    • +
    • Existing tables (in both): diffs entity schema against the snapshot +state via diffSchema and emits ALTER TABLE when changes exist.
    • +
    • Dropped tables (in prevSnapshot but not in entities): emits +DROP TABLE with a best-effort CREATE TABLE in the down direction.
    • +
    • Orders tables topologically by FK dependencies so parent tables are +created before child tables in up (and dropped after in down).
    • +
    +

    Parameters

    Returns {
        down: string;
        full: string;
        isEmpty: boolean;
        nextSnapshot: SchemaSnapshot;
        up: string;
    }

    { up, down, full, isEmpty, nextSnapshot } where nextSnapshot +should be written to disk after the migration file is created.

    +
    const prev = loadSnapshot('./migrations/snapshot.json');
    const result = generateMigrationsForContext(
    Object.values({ todos: TodoEntity, users: UserEntity }),
    prev
    );
    if (!result.isEmpty) {
    fs.writeFileSync('migrations/20260423000000_init.ts', result.full);
    writeSnapshot('./migrations/snapshot.json', result.nextSnapshot);
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..getPrimaryKeyColumns.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..getPrimaryKeyColumns.html new file mode 100644 index 00000000..6b83a086 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..getPrimaryKeyColumns.html @@ -0,0 +1,8 @@ +getPrimaryKeyColumns | Libraries
  • Resolve the primary-key columns of a schema at runtime.

    +

    Composite primary keys (declared via .hasPrimaryKey([...]) on the +object schema) take precedence over single-column primary keys. The +columns argument to .hasPrimaryKey() may contain either property keys +or SQL column names — both forms are accepted and normalised.

    +

    Returns { propertyKeys: [], columnNames: [] } when no primary key is +declared.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns PrimaryKeyColumns

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..getRowVersionColumn.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..getRowVersionColumn.html new file mode 100644 index 00000000..447420a3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..getRowVersionColumn.html @@ -0,0 +1,3 @@ +getRowVersionColumn | Libraries
  • Find the first column marked .rowVersion() on the schema and return its +metadata. Returns null when no row-version column is declared.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns RowVersionColumn | null

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..introspectDatabase.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..introspectDatabase.html new file mode 100644 index 00000000..fed2efeb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..introspectDatabase.html @@ -0,0 +1,11 @@ +introspectDatabase | Libraries
  • Introspect a PostgreSQL table and return its current state.

    +

    Queries information_schema.columns, pg_indexes, pg_constraint, and +referential constraint metadata to build a complete picture of the table's +columns, indexes, foreign keys, and check constraints.

    +

    Parameters

    • knex: Knex

      A configured Knex instance connected to a PostgreSQL database.

      +
    • tableName: string

      The table name to introspect.

      +

    Returns Promise<DatabaseTableState>

    The current database state for the table.

    +
    const dbState = await introspectDatabase(knex, 'users');
    console.log(dbState.columns); // { id: { type: 'integer', ... }, ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..isDiffEmpty.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..isDiffEmpty.html new file mode 100644 index 00000000..e02b37c6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..isDiffEmpty.html @@ -0,0 +1,3 @@ +isDiffEmpty | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..loadSnapshot.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..loadSnapshot.html new file mode 100644 index 00000000..987fbad3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..loadSnapshot.html @@ -0,0 +1,8 @@ +loadSnapshot | Libraries
  • Load a SchemaSnapshot from disk.

    +

    Returns an empty snapshot (no tables) when the file does not exist — this +is the "first run" case, which causes migrate generate to emit a single +migration containing CREATE TABLE for every entity.

    +

    Parameters

    • snapshotPath: string

      Absolute or cwd-relative path to snapshot.json.

      +

    Returns SchemaSnapshot

    The parsed snapshot, or { version: 1, tables: {} } if missing or +unreadable.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..mapObject.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..mapObject.html new file mode 100644 index 00000000..a604fc2f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..mapObject.html @@ -0,0 +1,10 @@ +mapObject | Libraries
  • Apply a map of per-key transformations to an object, returning a new object +with the transformed values.

    +

    Keys not present in mappers are copied through unchanged. Keys present in +mappers are passed through mapValue.

    +

    Type Parameters

    • T extends Record<string, any>

    Parameters

    • obj: T

      The source object (e.g. a raw database row).

      +
    • mappers: Record<string, ((v: any) => any) | string>

      A Record mapping property keys to mapper functions or +MAPPERS built-in names.

      +

    Returns T

    A shallow copy of obj with the specified values transformed.

    +

    If obj is null or a non-object, it is returned as-is.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..mapValue.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..mapValue.html new file mode 100644 index 00000000..df8d9f74 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..mapValue.html @@ -0,0 +1,8 @@ +mapValue | Libraries
  • Apply a single mapper to a value.

    +

    Parameters

    • mapper: string | ((v: any) => any)

      Either a transformation function (v: any) => any, or a +string key referencing one of the MAPPERS built-ins (e.g. +'date_from_json').

      +
    • value: any

      The raw value to transform.

      +

    Returns any

    The transformed value.

    +

    If mapper is a string that does not exist in MAPPERS.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..query.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..query.html new file mode 100644 index 00000000..ef13e66e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..query.html @@ -0,0 +1 @@ +query | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..rawQuery.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..rawQuery.html new file mode 100644 index 00000000..80ecf415 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..rawQuery.html @@ -0,0 +1,15 @@ +rawQuery | Libraries
  • Execute a raw SQL query or Knex query builder and map the result rows +through the schema's column→property name mapping.

    +

    This is the escape hatch for complex queries that can't be expressed with +the typed SchemaQueryBuilder API. The schema is used only for result +mapping — column names in the result are converted back to property names. +Extra columns (not in the schema) are passed through unchanged.

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Parameters

    • knex: Knex

      A configured Knex instance.

      +
    • schema: TSchema

      The ObjectSchemaBuilder for result mapping.

      +
    • queryOrSql: string | QueryBuilder<any, any>

      A raw SQL string or a Knex.QueryBuilder.

      +
    • Optionalbindings: any[]

      Optional bindings for parameterised SQL queries.

      +

    Returns Promise<(InferType<TSchema> & Record<string, any>)[]>

    Mapped result rows.

    +
    // Raw SQL with schema result mapping
    const results = await rawQuery(knex, PostSchema, `
    SELECT p.*, COUNT(c.id) AS comment_count
    FROM posts p
    LEFT JOIN comments c ON c.post_id = p.id
    GROUP BY p.id
    ORDER BY comment_count DESC
    LIMIT ?
    `, [10]);

    // Knex query builder as the source
    const subQuery = knex('posts').select('author_id', knex.raw('COUNT(*) as post_count')).groupBy('author_id');
    const results = await rawQuery(knex, UserSchema, subQuery); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..resolveColumnRef.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..resolveColumnRef.html new file mode 100644 index 00000000..4a2213ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..resolveColumnRef.html @@ -0,0 +1,27 @@ +resolveColumnRef | Libraries
  • Resolve a ColumnRef to a plain SQL column name (or a Knex.Raw expression for +nested JSON paths when knex is supplied).

    +
      +
    • String refs are treated as property keys (or dot-separated nested paths +such as 'address.city') and translated to column names via the column map.
    • +
    • Function refs (property accessor) are resolved via PropertyDescriptorTree, +then translated to column names. Nested accessors (e.g. t => t.address.city) +produce a Knex.Raw JSON-path expression when knex is provided.
    • +
    +

    Parameters

    • ref: ColumnRef<any>

      Column reference (property key, dotted path, or accessor fn).

      +
    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      Root ObjectSchemaBuilder.

      +
    • label: string

      Human-readable label for error messages.

      +
    • knex: Knex

      Knex instance. Required for nested JSON-path refs; when omitted +and a nested path is detected, an error is thrown.

      +

    Returns string | Raw<any>

  • Resolve a ColumnRef to a plain SQL column name (or a Knex.Raw expression for +nested JSON paths when knex is supplied).

    +
      +
    • String refs are treated as property keys (or dot-separated nested paths +such as 'address.city') and translated to column names via the column map.
    • +
    • Function refs (property accessor) are resolved via PropertyDescriptorTree, +then translated to column names. Nested accessors (e.g. t => t.address.city) +produce a Knex.Raw JSON-path expression when knex is provided.
    • +
    +

    Parameters

    • ref: ColumnRef<any>

      Column reference (property key, dotted path, or accessor fn).

      +
    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      Root ObjectSchemaBuilder.

      +
    • label: string

      Human-readable label for error messages.

      +

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..resolvePropertyKey.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..resolvePropertyKey.html new file mode 100644 index 00000000..d01a38a7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..resolvePropertyKey.html @@ -0,0 +1,3 @@ +resolvePropertyKey | Libraries
  • Resolve a ColumnRef to the property key (not the column name). +Used for result mapping.

    +

    Parameters

    • ref: ColumnRef<any>
    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
    • label: string

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..tableExistsInDb.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..tableExistsInDb.html new file mode 100644 index 00000000..a68c5d4f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..tableExistsInDb.html @@ -0,0 +1,8 @@ +tableExistsInDb | Libraries
  • Check whether a table exists in the connected PostgreSQL database.

    +

    Parameters

    • knex: Knex

      A configured Knex instance (or transaction).

      +
    • tableName: string

      The table name to check.

      +

    Returns Promise<boolean>

    true when the table exists.

    +
    const exists = await tableExistsInDb(knex, 'users');
    if (!exists) await generateCreateTable(UserSchema)(knex); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..writeSnapshot.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..writeSnapshot.html new file mode 100644 index 00000000..848524ea --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema..writeSnapshot.html @@ -0,0 +1,5 @@ +writeSnapshot | Libraries
  • Write a SchemaSnapshot to disk atomically (temp-file + rename) with +deterministic key ordering so diffs in version control are minimal.

    +

    Parameters

    • snapshotPath: string

      Absolute or cwd-relative path to write snapshot.json.

      +
    • snapshot: SchemaSnapshot

      The snapshot to serialize.

      +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.applyVariantsToSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.applyVariantsToSchema.html new file mode 100644 index 00000000..306c8434 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.applyVariantsToSchema.html @@ -0,0 +1,6 @@ +applyVariantsToSchema | Libraries
  • Internal

    Validate + apply a fully-resolved variant config to a base +schema. Stores the 'variants' and 'polymorphicVariants' extensions +read by SchemaQueryBuilder.

    +

    Called by the Entity chain (.discriminator().ctiVariant().stiVariant()). +Replaces the previous schema-level .withVariants() method.

    +

    Parameters

    • baseSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
    • discriminatorKey: string
    • variants: Record<string, VariantInputForResolver>

    Returns ObjectSchemaBuilder<any, any, any, any, any, any, any>

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getColumnName.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getColumnName.html new file mode 100644 index 00000000..276afb75 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getColumnName.html @@ -0,0 +1,3 @@ +getColumnName | Libraries
  • Get the SQL column name for a schema property. +Returns the hasColumnName() value if set, otherwise falls back to propertyKey.

    +

    Parameters

    • schema: SchemaBuilder<any, any, any>
    • propertyKey: string

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getPolymorphicVariantSchemas.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getPolymorphicVariantSchemas.html new file mode 100644 index 00000000..3f823d4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getPolymorphicVariantSchemas.html @@ -0,0 +1,4 @@ +getPolymorphicVariantSchemas | Libraries
  • Internal

    Retrieve the array of variant ObjectSchemaBuilder instances stored by +.withVariants(). Used by migration / DDL tools to discover variant +tables without walking the full schema tree.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns ObjectSchemaBuilder<any, any, any, any, any, any, any>[]

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getProjections.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getProjections.html new file mode 100644 index 00000000..114046c9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getProjections.html @@ -0,0 +1,10 @@ +getProjections | Libraries
  • Retrieve the named projections registered on a schema via +.projection(name, columns).

    +

    Returns a map of { [name]: { keys: readonly string[] } } where each +entry's keys array contains the property keys (not SQL column names) +for that projection. Returns an empty object when no projections are +defined.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns Record<string, { keys: readonly string[] }>

    const projs = getProjections(PostSchema);
    // { summary: { keys: ['id', 'title'] } } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getTableName.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getTableName.html new file mode 100644 index 00000000..89be3b13 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getTableName.html @@ -0,0 +1,3 @@ +getTableName | Libraries
  • Get the SQL table name from an ObjectSchemaBuilder. +Throws if hasTableName() was never called.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getVariants.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getVariants.html new file mode 100644 index 00000000..976f4548 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_knex-schema.extension.getVariants.html @@ -0,0 +1,4 @@ +getVariants | Libraries
  • Internal

    Retrieve the resolved variant configuration stored by .withVariants(). +Returns null when the schema is not polymorphic.

    +

    — used by SchemaQueryBuilder.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns Omit<ResolvedVariantConfig, "discriminatorColumn"> | null

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..applicationEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..applicationEnricher.html new file mode 100644 index 00000000..9487f79f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..applicationEnricher.html @@ -0,0 +1,4 @@ +applicationEnricher | Libraries

Function applicationEnricher

  • Enriches log events with the application name.

    +

    Parameters

    • application: string

      the application name (e.g. 'order-service')

      +

    Returns Enricher

    an enricher that adds { Application: '...' }

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..callerEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..callerEnricher.html new file mode 100644 index 00000000..ad2acf3a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..callerEnricher.html @@ -0,0 +1,5 @@ +callerEnricher | Libraries

Function callerEnricher

  • Enriches log events with the caller's source file and line number.

    +

    Warning: This enricher uses Error.captureStackTrace internally, +which is expensive. Use only when needed for debugging.

    +

    Returns Enricher

    an enricher that adds { SourceFile: '...', SourceLine: number }

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..captureProperties.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..captureProperties.html new file mode 100644 index 00000000..d9958546 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..captureProperties.html @@ -0,0 +1,7 @@ +captureProperties | Libraries

Function captureProperties

  • Captures structured properties from the template, applying destructure +semantics: {@Prop} keeps the full object, {Prop} calls toString() +on objects that have a custom toString.

    +

    Parameters

    • tokens: TemplateToken[]

      parsed template tokens

      +
    • properties: Record<string, unknown>

      raw property values

      +

    Returns Record<string, unknown>

    property bag with appropriate serialization applied

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..computeEventId.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..computeEventId.html new file mode 100644 index 00000000..c199c9bd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..computeEventId.html @@ -0,0 +1,5 @@ +computeEventId | Libraries

Function computeEventId

  • Generates a deterministic hex event ID from a message template string. +Uses a simple FNV-1a hash for speed — no cryptographic requirements.

    +

    Parameters

    • template: string

      the raw message template

      +

    Returns string

    8-character hex hash

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..configureLogging.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..configureLogging.html new file mode 100644 index 00000000..8dcd992b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..configureLogging.html @@ -0,0 +1,9 @@ +configureLogging | Libraries

Function configureLogging

  • Configures logging services in the DI container.

    +

    Registers the root logger as a singleton and optionally sets up +scoped loggers that auto-enrich with request context.

    +

    Parameters

    • services: any

      the ServiceCollection to register with

      +
    • logger: Logger

      the root logger instance

      +

    Returns void

    const server = new ServerBuilder()
    .services((svc) => {
    configureLogging(svc, logger);
    })
    .build(); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..consoleSink.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..consoleSink.html new file mode 100644 index 00000000..9d0e40d5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..consoleSink.html @@ -0,0 +1,12 @@ +consoleSink | Libraries

Function consoleSink

  • Creates a console sink for log output.

    +

    Supports two modes:

    +
      +
    • 'pretty' — colored, human-readable output (default for development)
    • +
    • 'json' — CLEF JSON output (for production / container logs)
    • +
    +

    Parameters

    Returns LogSink

    a LogSink that writes to stdout/stderr

    +
    const sink = consoleSink({ theme: 'dark', minimumLevel: 'debug' });
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..correlationIdEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..correlationIdEnricher.html new file mode 100644 index 00000000..c13da3c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..correlationIdEnricher.html @@ -0,0 +1,4 @@ +correlationIdEnricher | Libraries

Function correlationIdEnricher

  • Enriches log events with the correlation ID from AsyncLocalStorage. +Zero-cost when no context is active — simply returns the event unchanged.

    +

    Returns Enricher

    an enricher that adds { CorrelationId: '...' } if available

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..correlationIdMiddleware.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..correlationIdMiddleware.html new file mode 100644 index 00000000..e919171c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..correlationIdMiddleware.html @@ -0,0 +1,9 @@ +correlationIdMiddleware | Libraries

Function correlationIdMiddleware

  • Creates correlation ID middleware for @cleverbrush/server.

    +

    Extracts a correlation ID from incoming request headers (or generates one), +sets it on the response, and stores it in the LogContext for enrichers.

    +

    Parameters

    Returns (context: any, next: () => Promise<void>) => Promise<void>

    a middleware function

    +
    server.use(correlationIdMiddleware({
    requestHeaders: ['X-Correlation-Id', 'X-Request-Id'],
    })); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createLogEvent.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createLogEvent.html new file mode 100644 index 00000000..1d929bc3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createLogEvent.html @@ -0,0 +1,8 @@ +createLogEvent | Libraries

Function createLogEvent

  • Creates a complete LogEvent from a message template, properties, +and metadata.

    +

    Parameters

    • level: LogLevel

      severity level

      +
    • template: string

      message template string with {Property} holes

      +
    • properties: Record<string, unknown>

      structured property values

      +
    • Optionalexception: Error

      optional associated error

      +

    Returns LogEvent

    a fully populated LogEvent

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createLogger.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createLogger.html new file mode 100644 index 00000000..05e70153 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createLogger.html @@ -0,0 +1,14 @@ +createLogger | Libraries

Function createLogger

  • Creates a structured logger with the specified configuration.

    +

    The logger uses fire-and-forget semantics — log methods are synchronous +and push events into an internal async pipeline. Events flow through +enrichers, filters, and level overrides before being dispatched to sinks.

    +

    Parameters

    • config: LoggerConfig

      logger configuration including sinks, enrichers, and filters

      +

    Returns Logger

    a configured Logger instance that implements AsyncDisposable

    +
    const logger = createLogger({
    minimumLevel: 'information',
    sinks: [consoleSink({ theme: 'dark' })],
    enrichers: [hostnameEnricher()],
    });

    logger.info('Server started on port {Port}', { Port: 3000 }); +
    + +
    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createSink.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createSink.html new file mode 100644 index 00000000..7d9c74b1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..createSink.html @@ -0,0 +1,7 @@ +createSink | Libraries

Function createSink

  • Creates a simple LogSink from an emit function.

    +

    Parameters

    Returns LogSink

    a LogSink instance

    +
    const sink = createSink({
    minimumLevel: 'error',
    emit: async (events) => {
    for (const event of events) {
    await sendAlert(event.renderedMessage);
    }
    },
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..environmentEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..environmentEnricher.html new file mode 100644 index 00000000..f70407d9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..environmentEnricher.html @@ -0,0 +1,4 @@ +environmentEnricher | Libraries

Function environmentEnricher

  • Enriches log events with the deployment environment name.

    +

    Parameters

    • environment: string

      the environment name (e.g. 'production', 'staging')

      +

    Returns Enricher

    an enricher that adds { Environment: '...' }

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..extractCorrelationId.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..extractCorrelationId.html new file mode 100644 index 00000000..604820fa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..extractCorrelationId.html @@ -0,0 +1,11 @@ +extractCorrelationId | Libraries

Function extractCorrelationId

  • Extracts a correlation ID from incoming HTTP request headers.

    +

    Checks headers in priority order:

    +
      +
    1. X-Correlation-Id
    2. +
    3. X-Request-Id
    4. +
    5. traceparent (W3C Trace Context — extracts the trace-id segment)
    6. +
    +

    If no header is found, generates a new correlation ID.

    +

    Parameters

    • headers: Record<string, string | string[] | undefined>

      request headers object

      +

    Returns string

    a correlation ID string

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..fileSink.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..fileSink.html new file mode 100644 index 00000000..600e1a1b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..fileSink.html @@ -0,0 +1,8 @@ +fileSink | Libraries

Function fileSink

  • Creates a file sink that writes CLEF-formatted log events.

    +

    Supports size-based, time-based, and hybrid rotation strategies.

    +

    Parameters

    Returns LogSink

    a LogSink that appends to a file

    +
    const sink = fileSink({
    path: './logs/app.log',
    rotation: { strategy: 'time', interval: 'daily', retainCount: 30 },
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..formatClef.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..formatClef.html new file mode 100644 index 00000000..8875849a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..formatClef.html @@ -0,0 +1,10 @@ +formatClef | Libraries

Function formatClef

  • Formats a single LogEvent as a CLEF JSON string.

    +

    CLEF (Compact Log Event Format) is the standard wire format for Seq +and compatible with the Serilog ecosystem.

    +

    Parameters

    Returns string

    a single-line JSON string in CLEF format

    +
    const line = formatClef(event);
    // '{"@t":"2026-04-20T14:30:00.123Z","@mt":"User {UserId} signed in","UserId":"usr_abc"}' +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..formatClefBatch.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..formatClefBatch.html new file mode 100644 index 00000000..bed18ad7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..formatClefBatch.html @@ -0,0 +1,8 @@ +formatClefBatch | Libraries

Function formatClefBatch

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..generateCorrelationId.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..generateCorrelationId.html new file mode 100644 index 00000000..10ccd3b0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..generateCorrelationId.html @@ -0,0 +1,4 @@ +generateCorrelationId | Libraries

Function generateCorrelationId

  • Generates a new correlation ID using UUID v7 (time-sortable).

    +

    Falls back to UUID v4 if the runtime doesn't support v7.

    +

    Returns string

    a new UUID string suitable for correlation

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..hostnameEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..hostnameEnricher.html new file mode 100644 index 00000000..c3aaf269 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..hostnameEnricher.html @@ -0,0 +1,4 @@ +hostnameEnricher | Libraries

Function hostnameEnricher

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..levelToShortString.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..levelToShortString.html new file mode 100644 index 00000000..8dfe92b2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..levelToShortString.html @@ -0,0 +1,2 @@ +levelToShortString | Libraries

Function levelToShortString

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..levelToString.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..levelToString.html new file mode 100644 index 00000000..f9b4bc7f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..levelToString.html @@ -0,0 +1,4 @@ +levelToString | Libraries

Function levelToString

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..parseLogLevel.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..parseLogLevel.html new file mode 100644 index 00000000..1b3594d4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..parseLogLevel.html @@ -0,0 +1,4 @@ +parseLogLevel | Libraries

Function parseLogLevel

  • Parses a log level name string to a LogLevel numeric value.

    +

    Parameters

    • name: string

      case-insensitive level name

      +

    Returns LogLevel

    the numeric LogLevel value

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..parseTemplate.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..parseTemplate.html new file mode 100644 index 00000000..9ade26d5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..parseTemplate.html @@ -0,0 +1,6 @@ +parseTemplate | Libraries

Function parseTemplate

  • Parses a Serilog-style message template into tokens.

    +

    Supports {Property} for scalar capture and {@Property} for +destructuring (full object structure preserved in properties).

    +

    Parameters

    • template: string

      message template string with {Property} holes

      +

    Returns TemplateToken[]

    array of parsed tokens

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..processIdEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..processIdEnricher.html new file mode 100644 index 00000000..3cbe86af --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..processIdEnricher.html @@ -0,0 +1,4 @@ +processIdEnricher | Libraries

Function processIdEnricher

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..renderTemplate.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..renderTemplate.html new file mode 100644 index 00000000..1540113a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..renderTemplate.html @@ -0,0 +1,7 @@ +renderTemplate | Libraries

Function renderTemplate

  • Renders a parsed template into a human-readable string.

    +

    For non-destructured properties, calls toString() if available on +the value. For destructured properties ({@Prop}), uses JSON.stringify.

    +

    Parameters

    • tokens: TemplateToken[]

      parsed template tokens

      +
    • properties: Record<string, unknown>

      property values to interpolate

      +

    Returns string

    the rendered message string

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..requestLoggingMiddleware.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..requestLoggingMiddleware.html new file mode 100644 index 00000000..d18c8b35 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..requestLoggingMiddleware.html @@ -0,0 +1,11 @@ +requestLoggingMiddleware | Libraries

Function requestLoggingMiddleware

  • Creates request logging middleware for @cleverbrush/server.

    +

    Logs HTTP request completion with method, path, status code, and +elapsed time. Uses the logger from the request context or falls +back to the provided logger.

    +

    Parameters

    Returns (context: any, next: () => Promise<void>) => Promise<void>

    a middleware function

    +
    server.use(requestLoggingMiddleware(logger, {
    excludePaths: ['/health', myEndpoint],
    getLevel: (status) => status >= 500 ? 'error' : 'information',
    })); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..safeSerialize.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..safeSerialize.html new file mode 100644 index 00000000..7f7315c2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..safeSerialize.html @@ -0,0 +1,15 @@ +safeSerialize | Libraries

Function safeSerialize

  • Safely serializes a value for structured logging, handling:

    +
      +
    • Circular references → "[Circular]"
    • +
    • Depth limits → "[Object]" or "[Array]"
    • +
    • BigInt → string representation
    • +
    • Buffer → "[Buffer(N bytes)]"
    • +
    • Functions → "[Function: name]"
    • +
    • Symbols → "[Symbol: description]"
    • +
    • Error objects → { message, stack, name, ...ownProperties }
    • +
    • Long strings → truncated with "...(truncated)"
    • +
    +

    Parameters

    Returns unknown

    a JSON-safe representation of the value

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..samplingFilter.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..samplingFilter.html new file mode 100644 index 00000000..4f291c96 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..samplingFilter.html @@ -0,0 +1,9 @@ +samplingFilter | Libraries

Function samplingFilter

  • Creates a sampling filter for high-throughput scenarios.

    +

    Only a fraction of events at the specified levels are kept, +reducing log volume without losing visibility at higher severity levels.

    +

    Parameters

    Returns LogFilter

    a LogFilter that randomly samples events

    +
    const filter = samplingFilter({ debug: 0.01, trace: 0.001 });
    // Keeps 1% of debug events, 0.1% of trace events +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..seqSink.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..seqSink.html new file mode 100644 index 00000000..43e64904 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..seqSink.html @@ -0,0 +1,10 @@ +seqSink | Libraries

Function seqSink

  • Creates a sink that sends log events to a Seq server via HTTP in CLEF format.

    +

    Events are batched and sent to POST {serverUrl}/ingest/clef. The sink +respects Seq's MinimumLevelAccepted response to dynamically reduce +bandwidth when the server applies level filtering.

    +

    Parameters

    Returns LogSink

    a LogSink that batches and sends events to Seq

    +
    const sink = seqSink({
    serverUrl: 'https://seq.mycompany.com',
    apiKey: process.env.SEQ_API_KEY,
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..useLogging.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..useLogging.html new file mode 100644 index 00000000..9116d263 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log..useLogging.html @@ -0,0 +1,9 @@ +useLogging | Libraries

Function useLogging

  • Convenience function that returns correlation ID middleware and +request logging middleware, ready to spread into ServerBuilder.use().

    +

    Parameters

    • logger: Logger

      the root logger instance

      +
    • Optionaloptions: UseLoggingOptions

      request logging configuration

      +

    Returns [
        (context: any, next: () => Promise<void>) => Promise<void>,
        (context: any, next: () => Promise<void>) => Promise<void>,
    ]

    an array of middleware functions

    +
    const server = new ServerBuilder()
    .use(...useLogging(logger, {
    excludePaths: ['/health'],
    }))
    .build(); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log.clickhouse.clickHouseSink.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log.clickhouse.clickHouseSink.html new file mode 100644 index 00000000..28738116 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log.clickhouse.clickHouseSink.html @@ -0,0 +1,9 @@ +clickHouseSink | Libraries
  • Creates a ClickHouse sink that batch inserts log events.

    +

    Ships as a separate entrypoint (@cleverbrush/log/clickhouse) to +avoid forcing @cleverbrush/knex-clickhouse as a dependency.

    +

    Parameters

    Returns LogSink

    a LogSink that batch inserts into ClickHouse

    +
    const sink = clickHouseSink({
    connection: ch,
    table: 'application_logs',
    batchSize: 1000,
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log.clickhouse.createLogsTable.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log.clickhouse.createLogsTable.html new file mode 100644 index 00000000..65bf576a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_log.clickhouse.createLogsTable.html @@ -0,0 +1,8 @@ +createLogsTable | Libraries
  • Creates the ClickHouse logs table with a recommended schema.

    +

    Parameters

    • connection: any

      knex-clickhouse connection

      +
    • tableName: string

      name for the logs table

      +
    • Optionaloptions: CreateLogsTableOptions

      DDL options (engine, partitioning, TTL)

      +

    Returns Promise<void>

    await createLogsTable(ch, 'application_logs', {
    ttl: 'timestamp + INTERVAL 90 DAY',
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_mapper.mapper.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_mapper.mapper.html new file mode 100644 index 00000000..000f7559 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_mapper.mapper.html @@ -0,0 +1,7 @@ +mapper | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm-cli.defineConfig.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm-cli.defineConfig.html new file mode 100644 index 00000000..eaf6f63d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm-cli.defineConfig.html @@ -0,0 +1,5 @@ +defineConfig | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.applyDiff.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.applyDiff.html new file mode 100644 index 00000000..9586d101 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.applyDiff.html @@ -0,0 +1,10 @@ +applyDiff | Libraries

Function applyDiff

  • Execute a MigrationDiff directly against a live database without +writing a migration file. Intended for db push (dev-only schema sync).

    +

    Foreign-key constraint drops are executed as raw ALTER TABLE … DROP CONSTRAINT statements before the main alterTable call.

    +

    Parameters

    • knex: Knex

      A configured Knex instance or transaction.

      +
    • diff: MigrationDiff

      The diff from diffSchema.

      +
    • tableName: string

      The table to alter.

      +

    Returns Promise<void>

    const dbState = await introspectDatabase(knex, 'users');
    const diff = diffSchema(UserSchema, dbState);
    if (!isDiffEmpty(diff)) await applyDiff(knex, diff, 'users'); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.buildColumnMap.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.buildColumnMap.html new file mode 100644 index 00000000..345df3d0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.buildColumnMap.html @@ -0,0 +1,4 @@ +buildColumnMap | Libraries

Function buildColumnMap

  • Build a bidirectional column map from an ObjectSchemaBuilder's properties. +Uses getExtension('columnName') per property, falling back to the property key. +Result is cached per schema instance via WeakMap.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns ColumnMapResult

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.clearRow.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.clearRow.html new file mode 100644 index 00000000..dcb2b57d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.clearRow.html @@ -0,0 +1,13 @@ +clearRow | Libraries

Function clearRow

  • Apply value mappers to the joined fields of a result row in place.

    +

    After an eager-loaded query resolves, joined objects and arrays may contain +raw database values that need transformation (e.g. date strings → Date). +This function iterates over the one-to-one and one-to-many specs, applies +the mappers defined on each spec to the nested data, and returns the +mutated row.

    +

    This is an internal helper used by SchemaQueryBuilder's result +mapping pipeline. Exported to allow custom post-processing if needed.

    +

    Parameters

    • row: Record<string, any>

      The raw result row (mutated in place).

      +
    • oneSpecs: (ValidatedSpec & { type: "one" })[]

      Validated one-to-one join specs with optional mappers.

      +
    • manySpecs: (ValidatedSpec & { type: "many" })[]

      Validated one-to-many join specs with optional mappers.

      +

    Returns Record<string, any>

    The mutated row object.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.createDb.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.createDb.html new file mode 100644 index 00000000..0e866d10 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.createDb.html @@ -0,0 +1,9 @@ +createDb | Libraries

Function createDb

  • Create a typed database context.

    +

    Type Parameters

    Parameters

    • knex: Knex
    • entities: TMap
    • opts: { tracking: true }

    Returns TrackedDbContext<TMap>

    const TodoEntity = defineEntity(TodoSchema)
    .belongsTo(t => t.author, l => l.userId, r => r.id);

    const UserEntity = defineEntity(UserSchema);

    const db = createDb(knex, { todos: TodoEntity, users: UserEntity });

    const todo = await db.todos
    .where(t => t.id, '=', 42)
    .include(t => t.author)
    .first();

    await db.transaction(async dbTrx => {
    const u = await dbTrx.users.insert({ email: 'a@b.c', role: 'user', authProvider: 'local', createdAt: new Date() });
    await dbTrx.todos.insert({ title: 'Hi', userId: u.id, completed: false, createdAt: new Date(), updatedAt: new Date() });
    }); +
    + +
  • Create a typed database context.

    +

    Type Parameters

    Parameters

    • knex: Knex
    • entities: TMap
    • Optionalopts: { tracking?: false }

    Returns DbContext<TMap>

    const TodoEntity = defineEntity(TodoSchema)
    .belongsTo(t => t.author, l => l.userId, r => r.id);

    const UserEntity = defineEntity(UserSchema);

    const db = createDb(knex, { todos: TodoEntity, users: UserEntity });

    const todo = await db.todos
    .where(t => t.id, '=', 42)
    .include(t => t.author)
    .first();

    await db.transaction(async dbTrx => {
    const u = await dbTrx.users.insert({ email: 'a@b.c', role: 'user', authProvider: 'local', createdAt: new Date() });
    await dbTrx.todos.insert({ title: 'Hi', userId: u.id, completed: false, createdAt: new Date(), updatedAt: new Date() });
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.createQuery.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.createQuery.html new file mode 100644 index 00000000..bea03d94 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.createQuery.html @@ -0,0 +1 @@ +createQuery | Libraries

Function createQuery

  • Parameters

    • knexInstance: Knex

    Returns BoundQuery

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.defineEntity.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.defineEntity.html new file mode 100644 index 00000000..040ea88f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.defineEntity.html @@ -0,0 +1,6 @@ +defineEntity | Libraries

Function defineEntity

  • Wrap an ObjectSchemaBuilder in an Entity, enabling typed relation +declaration via .hasOne() / .hasMany() / .belongsTo() / .belongsToMany().

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Parameters

    Returns Entity<TSchema, {}>

    const UserEntity = defineEntity(
    object({
    id: number().primaryKey(),
    name: string(),
    posts: array(PostEntity.schema)
    }).hasTableName('users')
    ).hasMany(t => t.posts, l => l.id, r => r.userId); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.diffSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.diffSchema.html new file mode 100644 index 00000000..07c08672 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.diffSchema.html @@ -0,0 +1,10 @@ +diffSchema | Libraries

Function diffSchema

  • Compare a code-first schema model against a live database table state and +produce a diff describing the changes needed to bring the database in sync.

    +

    Parameters

    Returns MigrationDiff

    A MigrationDiff describing columns, indexes, and foreign +keys to add, drop, or alter.

    +
    const dbState = await introspectDatabase(knex, 'users');
    const diff = diffSchema(UserSchema, dbState);
    if (diff.addColumns.length > 0) {
    const migration = generateMigration(diff, 'users');
    console.log(migration.up);
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.entitiesToSnapshot.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.entitiesToSnapshot.html new file mode 100644 index 00000000..32b8d0a4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.entitiesToSnapshot.html @@ -0,0 +1,10 @@ +entitiesToSnapshot | Libraries

Function entitiesToSnapshot

  • Build a SchemaSnapshot from a set of entities without a live DB.

    +

    Handles polymorphic (CTI) entities by including each variant table. +Deduplicates tables so STI variants sharing a base table are only included +once.

    +

    Parameters

    • entities: Entity<any, any, never>[]

      The entities from your EntityMap.

      +

    Returns SchemaSnapshot

    A snapshot reflecting the current code-first schema state.

    +
    const snapshot = entitiesToSnapshot(Object.values(entityMap));
    writeSnapshot('./migrations/snapshot.json', snapshot); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.entitySchemaToTableState.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.entitySchemaToTableState.html new file mode 100644 index 00000000..65063c94 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.entitySchemaToTableState.html @@ -0,0 +1,12 @@ +entitySchemaToTableState | Libraries

Function entitySchemaToTableState

  • Derive a DatabaseTableState from a code-first ObjectSchemaBuilder +without connecting to the database.

    +

    The result mirrors what introspectDatabase would return after the +schema has been fully applied, so it can be fed directly into +diffSchema as the dbState argument. This is the foundation of +snapshot-based migration generation.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      An ObjectSchemaBuilder with DDL extensions.

      +

    Returns DatabaseTableState

    A DatabaseTableState representing the schema's ideal DB shape.

    +
    const state = entitySchemaToTableState(UserSchema);
    // state.columns, state.foreignKeys, state.indexes … +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreatePolymorphicTables.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreatePolymorphicTables.html new file mode 100644 index 00000000..58490baa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreatePolymorphicTables.html @@ -0,0 +1,12 @@ +generateCreatePolymorphicTables | Libraries

Function generateCreatePolymorphicTables

  • Generate a series of Knex schema.createTable() calls for a polymorphic +schema and all its CTI variant tables.

    +

    Returns an array of (knex: Knex) => Knex.SchemaBuilder functions — one +for the base table and one for each CTI variant. STI variants add their +columns to the base table itself so no extra table is needed.

    +

    Execute them sequentially in a migration:

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      The base ObjectSchemaBuilder with .withVariants() applied.

      +

    Returns ((knex: Knex) => SchemaBuilder)[]

    An array of table-creation functions to execute in order.

    +
    const creators = generateCreatePolymorphicTables(FileSchema);
    for (const create of creators) {
    await create(knex);
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreateTable.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreateTable.html new file mode 100644 index 00000000..6eee2ff0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreateTable.html @@ -0,0 +1,12 @@ +generateCreateTable | Libraries

Function generateCreateTable

  • Generate a Knex schema.createTable() call from an ObjectSchemaBuilder's +introspected metadata and DDL extensions.

    +

    Returns a function that accepts a Knex instance and returns a +SchemaBuilder (thenable). Call it inside a migration or setup script:

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      An ObjectSchemaBuilder with .hasTableName() and +column-level DDL extensions (.primaryKey(), .references(), etc.).

      +

    Returns (knex: Knex) => SchemaBuilder

    (knex: Knex) => Knex.SchemaBuilder — a function that creates the +table when executed.

    +
    const createUsersTable = generateCreateTable(UserSchema);
    await createUsersTable(knex); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreateTableSource.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreateTableSource.html new file mode 100644 index 00000000..d080fc17 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateCreateTableSource.html @@ -0,0 +1,12 @@ +generateCreateTableSource | Libraries

Function generateCreateTableSource

  • Generate up and down TypeScript code strings (4-space-indented\n * fragments) for creating a table from a schema.

    +

    Unlike generateCreateTable (which returns a Knex callback), the +output is plain source text suitable for writing into a migration file. The +fragments are designed to be embedded directly inside up() / down() +functions.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      An ObjectSchemaBuilder with .hasTableName() and column +DDL extensions.

      +

    Returns { down: string; up: string }

    { up, down } source fragments.

    +
    const { up, down } = generateCreateTableSource(UserSchema);
    // up: " await knex.schema.createTable('users', (table) => { … });"
    // down: " await knex.schema.dropTableIfExists('users');" +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateMigration.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateMigration.html new file mode 100644 index 00000000..a2c93402 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateMigration.html @@ -0,0 +1,10 @@ +generateMigration | Libraries

Function generateMigration

  • Generate migration up and down code strings from a MigrationDiff.

    +

    The generated code is valid TypeScript that uses Knex's schema builder API. +Write it to a migration file and run via Knex's migration system.

    +

    Parameters

    Returns { down: string; full: string; up: string }

    An object with up and down migration code strings.

    +
    const diff = diffSchema(UserSchema, dbState);
    const migration = generateMigration(diff, 'users');
    fs.writeFileSync('migration.ts', migration.full); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateMigrationsForContext.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateMigrationsForContext.html new file mode 100644 index 00000000..8d9d87ac --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.generateMigrationsForContext.html @@ -0,0 +1,21 @@ +generateMigrationsForContext | Libraries

Function generateMigrationsForContext

  • Generate a single combined migration (up + down) for a set of entities by +diffing the current code-first schemas against a serialized snapshot +stored in the repository — no live database connection required.

    +

    For each entity's table the function:

    +
      +
    • New tables (in entities but not in prevSnapshot): emits CREATE TABLE.
    • +
    • Existing tables (in both): diffs entity schema against the snapshot +state via diffSchema and emits ALTER TABLE when changes exist.
    • +
    • Dropped tables (in prevSnapshot but not in entities): emits +DROP TABLE with a best-effort CREATE TABLE in the down direction.
    • +
    • Orders tables topologically by FK dependencies so parent tables are +created before child tables in up (and dropped after in down).
    • +
    +

    Parameters

    Returns {
        down: string;
        full: string;
        isEmpty: boolean;
        nextSnapshot: SchemaSnapshot;
        up: string;
    }

    { up, down, full, isEmpty, nextSnapshot } where nextSnapshot +should be written to disk after the migration file is created.

    +
    const prev = loadSnapshot('./migrations/snapshot.json');
    const result = generateMigrationsForContext(
    Object.values({ todos: TodoEntity, users: UserEntity }),
    prev
    );
    if (!result.isEmpty) {
    fs.writeFileSync('migrations/20260423000000_init.ts', result.full);
    writeSnapshot('./migrations/snapshot.json', result.nextSnapshot);
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getColumnName.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getColumnName.html new file mode 100644 index 00000000..ec340858 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getColumnName.html @@ -0,0 +1,3 @@ +getColumnName | Libraries

Function getColumnName

  • Get the SQL column name for a schema property. +Returns the hasColumnName() value if set, otherwise falls back to propertyKey.

    +

    Parameters

    • schema: SchemaBuilder<any, any, any>
    • propertyKey: string

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getPolymorphicVariantSchemas.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getPolymorphicVariantSchemas.html new file mode 100644 index 00000000..bc068ae9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getPolymorphicVariantSchemas.html @@ -0,0 +1,4 @@ +getPolymorphicVariantSchemas | Libraries

Function getPolymorphicVariantSchemas

  • Internal

    Retrieve the array of variant ObjectSchemaBuilder instances stored by +.withVariants(). Used by migration / DDL tools to discover variant +tables without walking the full schema tree.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns ObjectSchemaBuilder<any, any, any, any, any, any, any>[]

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getPrimaryKeyColumns.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getPrimaryKeyColumns.html new file mode 100644 index 00000000..1541d3df --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getPrimaryKeyColumns.html @@ -0,0 +1,8 @@ +getPrimaryKeyColumns | Libraries

Function getPrimaryKeyColumns

  • Resolve the primary-key columns of a schema at runtime.

    +

    Composite primary keys (declared via .hasPrimaryKey([...]) on the +object schema) take precedence over single-column primary keys. The +columns argument to .hasPrimaryKey() may contain either property keys +or SQL column names — both forms are accepted and normalised.

    +

    Returns { propertyKeys: [], columnNames: [] } when no primary key is +declared.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns PrimaryKeyColumns

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getProjections.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getProjections.html new file mode 100644 index 00000000..3b88b642 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getProjections.html @@ -0,0 +1,10 @@ +getProjections | Libraries

Function getProjections

  • Retrieve the named projections registered on a schema via +.projection(name, columns).

    +

    Returns a map of { [name]: { keys: readonly string[] } } where each +entry's keys array contains the property keys (not SQL column names) +for that projection. Returns an empty object when no projections are +defined.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns Record<string, { keys: readonly string[] }>

    const projs = getProjections(PostSchema);
    // { summary: { keys: ['id', 'title'] } } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getRowVersionColumn.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getRowVersionColumn.html new file mode 100644 index 00000000..810fb906 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getRowVersionColumn.html @@ -0,0 +1,3 @@ +getRowVersionColumn | Libraries

Function getRowVersionColumn

  • Find the first column marked .rowVersion() on the schema and return its +metadata. Returns null when no row-version column is declared.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns RowVersionColumn | null

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getTableName.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getTableName.html new file mode 100644 index 00000000..d0c0ac8f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getTableName.html @@ -0,0 +1,3 @@ +getTableName | Libraries

Function getTableName

  • Get the SQL table name from an ObjectSchemaBuilder. +Throws if hasTableName() was never called.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getVariants.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getVariants.html new file mode 100644 index 00000000..f3e9f85a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.getVariants.html @@ -0,0 +1,4 @@ +getVariants | Libraries

Function getVariants

  • Internal

    Retrieve the resolved variant configuration stored by .withVariants(). +Returns null when the schema is not polymorphic.

    +

    — used by SchemaQueryBuilder.

    +

    Parameters

    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Returns Omit<ResolvedVariantConfig, "discriminatorColumn"> | null

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.introspectDatabase.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.introspectDatabase.html new file mode 100644 index 00000000..759af6c5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.introspectDatabase.html @@ -0,0 +1,11 @@ +introspectDatabase | Libraries

Function introspectDatabase

  • Introspect a PostgreSQL table and return its current state.

    +

    Queries information_schema.columns, pg_indexes, pg_constraint, and +referential constraint metadata to build a complete picture of the table's +columns, indexes, foreign keys, and check constraints.

    +

    Parameters

    • knex: Knex

      A configured Knex instance connected to a PostgreSQL database.

      +
    • tableName: string

      The table name to introspect.

      +

    Returns Promise<DatabaseTableState>

    The current database state for the table.

    +
    const dbState = await introspectDatabase(knex, 'users');
    console.log(dbState.columns); // { id: { type: 'integer', ... }, ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.isDiffEmpty.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.isDiffEmpty.html new file mode 100644 index 00000000..6faa57cb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.isDiffEmpty.html @@ -0,0 +1,3 @@ +isDiffEmpty | Libraries

Function isDiffEmpty

  • Return true when a MigrationDiff has no operations — i.e. the +database table is already in sync with the schema.

    +

    Parameters

    Returns boolean

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.loadSnapshot.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.loadSnapshot.html new file mode 100644 index 00000000..518c7af8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.loadSnapshot.html @@ -0,0 +1,8 @@ +loadSnapshot | Libraries

Function loadSnapshot

  • Load a SchemaSnapshot from disk.

    +

    Returns an empty snapshot (no tables) when the file does not exist — this +is the "first run" case, which causes migrate generate to emit a single +migration containing CREATE TABLE for every entity.

    +

    Parameters

    • snapshotPath: string

      Absolute or cwd-relative path to snapshot.json.

      +

    Returns SchemaSnapshot

    The parsed snapshot, or { version: 1, tables: {} } if missing or +unreadable.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.mapObject.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.mapObject.html new file mode 100644 index 00000000..9156591a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.mapObject.html @@ -0,0 +1,10 @@ +mapObject | Libraries

Function mapObject

  • Apply a map of per-key transformations to an object, returning a new object +with the transformed values.

    +

    Keys not present in mappers are copied through unchanged. Keys present in +mappers are passed through mapValue.

    +

    Type Parameters

    • T extends Record<string, any>

    Parameters

    • obj: T

      The source object (e.g. a raw database row).

      +
    • mappers: Record<string, ((v: any) => any) | string>

      A Record mapping property keys to mapper functions or +MAPPERS built-in names.

      +

    Returns T

    A shallow copy of obj with the specified values transformed.

    +

    If obj is null or a non-object, it is returned as-is.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.mapValue.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.mapValue.html new file mode 100644 index 00000000..fefbf4c9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.mapValue.html @@ -0,0 +1,8 @@ +mapValue | Libraries

Function mapValue

  • Apply a single mapper to a value.

    +

    Parameters

    • mapper: string | ((v: any) => any)

      Either a transformation function (v: any) => any, or a +string key referencing one of the MAPPERS built-ins (e.g. +'date_from_json').

      +
    • value: any

      The raw value to transform.

      +

    Returns any

    The transformed value.

    +

    If mapper is a string that does not exist in MAPPERS.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.query.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.query.html new file mode 100644 index 00000000..0a98a868 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.query.html @@ -0,0 +1 @@ +query | Libraries

Function query

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.rawQuery.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.rawQuery.html new file mode 100644 index 00000000..4d36d30f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.rawQuery.html @@ -0,0 +1,15 @@ +rawQuery | Libraries

Function rawQuery

  • Execute a raw SQL query or Knex query builder and map the result rows +through the schema's column→property name mapping.

    +

    This is the escape hatch for complex queries that can't be expressed with +the typed SchemaQueryBuilder API. The schema is used only for result +mapping — column names in the result are converted back to property names. +Extra columns (not in the schema) are passed through unchanged.

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

    Parameters

    • knex: Knex

      A configured Knex instance.

      +
    • schema: TSchema

      The ObjectSchemaBuilder for result mapping.

      +
    • queryOrSql: string | QueryBuilder<any, any>

      A raw SQL string or a Knex.QueryBuilder.

      +
    • Optionalbindings: any[]

      Optional bindings for parameterised SQL queries.

      +

    Returns Promise<(InferType<TSchema> & Record<string, any>)[]>

    Mapped result rows.

    +
    // Raw SQL with schema result mapping
    const results = await rawQuery(knex, PostSchema, `
    SELECT p.*, COUNT(c.id) AS comment_count
    FROM posts p
    LEFT JOIN comments c ON c.post_id = p.id
    GROUP BY p.id
    ORDER BY comment_count DESC
    LIMIT ?
    `, [10]);

    // Knex query builder as the source
    const subQuery = knex('posts').select('author_id', knex.raw('COUNT(*) as post_count')).groupBy('author_id');
    const results = await rawQuery(knex, UserSchema, subQuery); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.resolveColumnRef.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.resolveColumnRef.html new file mode 100644 index 00000000..75208511 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.resolveColumnRef.html @@ -0,0 +1,27 @@ +resolveColumnRef | Libraries

Function resolveColumnRef

  • Resolve a ColumnRef to a plain SQL column name (or a Knex.Raw expression for +nested JSON paths when knex is supplied).

    +
      +
    • String refs are treated as property keys (or dot-separated nested paths +such as 'address.city') and translated to column names via the column map.
    • +
    • Function refs (property accessor) are resolved via PropertyDescriptorTree, +then translated to column names. Nested accessors (e.g. t => t.address.city) +produce a Knex.Raw JSON-path expression when knex is provided.
    • +
    +

    Parameters

    • ref: ColumnRef<any>

      Column reference (property key, dotted path, or accessor fn).

      +
    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      Root ObjectSchemaBuilder.

      +
    • label: string

      Human-readable label for error messages.

      +
    • knex: Knex

      Knex instance. Required for nested JSON-path refs; when omitted +and a nested path is detected, an error is thrown.

      +

    Returns string | Raw<any>

  • Resolve a ColumnRef to a plain SQL column name (or a Knex.Raw expression for +nested JSON paths when knex is supplied).

    +
      +
    • String refs are treated as property keys (or dot-separated nested paths +such as 'address.city') and translated to column names via the column map.
    • +
    • Function refs (property accessor) are resolved via PropertyDescriptorTree, +then translated to column names. Nested accessors (e.g. t => t.address.city) +produce a Knex.Raw JSON-path expression when knex is provided.
    • +
    +

    Parameters

    • ref: ColumnRef<any>

      Column reference (property key, dotted path, or accessor fn).

      +
    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

      Root ObjectSchemaBuilder.

      +
    • label: string

      Human-readable label for error messages.

      +

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.resolvePropertyKey.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.resolvePropertyKey.html new file mode 100644 index 00000000..2a41bcee --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.resolvePropertyKey.html @@ -0,0 +1,3 @@ +resolvePropertyKey | Libraries

Function resolvePropertyKey

  • Resolve a ColumnRef to the property key (not the column name). +Used for result mapping.

    +

    Parameters

    • ref: ColumnRef<any>
    • schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
    • label: string

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.tableExistsInDb.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.tableExistsInDb.html new file mode 100644 index 00000000..2c77b8be --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.tableExistsInDb.html @@ -0,0 +1,8 @@ +tableExistsInDb | Libraries

Function tableExistsInDb

  • Check whether a table exists in the connected PostgreSQL database.

    +

    Parameters

    • knex: Knex

      A configured Knex instance (or transaction).

      +
    • tableName: string

      The table name to check.

      +

    Returns Promise<boolean>

    true when the table exists.

    +
    const exists = await tableExistsInDb(knex, 'users');
    if (!exists) await generateCreateTable(UserSchema)(knex); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.writeSnapshot.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.writeSnapshot.html new file mode 100644 index 00000000..2ad5451f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_orm.writeSnapshot.html @@ -0,0 +1,5 @@ +writeSnapshot | Libraries

Function writeSnapshot

  • Write a SchemaSnapshot to disk atomically (temp-file + rename) with +deterministic key ordering so diffs in version control are minimal.

    +

    Parameters

    • snapshotPath: string

      Absolute or cwd-relative path to write snapshot.json.

      +
    • snapshot: SchemaSnapshot

      The snapshot to serialize.

      +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..configureOtel.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..configureOtel.html new file mode 100644 index 00000000..6bea4a91 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..configureOtel.html @@ -0,0 +1,10 @@ +configureOtel | Libraries

Function configureOtel

  • Registers OTel Tracer and Meter instances in the DI container.

    +

    Both are resolved lazily from the global providers configured by +import('./setupOtel.js').setupOtel, so this helper can be +called at DI setup time even before the SDK has fully started.

    +

    Parameters

    • services: any

      the ServiceCollection to register with

      +
    • Optionaloptions: ConfigureOtelOptions

      tracer / meter naming overrides

      +

    Returns void

    import { configureOtel, ITracer } from '@cleverbrush/otel';

    configureOtel(services, { tracerName: 'todo-backend' });

    const tracer = provider.get(ITracer);
    tracer.startActiveSpan('custom-work', span => {
    // …
    span.end();
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..instrumentKnex.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..instrumentKnex.html new file mode 100644 index 00000000..7d304b76 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..instrumentKnex.html @@ -0,0 +1,18 @@ +instrumentKnex | Libraries

Function instrumentKnex

  • Instruments a Knex instance to emit an OpenTelemetry CLIENT span +for every executed query.

    +

    Hooks knex's built-in query, query-response, and query-error +events — every dbset read, change-tracker write, save-graph, and raw +knex(...) call is captured uniformly because they all flow through +the same knex instance.

    +

    Spans automatically nest under any ambient OTel context, so DB spans +become children of the enclosing HTTP server span produced by +tracingMiddleware.

    +

    Returns the same instance for fluent chaining: +instrumentKnex(knex({...})).

    +

    Type Parameters

    • T extends Knex<any, any[]>

    Parameters

    • k: T

      the knex instance to instrument (mutated in place)

      +
    • Optionaloptions: InstrumentKnexOptions

      optional overrides for db system, tracer name, redaction

      +

    Returns T

    the same knex instance

    +
    import knex from 'knex';
    import { instrumentKnex } from '@cleverbrush/otel';

    services.addSingleton(KnexToken, () =>
    instrumentKnex(
    knex({ client: 'pg', connection: dbUrl }),
    { dbSystem: 'postgresql' }
    )
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..otelLogSink.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..otelLogSink.html new file mode 100644 index 00000000..3f5b723f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..otelLogSink.html @@ -0,0 +1,26 @@ +otelLogSink | Libraries

Function otelLogSink

  • Creates a LogSink that forwards every event to the +OpenTelemetry Logs API.

    +

    Maps each LogEvent to an OTel LogRecord:

    +
      +
    • timestamp → nanoseconds via Date.getTime() × 1e6
    • +
    • levelseverityNumber and severityText
    • +
    • renderedMessagebody
    • +
    • properties → flat attribute map (functions / symbols dropped, +nested objects JSON-stringified)
    • +
    • messageTemplatecleverbrush.message_template attribute
    • +
    • eventIdcleverbrush.event_id attribute
    • +
    • exception.* attributes when the event carries an Error
    • +
    +

    Trace correlation (traceId, spanId) is filled in automatically +by the OTel SDK from the active context — typically established by +tracingMiddleware.

    +

    The sink itself is per-event; for high-throughput services wrap it +with BatchingSink from @cleverbrush/log.

    +

    Requires that setupOtel({ ... }) has been called so the global +LoggerProvider is set; otherwise emissions become no-ops.

    +

    Parameters

    Returns LogSink

    a LogSink that emits to the OTel Logs pipeline

    +
    import { createLogger, consoleSink } from '@cleverbrush/log';
    import { otelLogSink } from '@cleverbrush/otel';

    const logger = createLogger({
    minimumLevel: 'information',
    sinks: [consoleSink(), otelLogSink()],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..setupOtel.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..setupOtel.html new file mode 100644 index 00000000..77c10924 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..setupOtel.html @@ -0,0 +1,13 @@ +setupOtel | Libraries

Function setupOtel

  • Initializes the OpenTelemetry Node SDK with sensible defaults for +the Cleverbrush framework.

    +

    This must be called before any instrumented modules are imported +— typically via node --import ./telemetry.js entrypoint.js.

    +

    Configures W3C Trace Context propagation, OTLP/HTTP exporters for +traces, logs, and metrics, and the resource attributes that identify +the service in observability backends.

    +

    Parameters

    • config: OtelConfig

      service identity and exporter configuration

      +

    Returns OtelHandle

    a handle exposing shutdown() and the underlying SDK

    +
    // telemetry.ts — loaded via `node --import ./telemetry.js`
    import { setupOtel } from '@cleverbrush/otel';
    import { outboundHttpInstrumentations, runtimeMetrics } from '@cleverbrush/otel/instrumentations';

    export const otel = setupOtel({
    serviceName: 'todo-backend',
    serviceVersion: '1.0.0',
    environment: process.env.NODE_ENV,
    otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
    instrumentations: [...outboundHttpInstrumentations(), runtimeMetrics()],
    });

    process.on('SIGTERM', () => otel.shutdown()); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..traceEnricher.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..traceEnricher.html new file mode 100644 index 00000000..a5a0487f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..traceEnricher.html @@ -0,0 +1,11 @@ +traceEnricher | Libraries

Function traceEnricher

  • Creates a log enricher that attaches the active span's +TraceId, SpanId, and TraceFlags to every log event.

    +

    Reads from the OpenTelemetry context via @opentelemetry/api, +so it works with any tracer provider — including the one +configured by import('../setupOtel.js').setupOtel.

    +

    No-op when no span is active.

    +

    Returns Enricher

    an enricher that adds { TraceId, SpanId, TraceFlags } if a span is active

    +
    import { createLogger, consoleSink } from '@cleverbrush/log';
    import { traceEnricher } from '@cleverbrush/otel';

    const logger = createLogger({
    sinks: [consoleSink()],
    enrichers: [traceEnricher()],
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..tracingMiddleware.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..tracingMiddleware.html new file mode 100644 index 00000000..5872af27 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..tracingMiddleware.html @@ -0,0 +1,25 @@ +tracingMiddleware | Libraries

Function tracingMiddleware

  • Creates a @cleverbrush/server middleware that opens an OpenTelemetry +SERVER span for every incoming request.

    +

    Should be registered as the first middleware so that the span +wraps CORS, auth, request logging, and the handler — capturing the +full request lifetime.

    +

    Behavior:

    +
      +
    • Extracts inbound trace context from request headers +(W3C traceparent, baggage).
    • +
    • Names the span ${operationId} if available, otherwise +${method} ${http.route}, otherwise ${method} ${url.path}.
    • +
    • Sets HTTP semantic-convention attributes +(http.request.method, url.path, url.scheme, +server.address, user_agent.original, http.route).
    • +
    • Records http.response.status_code after next() completes.
    • +
    • Marks the span ERROR and records the exception on uncaught errors.
    • +
    • Stashes the span at ctx.items.get(OTEL_SPAN_ITEM_KEY) for +downstream code to enrich.
    • +
    +

    Parameters

    Returns (ctx: any, next: () => Promise<void>) => Promise<void>

    a Middleware compatible with @cleverbrush/server

    +
    import { tracingMiddleware } from '@cleverbrush/otel';

    createServer()
    .use(tracingMiddleware({ excludePaths: ['/health'] }))
    .use(corsMiddleware)
    .use(authMiddleware)
    .listen(3000); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..withSpan.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..withSpan.html new file mode 100644 index 00000000..cb8ed735 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel..withSpan.html @@ -0,0 +1,19 @@ +withSpan | Libraries

Function withSpan

  • Wraps fn in a custom OTel span and returns whatever fn returns.

    +

    The span is activated as the current context span via +startActiveSpan, so any child spans created inside fn (e.g. DB +queries from instrumentKnex) will be correctly nested under it. +Error handling is automatic — exceptions are recorded and the span is +marked ERROR before re-throwing.

    +

    Type Parameters

    • T

    Parameters

    Returns T

    const result = await withSpan('order.process', async span => {
    span.setAttribute('order.id', orderId);
    return processOrder(orderId); // DB spans nest under this span
    }); +
    + +
  • Creates a custom OTel span and returns a SpanHandle that +implements AsyncDisposable.

    +

    Use with await using for an ergonomic resource-management syntax. +Note that the span is not the active context span (see +SpanHandle for details). Call SpanHandle.fail in a +catch block to record errors before re-throwing.

    +

    Parameters

    Returns SpanHandle

    await using handle = withSpan('todo.create', { attributes: { 'todo.user_id': userId } });
    try {
    const todo = await db.todos.insert({...});
    handle.span.setAttribute('todo.id', todo.id);
    } catch (err) {
    handle.fail(err);
    throw err;
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.client.clientTracingMiddleware.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.client.clientTracingMiddleware.html new file mode 100644 index 00000000..32f0411f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.client.clientTracingMiddleware.html @@ -0,0 +1,9 @@ +clientTracingMiddleware | Libraries

Function clientTracingMiddleware

  • Creates a @cleverbrush/client middleware that traces outbound HTTP calls +and injects W3C Trace Context headers.

    +

    Register this as the first client middleware so it wraps retries, timeouts, +and batching. The server-side tracingMiddleware already extracts these +headers, so downstream services join the same distributed trace.

    +

    Parameters

    Returns ClientMiddleware

    import { createClient } from '@cleverbrush/client';
    import { clientTracingMiddleware } from '@cleverbrush/otel/client';

    const client = createClient(api, {
    baseUrl: 'http://service-b:3000',
    middlewares: [clientTracingMiddleware()]
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.instrumentations.outboundHttpInstrumentations.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.instrumentations.outboundHttpInstrumentations.html new file mode 100644 index 00000000..033cb6f5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.instrumentations.outboundHttpInstrumentations.html @@ -0,0 +1,12 @@ +outboundHttpInstrumentations | Libraries
  • Returns instrumentations for outbound HTTP traffic — Node http/https +(covers node-fetch etc.) and undici (covers global fetch).

    +

    Both packages are declared as optional peer dependencies of +@cleverbrush/otel. Install them in the host project to use:

    +
    npm install @opentelemetry/instrumentation-http @opentelemetry/instrumentation-undici
    +
    + +

    Returns unknown[]

    an array of instrumentation instances ready to pass to import('./setupOtel.js').setupOtel

    +
    import { setupOtel } from '@cleverbrush/otel';
    import { outboundHttpInstrumentations } from '@cleverbrush/otel/instrumentations';

    setupOtel({
    serviceName: 'todo-backend',
    instrumentations: outboundHttpInstrumentations(),
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.instrumentations.runtimeMetrics.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.instrumentations.runtimeMetrics.html new file mode 100644 index 00000000..11e2774b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_otel.instrumentations.runtimeMetrics.html @@ -0,0 +1,9 @@ +runtimeMetrics | Libraries
  • Returns the Node.js runtime metrics instrumentation, which emits +basic process gauges (event loop lag, GC, heap size).

    +

    Requires @opentelemetry/instrumentation-runtime-node to be +installed in the host project.

    +

    Returns unknown[]

    an array containing one instrumentation instance, or empty if the package is not installed

    +
    import { setupOtel } from '@cleverbrush/otel';
    import { runtimeMetrics } from '@cleverbrush/otel/instrumentations';

    setupOtel({
    serviceName: 'todo-backend',
    instrumentations: runtimeMetrics(),
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.Field.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.Field.html new file mode 100644 index 00000000..45daaad8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.Field.html @@ -0,0 +1,13 @@ +Field | Libraries
  • UI-agnostic Field component.

    +

    Resolves a renderer from:

    +
      +
    1. Explicit renderer prop
    2. +
    3. FormSystemProvider registry — checked for "type:variant" first, +then for the base "type"
    4. +
    +

    All rendering hints (variant, label, name, fieldProps) are +forwarded to the resolved renderer via FieldRenderProps.

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>

    Parameters

    Returns ReactNode

    <Field forProperty={(t) => t.password} form={form}
    variant="password" label="Password"
    fieldProps={{ placeholder: "Enter password", autoComplete: "current-password" }} /> +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.FormProvider.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.FormProvider.html new file mode 100644 index 00000000..67781f3b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.FormProvider.html @@ -0,0 +1,2 @@ +FormProvider | Libraries
  • Provides form context to children so they can use the context-based useField.

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>

    Parameters

    Returns ReactNode

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.FormSystemProvider.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.FormSystemProvider.html new file mode 100644 index 00000000..eb4f4a43 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.FormSystemProvider.html @@ -0,0 +1,6 @@ +FormSystemProvider | Libraries
  • Provides global renderer configuration via React Context. +Supports nesting — inner provider overrides outer.

    +

    Parameters

    Returns ReactNode

    <FormSystemProvider renderers={htmlRenderers}>
    <App />
    </FormSystemProvider> +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useField.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useField.html new file mode 100644 index 00000000..982e0ecd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useField.html @@ -0,0 +1,7 @@ +useField | Libraries
  • Context-based useField — can be used inside a FormProvider. +For best IntelliSense, prefer form.useField() which infers field types from the schema. +When using this context-based version, specify the schema type explicitly:

    +

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, undefined, false, {}, []>
    • TPropertySchema extends SchemaBuilder<any, any, any, false, {}> = SchemaBuilder<any, any, any, false, {}>

    Parameters

    Returns UseFieldResult<InferType<TPropertySchema>>

    const name = useField<typeof MySchema>((t) => t.name);
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useFormSystem.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useFormSystem.html new file mode 100644 index 00000000..3e1f62d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useFormSystem.html @@ -0,0 +1,2 @@ +useFormSystem | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useSchemaForm.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useSchemaForm.html new file mode 100644 index 00000000..65176e46 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_react-form.useSchemaForm.html @@ -0,0 +1,3 @@ +useSchemaForm | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.fromJsonSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.fromJsonSchema.html new file mode 100644 index 00000000..15f08db8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.fromJsonSchema.html @@ -0,0 +1,128 @@ +fromJsonSchema | Libraries
  • Converts a JSON Schema object into a @cleverbrush/schema builder.

    +

    Type Parameters

    • const S

    Parameters

    • schema: S

      A JSON Schema literal. Pass with as const for precise +TypeScript type inference on the returned builder.

      +

    Returns JsonSchemaNodeToBuilder<S>

    A @cleverbrush/schema builder whose static type mirrors the +structure described by the JSON Schema node.

    +

    as const is required for precise TypeScript inference. Without it +TypeScript widens string literals to string and the inferred builder +type collapses to SchemaBuilder<unknown>. Always pass the schema literal +(or the variable holding it) with as const.

    +

    Supported JSON Schema keywords

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeywordBuilder equivalent
    type: 'string'string()
    type: 'number'number()
    type: 'integer'number() (integer flag)
    type: 'boolean'boolean()
    type: 'null'SchemaBuilder<null>
    type: 'array' + itemsarray(itemBuilder)
    type: 'object' + propertiesobject({ … })
    required: […]required / optional per-prop
    additionalProperties: true.acceptUnknownProps()
    conststring/number/boolean eq
    enumunion(…)
    anyOfunion(…)
    minLength / maxLength.minLength() / .maxLength()
    pattern.matches(regex) (invalid patterns silently ignored)
    minimum / maximum.min() / .max()
    exclusiveMinimum / exclusiveMaximumcustom validator (not round-trippable via toJsonSchema)
    multipleOf.multipleOf()
    minItems / maxItems.minLength() / .maxLength()
    format: 'email'.email() extension
    format: 'uuid'.uuid() extension
    format: 'uri' / 'url'.url() extension
    format: 'ipv4'.ip({ version: 'v4' })
    format: 'ipv6'.ip({ version: 'v6' })
    format: 'date-time'.matches(iso8601 regex)
    +

    Keywords not supported: $ref, $defs, if/then/else, not, +contains, unevaluatedProperties, contentEncoding.

    +
    import { fromJsonSchema } from '@cleverbrush/schema-json';

    const schema = fromJsonSchema({
    type: 'object',
    properties: {
    name: { type: 'string', minLength: 1 },
    score: { type: 'number', minimum: 0, maximum: 100 },
    },
    required: ['name'],
    } as const);

    schema.parse({ name: 'Alice', score: 95 });
    // TypeScript infers: { name: string; score?: number } +
    + +
    // Union types via `enum`
    const statusSchema = fromJsonSchema({
    enum: ['active', 'inactive', 'pending']
    } as const);

    statusSchema.parse('active'); // valid — 'active' | 'inactive' | 'pending' +
    + +
    // Use InferFromJsonSchema to derive the TypeScript type statically
    import type { InferFromJsonSchema } from '@cleverbrush/schema-json';

    const S = { type: 'object', properties: { id: { type: 'integer' } }, required: ['id'] } as const;
    type Payload = InferFromJsonSchema<typeof S>; // { id: number }
    const payloadSchema = fromJsonSchema(S); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.toJsonSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.toJsonSchema.html new file mode 100644 index 00000000..e0be6ae7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.toJsonSchema.html @@ -0,0 +1,29 @@ +toJsonSchema | Libraries
  • Converts a @cleverbrush/schema builder to a JSON Schema object.

    +

    Parameters

    Returns Record<string, unknown>

    A plain JSON-serialisable object representing the schema.

    +

    What round-trips cleanly: all declarative constraints — type, format, +minLength/maxLength, minimum/maximum, multipleOf, pattern, required/optional +per property, additionalProperties, items, enum/const literals, anyOf/union.

    +

    What is silently omitted:

    +
      +
    • Custom validators added via addValidator (no JSON Schema equivalent)
    • +
    • Preprocessors added via addPreprocessor
    • +
    • JSDoc comments on schema properties
    • +
    • exclusiveMinimum/exclusiveMaximum constraints from fromJsonSchema +(stored as custom validators — not introspectable; only positive()/ +negative() extension-based exclusives are emitted)
    • +
    • IP format with both v4 and v6 allowed simultaneously (no single +standard JSON Schema format covers both; the format keyword is omitted +in that case)
    • +
    +

    By default the output includes a $schema header for JSON Schema Draft +2020-12. Pass { $schema: false } when embedding the result in an OpenAPI +specification, or { draft: '07' } for Draft 07 compatibility.

    +
    import { toJsonSchema } from '@cleverbrush/schema-json';
    import { object, string, number } from '@cleverbrush/schema';

    const UserSchema = object({
    name: string().minLength(1),
    email: string().email(),
    age: number().optional(),
    });

    const spec = toJsonSchema(UserSchema);
    // {
    // "$schema": "https://json-schema.org/draft/2020-12/schema",
    // "type": "object",
    // "properties": {
    // "name": { "type": "string", "minLength": 1 },
    // "email": { "type": "string", "format": "email" },
    // "age": { "type": "number" }
    // },
    // "required": ["name", "email"]
    // } +
    + +
    // Embed in an OpenAPI spec (strip the $schema header)
    toJsonSchema(schema, { $schema: false });

    // Use JSON Schema Draft 07
    toJsonSchema(schema, { draft: '07' }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.withStandardJsonSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.withStandardJsonSchema.html new file mode 100644 index 00000000..7b776af1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema-json.withStandardJsonSchema.html @@ -0,0 +1,14 @@ +withStandardJsonSchema | Libraries

Function withStandardJsonSchema

  • Wraps a @cleverbrush/schema builder with the +Standard JSON Schema v1 interface.

    +

    The returned schema object's ~standard property is enriched with a +jsonSchema converter. Because @cleverbrush/schema does not +distinguish between input and output types, both input() and output() +produce the same JSON Schema document.

    +

    Note: this mutates the schema instance by overriding the ~standard +property. The returned reference is the same schema object.

    +

    Type Parameters

    Parameters

    • schema: T

      Any @cleverbrush/schema builder instance.

      +

    Returns T & StandardJSONSchemaV1<unknown, unknown>

    The same schema instance, now also conforming to StandardJSONSchemaV1.

    +
    import { object, string, number } from '@cleverbrush/schema';
    import { withStandardJsonSchema } from '@cleverbrush/schema-json';

    const schema = object({ name: string(), age: number().optional() });
    const wrapped = withStandardJsonSchema(schema);

    // Access standard JSON Schema properties
    wrapped['~standard'].jsonSchema.input({ target: 'draft-2020-12' });
    wrapped['~standard'].jsonSchema.output({ target: 'draft-07' }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.defineExtension.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.defineExtension.html new file mode 100644 index 00000000..07e92f4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.defineExtension.html @@ -0,0 +1,49 @@ +defineExtension | Libraries

Function defineExtension

  • Defines an extension targeting one or more schema builder types.

    +

    Each extension is a plain object keyed by builder type name ("string", +"number", "date", …) whose values are method implementations. +Methods receive this bound to the builder instance and must return a +builder to support fluent chaining.

    + +

    Extension methods do not have to call this.withExtension(). The +system wraps each method and automatically attaches +withExtension(methodName, args) to the returned builder when the key +is not already present. This eliminates the most common source of +duplication in extension code.

    +
      +
    • Zero-arg methods → metadata value is true
    • +
    • Single-arg methods → metadata value is the argument itself
    • +
    • Multi-arg methods → metadata value is the arguments array
    • +
    +

    If you need custom metadata (e.g. a different key, a transformed +value, or a structured object), call this.withExtension(key, value) +explicitly inside the method — the auto-infer logic detects the existing +key and skips automatic attachment.

    + +

    defineExtension validates the configuration eagerly:

    +
      +
    • Unknown builder type names throw immediately.
    • +
    • RESERVED_METHODS | Reserved method names (e.g. validate, +introspect) cannot be overridden.
    • +
    • Non-function values in the method record are rejected.
    • +
    +

    Type Parameters

    Parameters

    • config: T

      An ExtensionConfig object mapping builder type +names to method records.

      +

    Returns ExtensionDescriptor<T>

    A branded ExtensionDescriptor ready to pass to +withExtensions.

    +
    const slugExt = defineExtension({
    string: {
    slug(this: StringSchemaBuilder) {
    return this.addValidator((val) => {
    const valid = /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(val);
    return { valid, errors: valid ? [] : [{ message: 'invalid slug' }] };
    });
    }
    }
    });

    // Usage:
    const s = withExtensions(slugExt);
    const schema = s.string().slug();
    schema.introspect().extensions.slug; // true +
    + +
    const currencyExt = defineExtension({
    number: {
    currency(this: NumberSchemaBuilder, opts?: { maxDecimals?: number }) {
    const maxDec = opts?.maxDecimals ?? 2;
    return this.withExtension('currency', { maxDecimals: maxDec })
    .min(0)
    .addValidator((val) => {
    const decimals = (String(val).split('.')[1] ?? '').length;
    const valid = decimals <= maxDec;
    return { valid, errors: valid ? [] : [{ message: `max ${maxDec} decimals` }] };
    });
    }
    }
    }); +
    + +
    const myExt = defineExtension({
    string: {
    email(this: StringSchemaBuilder) { return this.addValidator(...); }
    },
    number: {
    port(this: NumberSchemaBuilder) { return this.isInteger().min(1).max(65535); }
    }
    }); +
    + +

    If a builder type name is unknown.

    +

    If a method name is reserved.

    +

    If a method value is not a function.

    +
    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.enumOf.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.enumOf.html new file mode 100644 index 00000000..4a4ddf1b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.enumOf.html @@ -0,0 +1,33 @@ +enumOf | Libraries
  • Creates a string schema constrained to the given literal values.

    +

    Convenience factory equivalent to string().oneOf(...values). +Mirrors Zod's z.enum(['admin', 'user', 'guest']) API.

    +

    Rest-params form (no custom error message):

    +
    const Role = enumOf('admin', 'user', 'guest');
    +
    + +

    Array form (with optional custom error message):

    +
    const Role = enumOf(['admin', 'user', 'guest'], 'Invalid role');
    const Role2 = enumOf(['admin', 'user'], (val) => `"${val}" is not a valid role`); +
    + +

    Type Parameters

    • const T extends string

    Parameters

    • ...values: [T, ...T[]]

      the allowed string literals (at least one required)

      +

    Returns ExtendedString<T>

    a typed StringSchemaBuilder that only accepts the given values

    +
    import { enumOf, InferType } from '@cleverbrush/schema';

    const Role = enumOf('admin', 'user', 'guest');
    type Role = InferType<typeof Role>; // 'admin' | 'user' | 'guest'

    Role.validate('admin'); // valid
    Role.validate('other'); // invalid +
    + +
  • Creates a string schema constrained to the given literal values.

    +

    Convenience factory equivalent to string().oneOf(...values). +Mirrors Zod's z.enum(['admin', 'user', 'guest']) API.

    +

    Rest-params form (no custom error message):

    +
    const Role = enumOf('admin', 'user', 'guest');
    +
    + +

    Array form (with optional custom error message):

    +
    const Role = enumOf(['admin', 'user', 'guest'], 'Invalid role');
    const Role2 = enumOf(['admin', 'user'], (val) => `"${val}" is not a valid role`); +
    + +

    Type Parameters

    • const T extends string

    Parameters

    Returns ExtendedString<T>

    a typed StringSchemaBuilder that only accepts the given values

    +
    import { enumOf, InferType } from '@cleverbrush/schema';

    const Role = enumOf('admin', 'user', 'guest');
    type Role = InferType<typeof Role>; // 'admin' | 'user' | 'guest'

    Role.validate('admin'); // valid
    Role.validate('other'); // invalid +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.extern.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.extern.html new file mode 100644 index 00000000..c8ad3ef5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.extern.html @@ -0,0 +1,19 @@ +extern | Libraries
  • Wraps an external Standard Schema v1 +compatible schema into a @cleverbrush/schema builder.

    +

    This enables cross-library schema composition — use schemas from Zod, +Valibot, ArkType, or any Standard Schema v1 compliant library as +properties inside @cleverbrush/schema object schemas with full type +inference.

    +

    Type Parameters

    Parameters

    • standardSchema: T

      A Standard Schema v1 compliant schema instance +(any object that exposes a ['~standard'] property with version: 1 +and a validate function).

      +

    Returns ExternSchemaBuilder<
        T,
        true,
        false,
        undefined,
        false,
        {},
        StandardSchemaV1.InferOutput<T>,
    >

    import { z } from 'zod';
    import { object, date, extern, InferType } from '@cleverbrush/schema';

    const zodUser = z.object({ first: z.string(), last: z.string() });

    const order = object({
    user: extern(zodUser),
    date: date(),
    });

    type Order = InferType<typeof order>;
    // { user: { first: string; last: string }; date: Date }

    order.validate({
    user: { first: 'Alice', last: 'Smith' },
    date: new Date(),
    }); // { valid: true, object: { user: …, date: … } } +
    + +
    // Optional external schema
    const schema = extern(zodUser).optional();
    schema.validate(undefined); // valid +
    + +
    // Inside an array
    import { array, extern } from '@cleverbrush/schema';
    const users = array(extern(zodUser)); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.generic.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.generic.html new file mode 100644 index 00000000..241b3b14 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.generic.html @@ -0,0 +1,57 @@ +generic | Libraries
  • Creates a generic schema template — a reusable, parameterized schema factory +whose TypeScript type is inferred from the template function's generic +signature.

    +

    Call .apply() on the returned builder +to instantiate the template with concrete schema arguments and receive a +fully typed concrete schema.

    +

    There are two overloads:

    +
      +
    1. generic(templateFn) — Provide only the template function. The +template must be called via .apply() before validation.
    2. +
    3. generic(defaults, templateFn) — Provide positional default arguments +followed by the template function. The template can be validated directly +using those defaults (without calling .apply() first).
    4. +
    +

    Type Parameters

    • TFn extends (...args: any[]) => SchemaBuilder<any, any, any, any, any>

    Parameters

    • templateFn: TFn

      A (generic) function that accepts schema arguments and +returns a concrete schema. TypeScript infers the result type from this +function's generic signature when .apply() is called.

      +

    Returns GenericSchemaBuilder<TFn, true, false, undefined, false, {}>

    A new GenericSchemaBuilder with isRequired set to true.

    +
    import { generic, object, array, number, string, any, InferType } from '@cleverbrush/schema';

    const PaginatedList = generic(
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number(), page: number() })
    );

    const UserList = PaginatedList.apply(object({ name: string() }));
    type UserListType = InferType<typeof UserList>;
    // → { items: { name: string }[]; total: number; page: number }

    UserList.validate({ items: [{ name: 'Alice' }], total: 1, page: 1 }); // valid +
    + +
    const Result = generic(
    <T extends SchemaBuilder<any, any, any, any, any>,
    E extends SchemaBuilder<any, any, any, any, any>>(
    valueSchema: T,
    errorSchema: E
    ) =>
    union(
    object({ ok: boolean().equalsTo(true), value: valueSchema }),
    object({ ok: boolean().equalsTo(false), error: errorSchema })
    )
    );

    const StringResult = Result.apply(string(), number()); +
    + +
    const AnyList = generic(
    [any()], // default args — positional, one per template parameter
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number() })
    );

    // Validate directly — uses the default any() schema:
    AnyList.validate({ items: [1, 'two'], total: 2 }); // valid

    // Or apply concrete schemas first:
    AnyList.apply(string()).validate({ items: ['x'], total: 1 }); // valid +
    + +
  • Creates a generic schema template — a reusable, parameterized schema factory +whose TypeScript type is inferred from the template function's generic +signature.

    +

    Call .apply() on the returned builder +to instantiate the template with concrete schema arguments and receive a +fully typed concrete schema.

    +

    There are two overloads:

    +
      +
    1. generic(templateFn) — Provide only the template function. The +template must be called via .apply() before validation.
    2. +
    3. generic(defaults, templateFn) — Provide positional default arguments +followed by the template function. The template can be validated directly +using those defaults (without calling .apply() first).
    4. +
    +

    Type Parameters

    • TFn extends (...args: any[]) => SchemaBuilder<any, any, any, any, any>

    Parameters

    • defaults: readonly any[]
    • templateFn: TFn

      A (generic) function that accepts schema arguments and +returns a concrete schema. TypeScript infers the result type from this +function's generic signature when .apply() is called.

      +

    Returns GenericSchemaBuilder<TFn, true, false, undefined, false, {}>

    A new GenericSchemaBuilder with isRequired set to true.

    +
    import { generic, object, array, number, string, any, InferType } from '@cleverbrush/schema';

    const PaginatedList = generic(
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number(), page: number() })
    );

    const UserList = PaginatedList.apply(object({ name: string() }));
    type UserListType = InferType<typeof UserList>;
    // → { items: { name: string }[]; total: number; page: number }

    UserList.validate({ items: [{ name: 'Alice' }], total: 1, page: 1 }); // valid +
    + +
    const Result = generic(
    <T extends SchemaBuilder<any, any, any, any, any>,
    E extends SchemaBuilder<any, any, any, any, any>>(
    valueSchema: T,
    errorSchema: E
    ) =>
    union(
    object({ ok: boolean().equalsTo(true), value: valueSchema }),
    object({ ok: boolean().equalsTo(false), error: errorSchema })
    )
    );

    const StringResult = Result.apply(string(), number()); +
    + +
    const AnyList = generic(
    [any()], // default args — positional, one per template parameter
    <T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
    object({ items: array(itemSchema), total: number() })
    );

    // Validate directly — uses the default any() schema:
    AnyList.validate({ items: [1, 'two'], total: 2 }); // valid

    // Or apply concrete schemas first:
    AnyList.apply(string()).validate({ items: ['x'], total: 1 }); // valid +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.intersection.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.intersection.html new file mode 100644 index 00000000..e9d5a41f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.intersection.html @@ -0,0 +1,8 @@ +intersection | Libraries

Function intersection

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.lazy.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.lazy.html new file mode 100644 index 00000000..3cf4e0e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.lazy.html @@ -0,0 +1,13 @@ +lazy | Libraries
  • Creates a lazy schema that defers the schema definition until first validation. +Use this to define recursive/self-referential schemas.

    +

    The getter function is called once on first use and the result is cached. +You must provide an explicit TypeScript type annotation on the variable +holding the outer schema — TypeScript cannot infer recursive types automatically.

    +

    Type Parameters

    • TResult

    Parameters

    • getter: () => SchemaBuilder<TResult, any, any>

      A function that returns the schema to use for validation.

      +

    Returns LazySchemaBuilder<TResult, true, false, false, {}>

    // Tree structure
    type TreeNode = { value: number; children: TreeNode[] };

    const treeNode: SchemaBuilder<TreeNode, true> = object({
    value: number(),
    children: array(lazy(() => treeNode))
    }); +
    + +
    // Optional recursive field (submenu)
    type MenuItem = { label: string; submenu?: MenuItem[] };

    const menuItem: SchemaBuilder<MenuItem, true> = object({
    label: string(),
    submenu: array(lazy(() => menuItem)).optional()
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.nul.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.nul.html new file mode 100644 index 00000000..ce3abdc9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.nul.html @@ -0,0 +1,13 @@ +nul | Libraries
  • Creates a schema that validates the value is exactly null.

    +

    By default the schema is required — only null is accepted. +Call .optional() to also allow undefined.

    +

    Returns NullSchemaBuilder<true, false, undefined, false, {}>

    import { nul } from '@cleverbrush/schema';

    nul().validate(null); // { valid: true, object: null }
    nul().validate(undefined); // { valid: false }
    nul().validate(0); // { valid: false } +
    + +
    nul().optional().validate(null);       // { valid: true, object: null }
    nul().optional().validate(undefined); // { valid: true, object: undefined }
    nul().optional().validate(false); // { valid: false } +
    + +
    // Nullable field in an object schema
    import { object, string, nul, union, InferType } from '@cleverbrush/schema';

    const Schema = object({
    name: string(),
    deleted: union(nul()).or(string()), // null | string
    });

    type T = InferType<typeof Schema>;
    // { name: string; deleted: null | string } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.parseString.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.parseString.html new file mode 100644 index 00000000..8555ba0b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.parseString.html @@ -0,0 +1,18 @@ +parseString | Libraries

Function parseString

  • Creates a parse-string schema that validates a string against a +template pattern and parses it into a strongly-typed object.

    +

    The first argument defines the result shape via object(...), and the +second argument is a callback receiving a typed $template tagged-template +function whose template expressions are type-safe property selectors.

    +

    Type Parameters

    Parameters

    • objectSchema: TSchema

      An ObjectSchemaBuilder defining the result type and +per-property validation schemas.

      +
    • templateBuilder: ($template: ParseStringTemplateTag<TSchema>) => ParseStringTemplateDefinition

      Callback receiving the typed $template +tagged-template function. Must return the result of invoking $template.

      +

    Returns ParseStringSchemaBuilder<InferType<TSchema>>

    A ParseStringSchemaBuilder whose validate() accepts a +string and whose InferType is the object schema's inferred type.

    +
    const RouteSchema = parseString(
    object({
    userId: string().uuid(),
    id: number()
    }),
    $t => $t`/orders/${t => t.id}/${t => t.userId}`
    );

    const result = RouteSchema.validate('/orders/42/550e8400-e29b-41d4-a716-446655440000');
    // result.valid === true
    // result.object === { id: 42, userId: '550e8400-e29b-41d4-a716-446655440000' }

    type Route = InferType<typeof RouteSchema>;
    // { id: number; userId: string } +
    + +
    const schema = parseString(
    object({
    order: object({ id: number() }),
    user: object({ name: string() })
    }),
    $t => $t`/orders/${t => t.order.id}/by/${t => t.user.name}`
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.withExtensions.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.withExtensions.html new file mode 100644 index 00000000..9a970dcb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_schema.withExtensions.html @@ -0,0 +1,40 @@ +withExtensions | Libraries

Function withExtensions

  • Creates a set of schema factory functions with the provided extensions +applied.

    +

    Each factory function (string(), number(), date(), …) returned by +withExtensions produces builder instances whose prototypes include the +extension methods. All built-in builder methods remain available and +fully chainable alongside the new ones.

    + +

    Pass any number of ExtensionDescriptors — their methods are +merged per builder type. If two extensions define the same method +name on the same builder type, a runtime error is thrown to prevent +silent conflicts.

    + +

    The return type is fully inferred: TypeScript knows exactly which +extension methods are available on each builder factory. Extension +methods return the full extended builder type, so chaining like +s.string().email().slug().minLength(3) is fully typed.

    + +

    Builders that have no methods from any of the provided extensions +use the standard (unextended) factory, so there is zero overhead.

    +

    Type Parameters

    Parameters

    Returns WithExtensionsResult<TExts>

    An object with factory functions for all builder types +(string, number, boolean, date, object, array, union, +func, any), each returning augmented builders.

    +
    const s = withExtensions(emailExt, rangeExt);

    // string() now has .email()
    const emailSchema = s.string().email().minLength(5);

    // number() now has .range()
    const rangeSchema = s.number().range(0, 100);

    // builders without targeted extensions work as normal
    const dateSchema = s.date(); +
    + +
    const s = withExtensions(emailExt, slugExt, trimmedExt);
    const schema = s.string().email().slug().trimmed(); +
    + +
    const s = withExtensions(emailExt, portExt);
    const ServerConfig = s.object({
    host: s.string().email(),
    port: s.number().port()
    }); +
    + +

    If two extensions define the same method name on the +same builder type.

    +
    +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.convertSchema.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.convertSchema.html new file mode 100644 index 00000000..2bf861a9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.convertSchema.html @@ -0,0 +1,9 @@ +convertSchema | Libraries
  • Converts a @cleverbrush/schema builder to a JSON Schema object suitable +for embedding in an OpenAPI 3.1 spec (no $schema header, Draft 2020-12).

    +

    Returns an empty schema {} when the input is null or undefined.

    +

    When a SchemaRegistry or a custom resolver function is provided, any +schema instance that resolves to a name will be emitted as a +$ref: '#/components/schemas/<name>' pointer instead of being inlined.

    +

    Parameters

    • schema: SchemaBuilder<any, any, any, any, any> | null | undefined

      The schema to convert, or null/undefined.

      +
    • Optionalregistry: SchemaRegistry | NameResolver

      Optional registry or resolver function for $ref deduplication.

      +

    Returns Record<string, unknown>

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.createOpenApiEndpoint.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.createOpenApiEndpoint.html new file mode 100644 index 00000000..a174dfa0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.createOpenApiEndpoint.html @@ -0,0 +1,7 @@ +createOpenApiEndpoint | Libraries
  • Creates an endpoint definition and handler that serves the OpenAPI spec +as JSON. Register it with builder.handle(ep, handler).

    +

    The spec is lazily generated on first request and cached.

    +

    Parameters

    Returns { endpoint: EndpointBuilder<unknown>; handler: () => OpenApiDocument }

    const { endpoint: openApiEp, handler } = createOpenApiEndpoint({
    server,
    info: { title: 'My API', version: '1.0.0' }
    });
    server.handle(openApiEp, handler); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.generateAsyncApiSpec.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.generateAsyncApiSpec.html new file mode 100644 index 00000000..80c0ddc7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.generateAsyncApiSpec.html @@ -0,0 +1,17 @@ +generateAsyncApiSpec | Libraries
  • Generates an AsyncAPI 3.0 document from a set of WebSocket subscription +registrations.

    +

    Each subscription becomes:

    +
      +
    • A channel with its address and optional messages (for outgoing +server→client events and/or incoming client→server messages).
    • +
    • One or two operations: a send operation for server→client events +and/or a receive operation for client→server messages.
    • +
    +

    Named schemas (those with .schemaName() set) are automatically collected +and emitted as components.schemas entries with $ref pointers.

    +

    Parameters

    • options: AsyncApiOptions

      Configuration including subscription registrations and API info.

      +

    Returns AsyncApiDocument

    A plain AsyncAPI 3.0 document object suitable for JSON.stringify.

    +
    import { generateAsyncApiSpec } from '@cleverbrush/server-openapi';
    import { server } from './server.js';

    const spec = generateAsyncApiSpec({
    server,
    info: { title: 'My API', version: '1.0.0' },
    servers: {
    production: { host: 'api.example.com', protocol: 'wss' },
    },
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.generateOpenApiSpec.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.generateOpenApiSpec.html new file mode 100644 index 00000000..040b0bb5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.generateOpenApiSpec.html @@ -0,0 +1,2 @@ +generateOpenApiSpec | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.mapOperationSecurity.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.mapOperationSecurity.html new file mode 100644 index 00000000..8e1b30ee --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.mapOperationSecurity.html @@ -0,0 +1,7 @@ +mapOperationSecurity | Libraries
  • Map endpoint authRoles to an OpenAPI operation-level security array.

    +
      +
    • null → empty array (public endpoint, no security)
    • +
    • [][{ <schemeName>: [] }] (any authenticated user)
    • +
    • ['admin'][{ <schemeName>: ['admin'] }] (require specific roles)
    • +
    +

    Parameters

    • authRoles: readonly string[] | null
    • securitySchemeNames: string[]

    Returns Record<string, string[]>[]

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.mapSecuritySchemes.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.mapSecuritySchemes.html new file mode 100644 index 00000000..33871810 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.mapSecuritySchemes.html @@ -0,0 +1,2 @@ +mapSecuritySchemes | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.resolvePath.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.resolvePath.html new file mode 100644 index 00000000..65253cf8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.resolvePath.html @@ -0,0 +1,3 @@ +resolvePath | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.serveAsyncApi.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.serveAsyncApi.html new file mode 100644 index 00000000..8d9b7d19 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.serveAsyncApi.html @@ -0,0 +1,8 @@ +serveAsyncApi | Libraries
  • Returns a server middleware that serves the AsyncAPI 3.0 spec as JSON at +the configured path (default: /asyncapi.json).

    +

    The spec is lazily generated on the first request and cached for subsequent +requests.

    +

    Parameters

    Returns (context: RequestContext, next: () => Promise<void>) => Promise<void>

    import { serveAsyncApi } from '@cleverbrush/server-openapi';

    server.use(
    serveAsyncApi({
    server,
    info: { title: 'My API', version: '1.0.0' },
    servers: {
    production: { host: 'api.example.com', protocol: 'wss' },
    },
    })
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.serveOpenApi.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.serveOpenApi.html new file mode 100644 index 00000000..fb5b23d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.serveOpenApi.html @@ -0,0 +1,4 @@ +serveOpenApi | Libraries
  • Returns a server middleware that serves the OpenAPI spec as JSON at +the configured path (default: /openapi.json).

    +

    The spec is lazily generated on first request and cached.

    +

    Parameters

    Returns (context: RequestContext, next: () => Promise<void>) => Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.walkSchemas.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.walkSchemas.html new file mode 100644 index 00000000..d64f3fd5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.walkSchemas.html @@ -0,0 +1,15 @@ +walkSchemas | Libraries
  • Recursively visits every SchemaBuilder reachable from schema and +calls SchemaRegistry.register on each node.

    +

    Cycle detection is performed via a visited Set of object references, so +schemas may safely be shared across multiple branches without causing +infinite recursion.

    +

    Excluded schema types

    +
      +
    • lazy — deferred resolution would require calling the getter, which may +itself reference the parent schema; lazy schemas are handled separately.
    • +
    +

    Parameters

    • schema: SchemaBuilder<any, any, any>

      Root schema to start the walk from.

      +
    • registry: SchemaRegistry

      Registry to register named schemas into.

      +
    • visited: Set<SchemaBuilder<any, any, any, false, {}>> = ...

      Shared set for cycle detection; pass a new Set() for the +top-level call.

      +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.writeOpenApiSpec.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.writeOpenApiSpec.html new file mode 100644 index 00000000..2a7b6363 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server-openapi.writeOpenApiSpec.html @@ -0,0 +1,8 @@ +writeOpenApiSpec | Libraries
  • Generate an OpenAPI spec and write it to a file.

    +

    Parameters

    • options: OpenApiOptions

      Same options as generateOpenApiSpec().

      +
    • outputPath: string

      File path to write the JSON spec to.

      +

    Returns OpenApiDocument

    The generated spec document.

    +
    import { writeOpenApiSpec } from '@cleverbrush/server-openapi';
    import { createServer, endpoint } from '@cleverbrush/server';

    const builder = createServer()
    .handle(endpoint.get('/api/health'), () => ({ ok: true }));

    writeOpenApiSpec(
    {
    registrations: builder.getRegistrations(),
    info: { title: 'My API', version: '1.0.0' }
    },
    './openapi.json'
    ); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..cacheResponse.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..cacheResponse.html new file mode 100644 index 00000000..61c2cde1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..cacheResponse.html @@ -0,0 +1,18 @@ +cacheResponse | Libraries

Function cacheResponse

  • Server-side cache response middleware.

    +

    Uses cache-tag definitions from the matched endpoint (already available +on ctx.items.__endpoint_meta.cacheTags) to compute deterministic cache +keys from request data (params, query, body, headers).

    +
      +
    • GET: Computes cache key → serves cached response if valid → +handler never executes. On cache miss, runs the handler and caches +the response.
    • +
    • Mutation (POST/PUT/PATCH/DELETE): Lets the handler run, then +invalidates all cache entries whose key starts with any of the +endpoint's cache tag names.
    • +
    +

    Parameters

    Returns Middleware

    A server-side Middleware.

    +
    server.handle(ListTodos, listHandler, {
    middlewares: [cacheResponse({ defaultTtl: 30_000 })]
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..computeCacheKey.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..computeCacheKey.html new file mode 100644 index 00000000..224d401c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..computeCacheKey.html @@ -0,0 +1,10 @@ +computeCacheKey | Libraries

Function computeCacheKey

  • Computes a deterministic cache key from a tag definition and live +request data.

    +
      +
    • Simple tags (no properties) produce just the tag name.
    • +
    • Tags with properties produce name:key1=val1,key2=val2 where +keys are sorted alphabetically for determinism.
    • +
    +

    Properties whose getValue returns success: false are skipped +(their value is not included in the key).

    +

    Parameters

    • tag: CacheTagDefinition
    • root: {
          body: unknown;
          headers: Record<string, string>;
          params: Record<string, unknown>;
          query: Record<string, unknown>;
      }

    Returns string

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createCacheTagTree.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createCacheTagTree.html new file mode 100644 index 00000000..8b7ea1ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createCacheTagTree.html @@ -0,0 +1,8 @@ +createCacheTagTree | Libraries

Function createCacheTagTree

  • Builds a synthetic object({ params, body, query, headers }) schema +from the endpoint's schema definitions and returns its +PropertyDescriptorTree so callers can write type-safe selectors like:

    +
    endpoint.cacheTag('todo', p => ({
    id: p.query.id,
    fromBodyId: p.body.id
    })) +
    + +

    Only non-null schemas are included in the synthetic schema.

    +

    Parameters

    • schemas: {
          bodySchema?: SchemaBuilder<any, any, any, any, any> | null;
          headerSchema?:
              | ObjectSchemaBuilder<any, any, any, any, any, any, any>
              | null;
          paramsSchema?: SchemaBuilder<any, any, any, any, any> | null;
          querySchema?: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
      }

    Returns any

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createEndpoints.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createEndpoints.html new file mode 100644 index 00000000..1cf2a1ef --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createEndpoints.html @@ -0,0 +1,7 @@ +createEndpoints | Libraries

Function createEndpoints

  • Create a role-constrained endpoint factory. Roles are defined as a plain +as const object whose values become the string-literal union accepted +by authorize().

    +

    Type Parameters

    • const T extends Record<string, string>

    Parameters

    • _roles: T

    Returns EndpointFactory<T[keyof T]>

    const Roles = { admin: 'admin', editor: 'editor' } as const;
    const ep = createEndpoints(Roles);
    ep.get('/api/admin').authorize(IPrincipal, 'admin'); // ✓
    ep.get('/api/admin').authorize(IPrincipal, 'typo'); // ✗ type error +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createProblemDetails.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createProblemDetails.html new file mode 100644 index 00000000..1c427f28 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createProblemDetails.html @@ -0,0 +1,7 @@ +createProblemDetails | Libraries

Function createProblemDetails

  • Create a ProblemDetails object for the given HTTP status code.

    +

    Parameters

    • status: number

      HTTP status code (e.g. 400, 404, 500).

      +
    • Optionaltitle: string

      Short, human-readable summary. Defaults to a standard phrase +for common status codes.

      +
    • Optionaldetail: string

      Longer explanation specific to this occurrence.

      +
    • Optionalextensions: Record<string, unknown>

      Extra fields merged into the object (RFC 9457 §3.1).

      +

    Returns ProblemDetails

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createServer.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createServer.html new file mode 100644 index 00000000..0690a250 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createServer.html @@ -0,0 +1 @@ +createServer | Libraries

Function createServer

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createValidationProblemDetails.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createValidationProblemDetails.html new file mode 100644 index 00000000..ae54e590 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..createValidationProblemDetails.html @@ -0,0 +1,4 @@ +createValidationProblemDetails | Libraries

Function createValidationProblemDetails

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..defineWebhook.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..defineWebhook.html new file mode 100644 index 00000000..be08b8d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..defineWebhook.html @@ -0,0 +1,4 @@ +defineWebhook | Libraries

Function defineWebhook

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..idempotency.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..idempotency.html new file mode 100644 index 00000000..8b0a7a7b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..idempotency.html @@ -0,0 +1,12 @@ +idempotency | Libraries

Function idempotency

  • Server-side idempotency middleware.

    +

    Reads the x-idempotency-key header from mutating requests. If a +response has already been stored for that key, it is returned +immediately — the handler is never called. Otherwise the handler +executes and its response is stored for future replays.

    +

    GET, HEAD, and OPTIONS requests pass through without checking.

    +

    Parameters

    Returns Middleware

    A server-side Middleware.

    +
    server.handle(CreateTodo, createHandler, {
    middlewares: [idempotency({ ttl: 86_400_000 })]
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..mapHandlers.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..mapHandlers.html new file mode 100644 index 00000000..b95168b4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..mapHandlers.html @@ -0,0 +1,15 @@ +mapHandlers | Libraries

Function mapHandlers

  • Binds a complete set of endpoint builders to their handlers with +compile-time exhaustiveness checking.

    +

    TypeScript will report an error if any endpoint in endpoints is +missing from handlers, or if a handler's signature does not match +its endpoint. This is analogous to how @cleverbrush/mapper tracks +unmapped properties at the type level.

    +

    Type Parameters

    • TEndpoints extends Record<string, Record<string, AnyEndpoint | AnySubscriptionBuilder>>

    Parameters

    • endpoints: TEndpoints

      A grouped object of extended endpoint builders +(e.g. after .authorize() / .inject()).

      +
    • handlers: HandlerMap<TEndpoints>

      A matching grouped object of handler functions or +{ handler, middlewares } entries.

      +

    Returns HandlerMapping

    A HandlerMapping to pass to ServerBuilder.handleAll().

    +
    const mapping = mapHandlers(endpoints, {
    auth: {
    register: registerHandler,
    login: loginHandler,
    },
    todos: {
    list: listTodosHandler,
    create: createTodoHandler,
    export: { handler: exportHandler, middlewares: [auditLog] },
    },
    });

    server.handleAll(mapping); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..route.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..route.html new file mode 100644 index 00000000..39aa202e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..route.html @@ -0,0 +1,12 @@ +route | Libraries

Concise shorthand for defining a typed path template.

+
const TodoById = route({ id: number().coerce() })`/${t => t.id}`;
+
+ +
const Path = route`/some/path`;
// or
const Path = route()`/some/path`; +
+ +

Either a property map for typed path segments, +or a TemplateStringsArray when used directly as a tagged template.

+

A ParseStringSchemaBuilder, or a tagged-template function +that produces one.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..serializeTag.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..serializeTag.html new file mode 100644 index 00000000..cbfc63c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..serializeTag.html @@ -0,0 +1,7 @@ +serializeTag | Libraries

Function serializeTag

diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..tracked.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..tracked.html new file mode 100644 index 00000000..1abd67ae --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server..tracked.html @@ -0,0 +1,11 @@ +tracked | Libraries
  • Wrap a server-sent event with a unique ID for resumable subscriptions.

    +

    When a handler yields a TrackedEvent, the server sends the event with its +ID. If the client disconnects and reconnects with the last received ID, +the handler can skip already-delivered events.

    +

    Type Parameters

    • T

    Parameters

    • id: string

      A unique, monotonically increasing identifier for this event.

      +
    • data: T

      The event payload to send to the client.

      +

    Returns TrackedEvent<T>

    A TrackedEvent wrapper.

    +
    async function* handler({ incoming }) {
    yield tracked('evt-1', { message: 'Hello' });
    yield tracked('evt-2', { message: 'World' });
    } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.defineApi.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.defineApi.html new file mode 100644 index 00000000..571b3d3f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.defineApi.html @@ -0,0 +1,17 @@ +defineApi | Libraries
  • Defines a typed API contract with one level of grouping.

    +

    The returned object is the single source of truth for both server and +client. The server imports it and extends each endpoint with +.authorize(), .inject(), and OpenAPI metadata. The client passes it +to createClient() from @cleverbrush/client to obtain a fully typed HTTP +client.

    +

    At runtime the contract (and each group within it) is frozen with +Object.freeze to prevent accidental mutation — endpoint builders are +immutable by design, so every .body() / .query() / etc. call already +returns a new builder.

    +

    Type Parameters

    • T extends ApiContract

      The exact shape of the contract, inferred from the argument.

      +

    Parameters

    • contract: T

      A record of named groups, each containing named endpoints.

      +

    Returns Readonly<T>

    The same object, frozen and typed as Readonly<T>.

    +
    import { defineApi, endpoint, route } from '@cleverbrush/server/contract';
    import { array, number, object, string } from '@cleverbrush/schema';

    const TodoSchema = object({ id: number(), title: string(), completed: boolean() });
    const todosResource = endpoint.resource('/api/todos');
    const ById = route({ id: number().coerce() })`/${t => t.id}`;

    export const api = defineApi({
    todos: {
    list: todosResource.get()
    .query(object({ page: number().optional(), limit: number().optional() }))
    .responses({ 200: array(TodoSchema) }),
    get: todosResource.get(ById)
    .responses({ 200: TodoSchema }),
    create: todosResource.post()
    .body(object({ title: string() }))
    .responses({ 201: TodoSchema }),
    },
    auth: {
    login: endpoint.post('/api/auth/login')
    .body(object({ email: string(), password: string() }))
    .responses({ 200: object({ token: string() }) }),
    },
    }); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.mergeContracts.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.mergeContracts.html new file mode 100644 index 00000000..f09d4bda --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.mergeContracts.html @@ -0,0 +1,22 @@ +mergeContracts | Libraries
  • Merges two API contracts into one.

    +

    This is the primary building block for audience-scoped bundles: define +a publicApi that is safe to ship to every client, and a separate +adminApi that is only imported by the admin application. Combine them +at the admin entry point with mergeContracts.

    +
      +
    • Groups that exist in only one contract are passed through unchanged.
    • +
    • Groups that share a key have their endpoint maps shallowly merged +(later endpoints with the same name override earlier ones, same semantics +as Object.assign).
    • +
    • The returned contract is frozen, matching the invariant of +defineApi.
    • +
    +

    Type Parameters

    • A extends ApiContract

      The shape of the first contract.

      +
    • B extends ApiContract

      The shape of the second contract.

      +

    Parameters

    • a: A

      The base contract (e.g. the public API).

      +
    • b: B

      The contract to merge in (e.g. admin-only groups).

      +

    Returns Readonly<MergedContracts<A, B>>

    A new frozen contract whose type is MergedContracts<A, B>.

    +
    // shared/public-api.ts  — safe to import in the client bundle
    export const publicApi = defineApi({
    todos: { list: ..., get: ..., create: ... },
    auth: { login: ..., register: ... },
    });

    // shared/admin-api.ts — only imported by the admin application
    const adminApi = defineApi({
    admin: { activityLog: ..., banUser: ... },
    });

    // admin-app/contract.ts
    import { mergeContracts } from '@cleverbrush/server/contract';
    export const fullApi = mergeContracts(publicApi, adminApi);
    // TypeScript sees: { todos, auth, admin } — fully typed

    // client-app/contract.ts
    import { publicApi } from 'shared/public-api';
    // TypeScript sees: { todos, auth } — admin groups are absent +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.omitGroups.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.omitGroups.html new file mode 100644 index 00000000..6dd70985 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.omitGroups.html @@ -0,0 +1,13 @@ +omitGroups | Libraries
  • Returns a new contract with the specified groups removed.

    +

    The TypeScript return type is Omit<T, K> — the listed groups are absent +at both runtime and compile time. Useful for stripping debug, internal, or +admin groups before sharing a contract with less-privileged consumers.

    +

    Type Parameters

    • T extends ApiContract

      The shape of the source contract.

      +
    • K extends string | number | symbol

      The union of group keys to remove.

      +

    Parameters

    • contract: T

      The contract to omit from.

      +
    • ...groups: K[]

      The group keys to exclude.

      +

    Returns Readonly<Omit<T, K>>

    A new frozen contract without the listed groups.

    +
    const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

    // Strip internal groups before exporting to clients
    const publicApi = omitGroups(fullApi, 'admin', 'debug');
    // TypeScript: { todos: ..., auth: ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.pickGroups.html b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.pickGroups.html new file mode 100644 index 00000000..e851e68f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/functions/_cleverbrush_server.contract.pickGroups.html @@ -0,0 +1,14 @@ +pickGroups | Libraries
  • Returns a new contract containing only the specified groups.

    +

    The TypeScript return type is Pick<T, K> — the compiler sees exactly the +selected groups and no others. This provides full type safety on the +narrowed contract when passed to createClient() or used as a server +handler map.

    +

    Type Parameters

    • T extends ApiContract

      The shape of the source contract.

      +
    • K extends string | number | symbol

      The union of group keys to keep.

      +

    Parameters

    • contract: T

      The contract to select from.

      +
    • ...groups: K[]

      The group keys to include.

      +

    Returns Readonly<Pick<T, K>>

    A new frozen contract with only the listed groups.

    +
    const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

    // Pick only the groups the frontend needs
    const clientApi = pickGroups(fullApi, 'todos', 'auth');
    // TypeScript: { todos: ..., auth: ... } +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/hierarchy.html b/websites/docs/public/api-docs/v4.3.2/hierarchy.html new file mode 100644 index 00000000..807b29ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/hierarchy.html @@ -0,0 +1 @@ +Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/index.html b/websites/docs/public/api-docs/v4.3.2/index.html new file mode 100644 index 00000000..04a7882e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/index.html @@ -0,0 +1,421 @@ +Libraries

Libraries

Cleverbrush Framework

+

CI +License: BSD-3-Clause +Standard Schema v1

+ +

Coverage

+ +

A monorepo of production-quality TypeScript libraries. Written with zero runtime dependencies, strict types, and a strong focus on correctness — every package ships with unit tests, full TypeScript type coverage, and automated CI on every pull request.

+

The flagship package is @cleverbrush/schema — a schema validation library that is faster than Zod in 14 out of 15 benchmarks (up to 204× faster on invalid input), 3× smaller than Zod v4 in bundle size, and compatible with 50+ ecosystem tools via Standard Schema v1.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDescription
@cleverbrush/schemaSchema definition, type inference, and runtime validation. Standard Schema v1 compatible — works with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, and 50+ other tools. Wraps external schemas (Zod, Valibot, ArkType) via extern()
@cleverbrush/mapperSchema-driven object mapping with compile-time completeness checking and type-safe property selectors
@cleverbrush/react-formHeadless, schema-driven form system for React — type-safe field binding, auto-field rendering, UI-agnostic
@cleverbrush/schema-jsonBidirectional JSON Schema conversion: toJsonSchema() + fromJsonSchema() with full type inference
@cleverbrush/asyncAsync utilities: Collector, debounce, throttle, retry
@cleverbrush/deepDeep operations on objects: deep equality, deep merge, flattening, hashing
@cleverbrush/schedulerCron-like job scheduler for Node.js using worker threads
@cleverbrush/clientTyped HTTP client for @cleverbrush/server API contracts — Proxy-based, zero codegen, full type inference. Optional React + TanStack Query integration via /react subpath
@cleverbrush/otelOpenTelemetry instrumentation — traces for HTTP, SQL, and outbound client calls; OTLP log sink with trace correlation; DI integration
@cleverbrush/knex-clickhouseKnex query builder dialect for ClickHouse
+
+ +

If you have used Zod, Yup, or Joi, the fluent API will feel immediately familiar — with several important differences.

+ +
@cleverbrush/schema

├── TypeScript inference (InferType<typeof schema>)
├── Runtime validation (.validate() / .validateAsync())
├── @cleverbrush/mapper (type-safe object mapping)
├── @cleverbrush/react-form (auto-generated, schema-driven forms)
└── @cleverbrush/schema-json (bidirectional JSON Schema) +
+ +

Define a schema once and get all four capabilities for free — no duplication between types, validators, mappers, and form configs.

+ +
import { object, string, number, InferType } from '@cleverbrush/schema';

const UserSchema = object({
name: string().nonempty().minLength(2),
email: string().email(),
age: number().min(18).optional(),
});

// TypeScript type — inferred automatically, no duplication
type User = InferType<typeof UserSchema>;

// Runtime validation
const result = UserSchema.validate({ name: 'Alice', email: 'alice@example.com' });
if (result.valid) {
console.log(result.object); // typed as User
} else {
const nameErrors = result.getErrorsFor((p) => p.name);
console.log(nameErrors.errors); // ['Name must be at least 2 characters']
}

// Standard Schema interop — pass directly to tRPC, TanStack Form, T3 Env, …
const validator = UserSchema['~standard']; +
+ + +

Benchmarked with Vitest bench against Zod v4 on the same machine:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Benchmark@cleverbrush/schemaZodRatio
Array 100 objects — valid35,228 ops/s13,277 ops/s2.65× faster
Array 100 objects — invalid899,329 ops/s4,396 ops/s204× faster
Complex order — valid198,988 ops/s136,090 ops/s1.46× faster
Complex order — invalid884,706 ops/s26,106 ops/s33.9× faster
Flat object — valid1,001,194 ops/s840,725 ops/s1.19× faster
Flat object — invalid2,653,630 ops/s176,222 ops/s15.1× faster
Nested object — valid690,556 ops/s368,893 ops/s1.87× faster
Nested object — invalid2,739,319 ops/s87,245 ops/s31.4× faster
String — valid5,348,564 ops/s3,533,945 ops/s1.51× faster
String — invalid5,749,087 ops/s482,961 ops/s11.9× faster
Number — valid7,911,266 ops/s4,806,511 ops/s1.65× faster
Number — invalid5,387,475 ops/s637,513 ops/s8.45× faster
Union first branch1,925,508 ops/s1,529,547 ops/s1.26× faster
Union last branch676,107 ops/s732,682 ops/s0.92×
Union no match — invalid5,873,118 ops/s385,453 ops/s15.2× faster
+

14 out of 15 benchmarks. The early-exit optimization on invalid data produces especially large gains — up to 204× — because type errors are caught at the first failing field without evaluating the rest.

+

Run the benchmarks yourself:

+
npm run bench
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BundleGzippedNotes
@cleverbrush/schema (full)14 KBAll builders + built-in extensions
@cleverbrush/schema/string3.8 KBSub-path import, one builder only
@cleverbrush/schema/object5.8 KBSub-path import, one builder only
Zod v3 (full)14.4 KBFor reference
Zod v4 (full)41 KB3× larger than @cleverbrush/schema
+

Sub-path exports (@cleverbrush/schema/string, /number, /object, /array, /core) enable fine-grained tree-shaking for bundle-critical applications.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@cleverbrush/schemaZodYupJoi
TypeScript type inference~
Standard Schema v1
PropertyDescriptors (runtime introspection)
Type-safe extension system
Built-in object mapper
Built-in form generation
Bidirectional JSON Schema~ (output only)
External schema interop (extern())
JSDoc comment preservation
Immutable fluent API
Zero runtime dependencies
Bundle size (full, gzipped)14 KB41 KB (v4)~19 KB~26 KB
+

PropertyDescriptors are the architectural differentiator. Every schema emits a structured descriptor tree at runtime — not just a black-box validator function. This is what enables the mapper to provide type-safe property selectors, react-form to auto-generate fields, and schema-json to produce accurate JSON Schema output. No other popular validation library exposes this level of runtime metadata.

+
+ +

Every pull request must pass all of the following gates before merging — enforced by the CI pipeline:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GateToolWhat it checks
LintingBiomeCode style, formatting, and static analysis across all packages and the website
Type checkingTypeScript (strict mode)Strict null-checks, no implicit any, full type coverage
Unit testsVitestRuntime behaviour + type-level tests (expectTypeOf) — coverage spans all builders, extensions, edge cases, and error paths
Buildtsup + TurboESM output compiles cleanly with no TypeScript errors
BenchmarksVitest benchPerformance regressions are visible before merge
+

Run everything locally before opening a PR:

+
npm run lint        # Biome static analysis
npm run build # compile all packages
npm test # unit tests + type checks
npm run bench # performance benchmarks +
+ +
+ +

This project uses npm workspaces and Turborepo for incremental builds. All library source is under libs/.

+ +
npm install
+
+ + +
npm run build
+
+ + +
npm test
+
+ + +

API docs are generated by TypeDoc and published at https://docs.cleverbrush.com/.

+
npm run docs
+
+ +

Each library has its own README.md with usage examples and full API reference.

+
+ +

This project uses Changesets for versioning and publishing. All packages are versioned together.

+
    +
  1. +

    Add a changeset after making changes:

    +
    npm run changeset
    +
    + +

    Follow the prompts to describe the change. A changeset file is created in .changeset/.

    +
  2. +
  3. +

    Version packages when ready to release:

    +
    npm run version
    +
    + +

    This bumps package.json versions and updates CHANGELOG.md files.

    +
  4. +
  5. +

    Publish to npm:

    +
    npm run release
    +
    + +

    For a beta release:

    +
    npm run publish:beta
    +
    + +
  6. +
+
+ +

Contributions are welcome. See CONTRIBUTING.md for full guidelines.

+

The short version: make sure your changes include tests, pass linting (npm run lint), and don't break existing tests (npm test). If you add or change behaviour, update the relevant JSDoc comments — that's all the documentation update that's usually needed.

+

Extensions are the easiest place to start contributing — each one is a self-contained file with tests. Look for issues labelled good first issue.

+
+ +

BSD-3-Clause

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthenticationContext.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthenticationContext.html new file mode 100644 index 00000000..0c3dfa11 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthenticationContext.html @@ -0,0 +1,7 @@ +AuthenticationContext | Libraries

Interface AuthenticationContext

Transport-agnostic context passed to authentication schemes. +HTTP middleware builds this from RequestContext; future transports +(WebSocket, gRPC) provide the same shape.

+
interface AuthenticationContext {
    cookies: Record<string, string>;
    headers: Record<string, string>;
    items: Map<string, unknown>;
}
Index

Properties

Properties

cookies: Record<string, string>
headers: Record<string, string>
items: Map<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthenticationScheme.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthenticationScheme.html new file mode 100644 index 00000000..a6b8bd1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthenticationScheme.html @@ -0,0 +1,11 @@ +AuthenticationScheme | Libraries

Interface AuthenticationScheme<T>

An authentication scheme extracts and validates credentials from the +transport-agnostic AuthenticationContext.

+
interface AuthenticationScheme<T = unknown> {
    name: string;
    authenticate(
        context: AuthenticationContext,
    ): Promise<AuthenticationResult<T>>;
    challenge?(): { headerName: string; headerValue: string };
}

Type Parameters

  • T = unknown
Index

Properties

Methods

Properties

name: string

Unique name for this scheme (e.g. "jwt", "cookie").

+

Methods

  • Optional challenge header for 401 responses. +E.g. { headerName: 'WWW-Authenticate', headerValue: 'Bearer' }

    +

    Returns { headerName: string; headerValue: string }

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthorizationCodeSchemeOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthorizationCodeSchemeOptions.html new file mode 100644 index 00000000..06ac505d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthorizationCodeSchemeOptions.html @@ -0,0 +1,15 @@ +AuthorizationCodeSchemeOptions | Libraries

Interface AuthorizationCodeSchemeOptions<T>

Configuration for authorizationCodeScheme.

+
interface AuthorizationCodeSchemeOptions<T> {
    authenticate: (
        context: AuthenticationContext,
    ) => Promise<AuthenticationResult<T>>;
    authorizationUrl: string;
    name?: string;
    refreshUrl?: string;
    scopes?: Record<string, string>;
    tokenUrl: string;
}

Type Parameters

  • T

    The type of the principal value produced by authenticate.

    +
Index

Properties

authenticate: (
    context: AuthenticationContext,
) => Promise<AuthenticationResult<T>>

Validate the incoming request and return the principal or a failure.

+
authorizationUrl: string

OAuth authorization endpoint URL.

+
name?: string

Custom scheme name (default: 'oauth2').

+
refreshUrl?: string

Optional token refresh URL.

+
scopes?: Record<string, string>

Available scopes with descriptions (default: {}).

+
tokenUrl: string

OAuth token endpoint URL.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthorizationPolicy.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthorizationPolicy.html new file mode 100644 index 00000000..a804fd1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.AuthorizationPolicy.html @@ -0,0 +1,6 @@ +AuthorizationPolicy | Libraries

Interface AuthorizationPolicy

A named set of authorization requirements. +All requirements must pass (AND semantics) for the policy to be satisfied. +Build instances using PolicyBuilder.

+
interface AuthorizationPolicy {
    name: string;
    requirements: readonly AuthorizationRequirement[];
}
Index

Properties

Properties

name: string
requirements: readonly AuthorizationRequirement[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.ClientCredentialsSchemeOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.ClientCredentialsSchemeOptions.html new file mode 100644 index 00000000..497655d6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.ClientCredentialsSchemeOptions.html @@ -0,0 +1,13 @@ +ClientCredentialsSchemeOptions | Libraries

Interface ClientCredentialsSchemeOptions<T>

Configuration for clientCredentialsScheme.

+
interface ClientCredentialsSchemeOptions<T> {
    authenticate: (
        context: AuthenticationContext,
    ) => Promise<AuthenticationResult<T>>;
    name?: string;
    refreshUrl?: string;
    scopes?: Record<string, string>;
    tokenUrl: string;
}

Type Parameters

  • T

    The type of the principal value produced by authenticate.

    +
Index

Properties

authenticate: (
    context: AuthenticationContext,
) => Promise<AuthenticationResult<T>>

Validate the incoming request and return the principal or a failure.

+
name?: string

Custom scheme name (default: 'oauth2').

+
refreshUrl?: string

Optional token refresh URL.

+
scopes?: Record<string, string>

Available scopes with descriptions (default: {}).

+
tokenUrl: string

OAuth token endpoint URL.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.CookieOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.CookieOptions.html new file mode 100644 index 00000000..cbf4ac07 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.CookieOptions.html @@ -0,0 +1,17 @@ +CookieOptions | Libraries

Interface CookieOptions

Options for the Set-Cookie header, controlling cookie lifetime, +scope, and security attributes.

+
interface CookieOptions {
    domain?: string;
    expires?: Date;
    httpOnly?: boolean;
    maxAge?: number;
    path?: string;
    sameSite?: "Strict" | "Lax" | "None";
    secure?: boolean;
}
Index

Properties

domain?: string

Cookie domain.

+
expires?: Date

Absolute expiry date.

+
httpOnly?: boolean

Prevent client-side JS access.

+
maxAge?: number

Max lifetime in seconds.

+
path?: string

Cookie path (default "/").

+
sameSite?: "Strict" | "Lax" | "None"

SameSite attribute.

+
secure?: boolean

HTTPS only.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.CookieSchemeOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.CookieSchemeOptions.html new file mode 100644 index 00000000..9f7e2190 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.CookieSchemeOptions.html @@ -0,0 +1,12 @@ +CookieSchemeOptions | Libraries

Interface CookieSchemeOptions<T>

Configuration for cookieScheme.

+
interface CookieSchemeOptions<T> {
    cookieName: string;
    name?: string;
    validate: (cookieValue: string) => Promise<T | null>;
}

Type Parameters

  • T

    The type of the principal value returned by validate.

    +
Index

Properties

Properties

cookieName: string

Name of the cookie to read (e.g. "session", "sid").

+
name?: string

Custom scheme name (default: "cookie").

+
validate: (cookieValue: string) => Promise<T | null>

Validate the cookie value and return the principal data, or null +if the cookie is invalid / session expired.

+

The implementer is responsible for session lookup, signature +verification, etc.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.JwtPayload.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.JwtPayload.html new file mode 100644 index 00000000..3ee81ac3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.JwtPayload.html @@ -0,0 +1,10 @@ +JwtPayload | Libraries

Interface JwtPayload

The decoded JWT payload. Includes standard registered claims (iss, sub, +aud, exp, nbf, iat, jti) and any custom claims.

+
interface JwtPayload {
    aud?: string | string[];
    exp?: number;
    iat?: number;
    iss?: string;
    jti?: string;
    nbf?: number;
    sub?: string;
    [key: string]: unknown;
}

Indexable

  • [key: string]: unknown
Index

Properties

Properties

aud?: string | string[]
exp?: number
iat?: number
iss?: string
jti?: string
nbf?: number
sub?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.JwtSchemeOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.JwtSchemeOptions.html new file mode 100644 index 00000000..a5d5896a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.JwtSchemeOptions.html @@ -0,0 +1,17 @@ +JwtSchemeOptions | Libraries

Interface JwtSchemeOptions<T>

Configuration for jwtScheme.

+
interface JwtSchemeOptions<T> {
    algorithms?: string[];
    audience?: string;
    clockTolerance?: number;
    issuer?: string;
    mapClaims: (claims: JwtPayload) => T;
    name?: string;
    secret: string | Buffer<ArrayBufferLike>;
}

Type Parameters

  • T

    The type of the principal value produced by mapClaims.

    +
Index

Properties

algorithms?: string[]

Allowed algorithms (default: ['HS256']).

+
audience?: string

Expected audience — if set, aud must include it.

+
clockTolerance?: number

Clock tolerance in seconds for exp/nbf checks (default: 0).

+
issuer?: string

Expected issuer — if set, iss must match.

+
mapClaims: (claims: JwtPayload) => T

Map raw JWT claims to the typed principal value.

+
name?: string

Custom scheme name (default: 'jwt').

+
secret: string | Buffer<ArrayBufferLike>

HMAC secret (for HS256/HS384/HS512) or PEM public key (for RS256/RS384/RS512).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OAuthFlow.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OAuthFlow.html new file mode 100644 index 00000000..b93e3ad4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OAuthFlow.html @@ -0,0 +1,6 @@ +OAuthFlow | Libraries

Interface OAuthFlow

A single OAuth 2.0 flow as defined by the OpenAPI specification.

+
interface OAuthFlow {
    authorizationUrl?: string;
    refreshUrl?: string;
    scopes: Record<string, string>;
    tokenUrl?: string;
}
Index

Properties

authorizationUrl?: string
refreshUrl?: string
scopes: Record<string, string>
tokenUrl?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OAuthFlows.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OAuthFlows.html new file mode 100644 index 00000000..8539dd5b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OAuthFlows.html @@ -0,0 +1,7 @@ +OAuthFlows | Libraries

Interface OAuthFlows

Map of OAuth 2.0 grant-type flows.

+
interface OAuthFlows {
    authorizationCode?: OAuthFlow;
    clientCredentials?: OAuthFlow;
    implicit?: OAuthFlow;
    password?: OAuthFlow;
}
Index

Properties

authorizationCode?: OAuthFlow
clientCredentials?: OAuthFlow
implicit?: OAuthFlow
password?: OAuthFlow
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OidcSchemeOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OidcSchemeOptions.html new file mode 100644 index 00000000..494f3b4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_auth.OidcSchemeOptions.html @@ -0,0 +1,9 @@ +OidcSchemeOptions | Libraries

Interface OidcSchemeOptions<T>

Configuration for oidcScheme.

+
interface OidcSchemeOptions<T> {
    authenticate: (
        context: AuthenticationContext,
    ) => Promise<AuthenticationResult<T>>;
    name?: string;
    openIdConnectUrl: string;
}

Type Parameters

  • T

    The type of the principal value produced by authenticate.

    +
Index

Properties

authenticate: (
    context: AuthenticationContext,
) => Promise<AuthenticationResult<T>>

Validate the incoming request and return the principal or a failure.

+
name?: string

Custom scheme name (default: 'oidc').

+
openIdConnectUrl: string

OpenID Connect discovery URL (e.g. https://auth.example.com/.well-known/openid-configuration).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..ClientHooks.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..ClientHooks.html new file mode 100644 index 00000000..47757bd9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..ClientHooks.html @@ -0,0 +1,23 @@ +ClientHooks | Libraries

Interface ClientHooks

Lifecycle hooks that are invoked at various stages of a request.

+

All hook arrays are executed serially in order. Hooks can be synchronous +or asynchronous.

+
interface ClientHooks {
    afterResponse?: (
        (
            request: { init: RequestInit; url: string },
            response: Response,
        ) => any
    )[];
    beforeError?: ((error: WebError) => WebError | Promise<WebError>)[];
    beforeRequest?: (
        (request: { init: RequestInit; url: string }) => void | Promise<void>
    )[];
    beforeRetry?: (
        (
            info: {
                error: Error;
                init: RequestInit;
                retryCount: number;
                url: string;
            },
        ) => void
        | Promise<void>
    )[];
}
Index

Properties

afterResponse?: (
    (request: { init: RequestInit; url: string }, response: Response) => any
)[]

Called after a successful response is received. +Returning a Response replaces the original response.

+
hooks: {
afterResponse: [(req, res) => {
console.log(`${req.init.method} ${req.url}${res.status}`);
}],
} +
+ +
beforeError?: ((error: WebError) => WebError | Promise<WebError>)[]

Called before an error is thrown. +Can transform or enrich the error before it reaches the caller. +The returned error replaces the original.

+
beforeRequest?: (
    (request: { init: RequestInit; url: string }) => void | Promise<void>
)[]

Called before every request is sent. +Can be used to log, modify headers, or add tracing information.

+
hooks: {
beforeRequest: [(req) => {
req.init.headers = {
...req.init.headers as Record<string, string>,
'X-Request-Id': crypto.randomUUID(),
};
}],
} +
+ +
beforeRetry?: (
    (
        info: {
            error: Error;
            init: RequestInit;
            retryCount: number;
            url: string;
        },
    ) => void
    | Promise<void>
)[]

Called before a retry attempt. +Useful for logging retry attempts or modifying the request between retries.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..ClientOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..ClientOptions.html new file mode 100644 index 00000000..0437bb22 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..ClientOptions.html @@ -0,0 +1,43 @@ +ClientOptions | Libraries

Interface ClientOptions

Configuration for createClient.

+
interface ClientOptions {
    baseUrl?: string;
    fetch?: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>;
    getToken?: () => string | null;
    headers?: Record<string, string>;
    hooks?: ClientHooks;
    middlewares?: Middleware[];
    onUnauthorized?: () => void;
    subscriptionReconnect?: SubscriptionReconnectOptions;
}
Index

Properties

baseUrl?: string

Base URL prepended to every request path. +Defaults to '' (same origin).

+
`'https://api.example.com'`
+
+ +
fetch?: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>

Custom fetch implementation. +Defaults to the global fetch. Useful for testing or server-side +rendering where a polyfill is needed.

+

Type Declaration

    • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

getToken?: () => string | null

Returns the current authentication token, or null if unauthenticated. +When a non-null value is returned it is sent as a Bearer token in +the Authorization header.

+
headers?: Record<string, string>

Additional headers sent with every request.

+
hooks?: ClientHooks

Lifecycle hooks invoked at various stages of a request.

+
const client = createClient(api, {
hooks: {
beforeRequest: [(req) => { console.log('→', req.url); }],
afterResponse: [(req, res) => { console.log('←', res.status); }],
},
}); +
+ +
middlewares?: Middleware[]

Middleware functions that wrap the fetch call. +Applied in array order — the first middleware is the outermost wrapper.

+
import { retry } from '@cleverbrush/web/retry';
import { timeout } from '@cleverbrush/web/timeout';

const client = createClient(api, {
middlewares: [retry(), timeout({ timeout: 10000 })],
}); +
+ +
onUnauthorized?: () => void

Called when a 401 Unauthorized response is received. +Typically used to clear stored tokens and redirect to a login page.

+
subscriptionReconnect?: SubscriptionReconnectOptions

Default reconnection options for all WebSocket subscriptions created by +this client.

+

Individual subscription calls can override these options by passing a +reconnect argument. Pass reconnect: false at the call site to +disable reconnection for a specific subscription even when a global +default is set.

+
const client = createClient(api, {
baseUrl: 'https://api.example.com',
subscriptionReconnect: {
maxRetries: 10,
backoffLimit: 60_000,
jitter: true,
},
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..EndpointMeta.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..EndpointMeta.html new file mode 100644 index 00000000..5140e8af --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..EndpointMeta.html @@ -0,0 +1,41 @@ +EndpointMeta | Libraries

Interface EndpointMeta

Endpoint metadata carried through PER_CALL_OPTIONS on every request.

+

Computed by the Proxy-based client at call time, this gives middleware +access to the endpoint's structural info plus the actual call arguments +without any URL parsing or regex.

+

Used by throttlingCache for cache-invalidation callbacks.

+
interface EndpointMeta {
    basePath: string;
    baseUrl: string;
    body: unknown;
    cacheTags: readonly {
        name: string;
        properties: Readonly<
            Record<
                string,
                {
                    getValue(
                        root: {
                            body: unknown;
                            headers: Record<string, string>;
                            params: Record<string, unknown>;
                            query: Record<string, unknown>;
                        },
                    ): { success: boolean; value?: unknown };
                },
            >,
        >;
    }[];
    collectionPath: string;
    endpoint: string;
    fullCollectionUrl: string;
    group: string;
    headers: Readonly<Record<string, string>>;
    method: string;
    operationId: string | null;
    params: Readonly<Record<string, unknown>>;
    path: string;
    pathParamNames: string[];
    query: Readonly<Record<string, unknown>>;
    tags: readonly string[];
}
Index

Properties

basePath: string

Resource base path, e.g. /api/todos.

+
baseUrl: string

Client base URL (e.g. "http://localhost:3000" or "").

+
body: unknown

Request body.

+
cacheTags: readonly {
    name: string;
    properties: Readonly<
        Record<
            string,
            {
                getValue(
                    root: {
                        body: unknown;
                        headers: Record<string, string>;
                        params: Record<string, unknown>;
                        query: Record<string, unknown>;
                    },
                ): { success: boolean; value?: unknown };
            },
        >,
    >;
}[]

Cache tag definitions from the endpoint's .cacheTag() calls. +Each tag has a name and a map of properties (key → accessor). +Used by the cacheTags middleware.

+
collectionPath: string

Resource collection path (basePath without param placeholders).

+
endpoint: string

Endpoint name within the group, e.g. "update".

+
fullCollectionUrl: string

Full collection URL matching the HTTP cache key format. +Computed as baseUrl (stripped of trailing slash) + collectionPath.

+
group: string

Contract group name, e.g. "todos".

+
headers: Readonly<Record<string, string>>

Request headers from the call, e.g. { 'x-request-id': 'abc' }.

+
method: string

HTTP method in uppercase, e.g. "PATCH".

+
operationId: string | null

OpenAPI operationId, or null.

+
params: Readonly<Record<string, unknown>>

Actual route parameter values from the call, e.g. { id: 42 }.

+
path: string

Path template with colon placeholders, e.g. /api/todos/:id.

+
pathParamNames: string[]

Names of path parameters, e.g. ["id"].

+
query: Readonly<Record<string, unknown>>

Query parameters, e.g. { page: 1 }.

+
tags: readonly string[]

OpenAPI tags, or [].

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..FilePart.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..FilePart.html new file mode 100644 index 00000000..fc3009a9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..FilePart.html @@ -0,0 +1,10 @@ +FilePart | Libraries

Interface FilePart

Represents a single uploaded file from a multipart/form-data request.

+
interface FilePart {
    buffer: Buffer;
    filename: string;
    mimeType: string;
    size: number;
}
Index

Properties

Properties

buffer: Buffer

Full file contents as a Buffer.

+
filename: string

Original filename as provided by the client.

+
mimeType: string

MIME type of the file (e.g. 'image/jpeg').

+
size: number

File size in bytes.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..PerCallOverrides.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..PerCallOverrides.html new file mode 100644 index 00000000..94c4c650 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..PerCallOverrides.html @@ -0,0 +1,14 @@ +PerCallOverrides | Libraries

Interface PerCallOverrides

Per-call overrides that can be passed alongside endpoint arguments to +override middleware defaults for a single request.

+
interface PerCallOverrides {
    offlineQueue?: { skip?: boolean };
    optimisticUpdate?: { skip?: boolean };
    retry?: {
        backoffLimit?: number;
        jitter?: boolean;
        limit?: number;
        methods?: string[];
        retryOnTimeout?: boolean;
        statusCodes?: number[];
    };
    timeout?: number;
}
Index

Properties

offlineQueue?: { skip?: boolean }

Override offline queue middleware options for this call. +Pass { skip: true } to bypass the queue for this mutation.

+
optimisticUpdate?: { skip?: boolean }

Override optimistic update middleware options for this call. +Pass { skip: true } to skip tagging for this mutation.

+
retry?: {
    backoffLimit?: number;
    jitter?: boolean;
    limit?: number;
    methods?: string[];
    retryOnTimeout?: boolean;
    statusCodes?: number[];
}

Override retry middleware options for this call only. +Pass { limit: 0 } to disable retries entirely.

+
timeout?: number

Override the timeout (in milliseconds) for this call only.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..Subscription.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..Subscription.html new file mode 100644 index 00000000..b5eb4934 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client..Subscription.html @@ -0,0 +1,11 @@ +Subscription | Libraries

Interface Subscription<TOutgoing, TIncoming>

A live WebSocket subscription handle returned by client.group.endpoint().

+

Implements AsyncIterable for consuming server-sent events and provides +send() for client→server messages when the subscription is bidirectional.

+
interface Subscription<TOutgoing, TIncoming = never> {
    state: "connecting" | "connected" | "reconnecting" | "closed";
    "[asyncIterator]"(): AsyncIterator<TOutgoing, any, any>;
    close(): void;
    send(message: TIncoming): void;
}

Type Parameters

  • TOutgoing
  • TIncoming = never

Hierarchy

Index

Properties

Methods

Properties

state: "connecting" | "connected" | "reconnecting" | "closed"

Current connection state.

+

Methods

  • Returns AsyncIterator<TOutgoing, any, any>

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.batching.BatchingOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.batching.BatchingOptions.html new file mode 100644 index 00000000..de874d63 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.batching.BatchingOptions.html @@ -0,0 +1,30 @@ +BatchingOptions | Libraries

Options for the batching middleware.

+
interface BatchingOptions {
    batchPath?: string;
    maxSize?: number;
    skip?: (url: string, init: RequestInit) => boolean;
    windowMs?: number;
}
Index

Properties

batchPath?: string

URL path of the server-side batch endpoint.

+

Must match the path configured via ServerBuilder.useBatching() on the +server (default '/__batch').

+
'/__batch'
+
+ +
maxSize?: number

Maximum number of requests to include in a single batch.

+

When the queue reaches this size the batch is flushed immediately, +before the windowMs timer fires.

+
10
+
+ +
skip?: (url: string, init: RequestInit) => boolean

Predicate to exclude specific requests from batching.

+

Return true to send the request immediately, bypassing the batch +queue. Useful for streaming endpoints, file uploads, or requests that +must not be delayed.

+

Type Declaration

    • (url: string, init: RequestInit): boolean
    • Parameters

      • url: string

        The fully-resolved request URL.

        +
      • init: RequestInit

        The RequestInit object for the request.

        +

      Returns boolean

windowMs?: number

Time window in milliseconds to collect requests before flushing.

+

The first request in a new window starts the timer. All subsequent +requests received before the timer fires are included in the same batch.

+
10
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.cache.CacheOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.cache.CacheOptions.html new file mode 100644 index 00000000..4b8109c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.cache.CacheOptions.html @@ -0,0 +1,21 @@ +CacheOptions | Libraries

Options for the throttlingCache middleware.

+
interface CacheOptions {
    condition?: (response: Response) => boolean;
    invalidate?: (
        url: string,
        init: RequestInit,
        meta?: EndpointMeta,
    ) => string | null;
    key?: (url: string, init: RequestInit) => string;
    skip?: (url: string, init: RequestInit) => boolean;
    throttle?: number;
}
Index

Properties

condition?: (response: Response) => boolean

Predicate that determines whether a response should be cached.

+

Defaults to caching only successful responses (response.ok).

+
invalidate?: (
    url: string,
    init: RequestInit,
    meta?: EndpointMeta,
) => string | null

Returns a cache key to invalidate when a mutating request is made. +Return null to skip invalidation.

+

By default, mutating requests do not invalidate the cache.

+

The meta parameter carries endpoint metadata (group, endpoint, +method, path, params, body, query, etc.) provided by the client proxy.

+
key?: (url: string, init: RequestInit) => string

Computes the cache key for a request.

+

Defaults to method + '@' + url.

+
skip?: (url: string, init: RequestInit) => boolean

Predicate that decides whether a request should be skipped +(i.e. not cached).

+

Defaults to skipping non-GET requests.

+
throttle?: number

Cache TTL in milliseconds. +Defaults to 1000 (1 second).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.cache.CacheTagMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.cache.CacheTagMiddlewareOptions.html new file mode 100644 index 00000000..ebae6466 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.cache.CacheTagMiddlewareOptions.html @@ -0,0 +1,11 @@ +CacheTagMiddlewareOptions | Libraries

Interface CacheTagMiddlewareOptions

Configuration for the cacheTags middleware.

+
interface CacheTagMiddlewareOptions {
    condition?: (response: Response) => boolean;
    defaultTtl?: number;
    ttlByTag?: Record<string, number>;
}
Index

Properties

condition?: (response: Response) => boolean

Predicate that decides whether a request should be cached. +Defaults to caching only successful responses (response.ok).

+
defaultTtl?: number

Default TTL in milliseconds for tags without an explicit TTL. +Defaults to 0 (no caching — invalidation-only mode).

+
ttlByTag?: Record<string, number>

Per-tag TTL map: { [tagName]: ttlMs }. +Tags not listed here fall back to defaultTtl.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.dedupe.DedupeOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.dedupe.DedupeOptions.html new file mode 100644 index 00000000..1a0766af --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.dedupe.DedupeOptions.html @@ -0,0 +1,11 @@ +DedupeOptions | Libraries

Options for the dedupe middleware.

+
interface DedupeOptions {
    key?: (url: string, init: RequestInit) => string;
    skip?: (url: string, init: RequestInit) => boolean;
}
Index

Properties

Properties

key?: (url: string, init: RequestInit) => string

Computes the deduplication key for a request.

+

Requests with the same key that are in-flight simultaneously will +share a single underlying fetch.

+

Defaults to method + '@' + url.

+
skip?: (url: string, init: RequestInit) => boolean

Predicate that decides whether a request should be skipped +(i.e. not deduplicated).

+

Defaults to skipping non-GET requests.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.idempotency.IdempotencyOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.idempotency.IdempotencyOptions.html new file mode 100644 index 00000000..fb0f6c8a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.idempotency.IdempotencyOptions.html @@ -0,0 +1,13 @@ +IdempotencyOptions | Libraries

Configuration for idempotency.

+
interface IdempotencyOptions {
    condition?: (url: string, init: RequestInit) => boolean;
    headerName?: string;
    keyGenerator?: (url: string, init: RequestInit) => string;
}
Index

Properties

condition?: (url: string, init: RequestInit) => boolean

Predicate that decides whether a request should receive a key. +Defaults to true for POST, PUT, PATCH, DELETE.

+
headerName?: string

Header name to use for the idempotency key. +Defaults to "X-Idempotency-Key".

+
keyGenerator?: (url: string, init: RequestInit) => string

Custom key generator. Receives (url, init) and returns a string. +Defaults to generating a UUID v4.

+

The key must be stable across retries of the same logical request. +When not provided, a UUID is generated once and reused on retry.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.OfflineQueueOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.OfflineQueueOptions.html new file mode 100644 index 00000000..70178f30 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.OfflineQueueOptions.html @@ -0,0 +1,4 @@ +OfflineQueueOptions | Libraries
interface OfflineQueueOptions {
    maxRetries?: number;
    skip?: (url: string, init: RequestInit) => boolean;
    store?: OfflineQueueStore;
}
Index

Properties

Properties

maxRetries?: number
skip?: (url: string, init: RequestInit) => boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.OfflineQueueStore.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.OfflineQueueStore.html new file mode 100644 index 00000000..338faf2a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.OfflineQueueStore.html @@ -0,0 +1,4 @@ +OfflineQueueStore | Libraries
interface OfflineQueueStore {
    isOnline: boolean;
    isReplaying: boolean;
    queue: QueuedRequest[];
}
Index

Properties

Properties

isOnline: boolean
isReplaying: boolean
queue: QueuedRequest[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.QueuedRequest.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.QueuedRequest.html new file mode 100644 index 00000000..729abbb9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.offline-queue.QueuedRequest.html @@ -0,0 +1,6 @@ +QueuedRequest | Libraries
interface QueuedRequest {
    id: string;
    init: RequestInit;
    retryCount: number;
    timestamp: number;
    url: string;
}
Index

Properties

Properties

id: string
init: RequestInit
retryCount: number
timestamp: number
url: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticFailure.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticFailure.html new file mode 100644 index 00000000..a347d2ac --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticFailure.html @@ -0,0 +1,6 @@ +OptimisticFailure | Libraries
interface OptimisticFailure {
    error: Error;
    id: string;
    init: RequestInit;
    timestamp: number;
    url: string;
}
Index

Properties

Properties

error: Error
id: string
init: RequestInit
timestamp: number
url: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateOptions.html new file mode 100644 index 00000000..19e8e7c8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateOptions.html @@ -0,0 +1,3 @@ +OptimisticUpdateOptions | Libraries
interface OptimisticUpdateOptions {
    skip?: (url: string, init: RequestInit) => boolean;
    store?: OptimisticUpdateStore;
}
Index

Properties

Properties

skip?: (url: string, init: RequestInit) => boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateStore.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateStore.html new file mode 100644 index 00000000..7622f66b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.optimistic-update.OptimisticUpdateStore.html @@ -0,0 +1,2 @@ +OptimisticUpdateStore | Libraries
interface OptimisticUpdateStore {
    failures: OptimisticFailure[];
}
Index

Properties

Properties

failures: OptimisticFailure[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.OptimisticMutationConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.OptimisticMutationConfig.html new file mode 100644 index 00000000..2b638eb8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.OptimisticMutationConfig.html @@ -0,0 +1,6 @@ +OptimisticMutationConfig | Libraries

Interface OptimisticMutationConfig<TData, TArgs>

interface OptimisticMutationConfig<TData, TArgs> {
    onError?: (error: WebError, args: TArgs) => void;
    onSettled?: (
        data: TData | undefined,
        error: WebError | null,
        args: TArgs,
    ) => void;
    onSuccess?: (data: TData, args: TArgs) => void;
    optimisticUpdate: (oldData: TData | undefined, args: TArgs) => TData;
    queryKey: readonly unknown[];
}

Type Parameters

  • TData
  • TArgs
Index

Properties

onError?: (error: WebError, args: TArgs) => void
onSettled?: (
    data: TData | undefined,
    error: WebError | null,
    args: TArgs,
) => void
onSuccess?: (data: TData, args: TArgs) => void
optimisticUpdate: (oldData: TData | undefined, args: TArgs) => TData
queryKey: readonly unknown[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.UseSubscriptionOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.UseSubscriptionOptions.html new file mode 100644 index 00000000..328c59d0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.UseSubscriptionOptions.html @@ -0,0 +1,6 @@ +UseSubscriptionOptions | Libraries

Interface UseSubscriptionOptions

Options for useSubscription.

+
interface UseSubscriptionOptions {
    enabled?: boolean;
    maxEvents?: number;
}
Index

Properties

Properties

enabled?: boolean

Whether the subscription should be active. Defaults to true.

+
maxEvents?: number

Maximum number of events to keep in the events array. Defaults to unlimited.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.UseSubscriptionState.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.UseSubscriptionState.html new file mode 100644 index 00000000..ea0f3943 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.react.UseSubscriptionState.html @@ -0,0 +1,14 @@ +UseSubscriptionState | Libraries

Interface UseSubscriptionState<TOutgoing, TIncoming>

The state returned by useSubscription.

+
interface UseSubscriptionState<TOutgoing, TIncoming> {
    close: () => void;
    error: Error | undefined;
    events: TOutgoing[];
    lastEvent: TOutgoing | undefined;
    send: (message: TIncoming) => void;
    state: "connecting" | "connected" | "reconnecting" | "closed";
}

Type Parameters

  • TOutgoing
  • TIncoming
Index

Properties

close: () => void

Close the subscription.

+
error: Error | undefined

The last error that occurred, if any.

+
events: TOutgoing[]

All events received so far (newest last).

+
lastEvent: TOutgoing | undefined

The most recently received event.

+
send: (message: TIncoming) => void

Send a message to the server (bidirectional subscriptions).

+
state: "connecting" | "connected" | "reconnecting" | "closed"

Current connection state.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.retry.RetryOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.retry.RetryOptions.html new file mode 100644 index 00000000..434e8111 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.retry.RetryOptions.html @@ -0,0 +1,30 @@ +RetryOptions | Libraries

Options for the retry middleware.

+
interface RetryOptions {
    backoffLimit?: number;
    delay?: (attemptCount: number) => number;
    jitter?: boolean | ((delay: number) => number);
    limit?: number;
    methods?: string[];
    retryOnTimeout?: boolean;
    shouldRetry?: (error: Error, retryCount: number) => boolean;
    statusCodes?: number[];
}
Index

Properties

backoffLimit?: number

Maximum delay in milliseconds between retries. +Defaults to Infinity.

+
delay?: (attemptCount: number) => number

Custom delay function. Receives the current attempt number (1-based) +and returns the delay in milliseconds.

+

Defaults to exponential backoff: 0.3 * 2^(attempt-1) * 1000.

+
jitter?: boolean | ((delay: number) => number)

Adds randomized jitter to the delay to avoid thundering-herd problems.

+
    +
  • true — applies full jitter (delay * random(0, 1)).
  • +
  • A function — custom jitter: (delay) => adjustedDelay.
  • +
+

Defaults to false (no jitter).

+
limit?: number

Maximum number of retry attempts. Defaults to 2.

+
methods?: string[]

HTTP methods that are eligible for retry. +Defaults to ['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS'].

+
retryOnTimeout?: boolean

Whether to retry on timeout errors. +Defaults to false.

+
shouldRetry?: (error: Error, retryCount: number) => boolean

Custom predicate to decide whether to retry a given error. +When provided, it is checked in addition to the statusCodes check.

+
statusCodes?: number[]

HTTP status codes that trigger a retry. +Defaults to [408, 429, 500, 502, 503, 504].

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.timeout.TimeoutOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.timeout.TimeoutOptions.html new file mode 100644 index 00000000..3614e71b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_client.timeout.TimeoutOptions.html @@ -0,0 +1,5 @@ +TimeoutOptions | Libraries

Options for the timeout middleware.

+
interface TimeoutOptions {
    timeout?: number;
}
Index

Properties

Properties

timeout?: number

Per-request timeout in milliseconds. +Defaults to 10000 (10 seconds).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.IServiceProvider.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.IServiceProvider.html new file mode 100644 index 00000000..cc9778f7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.IServiceProvider.html @@ -0,0 +1,11 @@ +IServiceProvider | Libraries

Interface IServiceProvider

Minimal interface for the service provider, used to avoid circular +dependencies between modules.

+
interface IServiceProvider {
    get<TSchema extends SchemaBuilder<any, any, any, any, any>>(
        schema: TSchema,
    ): InferType<TSchema>;
    getOptional<TSchema extends SchemaBuilder<any, any, any, any, any>>(
        schema: TSchema,
    ): InferType<TSchema> | undefined;
}

Implemented by

Index

Methods

Methods

  • Resolves a service by its schema key.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema>

    If the service is not registered.

    +
  • Resolves a service by its schema key, or returns undefined if not registered.

    +

    Type Parameters

    • TSchema extends SchemaBuilder<any, any, any, any, any>

    Parameters

    • schema: TSchema

      The schema instance used as the service identifier.

      +

    Returns InferType<TSchema> | undefined

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceDescriptor.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceDescriptor.html new file mode 100644 index 00000000..22852855 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceDescriptor.html @@ -0,0 +1,18 @@ +ServiceDescriptor | Libraries

Interface ServiceDescriptor<T>

Describes a registered service: its schema key, lifetime, factory, and +optional runtime validation flag.

+
interface ServiceDescriptor<T = any> {
    factory: ServiceFactory<T>;
    lifetime: ServiceLifetime;
    schema: SchemaBuilder<T, any, any, any, any>;
    validate: boolean;
}

Type Parameters

  • T = any

    The type of the service instance.

    +
Index

Properties

factory: ServiceFactory<T>

The factory function that creates the service instance.

+
lifetime: ServiceLifetime

The lifetime of the service.

+
schema: SchemaBuilder<T, any, any, any, any>

The schema used as the service identifier (reference equality).

+
validate: boolean

When true, the container validates the factory's return value against +the schema at resolution time using schema.validate().

+

false

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceProviderOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceProviderOptions.html new file mode 100644 index 00000000..0ff92b2d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceProviderOptions.html @@ -0,0 +1,9 @@ +ServiceProviderOptions | Libraries

Interface ServiceProviderOptions

Options for building a ServiceProvider from a ServiceCollection.

+
interface ServiceProviderOptions {
    validateScopes?: boolean;
}
Index

Properties

Properties

validateScopes?: boolean

When true, resolving a Scoped service +from the root provider (outside of a scope) throws an error. This helps +catch accidental singleton captures of scoped services.

+

Recommended for development. Matches .NET's ValidateScopes behaviour.

+

true

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceRegistrationOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceRegistrationOptions.html new file mode 100644 index 00000000..033986d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_di.ServiceRegistrationOptions.html @@ -0,0 +1,12 @@ +ServiceRegistrationOptions | Libraries

Interface ServiceRegistrationOptions

Options for service registration.

+
interface ServiceRegistrationOptions {
    validate?: boolean;
}
Index

Properties

Properties

validate?: boolean

When true, the resolved value is validated against the schema at +resolution time. Useful for development/debugging. Has a performance +cost proportional to the schema complexity.

+

false

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_env.InvalidEnvVar.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_env.InvalidEnvVar.html new file mode 100644 index 00000000..e12f4ee3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_env.InvalidEnvVar.html @@ -0,0 +1,10 @@ +InvalidEnvVar | Libraries

Interface InvalidEnvVar

Describes a single invalid environment variable.

+
interface InvalidEnvVar {
    configPath: string;
    errors: string[];
    value: string;
    varName: string;
}
Index

Properties

configPath: string

Dot-separated config path (e.g. 'db.port').

+
errors: string[]

Validation error messages.

+
value: string

The raw string value that failed validation.

+
varName: string

The environment variable name (e.g. 'DB_PORT').

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_env.MissingEnvVar.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_env.MissingEnvVar.html new file mode 100644 index 00000000..fef0a32a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_env.MissingEnvVar.html @@ -0,0 +1,8 @@ +MissingEnvVar | Libraries

Interface MissingEnvVar

Describes a single missing environment variable.

+
interface MissingEnvVar {
    configPath: string;
    type: string;
    varName: string;
}
Index

Properties

Properties

configPath: string

Dot-separated config path (e.g. 'db.host').

+
type: string

Schema type identifier (e.g. 'string', 'number').

+
varName: string

The environment variable name (e.g. 'DB_HOST').

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-clickhouse.ClickHouseClient.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-clickhouse.ClickHouseClient.html new file mode 100644 index 00000000..26971644 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-clickhouse.ClickHouseClient.html @@ -0,0 +1,40 @@ +ClickHouseClient | Libraries
interface ClickHouseClient {
    "[asyncDispose]"(): Promise<void>;
    close(): Promise<void>;
    command(params: ExecParams): Promise<CommandResult>;
    exec(
        params: ExecParams | ExecParamsWithValues<Readable>,
    ): Promise<ExecResult<Readable>>;
    insert<T>(params: InsertParams<Readable, T>): Promise<InsertResult>;
    ping(params?: PingParams): Promise<ConnPingResult>;
    query<Format extends DataFormat = "JSON">(
        params: QueryParamsWithFormat<Format>,
    ): Promise<QueryResult<Format>>;
}

Hierarchy

  • ClickHouseClient<Stream.Readable>
    • ClickHouseClient
Index

Methods

  • Shuts down the underlying connection. +This method should ideally be called only once per application lifecycle, +for example, during the graceful shutdown phase.

    +

    Returns Promise<void>

  • It should be used for statements that do not have any output, +when the format clause is not applicable, or when you are not interested in the response at all. +The response stream is destroyed immediately as we do not expect useful information there. +Examples of such statements are DDLs or custom inserts.

    +

    Parameters

    • params: ExecParams

    Returns Promise<CommandResult>

    if you have a custom query that does not work with ClickHouseClient.query, +and you are interested in the response data, consider using ClickHouseClient.exec.

    +
  • Similar to ClickHouseClient.command, but for the cases where the output is expected, +but format clause is not applicable. The caller of this method must consume the stream, +as the underlying socket will not be released until then, and the request will eventually be timed out.

    +

    Parameters

    • params: ExecParams | ExecParamsWithValues<Readable>

    Returns Promise<ExecResult<Readable>>

    it is not intended to use this method to execute the DDLs, such as CREATE TABLE or similar; +use ClickHouseClient.command instead.

    +
  • The primary method for data insertion. It is recommended to avoid arrays in case of large inserts +to reduce application memory consumption and consider streaming for most of such use cases. +As the insert operation does not provide any output, the response stream is immediately destroyed.

    +

    Type Parameters

    • T

    Parameters

    • params: InsertParams<Readable, T>

    Returns Promise<InsertResult>

    in case of a custom insert operation (e.g., INSERT FROM SELECT), +consider using ClickHouseClient.command, passing the entire raw query there +(including the FORMAT clause).

    +
  • A health-check request. It does not throw if an error occurs - the error is returned inside the result object.

    +

    By default, Node.js version uses the built-in /ping endpoint, which does not verify credentials. +Optionally, it can be switched to a SELECT query (see PingParamsWithSelectQuery). +In that case, the server will verify the credentials.

    +

    NOTE: Since the /ping endpoint does not support CORS, the Web version always uses a SELECT query.

    +

    Parameters

    • Optionalparams: PingParams

    Returns Promise<ConnPingResult>

  • Type Parameters

    • Format extends DataFormat = "JSON"

    Parameters

    • params: QueryParamsWithFormat<Format>

    Returns Promise<QueryResult<Format>>

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddColumnDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddColumnDiff.html new file mode 100644 index 00000000..48b677a3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddColumnDiff.html @@ -0,0 +1,9 @@ +AddColumnDiff | Libraries

A column to add in a migration.

+
interface AddColumnDiff {
    defaultValue?: any;
    name: string;
    nullable: boolean;
    onDelete?: string;
    onUpdate?: string;
    references?: { column: string; table: string };
    type: string;
}
Index

Properties

defaultValue?: any
name: string
nullable: boolean
onDelete?: string
onUpdate?: string
references?: { column: string; table: string }
type: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddForeignKeyDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddForeignKeyDiff.html new file mode 100644 index 00000000..0a7f2a01 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddForeignKeyDiff.html @@ -0,0 +1,7 @@ +AddForeignKeyDiff | Libraries

A foreign key to add in a migration.

+
interface AddForeignKeyDiff {
    column: string;
    foreignColumn: string;
    foreignTable: string;
    onDelete?: string;
    onUpdate?: string;
}
Index

Properties

column: string
foreignColumn: string
foreignTable: string
onDelete?: string
onUpdate?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddIndexDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddIndexDiff.html new file mode 100644 index 00000000..49264c0f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AddIndexDiff.html @@ -0,0 +1,5 @@ +AddIndexDiff | Libraries

An index to add in a migration.

+
interface AddIndexDiff {
    columns: string[];
    name?: string;
    unique?: boolean;
}
Index

Properties

Properties

columns: string[]
name?: string
unique?: boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AlterColumnDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AlterColumnDiff.html new file mode 100644 index 00000000..82f34d9b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..AlterColumnDiff.html @@ -0,0 +1,4 @@ +AlterColumnDiff | Libraries

Changes to apply to an existing column.

+
interface AlterColumnDiff {
    changes: Record<string, { from: any; to: any }>;
    name: string;
}
Index

Properties

Properties

changes: Record<string, { from: any; to: any }>
name: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..BoundQuery.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..BoundQuery.html new file mode 100644 index 00000000..d0b57751 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..BoundQuery.html @@ -0,0 +1,3 @@ +BoundQuery | Libraries
interface BoundQuery {
    transaction<T>(callback: (db: BoundQuery) => Promise<T>): Promise<T>;
    withTransaction(trx: Transaction): BoundQuery;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
        baseQuery: QueryBuilder,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
}
Index

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..CursorPaginationResult.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..CursorPaginationResult.html new file mode 100644 index 00000000..9c1b84d7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..CursorPaginationResult.html @@ -0,0 +1,8 @@ +CursorPaginationResult | Libraries

Interface CursorPaginationResult<T>

Result of cursor-based pagination via SchemaQueryBuilder.paginateAfter.

+
interface CursorPaginationResult<T> {
    data: T[];
    hasMore: boolean;
    nextCursor: string | null;
}

Type Parameters

  • T
Index

Properties

Properties

data: T[]

The rows for the current page.

+
hasMore: boolean

Whether more rows exist after this page.

+
nextCursor: string | null

Cursor value for the next page, or null if no more rows.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseCheckInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseCheckInfo.html new file mode 100644 index 00000000..2808d9ae --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseCheckInfo.html @@ -0,0 +1,4 @@ +DatabaseCheckInfo | Libraries

Check constraint information read from the database.

+
interface DatabaseCheckInfo {
    definition: string;
    name: string;
}
Index

Properties

Properties

definition: string
name: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseColumnInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseColumnInfo.html new file mode 100644 index 00000000..88f9080b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseColumnInfo.html @@ -0,0 +1,8 @@ +DatabaseColumnInfo | Libraries

Interface DatabaseColumnInfo

Column information read from the database.

+
interface DatabaseColumnInfo {
    defaultValue: string | null;
    maxLength: number | null;
    name: string;
    nullable: boolean;
    numericPrecision: number | null;
    type: string;
}
Index

Properties

defaultValue: string | null
maxLength: number | null
name: string
nullable: boolean
numericPrecision: number | null
type: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseForeignKeyInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseForeignKeyInfo.html new file mode 100644 index 00000000..11553a4b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseForeignKeyInfo.html @@ -0,0 +1,8 @@ +DatabaseForeignKeyInfo | Libraries

Interface DatabaseForeignKeyInfo

Foreign key information read from the database.

+
interface DatabaseForeignKeyInfo {
    columnName: string;
    constraintName: string;
    deleteRule: string;
    foreignColumn: string;
    foreignTable: string;
    updateRule: string;
}
Index

Properties

columnName: string
constraintName: string
deleteRule: string
foreignColumn: string
foreignTable: string
updateRule: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseIndexInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseIndexInfo.html new file mode 100644 index 00000000..72f3c92c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseIndexInfo.html @@ -0,0 +1,6 @@ +DatabaseIndexInfo | Libraries

Index information read from the database.

+
interface DatabaseIndexInfo {
    columns: string[];
    definition: string;
    name: string;
    unique: boolean;
}
Index

Properties

Properties

columns: string[]
definition: string
name: string
unique: boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseTableState.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseTableState.html new file mode 100644 index 00000000..dd71fecb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..DatabaseTableState.html @@ -0,0 +1,6 @@ +DatabaseTableState | Libraries

Interface DatabaseTableState

Full database table state from introspection.

+
interface DatabaseTableState {
    checks: DatabaseCheckInfo[];
    columns: Record<string, DatabaseColumnInfo>;
    foreignKeys: DatabaseForeignKeyInfo[];
    indexes: DatabaseIndexInfo[];
}
Index

Properties

columns: Record<string, DatabaseColumnInfo>
foreignKeys: DatabaseForeignKeyInfo[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..JoinManySpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..JoinManySpec.html new file mode 100644 index 00000000..e418bd77 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..JoinManySpec.html @@ -0,0 +1,19 @@ +JoinManySpec | Libraries

Interface JoinManySpec<TLocalSchema, TForeignSchema, TFieldName>

interface JoinManySpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    limit?: number;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    offset?: number;
    orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" };
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
Index

Properties

Name of the field that will hold the loaded array in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
limit?: number

Maximum number of related items to load per parent row

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
offset?: number

Number of related items to skip per parent row

+
orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" }

Column to order the related items by (required for deterministic limit/offset)

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..JoinOneSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..JoinOneSpec.html new file mode 100644 index 00000000..7790abd7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..JoinOneSpec.html @@ -0,0 +1,15 @@ +JoinOneSpec | Libraries

Interface JoinOneSpec<TLocalSchema, TForeignSchema, TFieldName, TRequired>

interface JoinOneSpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
    TRequired extends boolean = true,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    required?: TRequired;
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
  • TRequired extends boolean = true
Index

Properties

Name of the field that will hold the loaded object in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
required?: TRequired

If true (default), uses INNER JOIN; if false, uses LEFT JOIN (result may be null)

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..MigrationDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..MigrationDiff.html new file mode 100644 index 00000000..e074a7f5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..MigrationDiff.html @@ -0,0 +1,9 @@ +MigrationDiff | Libraries

Schema diff result between the code-first model and the live database.

+
interface MigrationDiff {
    addColumns: AddColumnDiff[];
    addForeignKeys: AddForeignKeyDiff[];
    addIndexes: AddIndexDiff[];
    alterColumns: AlterColumnDiff[];
    dropColumns: string[];
    dropForeignKeys: string[];
    dropIndexes: string[];
}
Index

Properties

addColumns: AddColumnDiff[]
addForeignKeys: AddForeignKeyDiff[]
addIndexes: AddIndexDiff[]
alterColumns: AlterColumnDiff[]
dropColumns: string[]
dropForeignKeys: string[]
dropIndexes: string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..PaginationResult.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..PaginationResult.html new file mode 100644 index 00000000..285dca62 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..PaginationResult.html @@ -0,0 +1,16 @@ +PaginationResult | Libraries

Interface PaginationResult<T>

Result of offset-based pagination via SchemaQueryBuilder.paginate.

+
interface PaginationResult<T> {
    data: T[];
    hasNextPage: boolean;
    hasPreviousPage: boolean;
    page: number;
    pageSize: number;
    total: number;
    totalPages: number;
}

Type Parameters

  • T
Index

Properties

data: T[]

The rows for the current page.

+
hasNextPage: boolean

Whether a next page exists.

+
hasPreviousPage: boolean

Whether a previous page exists.

+
page: number

Current page number (1-based).

+
pageSize: number

Number of rows per page.

+
total: number

Total number of matching rows across all pages.

+
totalPages: number

Total number of pages.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..PrimaryKeyColumns.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..PrimaryKeyColumns.html new file mode 100644 index 00000000..766129e2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..PrimaryKeyColumns.html @@ -0,0 +1,9 @@ +PrimaryKeyColumns | Libraries

Result of getPrimaryKeyColumns.

+

propertyKeys are the schema property names (the keys you'd use in +.where(t => t.id, ...) style accessors); columnNames are the SQL +column names after applying any hasColumnName() overrides. Order is +preserved: composite-PK ordering matches the user's hasPrimaryKey() +declaration; single-PK arrays have length 1.

+
interface PrimaryKeyColumns {
    columnNames: readonly string[];
    propertyKeys: readonly string[];
}
Index

Properties

columnNames: readonly string[]
propertyKeys: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RelationInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RelationInfo.html new file mode 100644 index 00000000..486b7761 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RelationInfo.html @@ -0,0 +1,6 @@ +RelationInfo | Libraries

Interface RelationInfo<TKind, TForeign>

Phantom info for a single declared relation, stored on Entity's TRels +generic. TForeign is captured so .include() can type the customize +callback against the correct foreign schema.

+
interface RelationInfo<
    TKind extends "belongsTo"
    | "hasOne"
    | "hasMany"
    | "belongsToMany" = any,
    TForeign extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
    >,
> {
    foreign: TForeign;
    kind: TKind;
}

Type Parameters

  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany" = any
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<any, any, any, any, any, any, any>
Index

Properties

Properties

foreign: TForeign
kind: TKind
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RelationSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RelationSpec.html new file mode 100644 index 00000000..e488f250 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RelationSpec.html @@ -0,0 +1,7 @@ +RelationSpec | Libraries

Interface RelationSpecInternal

Relation metadata stored via .hasMany(), .belongsTo(), etc.

+
interface RelationSpec {
    foreignKey?: any;
    name: string;
    schema: any;
    through?: { foreignKey: string; localKey: string; table: string };
    type: "hasMany" | "hasOne" | "belongsTo" | "belongsToMany";
}
Index

Properties

foreignKey?: any
name: string
schema: any
through?: { foreignKey: string; localKey: string; table: string }
type: "hasMany" | "hasOne" | "belongsTo" | "belongsToMany"
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ResolvedVariantConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ResolvedVariantConfig.html new file mode 100644 index 00000000..1ba5e182 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ResolvedVariantConfig.html @@ -0,0 +1,8 @@ +ResolvedVariantConfig | Libraries

Interface ResolvedVariantConfigInternal

Full variant config stored in the schema extension 'variants'.

+
interface ResolvedVariantConfig {
    discriminatorColumn: string;
    discriminatorKey: string;
    variants: Record<string, ResolvedVariantSpec>;
}
Index

Properties

discriminatorColumn: string

SQL column name corresponding to discriminatorKey. Filled by query builder.

+
discriminatorKey: string

Property key on the base schema that is the discriminator.

+
variants: Record<string, ResolvedVariantSpec>

Map from discriminator value → resolved variant spec.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ResolvedVariantSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ResolvedVariantSpec.html new file mode 100644 index 00000000..aac0d0ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ResolvedVariantSpec.html @@ -0,0 +1,12 @@ +ResolvedVariantSpec | Libraries

Interface ResolvedVariantSpecInternal

Resolved, normalised variant spec stored in schema extensions.

+
interface ResolvedVariantSpec {
    allowOrphan: boolean;
    enforceCheck: boolean;
    foreignKey?: string;
    relations: ResolvedVariantRelationSpec[];
    schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    storage: VariantStorageType;
    tableName?: string;
}
Index

Properties

allowOrphan: boolean
enforceCheck: boolean
foreignKey?: string

CTI: FK column name on the variant table.

+
relations: ResolvedVariantRelationSpec[]

Variant-scoped relations (resolved), populated by .withVariants().

+
schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
tableName?: string

CTI: variant table name (from schema.hasTableName()).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RowVersionColumn.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RowVersionColumn.html new file mode 100644 index 00000000..dcadec3d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..RowVersionColumn.html @@ -0,0 +1,9 @@ +RowVersionColumn | Libraries

Resolved row-version column for a schema, returned by +getRowVersionColumn.

+
interface RowVersionColumn {
    columnName: string;
    propertyKey: string;
    strategy: RowVersionStrategy;
}
Index

Properties

columnName: string

SQL column name (after any hasColumnName() override).

+
propertyKey: string

Schema property name.

+

Concurrency-token update strategy.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..SchemaSnapshot.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..SchemaSnapshot.html new file mode 100644 index 00000000..cc55eee9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..SchemaSnapshot.html @@ -0,0 +1,11 @@ +SchemaSnapshot | Libraries

Serialized snapshot of all entity schemas at a given point in time.

+

Stored in <migrations.directory>/snapshot.json and committed to version +control. migrate generate diffs the current code against this snapshot +(instead of a live database) to produce migration files, so no DB +connection is required.

+

Each entry in tables mirrors the shape that introspectDatabase would +return — allowing diffSchema to be reused unchanged.

+
interface SchemaSnapshot {
    tables: Record<string, DatabaseTableState>;
    version: 1;
}
Index

Properties

Properties

tables: Record<string, DatabaseTableState>

Map of table name → database state derived from entity schemas.

+
version: 1
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ValidatedJoinManySpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ValidatedJoinManySpec.html new file mode 100644 index 00000000..c0b52fa4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ValidatedJoinManySpec.html @@ -0,0 +1,9 @@ +ValidatedJoinManySpec | Libraries

Interface ValidatedJoinManySpec

interface ValidatedJoinManySpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    limit: number | null;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    offset: number | null;
    orderBy: { column: string; direction: "asc" | "desc" } | null;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
limit: number | null
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
offset: number | null
orderBy: { column: string; direction: "asc" | "desc" } | null
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ValidatedJoinOneSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ValidatedJoinOneSpec.html new file mode 100644 index 00000000..e3888cdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema..ValidatedJoinOneSpec.html @@ -0,0 +1,7 @@ +ValidatedJoinOneSpec | Libraries

Interface ValidatedJoinOneSpec

interface ValidatedJoinOneSpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    required: boolean;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
required: boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema.extension.VariantInputForResolver.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema.extension.VariantInputForResolver.html new file mode 100644 index 00000000..ac574923 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_knex-schema.extension.VariantInputForResolver.html @@ -0,0 +1,14 @@ +VariantInputForResolver | Libraries

Interface VariantInputForResolverInternal

Input to applyVariantsToSchema: a single resolved variant +entry, as produced by Entity.ctiVariant() / Entity.stiVariant().

+
interface VariantInputForResolver {
    allowOrphan?: boolean;
    enforceCheck?: boolean;
    foreignKeyColumn?: string;
    relations?: ResolvedVariantRelationSpec[];
    schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    storage: VariantStorageType;
}
Index

Properties

allowOrphan?: boolean
enforceCheck?: boolean
foreignKeyColumn?: string

CTI-only: FK column name on the variant table that joins back to base PK.

+
relations?: ResolvedVariantRelationSpec[]

Variant-scoped relations (already resolved to FK column names). When +the variant entry is sourced from another Entity, these are read +from that entity's 'relations' extension and passed in here.

+
schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>

Variant body schema (CTI table or STI extras).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..BatchingSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..BatchingSinkOptions.html new file mode 100644 index 00000000..bed8810a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..BatchingSinkOptions.html @@ -0,0 +1,34 @@ +BatchingSinkOptions | Libraries

Interface BatchingSinkOptions

Configuration for the batching sink wrapper.

+
interface BatchingSinkOptions {
    batchSize?: number;
    circuitBreakerThreshold?: number;
    emit: (batch: LogEvent[]) => Promise<void>;
    flushInterval?: number;
    maxQueueSize?: number;
    maxRetries?: number;
    retryDelay?: number;
}
Index

Properties

batchSize?: number

Flush after this many events.

+
100
+
+ +
circuitBreakerThreshold?: number

Consecutive failures before circuit breaker opens.

+
3
+
+ +
emit: (batch: LogEvent[]) => Promise<void>

The emit function that writes a batch to the target.

+
flushInterval?: number

Flush after this many milliseconds of inactivity.

+
2000
+
+ +
maxQueueSize?: number

Maximum buffered events before dropping.

+
50000
+
+ +
maxRetries?: number

Maximum retry attempts for failed flushes.

+
5
+
+ +
retryDelay?: number

Initial retry delay in ms (exponential backoff).

+
1000
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..ConsoleSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..ConsoleSinkOptions.html new file mode 100644 index 00000000..dc5d3944 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..ConsoleSinkOptions.html @@ -0,0 +1,17 @@ +ConsoleSinkOptions | Libraries

Interface ConsoleSinkOptions

Console sink configuration.

+
interface ConsoleSinkOptions {
    minimumLevel?: LogLevelName;
    mode?: "pretty" | "json";
    theme?: "dark" | "light" | "none";
}
Index

Properties

Properties

minimumLevel?: LogLevelName

Minimum level for this sink.

+
undefined (uses pipeline level)
+
+ +
mode?: "pretty" | "json"

Output mode: 'pretty' for colored human-readable, 'json' for CLEF.

+
'pretty'
+
+ +
theme?: "dark" | "light" | "none"

Color theme for pretty mode.

+
'dark'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..CorrelationIdMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..CorrelationIdMiddlewareOptions.html new file mode 100644 index 00000000..b7975c25 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..CorrelationIdMiddlewareOptions.html @@ -0,0 +1,17 @@ +CorrelationIdMiddlewareOptions | Libraries

Interface CorrelationIdMiddlewareOptions

Correlation ID middleware configuration.

+
interface CorrelationIdMiddlewareOptions {
    generate?: () => string;
    requestHeaders?: string[];
    responseHeader?: string | false;
}
Index

Properties

generate?: () => string

Custom ID generator.

+
generateCorrelationId
+
+ +
requestHeaders?: string[]

Headers to read from incoming request (checked in order).

+
['X-Correlation-Id', 'X-Request-Id']
+
+ +
responseHeader?: string | false

Header to set on the response. Set to false to skip setting a response header entirely.

+
'X-Correlation-Id'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..CreateSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..CreateSinkOptions.html new file mode 100644 index 00000000..3282c29c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..CreateSinkOptions.html @@ -0,0 +1,10 @@ +CreateSinkOptions | Libraries

Interface CreateSinkOptions

Configuration for a quick custom sink.

+
interface CreateSinkOptions {
    dispose?: () => Promise<void>;
    emit: (events: LogEvent[]) => Promise<void>;
    flush?: () => Promise<void>;
    minimumLevel?: LogLevelName;
}
Index

Properties

dispose?: () => Promise<void>

Optional dispose function.

+
emit: (events: LogEvent[]) => Promise<void>

The emit function that writes events.

+
flush?: () => Promise<void>

Optional flush function.

+
minimumLevel?: LogLevelName

Minimum level for this sink.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..FileSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..FileSinkOptions.html new file mode 100644 index 00000000..ca556c15 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..FileSinkOptions.html @@ -0,0 +1,8 @@ +FileSinkOptions | Libraries

Interface FileSinkOptions

File sink configuration.

+
interface FileSinkOptions {
    minimumLevel?: LogLevelName;
    path: string;
    rotation?: RotationOptions;
}
Index

Properties

minimumLevel?: LogLevelName

Minimum level for this sink.

+
path: string

Path to the log file.

+
rotation?: RotationOptions

Rotation configuration.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogContextStore.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogContextStore.html new file mode 100644 index 00000000..08b3e24e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogContextStore.html @@ -0,0 +1,5 @@ +LogContextStore | Libraries

Interface LogContextStore

Store shape for the ambient log context.

+
interface LogContextStore {
    correlationId?: string;
    logger: Logger;
    properties?: Record<string, unknown>;
}
Index

Properties

correlationId?: string
logger: Logger
properties?: Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogEvent.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogEvent.html new file mode 100644 index 00000000..502d50d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogEvent.html @@ -0,0 +1,19 @@ +LogEvent | Libraries

Interface LogEvent

Represents a single structured log event in the pipeline.

+

Log events carry both a human-readable rendered message and the original +message template with structured property values, enabling both +human-friendly display and machine-queryable structured search.

+
interface LogEvent {
    eventId?: string;
    exception?: Error;
    level: LogLevel;
    messageTemplate: string;
    properties: Record<string, unknown>;
    renderedMessage: string;
    timestamp: Date;
}
Index

Properties

eventId?: string

Deterministic hex hash of messageTemplate — maps to CLEF @i.

+
exception?: Error

The exception associated with this event, if any.

+
level: LogLevel

Severity level of the event.

+
messageTemplate: string

The raw message template with {Property} holes.

+
properties: Record<string, unknown>

Structured properties extracted from the template and enrichers.

+
renderedMessage: string

The fully interpolated, human-readable message.

+
timestamp: Date

ISO timestamp when the event occurred.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogSink.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogSink.html new file mode 100644 index 00000000..8b5d5e54 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LogSink.html @@ -0,0 +1,10 @@ +LogSink | Libraries

Interface LogSink

A sink that receives batches of log events for output.

+

Sinks must implement AsyncDisposable for graceful shutdown. +The flush() method is optional and forces immediate delivery +of any buffered events.

+
interface LogSink {
    "[asyncDispose]"(): PromiseLike<void>;
    emit(events: LogEvent[]): Promise<void>;
    flush?(): Promise<void>;
}

Hierarchy

  • AsyncDisposable
    • LogSink

Implemented by

Index

Methods

  • Returns PromiseLike<void>

  • Force immediate delivery of buffered events.

    +

    Returns Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LoggerConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LoggerConfig.html new file mode 100644 index 00000000..f1a9636c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..LoggerConfig.html @@ -0,0 +1,30 @@ +LoggerConfig | Libraries

Interface LoggerConfig

Configuration for creating a structured logger.

+
interface LoggerConfig {
    dropPolicy?: "dropOldest" | "dropNewest" | "block";
    enrichers?: Enricher[];
    filters?: LogFilter[];
    handleProcessExit?: boolean;
    levelOverrides?: Record<string, LogLevelName>;
    maxQueueSize?: number;
    minimumLevel?: LogLevel | LogLevelName;
    sinks: LogSink[];
}
Index

Properties

dropPolicy?: "dropOldest" | "dropNewest" | "block"

Policy when queue is full.

+
'dropOldest'
+
+ +
enrichers?: Enricher[]

Enrichers that add properties to every event.

+
filters?: LogFilter[]

Filters that determine which events pass through.

+
handleProcessExit?: boolean

Whether to hook SIGTERM and beforeExit for flush.

+
false
+
+ +
levelOverrides?: Record<string, LogLevelName>

Namespace-level overrides for minimum log level.

+
maxQueueSize?: number

Maximum queued events before dropping.

+
10000
+
+ +
minimumLevel?: LogLevel | LogLevelName

Minimum log level (name or numeric).

+
'information'
+
+ +
sinks: LogSink[]

Output sinks for log events.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..RequestLoggingOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..RequestLoggingOptions.html new file mode 100644 index 00000000..5e8fc71e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..RequestLoggingOptions.html @@ -0,0 +1,23 @@ +RequestLoggingOptions | Libraries

Interface RequestLoggingOptions

Request logging middleware configuration.

+
interface RequestLoggingOptions {
    enrichRequest?: (ctx: any) => Record<string, unknown>;
    excludePaths?: (string | { path: string })[];
    getLevel?: (statusCode: number, elapsedMs: number) => LogLevelName;
    logRequestBody?: boolean;
    logRequestStart?: boolean;
    logResponseBody?: boolean;
}
Index

Properties

enrichRequest?: (ctx: any) => Record<string, unknown>

Extract custom properties from the request context.

+
excludePaths?: (string | { path: string })[]

Paths to exclude from request logging. Accepts plain strings or objects with a path property (e.g. endpoint builders).

+
getLevel?: (statusCode: number, elapsedMs: number) => LogLevelName

Customize log level based on status code and elapsed time.

+
logRequestBody?: boolean

Whether to log request bodies.

+
false
+
+ +
logRequestStart?: boolean

Whether to log when request starts (in addition to completion).

+
false
+
+ +
logResponseBody?: boolean

Whether to log response bodies.

+
false
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..RotationOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..RotationOptions.html new file mode 100644 index 00000000..a8d7de7f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..RotationOptions.html @@ -0,0 +1,13 @@ +RotationOptions | Libraries

Interface RotationOptions

File rotation configuration.

+
interface RotationOptions {
    interval?: "hourly" | "daily";
    maxBytes?: number;
    retainCount?: number;
    strategy: "size" | "time" | "hybrid";
}
Index

Properties

interval?: "hourly" | "daily"

Time-based rotation interval (for 'time' and 'hybrid').

+
maxBytes?: number

Maximum file size in bytes before rotation (for 'size' and 'hybrid').

+
retainCount?: number

Number of rotated files to retain.

+
10
+
+ +
strategy: "size" | "time" | "hybrid"

Rotation strategy.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..SeqSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..SeqSinkOptions.html new file mode 100644 index 00000000..804f1665 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..SeqSinkOptions.html @@ -0,0 +1,26 @@ +SeqSinkOptions | Libraries

Interface SeqSinkOptions

Seq sink configuration.

+
interface SeqSinkOptions {
    apiKey?: string;
    batchSize?: number;
    flushInterval?: number;
    maxRetries?: number;
    retryDelay?: number;
    serverUrl: string;
}
Index

Properties

apiKey?: string

Optional API key sent as X-Seq-ApiKey header.

+
batchSize?: number

Events per batch.

+
100
+
+ +
flushInterval?: number

Max milliseconds between flushes.

+
2000
+
+ +
maxRetries?: number

Maximum retry attempts.

+
5
+
+ +
retryDelay?: number

Initial retry delay in ms.

+
1000
+
+ +
serverUrl: string

Base URL of the Seq server (e.g. http://localhost:5341).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..SerializationOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..SerializationOptions.html new file mode 100644 index 00000000..dd4a3ee9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..SerializationOptions.html @@ -0,0 +1,12 @@ +SerializationOptions | Libraries

Interface SerializationOptions

Options for the safe serializer.

+
interface SerializationOptions {
    maxDepth?: number;
    maxStringLength?: number;
}
Index

Properties

maxDepth?: number

Maximum nesting depth for objects/arrays.

+
10
+
+ +
maxStringLength?: number

Maximum length for string values before truncation.

+
32768
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..TypedTemplate.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..TypedTemplate.html new file mode 100644 index 00000000..117c5420 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log..TypedTemplate.html @@ -0,0 +1,12 @@ +TypedTemplate | Libraries

Interface TypedTemplate<T>

A typed message template created via ParseStringSchemaBuilder.

+

When passed to a Logger log method, the logger uses template as the +messageTemplate (so events with the same shape are grouped in Seq / +SigNoz / ClickHouse) and derives the rendered message by interpolating +template with the supplied parameters.

+
import { s } from '@cleverbrush/schema';

// Build a reusable typed template once
const tmpl = s.parseString('Todo #{TodoId} "{Title}" created by {UserId}');

// All log sites share the same messageTemplate → groupable in the UI
logger.info(tmpl, { TodoId: 1, Title: 'Buy milk', UserId: 'u-42' }); +
+ +
interface TypedTemplate<T extends Record<string, unknown>> {
    template?: string;
    serialize(params: T): string;
}

Type Parameters

  • T extends Record<string, unknown>
Index

Properties

Methods

Properties

template?: string

The raw {Property} pattern string, used as messageTemplate.

+

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.ClickHouseColumnMapping.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.ClickHouseColumnMapping.html new file mode 100644 index 00000000..754055fe --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.ClickHouseColumnMapping.html @@ -0,0 +1,12 @@ +ClickHouseColumnMapping | Libraries

Interface ClickHouseColumnMapping

Column mapping for the ClickHouse logs table.

+
interface ClickHouseColumnMapping {
    correlationId?: string;
    exception?: string;
    level?: string;
    messageTemplate?: string;
    properties?: string;
    renderedMessage?: string;
    sourceContext?: string;
    spanId?: string;
    timestamp?: string;
    traceId?: string;
}
Index

Properties

correlationId?: string
exception?: string
level?: string
messageTemplate?: string
properties?: string
renderedMessage?: string
sourceContext?: string
spanId?: string
timestamp?: string
traceId?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.ClickHouseSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.ClickHouseSinkOptions.html new file mode 100644 index 00000000..4f31c78a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.ClickHouseSinkOptions.html @@ -0,0 +1,18 @@ +ClickHouseSinkOptions | Libraries

ClickHouse sink configuration.

+
interface ClickHouseSinkOptions {
    batchSize?: number;
    columns?: ClickHouseColumnMapping;
    connection: any;
    flushInterval?: number;
    table: string;
}
Index

Properties

batchSize?: number

Events per batch.

+
1000
+
+ +

Custom column mapping.

+
connection: any

Knex-ClickHouse connection instance.

+
flushInterval?: number

Max milliseconds between flushes.

+
5000
+
+ +
table: string

Table name to insert into.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.CreateLogsTableOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.CreateLogsTableOptions.html new file mode 100644 index 00000000..0f06d89d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_log.clickhouse.CreateLogsTableOptions.html @@ -0,0 +1,19 @@ +CreateLogsTableOptions | Libraries

Interface CreateLogsTableOptions

Options for creating the ClickHouse logs table.

+
interface CreateLogsTableOptions {
    engine?: string;
    orderBy?: string[];
    partitionBy?: string;
    ttl?: string;
}
Index

Properties

engine?: string

Table engine.

+
'MergeTree'
+
+ +
orderBy?: string[]

ORDER BY columns.

+
['timestamp', 'level']
+
+ +
partitionBy?: string

Partition expression.

+
"toYYYYMM(timestamp)"
+
+ +
ttl?: string

TTL expression for automatic data expiration.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm-cli.MigrationsConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm-cli.MigrationsConfig.html new file mode 100644 index 00000000..088d48d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm-cli.MigrationsConfig.html @@ -0,0 +1,11 @@ +MigrationsConfig | Libraries

Interface MigrationsConfig

Migration-runner configuration block inside OrmCliConfig.

+
interface MigrationsConfig {
    directory: string;
    snapshot?: string;
    tableName?: string;
}
Index

Properties

directory: string

Directory where migration files are read from / written to.

+
snapshot?: string

Path to the schema snapshot file. Must be committed to version control +— it is the source of truth for migrate generate.

+

<directory>/snapshot.json

+
tableName?: string

Knex migration tracking table name.

+

'knex_migrations'

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm-cli.OrmCliConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm-cli.OrmCliConfig.html new file mode 100644 index 00000000..c50e55fa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm-cli.OrmCliConfig.html @@ -0,0 +1,12 @@ +OrmCliConfig | Libraries

Interface OrmCliConfig

Shape of the default export expected in db.config.ts.

+
// db.config.ts
import { defineConfig } from '@cleverbrush/orm-cli';
import knex from './src/db/knex.js';
import { UserEntity, TodoEntity } from './src/db/schemas.js';

export default defineConfig({
knex,
entities: { users: UserEntity, todos: TodoEntity },
migrations: { directory: './migrations' },
}); +
+ +
interface OrmCliConfig {
    entities: Record<string, Entity<any, any>>;
    knex: Knex;
    migrations: MigrationsConfig;
}
Index

Properties

Properties

entities: Record<string, Entity<any, any>>

Map of entity name to Entity definition. The same map you pass to +createDb() from @cleverbrush/orm.

+
knex: Knex

A live Knex instance connected to your database.

+
migrations: MigrationsConfig

Migration configuration.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddColumnDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddColumnDiff.html new file mode 100644 index 00000000..cd8fe8ff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddColumnDiff.html @@ -0,0 +1,9 @@ +AddColumnDiff | Libraries

Interface AddColumnDiff

A column to add in a migration.

+
interface AddColumnDiff {
    defaultValue?: any;
    name: string;
    nullable: boolean;
    onDelete?: string;
    onUpdate?: string;
    references?: { column: string; table: string };
    type: string;
}
Index

Properties

defaultValue?: any
name: string
nullable: boolean
onDelete?: string
onUpdate?: string
references?: { column: string; table: string }
type: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddForeignKeyDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddForeignKeyDiff.html new file mode 100644 index 00000000..767223cf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddForeignKeyDiff.html @@ -0,0 +1,7 @@ +AddForeignKeyDiff | Libraries

Interface AddForeignKeyDiff

A foreign key to add in a migration.

+
interface AddForeignKeyDiff {
    column: string;
    foreignColumn: string;
    foreignTable: string;
    onDelete?: string;
    onUpdate?: string;
}
Index

Properties

column: string
foreignColumn: string
foreignTable: string
onDelete?: string
onUpdate?: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddIndexDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddIndexDiff.html new file mode 100644 index 00000000..611990e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AddIndexDiff.html @@ -0,0 +1,5 @@ +AddIndexDiff | Libraries

Interface AddIndexDiff

An index to add in a migration.

+
interface AddIndexDiff {
    columns: string[];
    name?: string;
    unique?: boolean;
}
Index

Properties

Properties

columns: string[]
name?: string
unique?: boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AlterColumnDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AlterColumnDiff.html new file mode 100644 index 00000000..69a8fa3a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.AlterColumnDiff.html @@ -0,0 +1,4 @@ +AlterColumnDiff | Libraries

Interface AlterColumnDiff

Changes to apply to an existing column.

+
interface AlterColumnDiff {
    changes: Record<string, { from: any; to: any }>;
    name: string;
}
Index

Properties

Properties

changes: Record<string, { from: any; to: any }>
name: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.BoundQuery.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.BoundQuery.html new file mode 100644 index 00000000..27362d8c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.BoundQuery.html @@ -0,0 +1,3 @@ +BoundQuery | Libraries

Interface BoundQuery

interface BoundQuery {
    transaction<T>(callback: (db: BoundQuery) => Promise<T>): Promise<T>;
    withTransaction(trx: Transaction): BoundQuery;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
    <
        TLocalSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    >(
        schema: TLocalSchema,
        baseQuery: QueryBuilder,
    ): SchemaQueryBuilder<TLocalSchema, QueryResultType<TLocalSchema>>;
}
Index

Methods

  • Type Parameters

    • T

    Parameters

    Returns Promise<T>

  • Parameters

    • trx: Transaction

    Returns BoundQuery

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.CursorPaginationResult.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.CursorPaginationResult.html new file mode 100644 index 00000000..e589c63a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.CursorPaginationResult.html @@ -0,0 +1,8 @@ +CursorPaginationResult | Libraries

Interface CursorPaginationResult<T>

Result of cursor-based pagination via SchemaQueryBuilder.paginateAfter.

+
interface CursorPaginationResult<T> {
    data: T[];
    hasMore: boolean;
    nextCursor: string | null;
}

Type Parameters

  • T
Index

Properties

Properties

data: T[]

The rows for the current page.

+
hasMore: boolean

Whether more rows exist after this page.

+
nextCursor: string | null

Cursor value for the next page, or null if no more rows.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseCheckInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseCheckInfo.html new file mode 100644 index 00000000..dba0ec1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseCheckInfo.html @@ -0,0 +1,4 @@ +DatabaseCheckInfo | Libraries

Interface DatabaseCheckInfo

Check constraint information read from the database.

+
interface DatabaseCheckInfo {
    definition: string;
    name: string;
}
Index

Properties

Properties

definition: string
name: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseColumnInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseColumnInfo.html new file mode 100644 index 00000000..7c231bbb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseColumnInfo.html @@ -0,0 +1,8 @@ +DatabaseColumnInfo | Libraries

Interface DatabaseColumnInfo

Column information read from the database.

+
interface DatabaseColumnInfo {
    defaultValue: string | null;
    maxLength: number | null;
    name: string;
    nullable: boolean;
    numericPrecision: number | null;
    type: string;
}
Index

Properties

defaultValue: string | null
maxLength: number | null
name: string
nullable: boolean
numericPrecision: number | null
type: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseForeignKeyInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseForeignKeyInfo.html new file mode 100644 index 00000000..182b8a51 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseForeignKeyInfo.html @@ -0,0 +1,8 @@ +DatabaseForeignKeyInfo | Libraries

Interface DatabaseForeignKeyInfo

Foreign key information read from the database.

+
interface DatabaseForeignKeyInfo {
    columnName: string;
    constraintName: string;
    deleteRule: string;
    foreignColumn: string;
    foreignTable: string;
    updateRule: string;
}
Index

Properties

columnName: string
constraintName: string
deleteRule: string
foreignColumn: string
foreignTable: string
updateRule: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseIndexInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseIndexInfo.html new file mode 100644 index 00000000..d8007b33 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseIndexInfo.html @@ -0,0 +1,6 @@ +DatabaseIndexInfo | Libraries

Interface DatabaseIndexInfo

Index information read from the database.

+
interface DatabaseIndexInfo {
    columns: string[];
    definition: string;
    name: string;
    unique: boolean;
}
Index

Properties

Properties

columns: string[]
definition: string
name: string
unique: boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseTableState.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseTableState.html new file mode 100644 index 00000000..eb3486b4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DatabaseTableState.html @@ -0,0 +1,6 @@ +DatabaseTableState | Libraries

Interface DatabaseTableState

Full database table state from introspection.

+
interface DatabaseTableState {
    checks: DatabaseCheckInfo[];
    columns: Record<string, DatabaseColumnInfo>;
    foreignKeys: DatabaseForeignKeyInfo[];
    indexes: DatabaseIndexInfo[];
}
Index

Properties

columns: Record<string, DatabaseColumnInfo>
foreignKeys: DatabaseForeignKeyInfo[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DbSet.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DbSet.html new file mode 100644 index 00000000..7aa3f145 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.DbSet.html @@ -0,0 +1,139 @@ +DbSet | Libraries

Interface DbSet<TEntity>

Typed query starter for a registered entity. Structurally it behaves like +a fresh EntityQuery — every method invocation allocates a new +underlying SchemaQueryBuilder so chains stay isolated.

+

Additional members beyond EntityQuery:

+
    +
  • entity — the wrapped Entity definition.
  • +
  • query() — explicit factory for a fresh EntityQuery (rarely needed).
  • +
  • withTransaction(trx) — return a new DbSet bound to a transaction.
  • +
+
interface DbSet<TEntity extends Entity<any, any, any>> {
    entity: TEntity;
    andWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    andWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    andWhere(record: Record<string, any>): this;
    andWhere(callback: (builder: QueryBuilder) => void): this;
    andWhere(raw: Raw): this;
    apply(fn: (builder: QueryBuilder) => void): this;
    avg(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    bulkInsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts?: {
            chunkSize?: number;
            conflictColumns?: ColumnRef<EntitySchema<TEntity>>[];
            onConflict?: "ignore" | "merge";
        },
    ): Promise<EntityResult<TEntity>[]>;
    bulkUpdate(
        updates: readonly {
            set: Partial<InferType<TLocalSchema>>;
            where: Partial<InferType<TLocalSchema>>;
        }[],
    ): Promise<number>;
    bulkUpsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts: {
            chunkSize?: number;
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<EntityResult<TEntity>[]>;
    count(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    countDistinct(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    delete(): Promise<number>;
    distinct(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    execute(): Promise<EntityResult<TEntity>[]>;
    find(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<EntityResult<TEntity> | undefined>;
    findMany(
        pks: readonly PrimaryKeyValueOf<EntitySchema<TEntity>>[],
    ): Promise<EntityResult<TEntity>[]>;
    findOrFail(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<EntityResult<TEntity>>;
    first(): Promise<EntityResult<TEntity> | undefined>;
    groupBy(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    groupByRaw(sql: string, ...bindings: any[]): this;
    hardDelete(): Promise<number>;
    having(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    havingRaw(sql: string, ...bindings: any[]): this;
    include<K extends string>(
        sel: (t: RelKeyTree<TEntity>) => K,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<TEntity, WithIncluded<TEntity, EntityResult<TEntity>, K>>;
    includeVariant<TVariant extends string, TRel extends string>(
        variantKey: TVariant,
        relationName: TRel,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<
        TEntity,
        TRel extends keyof EntityRelations<TEntity> & string
            ? WithVariantIncluded<TEntity, EntityResult<TEntity>, TVariant, TRel>
            : EntityResult<TEntity>,
    >;
    insert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
    ): Promise<EntityResult<TEntity>>;
    insertMany(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
    ): Promise<EntityResult<TEntity>[]>;
    joinMany<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
    >(
        spec: JoinManySpec<EntitySchema<TEntity>, TForeignSchema, TFieldName>,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedMany<EntityResult<TEntity>, TFieldName, TForeignSchema>,
    >;
    joinOne<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
        TRequired extends boolean = true,
    >(
        spec: JoinOneSpec<
            EntitySchema<TEntity>,
            TForeignSchema,
            TFieldName,
            TRequired,
        >,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedOne<
            EntityResult<TEntity>,
            TFieldName,
            TForeignSchema,
            TRequired,
        >,
    >;
    limit(n: number): this;
    max(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    min(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    offset(n: number): this;
    ofVariant<K extends string>(variantKey: K): VariantDbSet<TEntity, K>;
    onConflict(
        ...conflictColumns: ColumnRef<EntitySchema<TEntity>>[],
    ): OnConflictBuilder<EntitySchema<TEntity>, EntityResult<TEntity>>;
    onlyDeleted(): this;
    orderBy(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        direction?: "asc" | "desc",
    ): this;
    orderByRaw(sql: string, ...bindings: any[]): this;
    orWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    orWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    orWhere(record: Record<string, any>): this;
    orWhere(callback: (builder: QueryBuilder) => void): this;
    orWhere(raw: Raw): this;
    orWhereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    orWhereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    paginate(
        opts: { page: number; pageSize: number },
    ): Promise<PaginationResult<EntityResult<TEntity>>>;
    paginateAfter(
        opts: {
            column?: ColumnRef<EntitySchema<TEntity>>;
            cursor?: any;
            direction?: "asc" | "desc";
            limit: number;
        },
    ): Promise<CursorPaginationResult<EntityResult<TEntity>>>;
    pluck<K extends string>(
        column: ColumnRef<EntitySchema<TEntity>>,
    ): Promise<EntityResult<TEntity>[K][]>;
    projected<K extends string>(
        name: K,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        Pick<
            EntityResult<TEntity>,
            ProjectionKeysOf<EntitySchema<TEntity>, K> & keyof EntityResult<TEntity>,
        >,
    >;
    query(): EntityQuery<TEntity, EntityResult<TEntity>>;
    restore(): Promise<EntityResult<TEntity>[]>;
    save(graph: SaveGraph<TEntity>): Promise<EntityResult<TEntity>>;
    scoped<K extends never>(name: K): this;
    select(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    select<TSel extends SelectSelector<EntitySchema<TEntity>>>(
        selector: TSel,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        SelectProjection<ReturnType<TSel>>,
    >;
    selectRaw(sql: string, bindings?: any[]): this;
    selectVariants(keys: string[]): this;
    sum(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    then<TReturn1 = EntityResult<TEntity>[], TReturn2 = never>(
        onfulfilled?:
            | (
                (value: EntityResult<TEntity>[]) => TReturn1 | PromiseLike<TReturn1>
            )
            | null,
        onrejected?: ((reason: any) => TReturn2 | PromiseLike<TReturn2>) | null,
    ): Promise<TReturn1 | TReturn2>;
    toKnexQuery(): QueryBuilder;
    toQuery(): string;
    toString(): string;
    transacting(
        trx: Transaction,
    ): SchemaQueryBuilder<EntitySchema<TEntity>, EntityResult<TEntity>>;
    unscoped(): this;
    update(
        data: Partial<InferType<TLocalSchema>>,
    ): Promise<EntityResult<TEntity>[]>;
    upsert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
        opts: {
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
            updateColumns?: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<EntityResult<TEntity>>;
    where(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    where(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    where(raw: Raw, operator: string, value: any): this;
    where(callback: (builder: QueryBuilder) => void): this;
    where(record: Record<string, any>): this;
    where(raw: Raw): this;
    whereBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereILike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereJsonPath(
        column: ColumnRef<EntitySchema<TEntity>>,
        path: string,
        operator?: string,
        value?: any,
    ): this;
    whereLike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereNot(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    whereNot(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    whereNot(record: Record<string, any>): this;
    whereNot(callback: (builder: QueryBuilder) => void): this;
    whereNot(raw: Raw): this;
    whereNotBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereNotExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereRaw(sql: string, ...bindings: any[]): this;
    whereVariant(
        key: string,
        column: string,
        operator: string,
        value: any,
    ): this;
    withDeleted(): this;
    withTransaction(trx: Transaction): DbSet<TEntity>;
}

Type Parameters

  • TEntity extends Entity<any, any, any>

Hierarchy (View Summary)

Index

Properties

entity: TEntity

The wrapped entity definition.

+

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<number>

  • Returns Promise<number>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Return a typed variant view pre-filtered to variantKey.

    +

    Behaves like EF Core's Set<DerivedType>(): all reads automatically +filter by the discriminator value, and insert / update / delete +apply the correct single-table (STI) or two-table (CTI) logic.

    +
    const assigned = db.activities.ofVariant('assigned');

    // Insert a new variant row (discriminator set automatically):
    await assigned.insert({ todoId: 42, userId: 7, assigneeId: 9 });

    // Update variant-specific columns for matching rows:
    await assigned.where(t => t.id, activityId).update({ assigneeId: 10 });

    // Delete variant rows (CTI: variant table first, then base):
    await assigned.where(t => t.id, activityId).delete();

    // Find by PK (result is narrowed to the variant branch):
    const a = await assigned.find(activityId);
    // a.type === 'assigned' and a.assigneeId is available +
    + +

    Type Parameters

    • K extends string

    Parameters

    • variantKey: K

    Returns VariantDbSet<TEntity, K>

  • Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Persist a nested write graph (root + related entities) in a single +transaction. Each node is INSERTed when its primary-key fields are +absent and UPDATEd when they are present (composite-PK aware).

    +

    Topology:

    +
      +
    • belongsTo parents are saved first; their PKs feed the root's FK.
    • +
    • The root row is then written.
    • +
    • hasOne / hasMany / belongsToMany children inherit the root's +PK into their FK column.
    • +
    • belongsToMany children may be passed as full nested graphs (new +rows) or as { pk: value } references (link existing rows).
    • +
    +

    If called inside an existing transaction (via withTransaction), the +outer transaction is reused; otherwise a fresh one is opened and +automatically rolled back on failure.

    +

    Parameters

    Returns Promise<EntityResult<TEntity>>

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • raw: Raw
    • operator: string
    • value: any

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.EntityEntry.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.EntityEntry.html new file mode 100644 index 00000000..cabe017d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.EntityEntry.html @@ -0,0 +1,15 @@ +EntityEntry | Libraries

Interface EntityEntry<T>

Public view of a tracked entry, exposed via db.entry(entity).

+
interface EntityEntry<T extends object> {
    currentValues: T;
    originalValues: Readonly<T>;
    state: EntryState;
    isModified(field?: keyof T): boolean;
    reset(): void;
}

Type Parameters

  • T extends object
Index

Properties

currentValues: T

Live object (same reference as the tracked entity).

+
originalValues: Readonly<T>

Snapshot of the values at the time the entity was last loaded/saved.

+
state: EntryState

Current state of the entry.

+

Methods

  • Returns true when a specific field has changed since the last +snapshot, or true when any field has changed when called without +arguments.

    +

    Parameters

    • Optionalfield: keyof T

    Returns boolean

  • Reset all changes to the snapshot values and transition state back +to 'Unchanged' (or 'Added' if the entity was never persisted).

    +

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.EntityQuery.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.EntityQuery.html new file mode 100644 index 00000000..407ce1fe --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.EntityQuery.html @@ -0,0 +1,104 @@ +EntityQuery | Libraries

Interface EntityQuery<TEntity, TResult>

The typed query handle returned by every DbSet method that +initiates a query (e.g. .where(), .include(), .first()).

+

Structurally it IS a SchemaQueryBuilder for the entity's schema, +with typed .include() / .includeVariant() methods overlaid. All other +SchemaQueryBuilder methods are available and this-returning chains +preserve the typed wrapper.

+
interface EntityQuery<TEntity extends Entity<any, any, any>, TResult> {
    andWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    andWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    andWhere(record: Record<string, any>): this;
    andWhere(callback: (builder: QueryBuilder) => void): this;
    andWhere(raw: Raw): this;
    apply(fn: (builder: QueryBuilder) => void): this;
    avg(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    bulkInsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts?: {
            chunkSize?: number;
            conflictColumns?: ColumnRef<EntitySchema<TEntity>>[];
            onConflict?: "ignore" | "merge";
        },
    ): Promise<TResult[]>;
    bulkUpdate(
        updates: readonly {
            set: Partial<InferType<TLocalSchema>>;
            where: Partial<InferType<TLocalSchema>>;
        }[],
    ): Promise<number>;
    bulkUpsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts: {
            chunkSize?: number;
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<TResult[]>;
    count(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    countDistinct(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    delete(): Promise<number>;
    distinct(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    execute(): Promise<TResult[]>;
    find(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<TResult | undefined>;
    findMany(
        pks: readonly PrimaryKeyValueOf<EntitySchema<TEntity>>[],
    ): Promise<TResult[]>;
    findOrFail(pk: PrimaryKeyValueOf<EntitySchema<TEntity>>): Promise<TResult>;
    first(): Promise<TResult | undefined>;
    groupBy(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    groupByRaw(sql: string, ...bindings: any[]): this;
    hardDelete(): Promise<number>;
    having(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    havingRaw(sql: string, ...bindings: any[]): this;
    include<K extends string>(
        sel: (t: RelKeyTree<TEntity>) => K,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<TEntity, WithIncluded<TEntity, TResult, K>>;
    includeVariant<TVariant extends string, TRel extends string>(
        variantKey: TVariant,
        relationName: TRel,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): EntityQuery<
        TEntity,
        TRel extends keyof EntityRelations<TEntity> & string
            ? WithVariantIncluded<TEntity, TResult, TVariant, TRel>
            : TResult,
    >;
    insert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
    ): Promise<TResult>;
    insertMany(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
    ): Promise<TResult[]>;
    joinMany<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
    >(
        spec: JoinManySpec<EntitySchema<TEntity>, TForeignSchema, TFieldName>,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedMany<TResult, TFieldName, TForeignSchema>,
    >;
    joinOne<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
        TRequired extends boolean = true,
    >(
        spec: JoinOneSpec<
            EntitySchema<TEntity>,
            TForeignSchema,
            TFieldName,
            TRequired,
        >,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedOne<TResult, TFieldName, TForeignSchema, TRequired>,
    >;
    limit(n: number): this;
    max(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    min(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    offset(n: number): this;
    onConflict(
        ...conflictColumns: ColumnRef<EntitySchema<TEntity>>[],
    ): OnConflictBuilder<EntitySchema<TEntity>, TResult>;
    onlyDeleted(): this;
    orderBy(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        direction?: "asc" | "desc",
    ): this;
    orderByRaw(sql: string, ...bindings: any[]): this;
    orWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    orWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    orWhere(record: Record<string, any>): this;
    orWhere(callback: (builder: QueryBuilder) => void): this;
    orWhere(raw: Raw): this;
    orWhereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    orWhereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    paginate(
        opts: { page: number; pageSize: number },
    ): Promise<PaginationResult<TResult>>;
    paginateAfter(
        opts: {
            column?: ColumnRef<EntitySchema<TEntity>>;
            cursor?: any;
            direction?: "asc" | "desc";
            limit: number;
        },
    ): Promise<CursorPaginationResult<TResult>>;
    pluck<K extends string>(
        column: ColumnRef<EntitySchema<TEntity>>,
    ): Promise<TResult[K][]>;
    projected<K extends string>(
        name: K,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        Pick<TResult, ProjectionKeysOf<EntitySchema<TEntity>, K> & keyof TResult>,
    >;
    restore(): Promise<TResult[]>;
    scoped<K extends never>(name: K): this;
    select(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    select<TSel extends SelectSelector<EntitySchema<TEntity>>>(
        selector: TSel,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        SelectProjection<ReturnType<TSel>>,
    >;
    selectRaw(sql: string, bindings?: any[]): this;
    selectVariants(keys: string[]): this;
    sum(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    then<TReturn1 = TResult[], TReturn2 = never>(
        onfulfilled?:
            | ((value: TResult[]) => TReturn1 | PromiseLike<TReturn1>)
            | null,
        onrejected?: ((reason: any) => TReturn2 | PromiseLike<TReturn2>) | null,
    ): Promise<TReturn1 | TReturn2>;
    toKnexQuery(): QueryBuilder;
    toQuery(): string;
    toString(): string;
    transacting(
        trx: Transaction,
    ): SchemaQueryBuilder<EntitySchema<TEntity>, TResult>;
    unscoped(): this;
    update(data: Partial<InferType<TLocalSchema>>): Promise<TResult[]>;
    upsert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
        opts: {
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
            updateColumns?: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<TResult>;
    where(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    where(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    where(raw: Raw, operator: string, value: any): this;
    where(callback: (builder: QueryBuilder) => void): this;
    where(record: Record<string, any>): this;
    where(raw: Raw): this;
    whereBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereILike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereJsonPath(
        column: ColumnRef<EntitySchema<TEntity>>,
        path: string,
        operator?: string,
        value?: any,
    ): this;
    whereLike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereNot(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    whereNot(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    whereNot(record: Record<string, any>): this;
    whereNot(callback: (builder: QueryBuilder) => void): this;
    whereNot(raw: Raw): this;
    whereNotBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereNotExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereRaw(sql: string, ...bindings: any[]): this;
    whereVariant(
        key: string,
        column: string,
        operator: string,
        value: any,
    ): this;
    withDeleted(): this;
}

Type Parameters

  • TEntity extends Entity<any, any, any>
  • TResult

Hierarchy (View Summary)

Index

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    Returns Promise<number>

  • Parameters

    Returns Promise<TResult[]>

  • Returns Promise<number>

  • Returns Promise<TResult[]>

  • Look up a single entity by primary key. Returns undefined when no +row matches.

    +

    The PK column(s) are resolved automatically from the entity's schema +via the primaryKey / hasPrimaryKey extensions. Composite PKs are +passed as a tuple in declaration order:

    +
    await db.todos.find(42);                 // single PK
    await db.userRoles.find([userId, role]); // composite PK +
    + +

    Any chained .include() / .includeVariant() calls on this query +are honoured by the underlying SELECT.

    +

    Returns Promise<TResult | undefined>

  • Returns Promise<TResult | undefined>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns Promise<TResult>

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • opts: { page: number; pageSize: number }

    Returns Promise<PaginationResult<TResult>>

  • Returns Promise<TResult[]>

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns Promise<TResult[]>

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • raw: Raw
    • operator: string
    • value: any

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.JoinManySpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.JoinManySpec.html new file mode 100644 index 00000000..ed7b84db --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.JoinManySpec.html @@ -0,0 +1,19 @@ +JoinManySpec | Libraries

Interface JoinManySpec<TLocalSchema, TForeignSchema, TFieldName>

interface JoinManySpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    limit?: number;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    offset?: number;
    orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" };
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
Index

Properties

Name of the field that will hold the loaded array in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
limit?: number

Maximum number of related items to load per parent row

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
offset?: number

Number of related items to skip per parent row

+
orderBy?: { column: ColumnRef<TForeignSchema>; direction?: "asc" | "desc" }

Column to order the related items by (required for deterministic limit/offset)

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.JoinOneSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.JoinOneSpec.html new file mode 100644 index 00000000..b1f9421b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.JoinOneSpec.html @@ -0,0 +1,15 @@ +JoinOneSpec | Libraries

Interface JoinOneSpec<TLocalSchema, TForeignSchema, TFieldName, TRequired>

interface JoinOneSpec<
    TLocalSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TForeignSchema extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
    TFieldName extends string = string,
    TRequired extends boolean = true,
> {
    as: TFieldName;
    foreignColumn: ColumnRef<TForeignSchema>;
    foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder };
    foreignSchema: TForeignSchema;
    localColumn: ColumnRef<TLocalSchema>;
    mappers?: Partial<
        Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
    >;
    required?: TRequired;
}

Type Parameters

  • TLocalSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TFieldName extends string = string
  • TRequired extends boolean = true
Index

Properties

Name of the field that will hold the loaded object in the result

+
foreignColumn: ColumnRef<TForeignSchema>

Column on the foreign table used for the join (string key or property accessor)

+
foreignQuery?: QueryBuilder<any, any> | { toKnexQuery(): QueryBuilder }

Optional Knex query builder for the foreign table — auto-derived from foreignSchema's tableName if omitted

+
foreignSchema: TForeignSchema

Foreign schema for type inference

+
localColumn: ColumnRef<TLocalSchema>

Column on the local (base) table used for the join (string key or property accessor)

+
mappers?: Partial<
    Record<SchemaKeys<TForeignSchema>, string | ((value: any) => any)>,
>

Optional post-load value transformers per foreign column

+
required?: TRequired

If true (default), uses INNER JOIN; if false, uses LEFT JOIN (result may be null)

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.MigrationDiff.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.MigrationDiff.html new file mode 100644 index 00000000..e5a8f476 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.MigrationDiff.html @@ -0,0 +1,9 @@ +MigrationDiff | Libraries

Interface MigrationDiff

Schema diff result between the code-first model and the live database.

+
interface MigrationDiff {
    addColumns: AddColumnDiff[];
    addForeignKeys: AddForeignKeyDiff[];
    addIndexes: AddIndexDiff[];
    alterColumns: AlterColumnDiff[];
    dropColumns: string[];
    dropForeignKeys: string[];
    dropIndexes: string[];
}
Index

Properties

addColumns: AddColumnDiff[]
addForeignKeys: AddForeignKeyDiff[]
addIndexes: AddIndexDiff[]
alterColumns: AlterColumnDiff[]
dropColumns: string[]
dropForeignKeys: string[]
dropIndexes: string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.PaginationResult.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.PaginationResult.html new file mode 100644 index 00000000..411bea63 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.PaginationResult.html @@ -0,0 +1,16 @@ +PaginationResult | Libraries

Interface PaginationResult<T>

Result of offset-based pagination via SchemaQueryBuilder.paginate.

+
interface PaginationResult<T> {
    data: T[];
    hasNextPage: boolean;
    hasPreviousPage: boolean;
    page: number;
    pageSize: number;
    total: number;
    totalPages: number;
}

Type Parameters

  • T
Index

Properties

data: T[]

The rows for the current page.

+
hasNextPage: boolean

Whether a next page exists.

+
hasPreviousPage: boolean

Whether a previous page exists.

+
page: number

Current page number (1-based).

+
pageSize: number

Number of rows per page.

+
total: number

Total number of matching rows across all pages.

+
totalPages: number

Total number of pages.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.PrimaryKeyColumns.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.PrimaryKeyColumns.html new file mode 100644 index 00000000..3eb4da67 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.PrimaryKeyColumns.html @@ -0,0 +1,9 @@ +PrimaryKeyColumns | Libraries

Interface PrimaryKeyColumns

Result of getPrimaryKeyColumns.

+

propertyKeys are the schema property names (the keys you'd use in +.where(t => t.id, ...) style accessors); columnNames are the SQL +column names after applying any hasColumnName() overrides. Order is +preserved: composite-PK ordering matches the user's hasPrimaryKey() +declaration; single-PK arrays have length 1.

+
interface PrimaryKeyColumns {
    columnNames: readonly string[];
    propertyKeys: readonly string[];
}
Index

Properties

columnNames: readonly string[]
propertyKeys: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RelationInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RelationInfo.html new file mode 100644 index 00000000..e2627079 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RelationInfo.html @@ -0,0 +1,6 @@ +RelationInfo | Libraries

Interface RelationInfo<TKind, TForeign>

Phantom info for a single declared relation, stored on Entity's TRels +generic. TForeign is captured so .include() can type the customize +callback against the correct foreign schema.

+
interface RelationInfo<
    TKind extends "belongsTo"
    | "hasOne"
    | "hasMany"
    | "belongsToMany" = any,
    TForeign extends
        ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
    >,
> {
    foreign: TForeign;
    kind: TKind;
}

Type Parameters

  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany" = any
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any> = ObjectSchemaBuilder<any, any, any, any, any, any, any>
Index

Properties

Properties

foreign: TForeign
kind: TKind
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RelationSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RelationSpec.html new file mode 100644 index 00000000..7d4a9f41 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RelationSpec.html @@ -0,0 +1,7 @@ +RelationSpec | Libraries

Interface RelationSpecInternal

Relation metadata stored via .hasMany(), .belongsTo(), etc.

+
interface RelationSpec {
    foreignKey?: any;
    name: string;
    schema: any;
    through?: { foreignKey: string; localKey: string; table: string };
    type: "belongsTo" | "hasOne" | "hasMany" | "belongsToMany";
}
Index

Properties

foreignKey?: any
name: string
schema: any
through?: { foreignKey: string; localKey: string; table: string }
type: "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ResolvedVariantConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ResolvedVariantConfig.html new file mode 100644 index 00000000..22cf1825 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ResolvedVariantConfig.html @@ -0,0 +1,8 @@ +ResolvedVariantConfig | Libraries

Interface ResolvedVariantConfigInternal

Full variant config stored in the schema extension 'variants'.

+
interface ResolvedVariantConfig {
    discriminatorColumn: string;
    discriminatorKey: string;
    variants: Record<string, ResolvedVariantSpec>;
}
Index

Properties

discriminatorColumn: string

SQL column name corresponding to discriminatorKey. Filled by query builder.

+
discriminatorKey: string

Property key on the base schema that is the discriminator.

+
variants: Record<string, ResolvedVariantSpec>

Map from discriminator value → resolved variant spec.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ResolvedVariantSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ResolvedVariantSpec.html new file mode 100644 index 00000000..8804d565 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ResolvedVariantSpec.html @@ -0,0 +1,12 @@ +ResolvedVariantSpec | Libraries

Interface ResolvedVariantSpecInternal

Resolved, normalised variant spec stored in schema extensions.

+
interface ResolvedVariantSpec {
    allowOrphan: boolean;
    enforceCheck: boolean;
    foreignKey?: string;
    relations: ResolvedVariantRelationSpec[];
    schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    storage: VariantStorageType;
    tableName?: string;
}
Index

Properties

allowOrphan: boolean
enforceCheck: boolean
foreignKey?: string

CTI: FK column name on the variant table.

+
relations: ResolvedVariantRelationSpec[]

Variant-scoped relations (resolved), populated by .withVariants().

+
schema: ObjectSchemaBuilder<any, any, any, any, any, any, any>
tableName?: string

CTI: variant table name (from schema.hasTableName()).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RowVersionColumn.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RowVersionColumn.html new file mode 100644 index 00000000..0f2a8401 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.RowVersionColumn.html @@ -0,0 +1,9 @@ +RowVersionColumn | Libraries

Interface RowVersionColumn

Resolved row-version column for a schema, returned by +getRowVersionColumn.

+
interface RowVersionColumn {
    columnName: string;
    propertyKey: string;
    strategy: RowVersionStrategy;
}
Index

Properties

columnName: string

SQL column name (after any hasColumnName() override).

+
propertyKey: string

Schema property name.

+

Concurrency-token update strategy.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.SchemaSnapshot.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.SchemaSnapshot.html new file mode 100644 index 00000000..5b7bd89c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.SchemaSnapshot.html @@ -0,0 +1,11 @@ +SchemaSnapshot | Libraries

Interface SchemaSnapshot

Serialized snapshot of all entity schemas at a given point in time.

+

Stored in <migrations.directory>/snapshot.json and committed to version +control. migrate generate diffs the current code against this snapshot +(instead of a live database) to produce migration files, so no DB +connection is required.

+

Each entry in tables mirrors the shape that introspectDatabase would +return — allowing diffSchema to be reused unchanged.

+
interface SchemaSnapshot {
    tables: Record<string, DatabaseTableState>;
    version: 1;
}
Index

Properties

Properties

tables: Record<string, DatabaseTableState>

Map of table name → database state derived from entity schemas.

+
version: 1
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ValidatedJoinManySpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ValidatedJoinManySpec.html new file mode 100644 index 00000000..55ede1c9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ValidatedJoinManySpec.html @@ -0,0 +1,9 @@ +ValidatedJoinManySpec | Libraries

Interface ValidatedJoinManySpec

interface ValidatedJoinManySpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    limit: number | null;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    offset: number | null;
    orderBy: { column: string; direction: "asc" | "desc" } | null;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
limit: number | null
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
offset: number | null
orderBy: { column: string; direction: "asc" | "desc" } | null
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ValidatedJoinOneSpec.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ValidatedJoinOneSpec.html new file mode 100644 index 00000000..22b6197e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.ValidatedJoinOneSpec.html @@ -0,0 +1,7 @@ +ValidatedJoinOneSpec | Libraries

Interface ValidatedJoinOneSpec

interface ValidatedJoinOneSpec {
    as: string;
    foreignColumn: string;
    foreignQuery: QueryBuilder;
    localColumn: string;
    mappers?: Record<string, string | ((value: any) => any)>;
    required: boolean;
}
Index

Properties

as: string
foreignColumn: string
foreignQuery: QueryBuilder
localColumn: string
mappers?: Record<string, string | ((value: any) => any)>
required: boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.VariantDbSet.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.VariantDbSet.html new file mode 100644 index 00000000..5f589659 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_orm.VariantDbSet.html @@ -0,0 +1,90 @@ +VariantDbSet | Libraries

Interface VariantDbSet<TEntity, K>

A DbSet-like handle scoped to a single polymorphic variant (one branch +of a discriminated union entity). All reads are automatically pre-filtered +by the discriminator; all writes apply the correct STI / CTI logic.

+

Obtain via DbSet.ofVariant('key') — analogous to EF Core's +Set<DerivedType>().

+
interface VariantDbSet<TEntity extends Entity<any, any, any>, K extends string> {
    andWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    andWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    andWhere(record: Record<string, any>): this;
    andWhere(callback: (builder: QueryBuilder) => void): this;
    andWhere(raw: Raw): this;
    apply(fn: (builder: QueryBuilder) => void): this;
    avg(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    bulkInsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts?: {
            chunkSize?: number;
            conflictColumns?: ColumnRef<EntitySchema<TEntity>>[];
            onConflict?: "ignore" | "merge";
        },
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    bulkUpdate(
        updates: readonly {
            set: Partial<InferType<TLocalSchema>>;
            where: Partial<InferType<TLocalSchema>>;
        }[],
    ): Promise<number>;
    bulkUpsert(
        rows: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
        opts: {
            chunkSize?: number;
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    count(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    countDistinct(column?: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    delete(): Promise<void>;
    distinct(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    execute(): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    find(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<VariantResult<TEntity, K> | undefined>;
    findMany(
        pks: readonly PrimaryKeyValueOf<EntitySchema<TEntity>>[],
    ): Promise<VariantResult<TEntity, K>[]>;
    findOrFail(
        pk: PrimaryKeyValueOf<EntitySchema<TEntity>>,
    ): Promise<VariantResult<TEntity, K>>;
    first(): Promise<
        ExtractBranch<EntityResultByVariant<TEntity>, K>
        | undefined,
    >;
    groupBy(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    groupByRaw(sql: string, ...bindings: any[]): this;
    hardDelete(): Promise<number>;
    having(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    havingRaw(sql: string, ...bindings: any[]): this;
    include<R extends string>(
        sel: (t: RelKeyTree<TEntity>) => R,
        customize?: (q: SchemaQueryBuilder<any, any>) => void,
    ): VariantDbSet<TEntity, K>;
    insert(
        payload: VariantInsertPayload<TEntity, K>,
    ): Promise<VariantResult<TEntity, K>>;
    insertMany(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >[],
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    joinMany<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
    >(
        spec: JoinManySpec<EntitySchema<TEntity>, TForeignSchema, TFieldName>,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedMany<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
            TFieldName,
            TForeignSchema,
        >,
    >;
    joinOne<
        TForeignSchema extends
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        TFieldName extends string,
        TRequired extends boolean = true,
    >(
        spec: JoinOneSpec<
            EntitySchema<TEntity>,
            TForeignSchema,
            TFieldName,
            TRequired,
        >,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        WithJoinedOne<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
            TFieldName,
            TForeignSchema,
            TRequired,
        >,
    >;
    limit(n: number): this;
    max(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    min(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    offset(n: number): this;
    onConflict(
        ...conflictColumns: ColumnRef<EntitySchema<TEntity>>[],
    ): OnConflictBuilder<
        EntitySchema<TEntity>,
        ExtractBranch<EntityResultByVariant<TEntity>, K>,
    >;
    onlyDeleted(): this;
    orderBy(
        column: Raw<any> | ColumnRef<EntitySchema<TEntity>>,
        direction?: "asc" | "desc",
    ): this;
    orderByRaw(sql: string, ...bindings: any[]): this;
    orWhere(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    orWhere(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    orWhere(record: Record<string, any>): this;
    orWhere(callback: (builder: QueryBuilder) => void): this;
    orWhere(raw: Raw): this;
    orWhereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    orWhereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    orWhereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    paginate(
        opts: { page: number; pageSize: number },
    ): Promise<
        PaginationResult<ExtractBranch<EntityResultByVariant<TEntity>, K>>,
    >;
    paginateAfter(
        opts: {
            column?: ColumnRef<EntitySchema<TEntity>>;
            cursor?: any;
            direction?: "asc" | "desc";
            limit: number;
        },
    ): Promise<
        CursorPaginationResult<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
        >,
    >;
    pluck<K extends string>(
        column: ColumnRef<EntitySchema<TEntity>>,
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[K][]>;
    projected<K extends string>(
        name: K,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        Pick<
            ExtractBranch<EntityResultByVariant<TEntity>, K>,
            ProjectionKeysOf<EntitySchema<TEntity>, K> & keyof ExtractBranch<
                EntityResultByVariant<TEntity>,
                K,
            >,
        >,
    >;
    restore(): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>[]>;
    scoped<K extends never>(name: K): this;
    select(...columns: (Raw<any> | ColumnRef<EntitySchema<TEntity>>)[]): this;
    select<TSel extends SelectSelector<EntitySchema<TEntity>>>(
        selector: TSel,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        SelectProjection<ReturnType<TSel>>,
    >;
    selectRaw(sql: string, bindings?: any[]): this;
    selectVariants(keys: string[]): this;
    sum(column: Raw<any> | ColumnRef<EntitySchema<TEntity>>): this;
    then<
        TReturn1 = ExtractBranch<EntityResultByVariant<TEntity>, K>[],
        TReturn2 = never,
    >(
        onfulfilled?:
            | (
                (
                    value: ExtractBranch<EntityResultByVariant<TEntity>, K>[],
                ) => TReturn1 | PromiseLike<TReturn1>
            )
            | null,
        onrejected?: ((reason: any) => TReturn2 | PromiseLike<TReturn2>) | null,
    ): Promise<TReturn1 | TReturn2>;
    toKnexQuery(): QueryBuilder;
    toQuery(): string;
    toString(): string;
    transacting(
        trx: Transaction,
    ): SchemaQueryBuilder<
        EntitySchema<TEntity>,
        ExtractBranch<EntityResultByVariant<TEntity>, K>,
    >;
    unscoped(): this;
    update(patch: VariantUpdatePayload<TEntity, K>): Promise<void>;
    upsert(
        data: InferType<
            ReturnType<EntitySchema<TEntity>["makeAllPropsOptional"]>,
        >,
        opts: {
            conflictColumns: ColumnRef<EntitySchema<TEntity>>[];
            updateColumns?: ColumnRef<EntitySchema<TEntity>>[];
        },
    ): Promise<ExtractBranch<EntityResultByVariant<TEntity>, K>>;
    where(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    where(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    where(raw: Raw, operator: string, value: any): this;
    where(callback: (builder: QueryBuilder) => void): this;
    where(record: Record<string, any>): this;
    where(raw: Raw): this;
    whereBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereILike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereJsonPath(
        column: ColumnRef<EntitySchema<TEntity>>,
        path: string,
        operator?: string,
        value?: any,
    ): this;
    whereLike(column: ColumnRef<EntitySchema<TEntity>>, value: string): this;
    whereNot(
        column: ColumnRef<EntitySchema<TEntity>>,
        operator: string,
        value: any,
    ): this;
    whereNot(column: ColumnRef<EntitySchema<TEntity>>, value: any): this;
    whereNot(record: Record<string, any>): this;
    whereNot(callback: (builder: QueryBuilder) => void): this;
    whereNot(raw: Raw): this;
    whereNotBetween(
        column: ColumnRef<EntitySchema<TEntity>>,
        range: readonly [any, any],
    ): this;
    whereNotExists(
        callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>,
    ): this;
    whereNotIn(
        column: ColumnRef<EntitySchema<TEntity>>,
        values: readonly any[] | QueryBuilder<any, any>,
    ): this;
    whereNotNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereNull(column: ColumnRef<EntitySchema<TEntity>>): this;
    whereRaw(sql: string, ...bindings: any[]): this;
    whereVariant(
        key: string,
        column: string,
        operator: string,
        value: any,
    ): this;
    withDeleted(): this;
    withTransaction(trx: Transaction): VariantDbSet<TEntity, K>;
}

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string

Hierarchy

Index

Methods

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    • fn: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    Returns Promise<number>

  • Delete rows matched by the current WHERE clause (CTI: atomic).

    +

    Returns Promise<void>

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Returns Promise<number>

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • n: number

    Returns this

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Type Parameters

    • K extends never

    Parameters

    • name: K

    Returns this

  • Parameters

    • sql: string
    • Optionalbindings: any[]

    Returns this

  • Parameters

    • keys: string[]

    Returns this

  • Returns QueryBuilder

  • Returns string

  • Returns string

  • Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • record: Record<string, any>

    Returns this

  • Parameters

    • callback: (builder: QueryBuilder) => void

    Returns this

  • Parameters

    • raw: Raw

    Returns this

  • Parameters

    Returns this

  • Parameters

    • callback: QueryBuilder<any, any> | QueryCallback<any, unknown[]>

    Returns this

  • Parameters

    Returns this

  • Parameters

    • sql: string
    • ...bindings: any[]

    Returns this

  • Parameters

    • key: string
    • column: string
    • operator: string
    • value: any

    Returns this

  • Returns this

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..ConfigureOtelOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..ConfigureOtelOptions.html new file mode 100644 index 00000000..e7423a64 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..ConfigureOtelOptions.html @@ -0,0 +1,14 @@ +ConfigureOtelOptions | Libraries

Interface ConfigureOtelOptions

Configuration for configureOtel.

+
interface ConfigureOtelOptions {
    meterName?: string;
    tracerName?: string;
    version?: string;
}
Index

Properties

meterName?: string

Meter name.

+
'@cleverbrush/otel'
+
+ +
tracerName?: string

Tracer name.

+
'@cleverbrush/otel'
+
+ +
version?: string

Optional version string used for both tracer and meter.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..InstrumentKnexOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..InstrumentKnexOptions.html new file mode 100644 index 00000000..e3e1fa97 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..InstrumentKnexOptions.html @@ -0,0 +1,21 @@ +InstrumentKnexOptions | Libraries

Interface InstrumentKnexOptions

Configuration for instrumentKnex.

+
interface InstrumentKnexOptions {
    dbSystem?: string;
    recordStatement?: boolean;
    sanitizeStatement?: (sql: string) => string;
    tracerName?: string;
}
Index

Properties

dbSystem?: string

Value to record as db.system.name (e.g. postgresql, mysql, +sqlite). When omitted, inferred from the knex client.

+
recordStatement?: boolean

Whether to include the SQL statement as db.query.text.

+

The statement is taken verbatim from knex (parameter placeholders +are kept; bound values are not included). Disable if your +SQL itself may contain sensitive identifiers.

+
true
+
+ +
sanitizeStatement?: (sql: string) => string

Optional hook to redact / rewrite the SQL before it is recorded. +Called only when recordStatement is enabled.

+
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel/knex'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelConfig.html new file mode 100644 index 00000000..2290821a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelConfig.html @@ -0,0 +1,61 @@ +OtelConfig | Libraries

Interface OtelConfig

Configuration for setupOtel.

+
interface OtelConfig {
    debug?: boolean;
    disableLogs?: boolean;
    disableMetrics?: boolean;
    disableTraces?: boolean;
    environment?: string;
    headers?: Record<string, string>;
    instrumentations?: unknown[];
    logsEndpoint?: string;
    metricsEndpoint?: string;
    metricsExportIntervalMs?: number;
    otlpEndpoint?: string;
    resourceAttributes?: Record<string, string | number | boolean>;
    serviceName: string;
    serviceVersion?: string;
    tracesEndpoint?: string;
}
Index

Properties

debug?: boolean

Enable verbose OTel SDK diagnostics (sets the global diag logger).

+
false
+
+ +
disableLogs?: boolean

Disable log export.

+
false
+
+ +
disableMetrics?: boolean

Disable metrics export.

+
false
+
+ +
disableTraces?: boolean

Disable trace export.

+
false
+
+ +
environment?: string

Deployment environment name (e.g. production, staging, dev). +Becomes the deployment.environment.name resource attribute.

+
headers?: Record<string, string>

Optional headers to send with every OTLP export request +(e.g. authentication tokens for hosted backends).

+
instrumentations?: unknown[]

Auto-instrumentations to register at SDK startup.

+

Use the helpers from @cleverbrush/otel/instrumentations +(e.g. outboundHttpInstrumentations(), runtimeMetrics()).

+
logsEndpoint?: string

Override the OTLP logs endpoint (/v1/logs is appended).

+
metricsEndpoint?: string

Override the OTLP metrics endpoint (/v1/metrics is appended).

+
metricsExportIntervalMs?: number

Metric export interval in milliseconds.

+
60000
+
+ +
otlpEndpoint?: string

Base OTLP/HTTP endpoint for traces, logs, and metrics.

+

If not provided, falls back to the standard OTel environment +variables (OTEL_EXPORTER_OTLP_ENDPOINT, +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, etc.).

+

Per-signal endpoints below take precedence over this value.

+
process.env.OTEL_EXPORTER_OTLP_ENDPOINT
+
+ +
resourceAttributes?: Record<string, string | number | boolean>

Additional resource attributes merged onto the default resource. +Useful for host.name, cloud.region, custom team tags, etc.

+
serviceName: string

Logical name of the service emitting telemetry. +Becomes the service.name resource attribute and is the primary +identifier in observability backends.

+
serviceVersion?: string

Optional service version → service.version resource attribute.

+
tracesEndpoint?: string

Override the OTLP traces endpoint (/v1/traces is appended).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelHandle.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelHandle.html new file mode 100644 index 00000000..ea92a6a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelHandle.html @@ -0,0 +1,11 @@ +OtelHandle | Libraries

Interface OtelHandle

Handle returned by setupOtel for lifecycle management.

+
interface OtelHandle {
    sdk: NodeSDK;
    shutdown(): Promise<void>;
}
Index

Properties

sdk +

Methods

Properties

sdk: NodeSDK

The underlying NodeSDK instance.

+

Exposed for advanced use cases (custom span processors, runtime +configuration). Most consumers do not need to touch this directly.

+

Methods

  • Gracefully flushes and shuts down all exporters.

    +

    Idempotent — safe to call multiple times. +Should be invoked from your process's shutdown hook +(SIGTERM/SIGINT) before process.exit.

    +

    Returns Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelLogSinkOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelLogSinkOptions.html new file mode 100644 index 00000000..d5b97432 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..OtelLogSinkOptions.html @@ -0,0 +1,14 @@ +OtelLogSinkOptions | Libraries

Interface OtelLogSinkOptions

Configuration for otelLogSink.

+
interface OtelLogSinkOptions {
    loggerName?: string;
    loggerVersion?: string;
    sanitizeAttribute?: (key: string, value: unknown) => unknown;
}
Index

Properties

loggerName?: string

Logger name (InstrumentationScope) under which records are +emitted via the OTel Logs API.

+
'@cleverbrush/otel'
+
+ +
loggerVersion?: string

Optional logger version.

+
sanitizeAttribute?: (key: string, value: unknown) => unknown

Hook for redacting / dropping properties before they become +OTel log record attributes. Return undefined to drop the +attribute entirely.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..SpanHandle.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..SpanHandle.html new file mode 100644 index 00000000..e9460d57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..SpanHandle.html @@ -0,0 +1,20 @@ +SpanHandle | Libraries

Interface SpanHandle

Handle returned by the disposable form of withSpan.

+

Implements AsyncDisposable so it can be used with await using:

+
await using handle = withSpan('my.operation');
handle.span.setAttribute('key', value);
try {
// ... do work ...
} catch (err) {
handle.fail(err);
throw err;
}
// span.end() is called automatically when the block exits +
+ +

Note: The span created by the disposable form is NOT activated as +the current context span (OTel's public API requires a callback scope +for context propagation). DB / outbound-HTTP child spans created +inside the await using block will be siblings of this span (both +children of the enclosing HTTP span) rather than nested under it. +Use the callback form of withSpan when proper nesting is required.

+
interface SpanHandle {
    span: Span;
    "[asyncDispose]"(): Promise<void>;
    fail(err: unknown): void;
}
Index

Properties

Methods

Properties

span: Span

The underlying OTel span. Use it to set attributes or add events.

+

Methods

  • Ends the span. Called automatically when exiting an await using block.

    +

    Returns Promise<void>

  • Records an exception and marks the span as errored.

    +

    Idempotent — safe to call in a catch block even if the same +error might be reported elsewhere.

    +

    Parameters

    • err: unknown

    Returns void

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..TracingMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..TracingMiddlewareOptions.html new file mode 100644 index 00000000..9a5ec524 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..TracingMiddlewareOptions.html @@ -0,0 +1,34 @@ +TracingMiddlewareOptions | Libraries

Interface TracingMiddlewareOptions

Configuration for tracingMiddleware.

+
interface TracingMiddlewareOptions {
    enrichSpan?: (span: Span, ctx: any) => void;
    excludePaths?: (string | { path: string })[];
    recordQuery?: boolean;
    responseTraceHeader?: string | false;
    tracerName?: string;
    tracerVersion?: string;
}
Index

Properties

enrichSpan?: (span: Span, ctx: any) => void

Hook for adding custom attributes to the server span just before +the inner pipeline runs. Errors thrown here are swallowed.

+
excludePaths?: (string | { path: string })[]

Paths to exclude from tracing entirely (no span created).

+

Accepts plain strings or objects with a path property +(e.g. an EndpointBuilder). Useful for /health and other +high-frequency, low-value endpoints.

+
recordQuery?: boolean

Whether to record the URL query string as url.query.

+

Disabled by default because query strings frequently contain PII +(search terms, tokens). Enable explicitly only when you have +verified your URLs are safe to record.

+
false
+
+ +
responseTraceHeader?: string | false

Name of the response header that carries the W3C trace ID for the +current request span.

+

Expose this so API consumers can include it in bug reports and you +can look up the exact trace in SigNoz / Jaeger / etc.

+

Set to false to disable the header entirely.

+
'X-Trace-Id'
+
+ +
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel'
+
+ +
tracerVersion?: string

Tracer version.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..WithSpanOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..WithSpanOptions.html new file mode 100644 index 00000000..caf21e7e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel..WithSpanOptions.html @@ -0,0 +1,16 @@ +WithSpanOptions | Libraries

Interface WithSpanOptions

Options shared by both calling conventions of withSpan.

+
interface WithSpanOptions {
    attributes?: Attributes;
    kind?: SpanKind;
    tracerName?: string;
    tracerVersion?: string;
}
Index

Properties

attributes?: Attributes

Initial attributes to set on the span.

+
kind?: SpanKind

OTel span kind.

+
SpanKind.INTERNAL
+
+ +
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel'
+
+ +
tracerVersion?: string

Tracer version.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingEndpointMeta.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingEndpointMeta.html new file mode 100644 index 00000000..58d80ea6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingEndpointMeta.html @@ -0,0 +1,11 @@ +ClientTracingEndpointMeta | Libraries

Interface ClientTracingEndpointMeta

Endpoint metadata attached to RequestInit by @cleverbrush/client.

+

This is intentionally structural and partial so the OTel package can read +metadata when present without coupling to client internals at runtime.

+
interface ClientTracingEndpointMeta {
    collectionPath?: string;
    endpoint?: string;
    group?: string;
    method?: string;
    operationId?: string | null;
    path?: string;
    tags?: readonly string[];
}
Index

Properties

collectionPath?: string
endpoint?: string
group?: string
method?: string
operationId?: string | null
path?: string
tags?: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingInfo.html new file mode 100644 index 00000000..1f018c41 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingInfo.html @@ -0,0 +1,6 @@ +ClientTracingInfo | Libraries

Interface ClientTracingInfo

Information passed to the enrichSpan hook.

+
interface ClientTracingInfo {
    endpoint?: ClientTracingEndpointMeta;
    headers: Record<string, string>;
    method: string;
    url: string;
}
Index

Properties

Properties

headers: Record<string, string>
method: string
url: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingMiddlewareOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingMiddlewareOptions.html new file mode 100644 index 00000000..9d3e9dee --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_otel.client.ClientTracingMiddlewareOptions.html @@ -0,0 +1,21 @@ +ClientTracingMiddlewareOptions | Libraries

Interface ClientTracingMiddlewareOptions

Configuration for clientTracingMiddleware.

+
interface ClientTracingMiddlewareOptions {
    enrichSpan?: (span: Span, info: ClientTracingInfo) => void;
    recordUrlFull?: boolean;
    skip?: (url: string, init: RequestInit) => boolean;
    tracerName?: string;
    tracerVersion?: string;
}
Index

Properties

enrichSpan?: (span: Span, info: ClientTracingInfo) => void

Hook for adding custom attributes/events before the request is sent. +Errors thrown here are swallowed.

+
recordUrlFull?: boolean

Whether to record url.full.

+

Disabled by default because full URLs can include query strings with +sensitive values.

+
false
+
+ +
skip?: (url: string, init: RequestInit) => boolean

Predicate for skipping tracing on selected outbound requests.

+
tracerName?: string

Tracer name used when resolving the OTel tracer.

+
'@cleverbrush/otel'
+
+ +
tracerVersion?: string

Tracer version.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Converter.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Converter.html new file mode 100644 index 00000000..ae925ecc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Converter.html @@ -0,0 +1,6 @@ +Converter | Libraries

The Standard JSON Schema converter interface.

+
interface Converter {
    input: (
        options: StandardJSONSchemaV1.Options,
    ) => Record<string, unknown>;
    output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
}
Index

Properties

Properties

input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>

Converts the input type to JSON Schema. May throw if conversion is not supported.

+
output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>

Converts the output type to JSON Schema. May throw if conversion is not supported.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Options.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Options.html new file mode 100644 index 00000000..4376b82c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Options.html @@ -0,0 +1,6 @@ +Options | Libraries

The options for the input/output methods.

+
interface Options {
    libraryOptions?: Record<string, unknown>;
    target: Target;
}
Index

Properties

Properties

libraryOptions?: Record<string, unknown>

Explicit support for additional vendor-specific parameters, if needed.

+
target: Target

Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Props.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Props.html new file mode 100644 index 00000000..dc66ed06 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Props.html @@ -0,0 +1,10 @@ +Props | Libraries

The Standard JSON Schema properties interface.

+
interface Props<Input = unknown, Output = Input> {
    jsonSchema: Converter;
    types?: StandardTypedV1.Types<Input, Output>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

jsonSchema: Converter

Methods for generating the input/output JSON Schema.

+

Inferred types associated with the schema.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Types.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Types.html new file mode 100644 index 00000000..69ea2cc7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

The Standard types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.html new file mode 100644 index 00000000..15d1f0d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardJSONSchemaV1.html @@ -0,0 +1,4 @@ +StandardJSONSchemaV1 | Libraries

Interface StandardJSONSchemaV1<Input, Output>

The Standard JSON Schema interface.

+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
    "~standard": StandardJSONSchemaV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard JSON Schema properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.Props.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.Props.html new file mode 100644 index 00000000..4ef6ab3e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.Props.html @@ -0,0 +1,8 @@ +Props | Libraries

Interface Props<Input, Output>

The Standard Typed properties interface.

+
interface Props<Input = unknown, Output = Input> {
    types?: StandardTypedV1.Types<Input, Output>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

Inferred types associated with the schema.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.Types.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.Types.html new file mode 100644 index 00000000..83f4462c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

Interface Types<Input, Output>

The Standard Typed types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.html new file mode 100644 index 00000000..53997890 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema-json.StandardTypedV1.html @@ -0,0 +1,4 @@ +StandardTypedV1 | Libraries

Interface StandardTypedV1<Input, Output>

The Standard Typed interface. This is a base type extended by other specs.

+
interface StandardTypedV1<Input = unknown, Output = Input> {
    "~standard": StandardTypedV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.ArrayBuiltinExtensions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.ArrayBuiltinExtensions.html new file mode 100644 index 00000000..2b029c0f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.ArrayBuiltinExtensions.html @@ -0,0 +1,26 @@ +ArrayBuiltinExtensions | Libraries

Interface ArrayBuiltinExtensions<TElementSchema>

Methods added to ArraySchemaBuilder by the built-in array extension pack.

+

WORKAROUND: This interface duplicates the method signatures from +arrayExtensions so that JSDoc survives into the published .d.ts +files. TypeScript strips JSDoc when method signatures are reconstructed +through the FixedMethods mapped type (conditional infer loses +comments). Remove this interface once TypeScript preserves JSDoc +through mapped types / conditional type inference.

+
interface ArrayBuiltinExtensions<
    TElementSchema extends
        SchemaBuilder<any, any, any, any, any> = SchemaBuilder<any, any, any>,
> {
    nonempty(
        errorMessage?: ValidationErrorMessageProvider<
            ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >,
        >,
    ): ArrayExtReturn<TElementSchema>;
    unique(
        keyFn?: (item: any) => unknown,
        errorMessage?: ValidationErrorMessageProvider<
            ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >,
        >,
    ): ArrayExtReturn<TElementSchema>;
}

Type Parameters

Index

Methods

Methods

  • Validates that the array contains at least one element.

    +

    Parameters

    • OptionalerrorMessage: ValidationErrorMessageProvider<
          ArraySchemaBuilder<
              any,
              true,
              false,
              undefined,
              false,
              {},
              any[]
              | unknown[],
          >,
      >

      custom error message or function to generate one

      +

    Returns ArrayExtReturn<TElementSchema>

    a new schema builder with the nonempty validator applied

    +
    array().nonempty();
    array().nonempty('At least one item required'); +
    + +
  • Validates that all elements in the array are unique.

    +

    For primitive elements, uses strict equality. For objects, pass a keyFn +that extracts a comparison key from each element.

    +

    Parameters

    • OptionalkeyFn: (item: any) => unknown

      optional function to extract a comparison key from each element

      +
    • OptionalerrorMessage: ValidationErrorMessageProvider<
          ArraySchemaBuilder<
              any,
              true,
              false,
              undefined,
              false,
              {},
              any[]
              | unknown[],
          >,
      >

      custom error message or function to generate one

      +

    Returns ArrayExtReturn<TElementSchema>

    a new schema builder with the unique validator applied

    +
    array().unique();
    array().unique((item) => item.id);
    array().unique(undefined, 'No duplicates allowed'); +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.NumberBuiltinExtensions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.NumberBuiltinExtensions.html new file mode 100644 index 00000000..d6050d3a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.NumberBuiltinExtensions.html @@ -0,0 +1,61 @@ +NumberBuiltinExtensions | Libraries

Interface NumberBuiltinExtensions<T>

Methods added to NumberSchemaBuilder by the built-in number extension pack.

+

WORKAROUND: This interface duplicates the method signatures from +numberExtensions so that JSDoc survives into the published .d.ts +files. TypeScript strips JSDoc when method signatures are reconstructed +through the FixedMethods mapped type (conditional infer loses +comments). Remove this interface once TypeScript preserves JSDoc +through mapped types / conditional type inference.

+
interface NumberBuiltinExtensions<T extends number = number> {
    finite(
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
    multipleOf(
        n: number,
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
    negative(
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
    oneOf<V extends number>(...values: [V, ...V[]]): NumberExtReturn<V>;
    oneOf<V extends number>(
        ...args: [
            V,
            ...V[],
            ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ],
    ): NumberExtReturn<V>;
    oneOf<V extends number>(
        values: readonly [V, V],
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<V>;
    positive(
        errorMessage?: ValidationErrorMessageProvider<
            NumberSchemaBuilder<number, true, false, false, {}>,
        >,
    ): NumberExtReturn<T>;
}

Type Parameters

  • T extends number = number
Index

Methods

  • Validates that the number is an exact multiple of n.

    +

    Uses a relative tolerance of 1e-10 for float-safe comparison.

    +

    Parameters

    Returns NumberExtReturn<T>

    a new schema builder with the multipleOf validator applied

    +
    number().multipleOf(5);
    number().multipleOf(0.1, 'Must be a multiple of 0.1'); +
    + +
  • Constrains the number to one of the specified literal values.

    +

    Narrows the inferred type from number to the union of the +provided literals.

    +

    Type Parameters

    • V extends number

    Parameters

    • ...values: [V, ...V[]]

      the allowed number literals

      +

    Returns NumberExtReturn<V>

    a new schema builder restricted to the given values

    +
    import { number, InferType } from '@cleverbrush/schema';

    const priority = number().oneOf(1, 2, 3);
    type Priority = InferType<typeof priority>; // 1 | 2 | 3

    priority.validate(1); // valid
    priority.validate(4); // invalid — "must be one of: 1, 2, 3" +
    + +
  • Constrains the number to one of the specified literal values, +with a custom error message or factory as the last argument.

    +

    Type Parameters

    • V extends number

    Parameters

    Returns NumberExtReturn<V>

    const priority = number().oneOf(1, 2, 3, 'Priority must be 1, 2, or 3');
    const priority2 = number().oneOf(1, 2, 3, (val) => `${val} is not a valid priority`); +
    + +
  • Constrains the number to one of the specified literal values, +with an optional custom error message or factory.

    +

    Type Parameters

    • V extends number

    Parameters

    Returns NumberExtReturn<V>

    a new schema builder restricted to the given values

    +
    const priority = number().oneOf([1, 2, 3], 'Must be 1, 2, or 3');
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.FailureResult.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.FailureResult.html new file mode 100644 index 00000000..da2dcfd7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.FailureResult.html @@ -0,0 +1,4 @@ +FailureResult | Libraries

The result interface if validation fails.

+
interface FailureResult {
    issues: readonly Issue[];
}
Index

Properties

Properties

issues: readonly Issue[]

The issues of failed validation.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Issue.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Issue.html new file mode 100644 index 00000000..a1fc86d3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Issue.html @@ -0,0 +1,6 @@ +Issue | Libraries

The issue interface of the failure output.

+
interface Issue {
    message: string;
    path?: readonly (PropertyKey | PathSegment)[];
}
Index

Properties

Properties

message: string

The error message of the issue.

+
path?: readonly (PropertyKey | PathSegment)[]

The path of the issue, if any.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Options.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Options.html new file mode 100644 index 00000000..02ddd2b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Options.html @@ -0,0 +1,3 @@ +Options | Libraries
interface Options {
    libraryOptions?: Record<string, unknown>;
}
Index

Properties

Properties

libraryOptions?: Record<string, unknown>

Explicit support for additional vendor-specific parameters, if needed.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.PathSegment.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.PathSegment.html new file mode 100644 index 00000000..efebf6da --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.PathSegment.html @@ -0,0 +1,4 @@ +PathSegment | Libraries

The path segment interface of the issue.

+
interface PathSegment {
    key: PropertyKey;
}
Index

Properties

key +

Properties

key: PropertyKey

The key representing a path segment.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Props.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Props.html new file mode 100644 index 00000000..2a262375 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Props.html @@ -0,0 +1,10 @@ +Props | Libraries

Interface Props<Input, Output>

The Standard Schema properties interface.

+
interface Props<Input = unknown, Output = Input> {
    types?: StandardTypedV1.Types<Input, Output>;
    validate: (
        value: unknown,
        options?: StandardSchemaV1.Options,
    ) => Result<Output> | Promise<Result<Output>>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

Inferred types associated with the schema.

+
validate: (
    value: unknown,
    options?: StandardSchemaV1.Options,
) => Result<Output> | Promise<Result<Output>>

Validates unknown input values.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.SuccessResult.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.SuccessResult.html new file mode 100644 index 00000000..f3084a44 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.SuccessResult.html @@ -0,0 +1,6 @@ +SuccessResult | Libraries

The result interface if validation succeeds.

+
interface SuccessResult<Output> {
    issues?: undefined;
    value: Output;
}

Type Parameters

  • Output
Index

Properties

Properties

issues?: undefined

A falsy value for issues indicates success.

+
value: Output

The typed output value.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Types.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Types.html new file mode 100644 index 00000000..b23a5ccb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

Interface Types<Input, Output>

The Standard types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.html new file mode 100644 index 00000000..2028a33b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardSchemaV1.html @@ -0,0 +1,4 @@ +StandardSchemaV1 | Libraries

Interface StandardSchemaV1<Input, Output>

The Standard Schema interface.

+
interface StandardSchemaV1<Input = unknown, Output = Input> {
    "~standard": StandardSchemaV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard Schema properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.Props.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.Props.html new file mode 100644 index 00000000..258c0e08 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.Props.html @@ -0,0 +1,8 @@ +Props | Libraries

Interface Props<Input, Output>

The Standard Typed properties interface.

+
interface Props<Input = unknown, Output = Input> {
    types?: StandardTypedV1.Types<Input, Output>;
    vendor: string;
    version: 1;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

Inferred types associated with the schema.

+
vendor: string

The vendor name of the schema library.

+
version: 1

The version number of the standard.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.Types.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.Types.html new file mode 100644 index 00000000..d854da56 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.Types.html @@ -0,0 +1,6 @@ +Types | Libraries

Interface Types<Input, Output>

The Standard Typed types interface.

+
interface Types<Input = unknown, Output = Input> {
    input: Input;
    output: Output;
}

Type Parameters

  • Input = unknown
  • Output = Input

Hierarchy (View Summary)

Index

Properties

Properties

input: Input

The input type of the schema.

+
output: Output

The output type of the schema.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.html new file mode 100644 index 00000000..17061062 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StandardTypedV1.html @@ -0,0 +1,4 @@ +StandardTypedV1 | Libraries

Interface StandardTypedV1<Input, Output>

The Standard Typed interface. This is a base type extended by other specs.

+
interface StandardTypedV1<Input = unknown, Output = Input> {
    "~standard": StandardTypedV1.Props<Input, Output>;
}

Type Parameters

  • Input = unknown
  • Output = Input
Index

Properties

Properties

The Standard properties.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StringBuiltinExtensions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StringBuiltinExtensions.html new file mode 100644 index 00000000..23c2516b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_schema.StringBuiltinExtensions.html @@ -0,0 +1,84 @@ +StringBuiltinExtensions | Libraries

Interface StringBuiltinExtensions<T>

Methods added to StringSchemaBuilder by the built-in string extension pack.

+

WORKAROUND: This interface duplicates the method signatures from +stringExtensions so that JSDoc survives into the published .d.ts +files. TypeScript strips JSDoc when method signatures are reconstructed +through the FixedMethods mapped type (conditional infer loses +comments). Remove this interface once TypeScript preserves JSDoc +through mapped types / conditional type inference.

+
interface StringBuiltinExtensions<T extends string = string> {
    email(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    ip(
        opts?: { version?: "v4" | "v6" },
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    nonempty(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    oneOf<V extends string>(...values: [V, ...V[]]): StringExtReturn<V>;
    oneOf<V extends string>(
        ...args: [
            V,
            ...V[],
            ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ],
    ): StringExtReturn<V>;
    oneOf<V extends string>(
        values: readonly [V, V],
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<V>;
    toLowerCase(): StringExtReturn<T>;
    trim(): StringExtReturn<T>;
    url(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    url(
        opts?: { protocols?: string[] },
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
    uuid(
        errorMessage?: ValidationErrorMessageProvider<
            StringSchemaBuilder<string, true, false, false, {}>,
        >,
    ): StringExtReturn<T>;
}

Type Parameters

  • T extends string = string
Index

Methods

  • Validates that the string is a well-formed email address.

    +

    Uses the pattern ^[^\s@]+@[^\s@]+\.[^\s@]+$ for validation.

    +

    Parameters

    Returns StringExtReturn<T>

    a new schema builder with the email validator applied

    +
    string().email();
    string().email('Please enter a valid email');
    string().email((val) => `"${val}" is not a valid email`); +
    + +
  • Validates that the string is a valid IP address (IPv4 or IPv6).

    +

    Pass opts.version to restrict validation to a specific IP version.

    +

    Parameters

    • Optionalopts: { version?: "v4" | "v6" }

      optional configuration

      +
      • Optionalversion?: "v4" | "v6"

        restrict to 'v4' or 'v6' (default: accept both)

        +
    • OptionalerrorMessage: ValidationErrorMessageProvider<
          StringSchemaBuilder<string, true, false, false, {}>,
      >

      custom error message or function to generate one

      +

    Returns StringExtReturn<T>

    a new schema builder with the IP validator applied

    +
    string().ip();
    string().ip({ version: 'v4' });
    string().ip(undefined, 'Bad IP address'); +
    + +
  • Constrains the string to one of the specified literal values.

    +

    Narrows the inferred type from string to the union of the +provided literals.

    +

    Type Parameters

    • V extends string

    Parameters

    • ...values: [V, ...V[]]

      the allowed string literals

      +

    Returns StringExtReturn<V>

    a new schema builder restricted to the given values

    +
    import { string, InferType } from '@cleverbrush/schema';

    const role = string().oneOf('admin', 'user', 'guest');
    type Role = InferType<typeof role>; // 'admin' | 'user' | 'guest'

    role.validate('admin'); // valid
    role.validate('other'); // invalid — "must be one of: admin, user, guest" +
    + +
  • Constrains the string to one of the specified literal values, +with a custom error message or factory as the last argument.

    +

    Type Parameters

    • V extends string

    Parameters

    Returns StringExtReturn<V>

    const role = string().oneOf('admin', 'user', (val) => `"${val}" is not allowed`);
    +
    + +
  • Constrains the string to one of the specified literal values, +with an optional custom error message or factory.

    +

    Type Parameters

    • V extends string

    Parameters

    Returns StringExtReturn<V>

    a new schema builder restricted to the given values

    +
    const role = string().oneOf(['admin', 'user', 'guest'], 'Invalid role');
    +
    + +
  • Preprocessor that converts the string to lowercase before validation.

    +

    Returns StringExtReturn<T>

    a new schema builder with the toLowerCase preprocessor applied

    +
    string().toLowerCase(); // 'HELLO' → 'hello'
    +
    + +
  • Preprocessor that trims leading and trailing whitespace before validation.

    +

    Returns StringExtReturn<T>

    a new schema builder with the trim preprocessor applied

    +
    string().trim().minLength(1); // '  hi  ' → 'hi'
    +
    + +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiInfo.html new file mode 100644 index 00000000..d30d9b64 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiInfo.html @@ -0,0 +1,15 @@ +AsyncApiInfo | Libraries

API metadata included in the AsyncAPI info object. +Maps to the AsyncAPI 3.0 Info Object.

+
interface AsyncApiInfo {
    contact?: { email?: string; name?: string; url?: string };
    description?: string;
    license?: { name: string; url?: string };
    termsOfService?: string;
    title: string;
    version: string;
}
Index

Properties

contact?: { email?: string; name?: string; url?: string }

Contact information for the application.

+
description?: string

A short description of the application.

+
license?: { name: string; url?: string }

License information for the application.

+
termsOfService?: string

A URL to the Terms of Service.

+
title: string

The title of the application.

+
version: string

The application version.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiOptions.html new file mode 100644 index 00000000..e45e2f38 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiOptions.html @@ -0,0 +1,20 @@ +AsyncApiOptions | Libraries

Options passed to generateAsyncApiSpec.

+

When server is provided, subscriptions are derived from it +automatically (unless explicitly overridden).

+
interface AsyncApiOptions {
    info: AsyncApiInfo;
    pathPrefix?: string;
    server?: AsyncApiServer_ServerLike;
    servers?: Record<string, AsyncApiServerEntry>;
    subscriptions?: readonly SubscriptionRegistration[];
}
Index

Properties

API metadata (title, version, description).

+
pathPrefix?: string

Path prefix to strip from all channel addresses. +Useful when the subscription endpoints are mounted under a prefix +that differs from how the AsyncAPI doc should describe them.

+

A ServerBuilder (or any object implementing getSubscriptionRegistrations()). +When set, subscription registrations are automatically read from the +server instance. Explicit subscriptions values take precedence.

+
servers?: Record<string, AsyncApiServerEntry>

Server entries to include in the spec's servers map. +Keys are server IDs (e.g. 'production', 'staging').

+
subscriptions?: readonly SubscriptionRegistration[]

Subscription registrations to document. +When omitted, registrations are read from the server option.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiServerEntry.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiServerEntry.html new file mode 100644 index 00000000..480c180e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiServerEntry.html @@ -0,0 +1,15 @@ +AsyncApiServerEntry | Libraries

A server entry in the AsyncAPI 3.0 servers map. +Describes a connection endpoint where the API is accessible.

+
interface AsyncApiServerEntry {
    description?: string;
    host: string;
    pathname?: string;
    protocol: "http" | "ws" | "wss" | "https";
}
Index

Properties

description?: string

An optional string describing the server.

+
host: string

The host of the server (hostname + optional port).

+
`'api.example.com'`, `'localhost:3000'`
+
+ +
pathname?: string

The path component of the server URL.

+
protocol: "http" | "ws" | "wss" | "https"

The protocol used to connect to the server.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiServer_ServerLike.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiServer_ServerLike.html new file mode 100644 index 00000000..dfa07814 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.AsyncApiServer_ServerLike.html @@ -0,0 +1,4 @@ +AsyncApiServer_ServerLike | Libraries

Interface AsyncApiServer_ServerLike

Minimal interface for a @cleverbrush/server server instance. Matches +the relevant subset of ServerBuilder needed for AsyncAPI generation.

+
interface AsyncApiServer_ServerLike {
    getSubscriptionRegistrations(): readonly SubscriptionRegistration[];
}
Index

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiEndpointOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiEndpointOptions.html new file mode 100644 index 00000000..293d6ff3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiEndpointOptions.html @@ -0,0 +1,21 @@ +OpenApiEndpointOptions | Libraries

Options for createOpenApiEndpoint.

+

When server is provided, getRegistrations and authConfig are derived +from it automatically (unless explicitly overridden).

+
interface OpenApiEndpointOptions {
    authConfig?: AuthenticationConfig | null;
    getRegistrations?: () => readonly EndpointRegistration[];
    info: OpenApiInfo;
    path?: string;
    securitySchemes?: Record<string, OpenApiSecurityScheme>;
    server?: OpenApiServer_ServerLike;
    servers?: readonly OpenApiServer[];
}
Index

Properties

authConfig?: AuthenticationConfig | null

Optional auth config for security scheme generation.

+
getRegistrations?: () => readonly EndpointRegistration[]

Function that returns endpoint registrations.

+

OpenAPI info metadata.

+
path?: string

Path to serve the spec at (default: /openapi.json).

+
securitySchemes?: Record<string, OpenApiSecurityScheme>

Override security schemes manually.

+

A ServerBuilder (or any structurally compatible object). When set, +endpoint registrations and auth config are read from the server +automatically. Explicit getRegistrations / authConfig values +take precedence.

+
servers?: readonly OpenApiServer[]

Optional server entries.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiInfo.html new file mode 100644 index 00000000..fbc9d5e3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiInfo.html @@ -0,0 +1,9 @@ +OpenApiInfo | Libraries

API metadata included in the OpenAPI info object. +Maps directly to the OpenAPI 3.1 Info Object.

+
interface OpenApiInfo {
    contact?: { email?: string; name?: string; url?: string };
    description?: string;
    license?: { name: string; url?: string };
    termsOfService?: string;
    title: string;
    version: string;
}
Index

Properties

contact?: { email?: string; name?: string; url?: string }
description?: string
license?: { name: string; url?: string }
termsOfService?: string
title: string
version: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiOptions.html new file mode 100644 index 00000000..3fc041ac --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiOptions.html @@ -0,0 +1,28 @@ +OpenApiOptions | Libraries

Options passed to generateOpenApiSpec.

+

When server is provided, registrations and authConfig are derived +from it automatically (unless explicitly overridden).

+
interface OpenApiOptions {
    authConfig?: AuthenticationConfig | null;
    info: OpenApiInfo;
    registrations?: readonly EndpointRegistration[];
    securitySchemes?: Record<string, OpenApiSecurityScheme>;
    server?: OpenApiServer_ServerLike;
    servers?: readonly OpenApiServer[];
    tags?: readonly OpenApiTag[];
    webhooks?: readonly WebhookDefinition[];
}
Index

Properties

authConfig?: AuthenticationConfig | null
registrations?: readonly EndpointRegistration[]
securitySchemes?: Record<string, OpenApiSecurityScheme>

A ServerBuilder (or any object implementing the same methods). +When set, registrations, authConfig, and webhooks are +automatically read from the server instance. Explicit values for +those fields take precedence over the server-derived ones.

+
servers?: readonly OpenApiServer[]
tags?: readonly OpenApiTag[]

Top-level tag definitions with optional descriptions and external docs.

+

When provided, these entries are emitted as the top-level tags array. +Any tag names used by registered endpoints but absent from this list are +automatically appended as name-only entries (sorted alphabetically).

+

When omitted, unique tag names are still auto-collected from all +registered endpoints and emitted as name-only entries.

+
webhooks?: readonly WebhookDefinition[]

Webhook definitions to emit in the top-level webhooks map of the +generated OpenAPI document.

+

Webhooks are not served as HTTP routes — they merely document async +out-of-band requests that your API sends to subscribers.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiSecurityScheme.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiSecurityScheme.html new file mode 100644 index 00000000..4a34a74a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiSecurityScheme.html @@ -0,0 +1,11 @@ +OpenApiSecurityScheme | Libraries

An OpenAPI 3.1 Security Scheme Object. +Describes how requests to the API are authenticated.

+
interface OpenApiSecurityScheme {
    bearerFormat?: string;
    flows?: Record<string, unknown>;
    in?: string;
    name?: string;
    openIdConnectUrl?: string;
    scheme?: string;
    type: string;
}
Index

Properties

bearerFormat?: string
flows?: Record<string, unknown>
in?: string
name?: string
openIdConnectUrl?: string
scheme?: string
type: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiServer.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiServer.html new file mode 100644 index 00000000..028d5d7d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiServer.html @@ -0,0 +1,5 @@ +OpenApiServer | Libraries

A server entry in the OpenAPI servers array. +Describes a base URL where the API is accessible.

+
interface OpenApiServer {
    description?: string;
    url: string;
}
Index

Properties

Properties

description?: string
url: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiServer_ServerLike.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiServer_ServerLike.html new file mode 100644 index 00000000..5acee3e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiServer_ServerLike.html @@ -0,0 +1,7 @@ +OpenApiServer_ServerLike | Libraries

Interface OpenApiServer_ServerLike

Minimal interface for a @cleverbrush/server server instance. Matches +the relevant subset of ServerBuilder so that callers can pass the +server directly without importing the class.

+
interface OpenApiServer_ServerLike {
    getAuthenticationConfig(): AuthenticationConfig | null;
    getRegistrations(): readonly EndpointRegistration[];
    getWebhooks(): readonly WebhookDefinition[];
}
Index

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiTag.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiTag.html new file mode 100644 index 00000000..0fb3a402 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.OpenApiTag.html @@ -0,0 +1,11 @@ +OpenApiTag | Libraries

A tag entry in the OpenAPI top-level tags array. +Provides a name, optional description, and optional external documentation +for a tag group.

+
interface OpenApiTag {
    description?: string;
    externalDocs?: { description?: string; url: string };
    name: string;
}
Index

Properties

description?: string

Short description for the tag group, displayed in Swagger UI / Redoc.

+
externalDocs?: { description?: string; url: string }

Link to external documentation for this tag.

+
name: string

Tag name. Must match the tag strings used on individual operations.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.PathParameterInfo.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.PathParameterInfo.html new file mode 100644 index 00000000..3e2410fc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.PathParameterInfo.html @@ -0,0 +1,5 @@ +PathParameterInfo | Libraries

Describes a single path parameter extracted from a route template, +including its name and the JSON Schema representation of its type.

+
interface PathParameterInfo {
    name: string;
    schema: Record<string, unknown>;
}
Index

Properties

Properties

name: string
schema: Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ResolvedPath.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ResolvedPath.html new file mode 100644 index 00000000..91d21d87 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ResolvedPath.html @@ -0,0 +1,7 @@ +ResolvedPath | Libraries

The output of resolving a route path template to an OpenAPI-compatible +path string and its parameter list.

+
interface ResolvedPath {
    parameters: readonly PathParameterInfo[];
    path: string;
}
Index

Properties

Properties

parameters: readonly PathParameterInfo[]

Extracted path parameters with their JSON Schema

+
path: string

OpenAPI-formatted path, e.g. /api/users/{id}

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ServeAsyncApiOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ServeAsyncApiOptions.html new file mode 100644 index 00000000..6cddf2e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ServeAsyncApiOptions.html @@ -0,0 +1,18 @@ +ServeAsyncApiOptions | Libraries

Options for the serveAsyncApi middleware.

+

When server is provided, getSubscriptionRegistrations is derived +from it automatically (unless explicitly overridden).

+
interface ServeAsyncApiOptions {
    getSubscriptionRegistrations?: () => readonly SubscriptionRegistration[];
    info: AsyncApiInfo;
    path?: string;
    server?: AsyncApiServer_ServerLike;
    servers?: Record<string, AsyncApiServerEntry>;
}
Index

Properties

getSubscriptionRegistrations?: () => readonly SubscriptionRegistration[]

Function that returns subscription registrations. +Takes precedence over server.getSubscriptionRegistrations().

+

AsyncAPI info metadata (title, version, description).

+
path?: string

Path to serve the spec at. Defaults to /asyncapi.json.

+

A ServerBuilder (or any structurally compatible object). When set, +subscription registrations are read from the server automatically. +An explicit getSubscriptionRegistrations value takes precedence.

+
servers?: Record<string, AsyncApiServerEntry>

Server entries to include in the spec's servers map. +Keys are server IDs (e.g. 'production', 'staging').

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ServeOpenApiOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ServeOpenApiOptions.html new file mode 100644 index 00000000..a570c111 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server-openapi.ServeOpenApiOptions.html @@ -0,0 +1,21 @@ +ServeOpenApiOptions | Libraries

Options for the serveOpenApi middleware.

+

When server is provided, getRegistrations and authConfig are derived +from it automatically (unless explicitly overridden).

+
interface ServeOpenApiOptions {
    authConfig?: AuthenticationConfig | null;
    getRegistrations?: () => readonly EndpointRegistration[];
    info: OpenApiInfo;
    path?: string;
    securitySchemes?: Record<string, OpenApiSecurityScheme>;
    server?: OpenApiServer_ServerLike;
    servers?: readonly OpenApiServer[];
}
Index

Properties

authConfig?: AuthenticationConfig | null

Optional auth config for security scheme generation.

+
getRegistrations?: () => readonly EndpointRegistration[]

Function that returns endpoint registrations.

+

OpenAPI info metadata.

+
path?: string

Path to serve the spec at (default: /openapi.json).

+
securitySchemes?: Record<string, OpenApiSecurityScheme>

Override security schemes manually.

+

A ServerBuilder (or any structurally compatible object). When set, +endpoint registrations and auth config are read from the server +automatically. Explicit getRegistrations / authConfig values +take precedence.

+
servers?: readonly OpenApiServer[]

Optional server entries.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..AuthenticationConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..AuthenticationConfig.html new file mode 100644 index 00000000..23bc8f45 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..AuthenticationConfig.html @@ -0,0 +1,9 @@ +AuthenticationConfig | Libraries

Interface AuthenticationConfig

Authentication configuration passed to ServerBuilder.useAuthentication().

+

At least one scheme must be listed. The defaultScheme name must match +one of the registered scheme name values — it is used when no specific +scheme is requested.

+
interface AuthenticationConfig {
    defaultScheme: string;
    schemes: AuthenticationScheme<any>[];
}
Index

Properties

Properties

defaultScheme: string

Name of the default scheme to use (must match a scheme's name).

+
schemes: AuthenticationScheme<any>[]

Registered authentication schemes.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..AuthorizationConfig.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..AuthorizationConfig.html new file mode 100644 index 00000000..dec5d4dd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..AuthorizationConfig.html @@ -0,0 +1,6 @@ +AuthorizationConfig | Libraries

Interface AuthorizationConfig

Authorization configuration passed to ServerBuilder.useAuthorization().

+

Named policies can be referenced by string in future authorize('policy-name') +calls (currently resolved at startup time).

+
interface AuthorizationConfig {
    policies?: Record<string, (builder: PolicyBuilder) => void>;
}
Index

Properties

Properties

policies?: Record<string, (builder: PolicyBuilder) => void>

Named policies (looked up by authorize('policy-name') — future use).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CacheTagDefinition.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CacheTagDefinition.html new file mode 100644 index 00000000..1327e10e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CacheTagDefinition.html @@ -0,0 +1,7 @@ +CacheTagDefinition | Libraries

Interface CacheTagDefinition

A serialisable cache-tag definition stored on endpoint metadata.

+

properties maps human-readable key names (used as label segments +in the final cache key) to accessors that resolve the actual value +from call-time request data.

+
interface CacheTagDefinition {
    name: string;
    properties: Readonly<Record<string, CacheTagPropertyAccessor>>;
}
Index

Properties

Properties

name: string
properties: Readonly<Record<string, CacheTagPropertyAccessor>>
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CacheTagPropertyAccessor.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CacheTagPropertyAccessor.html new file mode 100644 index 00000000..b527cbc9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CacheTagPropertyAccessor.html @@ -0,0 +1,5 @@ +CacheTagPropertyAccessor | Libraries

Interface CacheTagPropertyAccessor

An accessor that can extract a property value from a structured +request root. Wraps a PropertyDescriptor's getValue +closure so the middleware layer does not need to know about schemas.

+
interface CacheTagPropertyAccessor {
    getValue(
        root: {
            body: unknown;
            headers: Record<string, string>;
            params: Record<string, unknown>;
            query: Record<string, unknown>;
        },
    ): { success: boolean; value?: unknown };
}
Index

Methods

Methods

  • Parameters

    • root: {
          body: unknown;
          headers: Record<string, string>;
          params: Record<string, unknown>;
          query: Record<string, unknown>;
      }

    Returns { success: boolean; value?: unknown }

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CallbackDefinition.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CallbackDefinition.html new file mode 100644 index 00000000..9497ae2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..CallbackDefinition.html @@ -0,0 +1,22 @@ +CallbackDefinition | Libraries

Interface CallbackDefinition<TBody>

A callback declaration for async request/response patterns.

+
interface CallbackDefinition<TBody = any> {
    body?: SchemaBuilder<any, any, any, any, any>;
    description?: string;
    expression?: string;
    method?: string;
    response?: SchemaBuilder<any, any, any, any, any>;
    summary?: string;
    urlFrom?: (
        body: TBody extends ObjectSchemaBuilder<
            any,
            any,
            any,
            any,
            any,
            {},
            [],
        >
            ? PropertyDescriptorTree<TBody, TBody>
            : PropertyRefTree<any>,
    ) => unknown;
}

Type Parameters

  • TBody = any
Index

Properties

body?: SchemaBuilder<any, any, any, any, any>

Request body schema for the callback payload.

+
description?: string

Detailed description of the callback operation.

+
expression?: string

Raw OpenAPI runtime expression for the callback URL, +e.g. '{$request.body#/callbackUrl}'. +Mutually exclusive with urlFrom.

+
method?: string

HTTP method for the callback request (default: 'POST').

+
response?: SchemaBuilder<any, any, any, any, any>

Response schema expected from the callback consumer.

+
summary?: string

Short summary of the callback operation.

+
urlFrom?: (
    body: TBody extends ObjectSchemaBuilder<any, any, any, any, any, {}, []>
        ? PropertyDescriptorTree<TBody, TBody>
        : PropertyRefTree<any>,
) => unknown

Type-safe selector for the request body field holding the callback URL. +The generator converts the selected property to a +'{$request.body#/<pointer>}' expression automatically. +Mutually exclusive with expression.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ContentTypeHandler.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ContentTypeHandler.html new file mode 100644 index 00000000..9be358fb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ContentTypeHandler.html @@ -0,0 +1,10 @@ +ContentTypeHandler | Libraries

Interface ContentTypeHandler

A pluggable serializer/deserializer for a specific MIME type. +Register instances with ServerBuilder.contentType() or +ContentNegotiator.register() to extend content negotiation.

+
const msgpackHandler: ContentTypeHandler = {
mimeType: 'application/msgpack',
serialize: (value) => encode(value),
deserialize: (raw) => decode(Buffer.from(raw))
};
server.contentType(msgpackHandler); +
+ +
interface ContentTypeHandler {
    mimeType: string;
    deserialize(raw: string): unknown;
    serialize(value: unknown): string;
}
Index

Properties

Methods

Properties

mimeType: string

Methods

diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..EndpointMetadata.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..EndpointMetadata.html new file mode 100644 index 00000000..3b94f4e0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..EndpointMetadata.html @@ -0,0 +1,63 @@ +EndpointMetadata | Libraries

Interface EndpointMetadata

Snapshot of all configuration set on an EndpointBuilder. +Used by the server for routing and by @cleverbrush/server-openapi for +spec generation.

+
interface EndpointMetadata {
    authRoles: readonly string[] | null;
    basePath: string;
    bodySchema: SchemaBuilder<any, any, any, any, any> | null;
    cacheTags: readonly CacheTagDefinition[];
    callbacks: Record<string, CallbackDefinition<any>> | null;
    deprecated: boolean;
    description: string | null;
    example: unknown;
    examples:
        | Record<
            string,
            { description?: string; summary?: string; value: unknown },
        >
        | null;
    externalDocs: { description?: string; url: string } | null;
    fileUpload: UploadOptions | null;
    headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    links: Record<string, LinkDefinition<any>> | null;
    method: string;
    operationId: string | null;
    pathTemplate: RoutePath;
    produces:
        | Record<string, { schema?: SchemaBuilder<any, any, any, any, any> }>
        | null;
    producesFile: { contentType?: string; description?: string } | null;
    querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    responseHeaderSchema:
        | ObjectSchemaBuilder<any, any, any, any, any, any, any>
        | null;
    responseSchema: SchemaBuilder<any, any, any, any, any> | null;
    responsesSchemas:
        | Record<number, SchemaBuilder<any, any, any, any, any> | null>
        | null;
    serviceSchemas:
        | Record<string, SchemaBuilder<any, any, any, any, any>>
        | null;
    summary: string | null;
    tags: readonly string[];
}
Index

Properties

authRoles: readonly string[] | null

Authorization roles required for this endpoint.

+
    +
  • null → no authorization required (public)
  • +
  • [] → any authenticated user
  • +
  • ['admin', ...] → user must have at least one of these roles
  • +
+
basePath: string
bodySchema: SchemaBuilder<any, any, any, any, any> | null
cacheTags: readonly CacheTagDefinition[]

Cache tags declared via .clearsCacheTag(), providing tag-based cache +key computation for the client middleware.

+
callbacks: Record<string, CallbackDefinition<any>> | null

Callbacks declared via .callbacks(), emitted as callbacks on the +OpenAPI Operation Object.

+
deprecated: boolean
description: string | null
example: unknown

A single example value for the request body, emitted as example on the +OpenAPI Media Type Object.

+
examples:
    | Record<
        string,
        { description?: string; summary?: string; value: unknown },
    >
    | null

A map of named examples for the request body, emitted as examples on the +OpenAPI Media Type Object. Each entry follows the OpenAPI Example Object shape.

+
externalDocs: { description?: string; url: string } | null

External documentation URL for this operation, emitted as externalDocs +on the OpenAPI Operation Object.

+
fileUpload: UploadOptions | null

When set, the endpoint accepts multipart/form-data uploads. +The configuration controls max file size, allowed MIME types, etc.

+

EndpointBuilder.upload()

+
headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
links: Record<string, LinkDefinition<any>> | null

Response links declared via .links(), emitted under the primary +success response's links map in the OpenAPI spec.

+
method: string
operationId: string | null
pathTemplate: RoutePath
produces:
    | Record<string, { schema?: SchemaBuilder<any, any, any, any, any> }>
    | null

Multiple response content types for content-negotiated endpoints. +Keys are MIME types; an optional schema overrides the default response +schema for that content type. When set alongside .producesFile(), +producesFile takes precedence.

+
producesFile: { contentType?: string; description?: string } | null

When set, the endpoint produces a binary file response instead of JSON. +The OpenAPI spec will emit the appropriate binary content type.

+
querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
responseHeaderSchema:
    | ObjectSchemaBuilder<any, any, any, any, any, any, any>
    | null

Schema describing response headers emitted on every response code. +Each property in the object schema becomes a header name with its +sub-schema and optional description.

+
responseSchema: SchemaBuilder<any, any, any, any, any> | null
responsesSchemas:
    | Record<number, SchemaBuilder<any, any, any, any, any> | null>
    | null

Per-status-code response schemas declared via .responses(). +When non-null, takes precedence over responseSchema for OpenAPI generation +and constrains the handler return type to the declared codes. +A null schema value means the response has no body (e.g. 204).

+
serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null
summary: string | null
tags: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..EndpointRegistration.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..EndpointRegistration.html new file mode 100644 index 00000000..cb115f5c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..EndpointRegistration.html @@ -0,0 +1,6 @@ +EndpointRegistration | Libraries

Interface EndpointRegistration

A registered endpoint pairing its metadata (method, path, schemas) with +the handler function and any per-endpoint middleware.

+
interface EndpointRegistration {
    endpoint: EndpointMetadata;
    handler: (...args: any[]) => any;
    middlewares?: readonly Middleware[];
}
Index

Properties

handler: (...args: any[]) => any
middlewares?: readonly Middleware[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..FilePart.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..FilePart.html new file mode 100644 index 00000000..f943f13b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..FilePart.html @@ -0,0 +1,10 @@ +FilePart | Libraries

Interface FilePart

Represents a single uploaded file from a multipart/form-data request.

+
interface FilePart {
    buffer: Buffer;
    filename: string;
    mimeType: string;
    size: number;
}
Index

Properties

Properties

buffer: Buffer

Full file contents as a Buffer.

+
filename: string

Original filename as provided by the client.

+
mimeType: string

MIME type of the file (e.g. 'image/jpeg').

+
size: number

File size in bytes.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..HandlerMapping.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..HandlerMapping.html new file mode 100644 index 00000000..bb4d2caa --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..HandlerMapping.html @@ -0,0 +1,5 @@ +HandlerMapping | Libraries

Interface HandlerMapping

The opaque result of mapHandlers. Passed to +ServerBuilder.handleAll() to register every endpoint at once.

+
interface HandlerMapping {
    _entries: readonly {
        endpoint: AnyEndpoint;
        handler: (...args: any[]) => any;
        middlewares?: Middleware[];
    }[];
    _subscriptions: readonly {
        endpoint: AnySubscriptionBuilder;
        handler: (...args: any[]) => any;
        middlewares?: Middleware[];
    }[];
}
Index

Properties

_entries: readonly {
    endpoint: AnyEndpoint;
    handler: (...args: any[]) => any;
    middlewares?: Middleware[];
}[]
_subscriptions: readonly {
    endpoint: AnySubscriptionBuilder;
    handler: (...args: any[]) => any;
    middlewares?: Middleware[];
}[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..LinkDefinition.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..LinkDefinition.html new file mode 100644 index 00000000..14ea007f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..LinkDefinition.html @@ -0,0 +1,18 @@ +LinkDefinition | Libraries

Interface LinkDefinition<TResponse>

A link from a response to a follow-up operation.

+
interface LinkDefinition<TResponse = any> {
    description?: string;
    operationId: string;
    parameters?:
        | Record<string, string>
        | (
            (
                response: TResponse extends ObjectSchemaBuilder<
                    any,
                    any,
                    any,
                    any,
                    any,
                    {},
                    [],
                >
                    ? PropertyDescriptorTree<TResponse, TResponse>
                    : PropertyRefTree<any>,
            ) => Record<string, unknown>
        );
    requestBody?: string;
}

Type Parameters

  • TResponse = any
Index

Properties

description?: string

Human-readable description of the link relationship.

+
operationId: string

operationId of the target operation.

+
parameters?:
    | Record<string, string>
    | (
        (
            response: TResponse extends ObjectSchemaBuilder<
                any,
                any,
                any,
                any,
                any,
                {},
                [],
            >
                ? PropertyDescriptorTree<TResponse, TResponse>
                : PropertyRefTree<any>,
        ) => Record<string, unknown>
    )

Map of target parameter names to values.

+
    +
  • Record<string, string> — raw OpenAPI runtime expressions such as +'$response.body#/id'.
  • +
  • Callback (response: PropertyRefTree<TResponse>) => Record<string, unknown> — +type-safe selector; properties accessed on response are converted to +$response.body#/<pointer> expressions automatically.
  • +
+
requestBody?: string

Runtime expression or literal for the linked operation's request body.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ProblemDetails.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ProblemDetails.html new file mode 100644 index 00000000..f679cc1e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ProblemDetails.html @@ -0,0 +1,10 @@ +ProblemDetails | Libraries

Interface ProblemDetails

An RFC 9457 (formerly RFC 7807) Problem Details object.

+

Provides machine-readable error information in HTTP API responses. +Serialized as application/problem+json.

+
interface ProblemDetails {
    detail?: string;
    instance?: string;
    status: number;
    title: string;
    type: string;
    readonly [extension: string]: unknown;
}

Indexable

  • readonly [extension: string]: unknown
Index

Properties

detail?: string
instance?: string
status: number
title: string
type: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..RejectedFile.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..RejectedFile.html new file mode 100644 index 00000000..3f7744d5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..RejectedFile.html @@ -0,0 +1,8 @@ +RejectedFile | Libraries

Interface RejectedFile

Describes a file that was rejected during multipart parsing.

+
interface RejectedFile {
    filename: string;
    mimeType: string;
    reason: string;
}
Index

Properties

Properties

filename: string

Original filename as provided by the client.

+
mimeType: string

MIME type of the file (e.g. 'application/xlsx').

+
reason: string

Human-readable reason the file was rejected.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerBatchingOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerBatchingOptions.html new file mode 100644 index 00000000..3a502a47 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerBatchingOptions.html @@ -0,0 +1,31 @@ +ServerBatchingOptions | Libraries

Interface ServerBatchingOptions

Configuration for the server-side request batching endpoint, enabled via +ServerBuilder.useBatching().

+

The batch endpoint accepts POST <path> with a JSON body containing an +array of sub-requests. It processes each through the full middleware and +handler pipeline, then returns an array of sub-responses in a single reply.

+
new ServerBuilder()
.useBatching({ path: '/__batch', maxSize: 20, parallel: true })
.handleAll(mapping)
.listen(3000); +
+ +
interface ServerBatchingOptions {
    maxSize?: number;
    parallel?: boolean;
    path?: string;
}
Index

Properties

Properties

maxSize?: number

Maximum number of sub-requests allowed per batch.

+

Requests exceeding this limit are rejected with 400 Bad Request.

+
20
+
+ +
parallel?: boolean

Whether to execute sub-requests in parallel (true) or sequentially +(false).

+

Parallel execution is faster but requires all handlers to be +concurrency-safe. Set to false if your handlers share mutable +request-scoped state that would cause conflicts when run concurrently.

+
true
+
+ +
path?: string

URL path of the batch endpoint.

+

Must match the batchPath configured on the client-side +batching() middleware.

+
'/__batch'
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerCacheOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerCacheOptions.html new file mode 100644 index 00000000..302216e6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerCacheOptions.html @@ -0,0 +1,7 @@ +ServerCacheOptions | Libraries

Interface ServerCacheOptions

Configuration for cacheResponse.

+
interface ServerCacheOptions {
    defaultTtl?: number;
    ttlByTag?: Record<string, number>;
}
Index

Properties

Properties

defaultTtl?: number

Default TTL in milliseconds for tags without an explicit TTL. +Defaults to 60000 (60 seconds).

+
ttlByTag?: Record<string, number>

Per-tag TTL overrides: { [tagName]: ttlMs }.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerIdempotencyOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerIdempotencyOptions.html new file mode 100644 index 00000000..b110444d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerIdempotencyOptions.html @@ -0,0 +1,11 @@ +ServerIdempotencyOptions | Libraries

Interface ServerIdempotencyOptions

Configuration for idempotency.

+
interface ServerIdempotencyOptions {
    headerName?: string;
    skip?: (ctx: RequestContext) => boolean;
    ttl?: number;
}
Index

Properties

Properties

headerName?: string

Header name to read the idempotency key from. +Defaults to "x-idempotency-key".

+
skip?: (ctx: RequestContext) => boolean

Predicate that decides whether a request should be skipped. +Defaults to skipping non-mutating requests (GET, HEAD, OPTIONS).

+
ttl?: number

TTL in milliseconds for stored responses. +Defaults to 86_400_000 (24 hours).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerOptions.html new file mode 100644 index 00000000..b74d8766 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ServerOptions.html @@ -0,0 +1,13 @@ +ServerOptions | Libraries

Interface ServerOptions

Configuration options passed to ServerBuilder.listen() or the Server +constructor. All fields are optional; sensible defaults are applied.

+
interface ServerOptions {
    host?: string;
    https?: { cert: string; key: string };
    maxBodySize?: number;
    port?: number;
}
Index

Properties

host?: string
https?: { cert: string; key: string }
maxBodySize?: number

Maximum allowed size (in bytes) for incoming request bodies, batch +payloads, and WebSocket messages.

+

Requests that exceed this limit are rejected with 413 Payload Too Large.

+
5_242_880 (5 MB)
+
+ +
port?: number
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..SubscriptionMetadata.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..SubscriptionMetadata.html new file mode 100644 index 00000000..d16dc6c0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..SubscriptionMetadata.html @@ -0,0 +1,20 @@ +SubscriptionMetadata | Libraries

Interface SubscriptionMetadata

Snapshot of all configuration set on a SubscriptionBuilder. +Used by the server for WebSocket upgrade handling and by documentation +generators for AsyncAPI / OpenAPI spec output.

+
interface SubscriptionMetadata {
    authRoles: readonly string[] | null;
    basePath: string;
    deprecated: boolean;
    description: string | null;
    externalDocs: { description?: string; url: string } | null;
    headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    incomingSchema: SchemaBuilder<any, any, any, any, any> | null;
    operationId: string | null;
    outgoingSchema: SchemaBuilder<any, any, any, any, any> | null;
    pathTemplate: RoutePath;
    protocol: "subscription";
    querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null;
    serviceSchemas:
        | Record<string, SchemaBuilder<any, any, any, any, any>>
        | null;
    summary: string | null;
    tags: readonly string[];
}
Index

Properties

authRoles: readonly string[] | null
basePath: string
deprecated: boolean
description: string | null
externalDocs: { description?: string; url: string } | null
headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
incomingSchema: SchemaBuilder<any, any, any, any, any> | null
operationId: string | null
outgoingSchema: SchemaBuilder<any, any, any, any, any> | null
pathTemplate: RoutePath
protocol: "subscription"

Always 'subscription'. Distinguishes from HTTP endpoint metadata.

+
querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null
serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null
summary: string | null
tags: readonly string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..SubscriptionRegistration.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..SubscriptionRegistration.html new file mode 100644 index 00000000..1b311bc3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..SubscriptionRegistration.html @@ -0,0 +1,6 @@ +SubscriptionRegistration | Libraries

Interface SubscriptionRegistration

A registered subscription pairing its metadata with the async generator +handler and any per-subscription middleware.

+
interface SubscriptionRegistration {
    endpoint: SubscriptionMetadata;
    handler: (...args: any[]) => any;
    middlewares?: readonly Middleware[];
}
Index

Properties

handler: (...args: any[]) => any
middlewares?: readonly Middleware[]
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..TrackedEvent.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..TrackedEvent.html new file mode 100644 index 00000000..60cf50c4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..TrackedEvent.html @@ -0,0 +1,11 @@ +TrackedEvent | Libraries

Interface TrackedEvent<T>

A server-sent event wrapped with a unique ID for resumable subscriptions.

+

When a client reconnects, it can send the last received event ID so the +server resumes from that point instead of replaying everything.

+

tracked

+
interface TrackedEvent<T = unknown> {
    "[TRACKED_SYMBOL]": true;
    data: T;
    id: string;
}

Type Parameters

  • T = unknown
Index

Properties

Properties

"[TRACKED_SYMBOL]": true

Brand marker.

+
data: T

The actual event payload.

+
id: string

Unique event identifier for resume tracking.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..UploadOptions.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..UploadOptions.html new file mode 100644 index 00000000..f5a135f3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..UploadOptions.html @@ -0,0 +1,16 @@ +UploadOptions | Libraries

Interface UploadOptions

Configuration for file upload endpoints declared via +EndpointBuilder.upload().

+
interface UploadOptions {
    allowedMimeTypes?: string[];
    maxFileCount?: number;
    maxFileSize?: number;
}
Index

Properties

allowedMimeTypes?: string[]

Allowed MIME types or patterns (e.g. 'image/*', 'application/pdf'). +When not set, all MIME types are accepted.

+
maxFileCount?: number

Maximum number of files allowed in a single request.

+
10
+
+ +
maxFileSize?: number

Maximum allowed file size per uploaded file in bytes.

+
10_485_760 (10 MB)
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ValidationErrorItem.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ValidationErrorItem.html new file mode 100644 index 00000000..bd4a5a79 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..ValidationErrorItem.html @@ -0,0 +1,8 @@ +ValidationErrorItem | Libraries

Interface ValidationErrorItem

A single field-level validation error, used in validation Problem Details +responses. pointer follows JSON Pointer syntax (RFC 6901).

+
`{ pointer: '/body/email', detail: 'Must be a valid email address' }`
+
+ +
interface ValidationErrorItem {
    detail: string;
    pointer: string;
}
Index

Properties

Properties

detail: string
pointer: string
diff --git a/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..WebhookDefinition.html b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..WebhookDefinition.html new file mode 100644 index 00000000..29c6e80c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/interfaces/_cleverbrush_server..WebhookDefinition.html @@ -0,0 +1,22 @@ +WebhookDefinition | Libraries

Interface WebhookDefinition

Describes an out-of-band webhook that your API can send to consumers.

+

Pass instances to ServerBuilder.webhook() so that +@cleverbrush/server-openapi can emit them inside the webhooks map of +the generated OpenAPI document.

+
const userCreatedWebhook = defineWebhook('userCreated', {
method: 'POST',
summary: 'Fired when a new user is created',
body: object({ id: number(), email: string() }),
}); +
+ +
interface WebhookDefinition {
    body?: SchemaBuilder<any, any, any, any, any>;
    description?: string;
    method?: string;
    name: string;
    response?: SchemaBuilder<any, any, any, any, any>;
    summary?: string;
    tags?: readonly string[];
}
Index

Properties

body?: SchemaBuilder<any, any, any, any, any>

Schema describing the webhook request payload.

+
description?: string

Longer description for OpenAPI documentation. Supports Markdown.

+
method?: string

HTTP method sent to the consumer endpoint (default: 'POST').

+
name: string

Unique webhook name used as the key in the webhooks map.

+
response?: SchemaBuilder<any, any, any, any, any>

Schema describing the expected response from the consumer.

+
summary?: string

Short summary for OpenAPI documentation.

+
tags?: readonly string[]

Tags to group this webhook in generated documentation.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/media/CONTRIBUTING.md b/websites/docs/public/api-docs/v4.3.2/media/CONTRIBUTING.md new file mode 100644 index 00000000..6abba706 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/media/CONTRIBUTING.md @@ -0,0 +1,125 @@ +# Contributing to @cleverbrush/framework + +Thanks for your interest in contributing! This guide will help you get started. + +## Prerequisites + +- **Node.js** 20 or later (22 recommended — see `.nvmrc`) +- **npm** (ships with Node) + +## Getting Started + +```bash +# Clone the repo +git clone https://github.com/cleverbrush/framework.git +cd framework + +# Install dependencies +npm ci + +# Build all packages +npm run build + +# Run tests & typechecks +npm run test +``` + +## Monorepo Structure + +This project uses **npm workspaces** with **Turborepo** for orchestration. All packages live under `libs/`: + +| Package | Description | +| --- | --- | +| `@cleverbrush/schema` | Type-safe schema validation with immutable builders | +| `@cleverbrush/deep` | Deep equality & deep extend utilities | +| `@cleverbrush/async` | Async utilities (Collector, debounce, throttle, retry) | +| `@cleverbrush/mapper` | Schema-driven object mapping | +| `@cleverbrush/react-form` | React form library powered by schema PropertyDescriptors | +| `@cleverbrush/scheduler` | Cron-like job scheduler with schema-validated config | +| `@cleverbrush/knex-clickhouse` | Knex dialect for ClickHouse | + +## Development Workflow + +### Code Style + +[Biome](https://biomejs.dev) handles both formatting and linting: + +```bash +# Check for lint/format issues +npm run lint + +# Auto-fix issues +npm run lint:fix +``` + +### Testing + +Tests use [Vitest](https://vitest.dev) and are co-located with source files (`*.test.ts`): + +```bash +# Run all tests with typechecking +npm run test + +# Run tests for a specific package +npx vitest --run libs/schema +``` + +### Building + +```bash +# Build all packages (respects dependency order via Turbo) +npm run build + +# Clean all build artifacts +npm run clean +``` + +## Adding a Schema Extension + +The extension system is the primary way to add new validators. See `libs/schema/src/extensions/` for examples. + +1. Create your extension file (e.g. `libs/schema/src/extensions/myExtension.ts`) +2. Export extension functions that call the builder's `.extend()` method +3. Add tests in a co-located `*.test.ts` file +4. Re-export from `libs/schema/src/extensions/index.ts` + +Look at `libs/schema/src/extensions/string.ts` for a complete example of how extensions add validators like `email()`, `url()`, `uuid()`, etc. + +## Adding a New Builder + +Builders live in `libs/schema/src/builders/`. Each builder extends the base `SchemaBuilder` class. + +1. Create your builder file in `libs/schema/src/builders/` +2. Extend `SchemaBuilder` with appropriate type parameters +3. Add a factory function (e.g. `myType()`) and export it +4. Add comprehensive tests in a co-located `*.test.ts` file +5. Export from `libs/schema/src/index.ts` + +## Pull Request Process + +1. **Fork** the repo and create a feature branch from `master` +2. Make your changes with tests +3. **Add a changeset** — every PR that changes package behavior needs one: + ```bash + npx changeset + ``` + Follow the prompts to select affected packages and describe the change. +4. Ensure all checks pass: + ```bash + npm run lint + npm run build + npm run test + ``` +5. Open a PR against `master` + +### Changeset Guidelines + +- **patch** — bug fixes, internal refactors with no API change +- **minor** — new features, new extensions, new builders +- **major** — breaking API changes + +All packages are versioned together (fixed release group), so a single changeset covers all packages. + +## Questions? + +Open a [GitHub issue](https://github.com/cleverbrush/framework/issues) — we're happy to help. diff --git a/websites/docs/public/api-docs/v4.3.2/media/LICENSE b/websites/docs/public/api-docs/v4.3.2/media/LICENSE new file mode 100644 index 00000000..0b842d4c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/media/LICENSE @@ -0,0 +1,52 @@ +Cleverbrush Framework is dual-licensed under both the "Unlicense" and the +"Zero-Clause BSD" (0BSD) licenses. The intent of this dual-licensing +structure is to make Cleverbrush Framework as consumable as possible in as many +environments / countries / companies as possible without encumbering +users. + +This license applies to all of the Cleverbrush Framework source code, build code, +and tests. + +The text of the two licenses follows below: + +============================== UNLICENSE ============================== + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + +================================ 0BSD ================================= + +Copyright (C) 2024 by Andrew Zolotuhkin + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/websites/docs/public/api-docs/v4.3.2/media/ci.yml b/websites/docs/public/api-docs/v4.3.2/media/ci.yml new file mode 100644 index 00000000..5c9af5d0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/media/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ci: + name: Lint, Build & Test (Node ${{ matrix.node }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: [24] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Build + run: npm run build + + - name: Typecheck schema site + run: npm run typecheck:schema-site + + - name: Typecheck docs site + run: npm run typecheck:docs-site + + - name: Test & Typecheck + run: npm run test diff --git a/websites/docs/public/api-docs/v4.3.2/modules.html b/websites/docs/public/api-docs/v4.3.2/modules.html new file mode 100644 index 00000000..8ed1885c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules.html @@ -0,0 +1 @@ +Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_async.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_async.html new file mode 100644 index 00000000..2fd8edeb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_async.html @@ -0,0 +1,202 @@ +@cleverbrush/async | Libraries

Module @cleverbrush/async

@cleverbrush/async

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A set of simple utilities for working with asynchronous operations.

+ +
npm install @cleverbrush/async
+
+ + +
import { Collector, debounce, throttle, retry, withTimeout, dedupe } from '@cleverbrush/async';
+
+ + + +

Collects a set of named values and emits an event when all items have been collected. Extends EventEmitter. The constructor accepts a list of keys to collect and an optional timeout in milliseconds.

+
type Person = {
firstName: string;
lastName: string;
};

const collector = new Collector<Person>(['firstName', 'lastName'], 10000);

collector.on('end', (collectedObject: Person) => {
console.log(collectedObject);
});

collector.on('timeout', (collectedData: Partial<Person>) => {
// timeout reached before all items were collected
});

collector.collect('firstName', 'John');
collector.collect('lastName', 'Smith'); +
+ +

The Collector can also be used with a Promise-based approach:

+
const collector = new Collector<Person>(['firstName', 'lastName'], 10000);
const promise = collector.toPromise();

collector.collect('firstName', 'John').collect('lastName', 'Smith');

try {
const person: Person = await promise;
} catch (e) {
// timeout or error occurred
} +
+ + +

Ensures a function is only called after a specified delay since the last invocation. Useful for handling rapid user input such as search fields or window resizing.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
func(...args) => voidThe function to debounce
waitnumberDelay in milliseconds
opts.immediatebooleanIf true, calls the function immediately on the first invocation, then debounces subsequent calls. Default: false
+
import { debounce } from '@cleverbrush/async';

const debouncedSearch = debounce((query: string) => {
// perform search
}, 300);

// called rapidly, but only the last call executes after 300ms of inactivity
debouncedSearch('h');
debouncedSearch('he');
debouncedSearch('hello'); +
+ + +

Ensures a function is called at most once per specified interval. Unlike debounce, it guarantees regular execution during sustained activity.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
func(...args) => voidThe function to throttle
limitnumberMinimum interval in milliseconds between calls
+
import { throttle } from '@cleverbrush/async';

const throttledResize = throttle(() => {
// handle resize
}, 200);

window.addEventListener('resize', throttledResize); +
+ + +

Retries an async function with exponential backoff on failure. Returns the result of the first successful attempt.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
fn() => Promise<T>The async function to retry
options.maxRetriesnumber3Maximum number of retry attempts
options.minDelaynumber100Minimum delay in milliseconds before the first retry
options.delayFactornumber2Multiplier applied to the delay after each retry
options.delayRandomizationPercentnumber0Randomization factor (01) added to each delay
options.shouldRetry(error) => booleanOptional predicate to decide whether to retry a given error
+
import { retry } from '@cleverbrush/async';

const data = await retry(
() => fetch('https://api.example.com/data').then((r) => r.json()),
{
maxRetries: 5,
minDelay: 200,
delayFactor: 2,
shouldRetry: (err) => err.status !== 404
}
); +
+ + +

Wraps a promise-returning function with a timeout. If the function does not resolve within ms milliseconds, the returned promise rejects with a TimeoutError and the internal AbortSignal is triggered.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn(signal: AbortSignal) => Promise<T>The async function to wrap. Receives an AbortSignal that fires on timeout.
msnumberTimeout in milliseconds
+
import { withTimeout } from '@cleverbrush/async';

const data = await withTimeout(
(signal) => fetch('/api/slow', { signal }).then(r => r.json()),
5000
); +
+ + +

Deduplicates concurrent calls to the same async function. If a call with the same key is already in-flight, returns the existing promise instead of starting a new one.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyFn(...args) => stringComputes a cache key from the arguments
fn(...args) => Promise<T>The async function to wrap
+
import { dedupe } from '@cleverbrush/async';

const fetchUser = dedupe(
(id: number) => `user-${id}`,
(id: number) => fetch(`/api/users/${id}`).then(r => r.json())
);

// These two concurrent calls share a single fetch:
const [a, b] = await Promise.all([fetchUser(1), fetchUser(1)]); +
+ + +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode
  • +
  • Unit tests: Vitest — covering Collector event/promise modes, debounce/throttle timing, and retry back-off logic
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Classes

Collector
TimeoutError

Functions

debounce
dedupe
retry
throttle
withTimeout
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_auth.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_auth.html new file mode 100644 index 00000000..84bb4571 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_auth.html @@ -0,0 +1,52 @@ +@cleverbrush/auth | Libraries

Module @cleverbrush/auth

@cleverbrush/auth

+

CI +License: BSD-3-Clause

+

Transport-agnostic authentication and authorization for TypeScript. Ships with JWT and cookie schemes, a fluent policy builder, and a typed Principal value object. Designed for @cleverbrush/server but usable in any Node.js context.

+ +
    +
  • Transport-agnostic — authentication schemes receive a plain AuthenticationContext (headers + cookies + items), not a raw HTTP request.
  • +
  • Principal<T> — immutable, typed value object exposing .hasRole(), .hasClaim(), .isAuthenticated, and .claims.
  • +
  • JWT schemejwtScheme() supports HS256/HS384/HS512 and RS256/RS384/RS512; configurable issuer, audience, clock tolerance, and role claim.
  • +
  • Cookie schemecookieScheme() with a user-supplied async validate() function (session lookup, signature check, etc.).
  • +
  • AuthorizationPolicyBuilder with .requireRole() / .require(predicate) fluent API; AuthorizationService.authorize() accepts requirements or a named policy.
  • +
  • requireRole() helper — convenience factory for single-call role requirements.
  • +
  • Cookie utilitiesparseCookies() and serializeCookie() for low-level cookie handling.
  • +
  • Zero runtime dependencies — uses only Node.js built-in crypto.
  • +
+ +
npm install @cleverbrush/auth
+
+ + +
import { jwtScheme, Principal } from '@cleverbrush/auth';

type UserClaims = { sub: string; role: string };

const jwt = jwtScheme<UserClaims>({
secret: process.env.JWT_SECRET!,
mapClaims: claims => ({
sub: claims.sub as string,
role: claims.role as string
})
});

// Authenticate a request context (built from HTTP headers)
const result = await jwt.authenticate({
headers: { authorization: 'Bearer <token>' },
cookies: {},
items: new Map()
});

if (result.succeeded) {
const principal: Principal<UserClaims> = result.principal;
principal.isAuthenticated; // true
principal.hasRole('admin'); // boolean
principal.value.sub; // string
} +
+ + +
import { jwtScheme, signJwt } from '@cleverbrush/auth';

// Sign a token (for testing or token issuance)
const token = signJwt({ sub: 'user-1', role: 'admin' }, 'my-secret');

// Verify and authenticate
const scheme = jwtScheme({
secret: 'my-secret',
algorithms: ['HS256'], // default
issuer: 'https://my-app.com', // optional iss check
audience: 'my-api', // optional aud check
clockTolerance: 5, // seconds
roleClaim: 'role', // default
mapClaims: c => ({ sub: c.sub as string, role: c.role as string })
}); +
+ +

Supported algorithms: HS256, HS384, HS512, RS256, RS384, RS512.

+ +
import { cookieScheme } from '@cleverbrush/auth';

const cookie = cookieScheme<{ userId: string; role: string }>({
cookieName: 'session',
validate: async (cookieValue) => {
// Look up session from DB, verify signature, etc.
const session = await sessionStore.get(cookieValue);
if (!session) return null;
return { userId: session.userId, role: session.role };
}
}); +
+ + + +
import { PolicyBuilder, requireRole } from '@cleverbrush/auth';

const adminPolicy = new PolicyBuilder()
.requireRole('admin')
.require(principal => principal.hasClaim('verified', 'true'))
.build('admin-only'); +
+ + +
import { AuthorizationService } from '@cleverbrush/auth';

const policies = new Map([['admin-only', adminPolicy]]);
const authz = new AuthorizationService(policies);

// Check by requirements array
const result = await authz.authorize(principal, [requireRole('admin')]);

// Check by named policy
const result2 = await authz.authorize(principal, 'admin-only');

if (!result.allowed) {
console.log(result.reason); // 'Not authenticated' | 'Forbidden'
} +
+ + +
import { parseCookies, serializeCookie } from '@cleverbrush/auth';

// Parse Cookie header
const cookies = parseCookies('session=abc123; theme=dark');
// { session: 'abc123', theme: 'dark' }

// Build Set-Cookie header value
const header = serializeCookie('session', 'abc123', {
httpOnly: true,
secure: true,
sameSite: 'Lax',
maxAge: 3600
}); +
+ + +
import { ServerBuilder } from '@cleverbrush/server';
import { jwtScheme } from '@cleverbrush/auth';

const server = new ServerBuilder();

server
.useAuthentication({
defaultScheme: 'jwt',
schemes: [jwtScheme({ secret: process.env.JWT_SECRET!, mapClaims: c => c })]
})
.useAuthorization();

await server.listen(3000); +
+ + +

BSD-3-Clause — see LICENSE.

+

Classes

AuthorizationService
PolicyBuilder
Principal

Interfaces

AuthenticationContext
AuthenticationScheme
AuthorizationCodeSchemeOptions
AuthorizationPolicy
ClientCredentialsSchemeOptions
CookieOptions
CookieSchemeOptions
JwtPayload
JwtSchemeOptions
OAuthFlow
OAuthFlows
OidcSchemeOptions

Type Aliases

AuthenticationResult
AuthorizationRequirement
AuthorizationResult

Functions

authorizationCodeScheme
clientCredentialsScheme
cookieScheme
defineRoles
jwtScheme
oidcScheme
parseCookies
requireRole
serializeCookie
signJwt
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client..html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client..html new file mode 100644 index 00000000..1d0e3169 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client..html @@ -0,0 +1,6 @@ + | Libraries

@cleverbrush/client — typed HTTP client for @cleverbrush/server API contracts.

+

For React + TanStack Query hooks, import from @cleverbrush/client/react.

+
import { createClient } from '@cleverbrush/client';
import { api } from 'todo-shared';

const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
});

const todos = await client.todos.list(); +
+ +

Classes

ApiError
NetworkError
OfflineError
TimeoutError
WebError

Interfaces

ClientHooks
ClientOptions
EndpointMeta
FilePart
PerCallOverrides
Subscription

Type Aliases

ApiContract
EndpointCall
EndpointCallArgs
EndpointResponse
FetchLike
Middleware
SubscriptionCall
SubscriptionCallArgs
SubscriptionIncoming
SubscriptionOutgoing
TypedClient

Variables

PER_CALL_OPTIONS

Functions

composeMiddleware
createClient
getPerCallOptions
isApiError
isNetworkError
isOfflineError
isTimeoutError
isWebError
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.batching.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.batching.html new file mode 100644 index 00000000..7f3ec275 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.batching.html @@ -0,0 +1 @@ +batching | Libraries

Interfaces

BatchingOptions

Functions

batching
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.cache.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.cache.html new file mode 100644 index 00000000..dea59abc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.cache.html @@ -0,0 +1 @@ +cache | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.dedupe.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.dedupe.html new file mode 100644 index 00000000..aaf96f2e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.dedupe.html @@ -0,0 +1 @@ +dedupe | Libraries

Interfaces

DedupeOptions

Functions

dedupe
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.html new file mode 100644 index 00000000..16505a02 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.html @@ -0,0 +1,692 @@ +@cleverbrush/client | Libraries

Module @cleverbrush/client

@cleverbrush/client

+

Typed HTTP client for @cleverbrush/server API contracts — zero codegen, full type safety. Optional React + TanStack Query integration via @cleverbrush/client/react.

+ +

@cleverbrush/client provides a Proxy-based HTTP client that infers all endpoint types (params, body, query, headers, responses) from an API contract defined with defineApi() from @cleverbrush/server/contract. No code generation or manual type annotations are needed.

+

The optional /react subpath adds TanStack Query hooks to the same client, so every endpoint is both a callable function and a hook provider.

+ + +
// packages/shared/src/contract.ts
import { defineApi, endpoint, route } from '@cleverbrush/server/contract';
import { array, number, object, string, boolean } from '@cleverbrush/schema';

const TodoSchema = object({ id: number(), title: string(), completed: boolean() });
const todosResource = endpoint.resource('/api/todos');
const ById = route({ id: number().coerce() })`/${t => t.id}`;

export const api = defineApi({
todos: {
list: todosResource.get()
.query(object({ page: number().optional(), limit: number().optional() }))
.responses({ 200: array(TodoSchema) }),
get: todosResource.get(ById)
.responses({ 200: TodoSchema }),
create: todosResource.post()
.body(object({ title: string() }))
.responses({ 201: TodoSchema }),
delete: todosResource.delete(ById)
.responses({ 204: null }),
},
auth: {
login: endpoint.post('/api/auth/login')
.body(object({ email: string(), password: string() }))
.responses({ 200: object({ token: string() }) }),
},
}); +
+ + +
// Framework-agnostic (works in any JS runtime)
import { createClient } from '@cleverbrush/client';
import { api } from 'shared/contract';

export const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
onUnauthorized: () => { window.location.href = '/login'; },
}); +
+ +

Or with React + TanStack Query hooks:

+
// React — adds useQuery, useMutation, etc. to every endpoint
import { createClient } from '@cleverbrush/client/react';
import { api } from 'shared/contract';

export const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
}); +
+ + +
// Direct fetch (both clients)
const todos = await client.todos.list({ query: { page: 1, limit: 10 } });
// ^? TodoResponse[]

const todo = await client.todos.get({ params: { id: 1 } });
// ^? TodoResponse

const created = await client.todos.create({ body: { title: 'Buy milk' } });
// ^? TodoResponse

await client.todos.delete({ params: { id: 1 } });
// ^? undefined (204 No Content) +
+ +
// React hooks (react client only)
function TodoList() {
const { data, isLoading } = client.todos.list.useQuery();

if (isLoading) return <p>Loading…</p>;
return <ul>{data?.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
} +
+ + + +

Creates a typed HTTP client from an API contract.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contractApiContractContract created with defineApi()
options.baseUrlstringBase URL prepended to every request (default: '')
options.getToken() => string | nullReturns auth token for Authorization: Bearer header
options.onUnauthorized() => voidCalled on 401 responses
options.fetchtypeof fetchCustom fetch implementation (default: globalThis.fetch)
options.headersRecord<string, string>Extra headers sent with every request
options.middlewaresMiddleware[]Middleware functions that wrap the fetch call
options.hooksClientHooksLifecycle hooks invoked at various stages of a request
+ +

Middlewares wrap the fetch call, allowing you to intercept, modify, or short-circuit requests and responses. They compose like an onion — the first middleware in the array is the outermost wrapper.

+
import { createClient } from '@cleverbrush/client';
import { retry } from '@cleverbrush/client/retry';
import { timeout } from '@cleverbrush/client/timeout';
import { dedupe } from '@cleverbrush/client/dedupe';
import { throttlingCache } from '@cleverbrush/client/cache';

const client = createClient(api, {
baseUrl: 'https://api.example.com',
middlewares: [
retry({ limit: 3 }),
timeout({ timeout: 10000 }),
dedupe(),
throttlingCache({ throttle: 2000 }),
],
}); +
+ + +
import type { Middleware } from '@cleverbrush/client';

const logger: Middleware = (next) => async (url, init) => {
console.log('→', init.method, url);
const res = await next(url, init);
console.log('←', res.status);
return res;
}; +
+ + +

Hooks are invoked at various stages of a request. All hook arrays execute serially in order.

+
const client = createClient(api, {
hooks: {
beforeRequest: [(req) => {
req.init.headers = {
...req.init.headers as Record<string, string>,
'X-Request-Id': crypto.randomUUID(),
};
}],
afterResponse: [(req, res) => {
console.log(`${req.init.method} ${req.url}${res.status}`);
}],
beforeError: [(error) => {
console.error('Request failed:', error.message);
return error;
}],
},
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HookSignatureDescription
beforeRequest(req: { url, init }) => voidModify request before sending
afterResponse(req, response) => void | ResponseInspect/replace response
beforeRetry(info: { url, init, error, retryCount }) => voidCalled between retry attempts
beforeError(error: WebError) => WebErrorTransform errors before throwing
+ + +
import { retry } from '@cleverbrush/client/retry';

retry({
limit: 2, // max retries (default: 2)
methods: ['GET'], // retryable methods (default: GET, PUT, HEAD, DELETE, OPTIONS)
statusCodes: [500], // retryable status codes (default: 408, 429, 500, 502, 503, 504)
backoffLimit: 5000, // max delay in ms (default: Infinity)
delay: (n) => n * 1000, // custom delay function
jitter: true, // add randomization to delays
retryOnTimeout: false, // retry on TimeoutError (default: false)
shouldRetry: (err, count) => count < 3, // custom predicate
}); +
+ +

Respects Retry-After headers (seconds and HTTP-date formats) on 429/503 responses.

+ +
import { timeout } from '@cleverbrush/client/timeout';

timeout({ timeout: 10000 }); // 10 second timeout (default) +
+ +

Aborts requests that exceed the configured duration, throwing a TimeoutError.

+ +
import { dedupe } from '@cleverbrush/client/dedupe';

dedupe({
skip: (url, init) => init.method !== 'GET', // skip non-GET (default)
key: (url, init) => `${init.method}@${url}`, // dedup key (default)
}); +
+ +

Prevents duplicate in-flight requests. Concurrent calls with the same key share a single fetch; each caller receives a cloned response.

+ +
import { throttlingCache } from '@cleverbrush/client/cache';

throttlingCache({
throttle: 1000, // TTL in ms (default: 1000)
skip: (url, init) => init.method !== 'GET', // skip non-GET (default)
condition: (res) => res.ok, // only cache successful responses (default)
invalidate: (url, init) => {
if (init.method !== 'GET') return `GET@${url}`;
return null;
},
}); +
+ +

Caches successful GET responses for a configurable TTL. Subsequent requests within the TTL receive a cloned cached response without hitting the network.

+ +

Tag-based HTTP caching with automatic invalidation driven by server-side endpoint +annotations (.cacheTag() / .clearsCacheTag()). Replaces manual invalidation callbacks — mutations +automatically clear cache entries matching the endpoint's declared tag names.

+
import { cacheTags } from '@cleverbrush/client/cache';

const client = createClient(api, {
middlewares: [cacheTags({ defaultTtl: 5000 })],
});

// Populates cache entries for 'todo-list' and 'todo:id=1' tags.
await client.todos.list({ query: { page: 1 } });
await client.todos.get({ params: { id: 1 } });

// Mutation — automatically invalidates both tags.
await client.todos.update({ params: { id: 1 }, body: { title: 'Updated' } });

// Triggers network fetch — cache was cleared.
await client.todos.list({ query: { page: 1 } }); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
defaultTtlnumber0TTL in ms for tags without explicit TTL. 0 = invalidation-only.
ttlByTagRecord<string, number>{}Per-tag TTL overrides.
condition(Response) => booleanresponse.okPredicate controlling which responses are cached.
+

When used with @cleverbrush/client/react, TanStack Query's useMutation hooks +automatically invalidate the query cache for the affected group — no manual +queryClient.invalidateQueries() needed.

+

See the server-side cache tags section for how to declare +tags on your endpoints.

+ +

Override middleware options for individual calls:

+
// Override timeout for a slow endpoint
const report = await client.reports.generate({
body: { type: 'annual' },
timeout: 60000,
});

// Override retry limit
const data = await client.data.fetch({
query: { id: 1 },
retry: { limit: 5 },
}); +
+ + +

All errors extend a common WebError base class.

+
import {
ApiError, TimeoutError, NetworkError,
isApiError, isTimeoutError, isNetworkError, isWebError
} from '@cleverbrush/client'; +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ErrorDescriptionProperties
WebErrorBase class for all web client errorsmessage
ApiErrorNon-2xx HTTP responsestatus, message, body
TimeoutErrorRequest exceeded timeouttimeout (ms)
NetworkErrorNetwork-level failurecause
+ +
try {
await client.todos.get({ params: { id: 999 } });
} catch (err) {
if (isApiError(err)) {
console.log(err.status, err.body);
} else if (isTimeoutError(err)) {
console.log('Timed out after', err.timeout, 'ms');
} else if (isNetworkError(err)) {
console.log('Network failure:', err.cause);
}
} +
+ + +
import { batching } from '@cleverbrush/client/batching';
+
+ +

Reduces HTTP round-trips by coalescing concurrent requests into a single POST /__batch. Individual call sites are completely unaware of batching — they still receive their own typed responses.

+
+

Prerequisite: the server must have batching enabled via ServerBuilder.useBatching().

+
+ +
import { batching } from '@cleverbrush/client/batching';

const client = createClient(api, {
baseUrl: 'https://api.example.com',
middlewares: [
retry(),
timeout(),
batching({ maxSize: 10, windowMs: 10 }), // innermost — closest to fetch
],
});

// These three concurrent calls are coalesced into ONE HTTP request.
const [todos, user, stats] = await Promise.all([
client.todos.list(),
client.users.me(),
client.stats.summary(),
]); +
+ + +
    +
  1. The first queued request starts a windowMs timer.
  2. +
  3. Additional requests arriving before the timer fires join the same batch.
  4. +
  5. When the timer fires (or maxSize is reached), all queued requests are sent as a single POST /__batch.
  6. +
  7. The server processes each sub-request through its full pipeline and returns an array of sub-responses.
  8. +
  9. Each caller receives its own reconstructed Response.
  10. +
+

If only one request is queued at flush time it is sent directly — no batch overhead.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
maxSizenumber10Maximum requests per batch; flush immediately on reaching this limit
windowMsnumber10Collection window in milliseconds
batchPathstring'/__batch'Batch endpoint path (must match server config)
skip(url, init) => booleanReturn true to bypass batching for a specific request
+ +
batching({
skip: (_url, init) => {
// Never batch file uploads
return init.body instanceof FormData;
},
}) +
+ + +

Place batching() last in the middleware array so that retry() and timeout() operate on each logical call promise independently, not on the single batch fetch:

+
middlewares: [retry(), timeout(), batching()], // ✅ correct
middlewares: [batching(), retry(), timeout()], // ⚠️ retry wraps the whole batch +
+ + +

Subscription endpoints defined with endpoint.subscription() in the server contract are automatically detected by the client. Instead of returning a Promise, they return a live Subscription handle backed by the browser WebSocket API.

+ +
// The subscribe function returns a Subscription handle, not a Promise
const sub = client.live.todoUpdates();

// Consume events via async iteration
for await (const event of sub) {
console.log(event.action, event.todoId);
} +
+ + +
const chat = client.live.chat();

// Send messages to the server
chat.send({ text: 'Hello!' });

// Receive messages
for await (const msg of chat) {
console.log(`${msg.user}: ${msg.text}`);
} +
+ + +
const sub = client.live.events();

sub.state; // 'connecting' | 'connected' | 'reconnecting' | 'closed' +
+ + +
sub.close();
+
+ + +
const ac = new AbortController();
const sub = client.live.events({ signal: ac.signal });

// Abort closes the WebSocket
ac.abort(); +
+ + +

Auth tokens are sent as a ?token= query parameter (the browser WebSocket API does not support custom headers):

+
const client = createClient(api, {
baseUrl: 'https://api.example.com',
getToken: () => localStorage.getItem('token'),
});

// Token is automatically appended:
// wss://api.example.com/ws/events?token=<token>
const sub = client.live.events(); +
+ + +

Enable automatic reconnection with exponential backoff for WebSocket subscriptions. Reconnection is not triggered by manual .close() calls or AbortSignal aborts — only by unexpected connection drops.

+ +
const client = createClient(api, {
baseUrl: 'https://api.example.com',
subscriptionReconnect: {
maxRetries: 10, // default: Infinity
backoffLimit: 30_000, // max delay ms (default: 30 000)
jitter: true, // ±25% random jitter (default: true)
},
}); +
+ + +
// Override the global default for this subscription:
const sub = client.live.events({
reconnect: { maxRetries: 3, jitter: false },
});

// Disable reconnection for this subscription even when a global default is set:
const sub = client.live.events({ reconnect: false });

// Use global defaults explicitly:
const sub = client.live.events({ reconnect: true }); +
+ + +
const sub = client.live.events({
reconnect: {
delay: (attempt) => Math.min(500 * 2 ** (attempt - 1), 60_000),
jitter: false,
},
}); +
+ +

The default delay formula is 300 × 2^(attempt − 1) ms (same as the HTTP retry middleware), capped by backoffLimit.

+ +
const sub = client.live.events({
reconnect: {
shouldReconnect: ({ code, reason }) => code !== 4003,
},
}); +
+ +

When shouldReconnect returns false the subscription transitions directly to 'closed' without further attempts.

+ +
const { state } = useSubscription(() => client.live.events({
reconnect: { maxRetries: 5 },
}));

// state can be: 'connecting' | 'connected' | 'reconnecting' | 'closed'
if (state === 'reconnecting') {
return <Badge>Reconnecting…</Badge>;
} +
+ + +

Import from @cleverbrush/client/react:

+
import { useSubscription } from '@cleverbrush/client/react';

function LiveFeed() {
const { events, state, send, close, error } = useSubscription(
() => client.live.events(),
{ maxEvents: 100, enabled: true }
);

return (
<div>
<p>Status: {state}</p>
{events.map((e, i) => <div key={i}>{JSON.stringify(e)}</div>)}
</div>
);
} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Return valueTypeDescription
lastEventT | undefinedMost recently received event
eventsT[]Accumulated events (newest last)
statestringConnection state: connecting, connected, reconnecting, closed
send(msg) => voidSend a message (bidirectional subscriptions)
close() => voidClose the subscription
errorError | undefinedLast error, if any
+ + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
enabledbooleantrueToggle the subscription on/off
maxEventsnumberunlimitedMaximum events to keep in the events array
+ +

The /react subpath provides a createClient() that wraps the core client with TanStack Query hooks. Every endpoint becomes callable and provides hooks.

+

Peer dependencies: react >=18, @tanstack/react-query ^5

+ +
import { createClient } from '@cleverbrush/client/react';

const client = createClient(api, { baseUrl: '/api' });

// Each endpoint provides:
client.todos.list(args?) // Direct fetch → Promise<T>
client.todos.list.stream(args?) // NDJSON streaming → AsyncIterable<string>
client.todos.list.useQuery(args?, options?) // TanStack useQuery
client.todos.list.useSuspenseQuery(args?, options?) // TanStack useSuspenseQuery
client.todos.list.useInfiniteQuery(argsFn, options) // TanStack useInfiniteQuery
client.todos.list.useMutation(options?) // TanStack useMutation
client.todos.list.queryKey(args?) // Query key array
client.todos.list.prefetch(qc, args?) // Prefetch into cache

// Group-level query key for bulk invalidation:
client.todos.queryKey() // → ['@cleverbrush', 'todos'] +
+ + +

Keys follow a hierarchical structure for predictable invalidation:

+
client.todos.queryKey()
// → ['@cleverbrush', 'todos']

client.todos.list.queryKey()
// → ['@cleverbrush', 'todos', 'list']

client.todos.get.queryKey({ params: { id: 42 } })
// → ['@cleverbrush', 'todos', 'get', { params: { id: 42 } }] +
+ + +

For manual key construction outside of the proxy:

+
import { buildQueryKey, buildGroupQueryKey, QUERY_KEY_PREFIX } from '@cleverbrush/client/react';

buildGroupQueryKey('todos'); // ['@cleverbrush', 'todos']
buildQueryKey('todos', 'list'); // ['@cleverbrush', 'todos', 'list']
buildQueryKey('todos', 'get', args); // ['@cleverbrush', 'todos', 'get', args] +
+ + +
function TodoDetail({ id }: { id: number }) {
const { data } = client.todos.get.useQuery({ params: { id } });
return <h2>{data?.title}</h2>;
} +
+ + +
import { useQueryClient } from '@tanstack/react-query';

function CreateTodo() {
const queryClient = useQueryClient();
const mutation = client.todos.create.useMutation({
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: client.todos.queryKey() });
},
});

return (
<button onClick={() => mutation.mutate({ body: { title: 'New todo' } })}>
Add Todo
</button>
);
} +
+ + +
import { Suspense } from 'react';

function TodoListSuspense() {
const { data } = client.todos.list.useSuspenseQuery();
return <ul>{data.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
}

function App() {
return (
<Suspense fallback={<p>Loading…</p>}>
<TodoListSuspense />
</Suspense>
);
} +
+ + +
const queryClient = useQueryClient();

<button
onMouseEnter={() => client.todos.get.prefetch(queryClient, { params: { id: 1 } })}
>
View Todo
</button> +
+ + +
function UserTodos({ userId }: { userId: number | null }) {
const { data } = client.todos.list.useQuery({
query: { userId: userId! },
enabled: userId !== null,
});
// ...
} +
+ + +
function InfiniteTodos() {
const { data, fetchNextPage, hasNextPage } = client.todos.list.useInfiniteQuery(
(pageParam) => ({ query: { page: pageParam, limit: 10 } }),
{
initialPageParam: 1,
getNextPageParam: (lastPage, allPages) => allPages.length + 1,
}
);
// ...
} +
+ + +

The useOptimisticMutation hook wraps TanStack Query's useMutation with automatic cache snapshot, optimistic update, and rollback on error. This replaces the manual onMutate/onError/onSettled pattern.

+
import { useOptimisticMutation } from '@cleverbrush/client/react';

function TodoItem({ todo }: { todo: Todo }) {
const toggleMutation = useOptimisticMutation(client.todos.update, {
queryKey: client.todos.list.queryKey(),
optimisticUpdate: (oldTodos, variables) =>
(oldTodos ?? []).map(t =>
t.id === variables.params.id
? { ...t, completed: variables.body.completed }
: t
),
onSettled: () => {
queryClient.invalidateQueries({
queryKey: client.todos.queryKey()
});
}
});

return (
<button onClick={() => toggleMutation.mutate({
params: { id: todo.id },
body: { completed: !todo.completed }
})}>
{todo.completed ? '✓' : '○'}
</button>
);
} +
+ +

The hook handles:

+
    +
  1. Cancel — cancels in-flight queries for the given queryKey
  2. +
  3. Snapshot — captures the current cache state
  4. +
  5. Optimistic update — applies your optimisticUpdate function
  6. +
  7. Rollback — restores the snapshot if the mutation fails
  8. +
  9. Invalidate — invalidates the cache when the mutation settles
  10. +
+ +
import { isApiError, isTimeoutError } from '@cleverbrush/client';

const { error } = client.todos.list.useQuery();

if (isApiError(error)) {
console.log(error.status, error.body);
} else if (isTimeoutError(error)) {
console.log('Timed out after', err.timeout, 'ms');
} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
EndpointCallCallable endpoint function type
EndpointCallArgs<E>Request argument shape for an endpoint
EndpointResponse<E>Success response type for an endpoint
TypedClient<T>Full client type mirroring the contract
ClientOptionsConfiguration for createClient()
MiddlewareMiddleware function type
PerCallOverridesPer-call override options (retry, timeout, etc.)
UnifiedClient<T>React client type with hooks on every endpoint
+ +
    +
  1. +

    Compile time: TypeScript infers the full type of each endpoint from the defineApi() contract. TypedClient<T> maps each group/endpoint to a typed async function.

    +
  2. +
  3. +

    Runtime: createClient() returns a two-level Proxy. When you call client.todos.list(args), the proxy:

    +
      +
    • Calls .introspect() on the endpoint builder to get HTTP method, base path, and path template
    • +
    • Serializes path parameters via ParseStringSchemaBuilder.serialize()
    • +
    • Serializes query parameters to a URL query string
    • +
    • JSON-encodes the body for POST/PUT/PATCH requests
    • +
    • Sends the request via fetch with auth headers
    • +
    +
  4. +
  5. +

    React layer (optional): The /react createClient() wraps the core client in an additional proxy layer that attaches TanStack Query hook factories to each endpoint function.

    +
  6. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImportDescription
@cleverbrush/clientCore client, errors, middleware utilities, types
@cleverbrush/client/retryRetry middleware with exponential backoff
@cleverbrush/client/timeoutAbortController-based timeout middleware
@cleverbrush/client/dedupeRequest deduplication middleware
@cleverbrush/client/idempotencyIdempotency key middleware (deduplicates mutations)
@cleverbrush/client/cacheThrottling cache + tag-based cache invalidation middleware
@cleverbrush/client/batchingRequest batching middleware
@cleverbrush/client/optimistic-updateOptimistic update middleware (mutation tracking)
@cleverbrush/client/offline-queueOffline queue middleware (queue + replay)
@cleverbrush/client/reactTanStack Query hooks + unified client
+ +
import { optimisticUpdate } from '@cleverbrush/client/optimistic-update';
+
+ +

Tags mutation requests (POST/PUT/PATCH/DELETE) with a unique ID and tracks network failures in an inspectable store. Designed to work with the useOptimisticMutation React hook.

+ +
import { createClient } from '@cleverbrush/client';
import { optimisticUpdate } from '@cleverbrush/client/optimistic-update';

const client = createClient(api, {
middlewares: [optimisticUpdate()]
}); +
+ + +

Pass a shared store to inspect failed mutations:

+
import { optimisticUpdate, type OptimisticUpdateStore } from '@cleverbrush/client/optimistic-update';

const store: OptimisticUpdateStore = { failures: [] };

const client = createClient(api, {
middlewares: [optimisticUpdate({ store })]
});

// After a network error:
console.log(store.failures);
// → [{ id, url, init, error, timestamp }] +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
storeOptimisticUpdateStore{ failures: [] }Shared mutable store
skip(url, init) => booleanSkip tagging for specific requests
+ +
await client.todos.create({
body: { title: 'test' },
optimisticUpdate: { skip: true } // skip tagging for this call
}); +
+ + +
import { offlineQueue } from '@cleverbrush/client/offline-queue';
+
+ +

Queues mutation requests (POST/PUT/PATCH/DELETE) when the browser reports offline (navigator.onLine). Automatically replays queued mutations when connectivity is restored.

+ +

offlineQueue() must be the outermost middleware (first in the array) so that retry/timeout/etc. middlewares re-apply when queued mutations are replayed:

+
middlewares: [
offlineQueue(), // outermost
retry({ limit: 3 }), // re-applies on replay
timeout({ timeout: 10000 }),
batching(),
] +
+ + +
import { createClient } from '@cleverbrush/client';
import { offlineQueue } from '@cleverbrush/client/offline-queue';

const client = createClient(api, {
middlewares: [offlineQueue()]
}); +
+ + +

Pass a shared store to observe queue state:

+
import { offlineQueue, type OfflineQueueStore } from '@cleverbrush/client/offline-queue';

const store: OfflineQueueStore = { queue: [], isOnline: true, isReplaying: false };

const client = createClient(api, {
middlewares: [offlineQueue({ store })]
});

// Check queue status:
console.log(store.isOnline); // boolean
console.log(store.queue.length); // queued mutations
console.log(store.isReplaying); // currently replaying +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
storeOfflineQueueStore{ queue: [], isOnline: true, isReplaying: false }Shared mutable store
skip(url, init) => booleanSkip queue for specific requests
maxRetriesnumber3Max flush retries per queued item
+ +
await client.todos.create({
body: { title: 'test' },
offlineQueue: { skip: true } // bypass queue for this call
}); +
+ + +

BSD 3-Clause

+

Modules

batching
cache
dedupe
idempotency
offline-queue
optimistic-update
react
retry
timeout
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.idempotency.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.idempotency.html new file mode 100644 index 00000000..ce98806d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.idempotency.html @@ -0,0 +1 @@ +idempotency | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.offline-queue.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.offline-queue.html new file mode 100644 index 00000000..de8a18b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.offline-queue.html @@ -0,0 +1 @@ +offline-queue | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.optimistic-update.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.optimistic-update.html new file mode 100644 index 00000000..e094c97d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.optimistic-update.html @@ -0,0 +1 @@ +optimistic-update | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.react.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.react.html new file mode 100644 index 00000000..49ef065a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.react.html @@ -0,0 +1,2 @@ +react | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.retry.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.retry.html new file mode 100644 index 00000000..d025c329 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.retry.html @@ -0,0 +1 @@ +retry | Libraries

Interfaces

RetryOptions

Functions

retry
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.timeout.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.timeout.html new file mode 100644 index 00000000..3f924538 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_client.timeout.html @@ -0,0 +1 @@ +timeout | Libraries

Interfaces

TimeoutOptions

Functions

timeout
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_deep.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_deep.html new file mode 100644 index 00000000..e84f1695 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_deep.html @@ -0,0 +1,127 @@ +@cleverbrush/deep | Libraries

Module @cleverbrush/deep

@cleverbrush/deep

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A library for deep operations on JavaScript objects — deep equality, deep merge, and flattening.

+ +
npm install @cleverbrush/deep
+
+ + +
import { deepEqual, deepExtend, deepFlatten } from '@cleverbrush/deep';
+
+ + + +

Recursively compares two values and returns true if they are deeply equal. Supports nested objects, arrays, Date instances, and handles circular references.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
aanyFirst value
banySecond value
options.disregardArrayOrderbooleanfalseWhen true, arrays are treated as equal regardless of element order
+
import { deepEqual } from '@cleverbrush/deep';

deepEqual({ a: { b: 1 } }, { a: { b: 1 } });
// => true

deepEqual({ a: { b: 1 } }, { a: { b: 20 } });
// => false

deepEqual({ a: { b: 1, c: 2 } }, { a: { b: 1 } });
// => false

// Array order can be ignored
deepEqual([1, 2, 3], [3, 1, 2], { disregardArrayOrder: true });
// => true +
+ + +

Deeply merges multiple objects. Works like Object.assign, but recursively merges nested objects instead of overwriting them. All arguments must be non-null objects.

+

Returns a new object that is the deep merge of all provided objects.

+
import { deepExtend } from '@cleverbrush/deep';

const result = deepExtend(
{},
{
a: 'something',
name: {
first: 'Ivan'
}
},
{
name: {
last: 'Ivanov'
}
}
);

// result:
// {
// a: 'something',
// name: {
// first: 'Ivan',
// last: 'Ivanov'
// }
// } +
+ +

The result type is inferred from the input types using the Merge<T> utility type, which is also exported from the library.

+ +

Flattens a nested object to a single level, concatenating keys with the specified delimiter.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
objRecord<string, any>Object to flatten
delimiterstring'.'Separator used to join nested keys
+

Throws an error if the object contains circular references.

+
import { deepFlatten } from '@cleverbrush/deep';

deepFlatten({
a: {
b: 1,
c: 2
},
d: 3
});
// => { 'a.b': 1, 'a.c': 2, d: 3 }

deepFlatten(
{
a: {
b: 1,
c: 2
},
d: {
e: {
f: 3
}
}
},
'-'
);
// => { 'a-b': 1, 'a-c': 2, 'd-e-f': 3 } +
+ + +

Generates a hash representation for an object. Useful for comparing objects by value.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
objanyThe value to hash
excludeany[]Optional list of values to exclude from hashing
+
import { HashObject } from '@cleverbrush/deep';

const hash = HashObject({ name: 'John', age: 30 }); +
+ + +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode
  • +
  • Unit tests: Vitest — covering deep equality edge cases (circular references, Date instances, array order), deep merge, flattening, and hashing
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Type Aliases

Merge
MergeTwo

Variables

deepExtend

Functions

deepEqual
deepFlatten
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_di.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_di.html new file mode 100644 index 00000000..d573406c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_di.html @@ -0,0 +1,209 @@ +@cleverbrush/di | Libraries

Module @cleverbrush/di

@cleverbrush/di — .NET-style dependency injection for TypeScript.

+

Uses @cleverbrush/schema instances as service keys for type-safe +registration and resolution. Supports singleton, scoped, and transient +lifetimes, function injection via FunctionSchemaBuilder, and +automatic disposal of scoped services.

+
import { ServiceCollection } from '@cleverbrush/di';
import { object, string, number, func } from '@cleverbrush/schema';

// Define service contracts as schemas
const IConfig = object({ port: number(), host: string() });
const ILogger = object({ info: func().addParameter(string()) });

// Register services
const services = new ServiceCollection();
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addSingleton(ILogger, () => ({ info: console.log }));

// Build the provider
const provider = services.buildServiceProvider();

// Resolve — fully typed, no generics needed
const config = provider.get(IConfig);
config.port; // number +
+ +

@cleverbrush/di

+

CI +License: BSD-3-Clause

+

A .NET-style dependency injection container for TypeScript. Uses @cleverbrush/schema instances as service keys for fully-typed, zero-generic registration and resolution. Supports three service lifetimes, schema-driven function injection, and automatic disposal of scoped services.

+ +
    +
  • Schema-as-key — schema instances (from @cleverbrush/schema) serve as service identifiers via reference equality. No string tokens, no Symbol, no decorators.
  • +
  • Three lifetimesSingleton, Scoped, and Transient, matching .NET semantics.
  • +
  • Function injection — resolve dependencies automatically via FunctionSchemaBuilder parameter lists with invoke() / addSingletonFromSchema().
  • +
  • Scope validation — resolving a scoped service from the root provider throws by default, catching common lifecycle bugs early.
  • +
  • Automatic disposalServiceScope disposes scoped services in reverse creation order (LIFO) on scope exit, supporting both Symbol.dispose and Symbol.asyncDispose.
  • +
  • using keyword supportServiceScope implements Disposable and AsyncDisposable.
  • +
  • No decorators, no reflect-metadata — works in any TypeScript project without experimentalDecorators.
  • +
  • Zero runtime dependencies (other than @cleverbrush/schema).
  • +
+ +
npm install @cleverbrush/di @cleverbrush/schema
+
+ + +
import { ServiceCollection } from '@cleverbrush/di';
import { object, string, number, func } from '@cleverbrush/schema';

// 1. Define service contracts as schemas (used as keys)
const IConfig = object({ port: number(), host: string() });
const ILogger = object({ info: func().addParameter(string()) });

// 2. Register services
const services = new ServiceCollection();
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addSingleton(ILogger, () => ({ info: (msg) => console.log(msg) }));

// 3. Build the provider
const provider = services.buildServiceProvider();

// 4. Resolve — fully typed, no explicit generics needed
const config = provider.get(IConfig);
config.port; // number +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
LifetimeCreatedUse for
SingletonOnce per ServiceProviderLoggers, configuration, connection pools
ScopedOnce per ServiceScopeDatabase contexts, HTTP request state
TransientOn every get() callLightweight, stateless services
+
const IDbContext = object({ query: func() });
const IRequestId = object({ id: string() });

services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
services.addScoped(IDbContext, (provider) => {
const config = provider.get(IConfig);
return new DbContext(config.host);
});
services.addTransient(IRequestId, () => ({ id: crypto.randomUUID() })); +
+ + + +
services.addSingleton(IConfig, { port: 3000, host: 'localhost' });
+
+ + +

The factory receives the ServiceProvider so it can resolve other services:

+
services.addSingleton(ILogger, (provider) => {
const config = provider.get(IConfig);
return new ConsoleLogger(config.logLevel);
}); +
+ + +

Use when the service is a function type — addSingleton would invoke a function value as a factory, but addSingletonInstance always treats its argument as the value:

+
const IHandler = func();
const myHandler = (req: Request) => new Response('ok');

services.addSingletonInstance(IHandler, myHandler); +
+ + +

Declare dependencies via a FunctionSchemaBuilder and let the container resolve them automatically:

+
const IGreeter = object({ greet: func() });

const greeterDeps = func()
.addParameter(IConfig)
.addParameter(ILogger);

services.addSingletonFromSchema(
IGreeter,
greeterDeps,
(config, logger) => ({
greet() { logger.info(`Hello from ${config.host}`); }
})
);
// Also available: addScopedFromSchema, addTransientFromSchema +
+ + +

Pass { validate: true } to any registration method to validate the resolved value against its schema at resolution time. Useful in development and testing:

+
services.addSingleton(IConfig, loadConfig(), { validate: true });
+
+ + +
const provider = services.buildServiceProvider();

// Throws if not registered
const config = provider.get(IConfig);

// Returns undefined if not registered (no throw)
const mailer = provider.getOptional(IMailer); +
+ + +

Create a scope for work that has a bounded lifetime (e.g. an HTTP request). Scoped services are cached within the scope and disposed when the scope exits.

+
// Automatic disposal with `using`
using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db is disposed when the block exits

// Async disposal
await using scope = provider.createScope();
const db = scope.serviceProvider.get(IDbContext);
// db.[Symbol.asyncDispose]() is called when the block exits

// Manual disposal
const scope = provider.createScope();
try {
const db = scope.serviceProvider.get(IDbContext);
// use db...
} finally {
await scope.asyncDispose();
} +
+ +

Services registered with a class that implements Symbol.dispose or Symbol.asyncDispose are tracked and disposed automatically when the scope ends.

+ +

Resolve dependencies described by a FunctionSchemaBuilder and call a function with them directly, without registering anything:

+
const handlerDeps = func()
.addParameter(ILogger)
.addParameter(IDbContext);

const result = scope.serviceProvider.invoke(handlerDeps, (logger, db) => {
logger.info('Handling request');
return db.query('SELECT 1');
}); +
+ + +

By default, resolving a Scoped service from the root provider throws an error, preventing accidental singleton captures:

+
// Throws: "Cannot resolve scoped service from the root provider."
provider.get(IDbContext);

// Disable if intentional (not recommended for production)
const provider = services.buildServiceProvider({ validateScopes: false }); +
+ + +

The container detects circular dependencies at resolution time and throws a descriptive error showing the dependency chain.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
addSingleton(schema, factoryOrValue, options?)Register a singleton service
addScoped(schema, factory, options?)Register a scoped service
addTransient(schema, factory, options?)Register a transient service
addSingletonInstance(schema, instance, options?)Register a pre-created singleton (safe for function values)
addSingletonFromSchema(target, funcSchema, impl, options?)Register a singleton with schema-driven dependencies
addScopedFromSchema(target, funcSchema, impl, options?)Register a scoped service with schema-driven dependencies
addTransientFromSchema(target, funcSchema, impl, options?)Register a transient service with schema-driven dependencies
buildServiceProvider(options?)Build the immutable ServiceProvider
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
get(schema)Resolve a service; throws if not registered
getOptional(schema)Resolve a service; returns undefined if not registered
createScope()Create a new ServiceScope
invoke(funcSchema, implementation)Call a function with its dependencies resolved automatically
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberDescription
serviceProviderThe scoped IServiceProvider for this scope
[Symbol.dispose]()Synchronously dispose scoped services (LIFO)
[Symbol.asyncDispose]()Asynchronously dispose scoped services (LIFO)
asyncDispose()Explicit async dispose (same as Symbol.asyncDispose)
+ +

BSD 3-Clause

+

Enumerations

ServiceLifetime

Classes

ScopedServiceProvider
ServiceCollection
ServiceProvider
ServiceScope

Interfaces

IServiceProvider
ServiceDescriptor
ServiceProviderOptions
ServiceRegistrationOptions

Type Aliases

ServiceFactory

Functions

isAsyncDisposable
isDisposable
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_env.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_env.html new file mode 100644 index 00000000..6a50a7c3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_env.html @@ -0,0 +1,182 @@ +@cleverbrush/env | Libraries

Module @cleverbrush/env

@cleverbrush/env

+

CI +License: BSD-3-Clause

+

Type-safe environment variable parsing with @cleverbrush/schema — validated, coerced, structured configs from process.env.

+ +

The problem: Environment variables are untyped strings. Most apps access them via process.env.SOME_VAR! — no validation, no coercion, no structure. Missing variables surface as runtime crashes. Secrets accidentally leak into frontend bundles. Config objects are ad-hoc and fragile.

+

The solution: @cleverbrush/env uses @cleverbrush/schema builders for validation and coercion, and a branded env() wrapper for type-safe variable binding. TypeScript enforces at compile time that every config leaf is bound to an environment variable. At runtime, all variables are validated at once and coerced to the correct types — with clear error messages for CI and startup logs.

+

What makes it different:

+
    +
  • Compile-time enforcement — forgetting env() on a config leaf is a TypeScript error, not a runtime surprise
  • +
  • Structured configs — nest objects arbitrarily deep; env vars map to leaf fields
  • +
  • Validation & coercion — full @cleverbrush/schema power: .minLength(), .coerce(), .default(), custom validators
  • +
  • Array supportsplitBy(',') preprocessor for comma-separated values
  • +
  • Clear error reporting — lists all missing and invalid vars at once with paths and types
  • +
  • Computed values — derive values from resolved config via a type-safe callback
  • +
  • Flat modeparseEnvFlat() for simple apps where keys = env var names
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/envt3-envenvalid
Compile-time leaf enforcement
Nested config structures
Schema-based validation~
Type coercion (number, boolean, date)Manual
Array support
Computed / derived values
All-at-once error reporting
No Zod dependency
+ +
npm install @cleverbrush/env @cleverbrush/schema
+
+ +

Peer dependency: @cleverbrush/schema must be installed separately.

+ + +
import { env, parseEnv, splitBy } from '@cleverbrush/env';
import { string, number, boolean, array } from '@cleverbrush/schema';

const config = parseEnv({
db: {
host: env('DB_HOST', string().default('localhost')),
port: env('DB_PORT', number().coerce().default(5432)),
name: env('DB_NAME', string()),
},
jwt: {
secret: env('JWT_SECRET', string().minLength(32)),
},
debug: env('DEBUG', boolean().coerce().default(false)),
allowedOrigins: env(
'ALLOWED_ORIGINS',
array(string()).addPreprocessor(splitBy(','), { mutates: false })
),
});

// Type is fully inferred:
// {
// db: { host: string, port: number, name: string },
// jwt: { secret: string },
// debug: boolean,
// allowedOrigins: string[]
// } +
+ + +

For simple apps where each key is both the property name and the env var name:

+
import { parseEnvFlat } from '@cleverbrush/env';
import { string, number } from '@cleverbrush/schema';

const config = parseEnvFlat({
DB_HOST: string().default('localhost'),
DB_PORT: number().coerce().default(5432),
JWT_SECRET: string().minLength(32),
});
// Type: { DB_HOST: string, DB_PORT: number, JWT_SECRET: string } +
+ + +

Forgetting env() is a compile-time error:

+
parseEnv({
db: {
host: string(), // ← TypeScript ERROR: not assignable to EnvConfigNode
},
}); +
+ + +

Use the splitBy() preprocessor helper:

+
// Comma-separated strings
env('ALLOWED_ORIGINS', array(string()).addPreprocessor(splitBy(','), { mutates: false }))
// "a, b, c" → ['a', 'b', 'c']

// Comma-separated numbers
env('PORTS', array(number().coerce()).addPreprocessor(splitBy(','), { mutates: false }))
// "3000, 4000" → [3000, 4000] +
+ + +

When variables are missing or invalid, EnvValidationError is thrown with a formatted message:

+
Missing environment variables:
- DB_NAME (required by db.name) [string]
- JWT_SECRET (required by jwt.secret) [string]
Invalid environment variables:
- DB_PORT: "abc" (required by db.port) — number expected +
+ +

The error also exposes structured .missing and .invalid properties for programmatic access.

+ +

By default, parseEnv() reads from process.env. Pass a custom source for testing or alternative runtimes:

+
const config = parseEnv(schema, {
DB_HOST: 'test-host',
DB_PORT: '9999',
}); +
+ + +

Derive values from the resolved config by passing a compute callback as the second argument. The callback receives the fully typed base config and returns an object that is deep-merged into the result:

+
import { env, parseEnv } from '@cleverbrush/env';
import { string, number } from '@cleverbrush/schema';

const config = parseEnv(
{
db: {
host: env('DB_HOST', string().default('localhost')),
port: env('DB_PORT', number().coerce().default(5432)),
name: env('DB_NAME', string()),
},
},
(base) => ({
db: {
connectionString: `postgres://${base.db.host}:${base.db.port}/${base.db.name}`,
},
})
);

// base is fully typed: { db: { host: string, port: number, name: string } }
// Result type is deep-merged:
// { db: { host: string, port: number, name: string, connectionString: string } }

config.db.connectionString // "postgres://localhost:5432/mydb" +
+ +

When using a compute callback, the optional source is passed as the third argument:

+
const config = parseEnv(
{ host: env('HOST', string()) },
(base) => ({ url: `http://${base.host}` }),
{ HOST: 'example.com' } // custom source
); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExportTypeDescription
env(varName, schema)FunctionBinds a schema to an env var name. Required for every leaf in parseEnv().
parseEnv(config, source?)FunctionParses env vars into a validated, typed nested config object.
parseEnv(config, compute, source?)FunctionParses env vars, then deep-merges computed values from the callback.
parseEnvFlat(schemas, source?)FunctionFlat convenience — keys are env var names, no env() needed.
splitBy(separator)FunctionPreprocessor that splits a string into an array.
EnvValidationErrorClassThrown when env vars are missing or invalid. Has .missing and .invalid.
EnvField<T>TypeBranded wrapper type created by env().
EnvConfigTypeConfig descriptor tree type (input to parseEnv).
InferEnvConfig<T>TypeInfers the runtime type from a config descriptor.
+ +

BSD-3-Clause

+

Classes

EnvValidationError

Interfaces

InvalidEnvVar
MissingEnvVar

Type Aliases

EnvConfig
EnvConfigNode
EnvField
InferEnvConfig

Functions

env
parseEnv
parseEnvFlat
splitBy
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-clickhouse.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-clickhouse.html new file mode 100644 index 00000000..801d4072 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-clickhouse.html @@ -0,0 +1,94 @@ +@cleverbrush/knex-clickhouse | Libraries

Module @cleverbrush/knex-clickhouse

@cleverbrush/knex-clickhouse

+ +

Coverage

+ +

A Knex dialect for ClickHouse. Uses the official @clickhouse/client library to connect to ClickHouse and lets you build queries with Knex's familiar API.

+ +
npm install @cleverbrush/knex-clickhouse
+
+ +

Peer dependency: knex >= 3.1.0

+ +
import { getClickhouseConnection } from '@cleverbrush/knex-clickhouse';

const db = getClickhouseConnection({
connection: {
url: 'http://localhost:8123',
user: 'default',
password: '',
database: 'my_database'
}
});

// Select
const [rows] = await db('my_table').select('*').where('id', 1);

// Insert
await db('my_table').insert({ id: 1, name: 'Alice' });

// Raw queries
const [rows] = await db.raw('SELECT * FROM my_table WHERE id = ?', [1]); +
+ + + +

Creates and returns a Knex instance configured with the ClickHouse dialect.

+

Parameters:

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
configKnex.Config & AdditionalClientOptionsKnex configuration with optional retry settings
clickHouseSettingsClickHouseSettingsOptional ClickHouse-specific settings
+ +

The Knex client class for ClickHouse. Can be used directly if you need more control over Knex initialization:

+
import Knex from 'knex';
import { ClickhouseKnexClient } from '@cleverbrush/knex-clickhouse';

const db = Knex({
client: ClickhouseKnexClient,
connection: {
url: 'http://localhost:8123',
user: 'default',
password: '',
database: 'my_database'
}
}); +
+ + +

Standard Knex query methods are supported:

+
    +
  • select() / first() / pluck() — read queries
  • +
  • insert() — standard inserts
  • +
  • update() — update records
  • +
  • del() — delete records
  • +
  • raw() — raw SQL queries (auto-detected as SELECT when the query starts with SELECT or WITH)
  • +
+ +

An extended method for inserting rows with ClickHouse-specific data types like arrays and tuples:

+
await db('my_table').insertToClickhouse([
[1, 'Alice', [10, 20, 30]],
[2, 'Bob', [40, 50]]
]); +
+ + +

By default, queries are retried up to 10 times on ECONNRESET errors with exponential backoff. You can customize or disable this:

+
const db = getClickhouseConnection({
connection: { /* ... */ },
retry: {
maxRetries: 5,
minDelay: 200,
delayFactor: 2,
delayRandomizationPercent: 0.1,
shouldRetry: (error) => error.code === 'ECONNRESET'
}
});

// Disable retries
const db = getClickhouseConnection({
connection: { /* ... */ },
retry: null
}); +
+ + +

The client automatically parses ClickHouse types to JavaScript types:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ClickHouse TypeJavaScript Type
Date, DateTime, DateTime('UTC')Date
Nullable(Date), Nullable(DateTime)Date
LowCardinality(Date), LowCardinality(DateTime)Date
UInt64, UInt32number
+ +

BSD-3-Clause

+

Classes

ClickhouseKnexClient

Interfaces

ClickHouseClient

Functions

getClickhouseConnection
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema..html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema..html new file mode 100644 index 00000000..9baa9871 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema..html @@ -0,0 +1 @@ + | Libraries

Classes

Entity
SchemaQueryBuilder

Interfaces

AddColumnDiff
AddForeignKeyDiff
AddIndexDiff
AlterColumnDiff
BoundQuery
CursorPaginationResult
DatabaseCheckInfo
DatabaseColumnInfo
DatabaseForeignKeyInfo
DatabaseIndexInfo
DatabaseTableState
JoinManySpec
JoinOneSpec
MigrationDiff
PaginationResult
PrimaryKeyColumns
RelationInfo
RelationSpec
ResolvedVariantConfig
ResolvedVariantSpec
RowVersionColumn
SchemaSnapshot
ValidatedJoinManySpec
ValidatedJoinOneSpec

Type Aliases

ColumnRef
EntityPropSelector
EntityRelationKeys
EntityRelations
EntitySchema
EntityVariantUnion
InsertType
PrimaryKeyOf
PrimaryKeyValueOf
RowVersionStrategy
SchemaKeys
SchemaProps
SelectProjection
SelectSelector
UnwrapNavSchema
ValidatedSpec
VariantBranch
VariantStorageType
WithJoinedMany
WithJoinedOne
WithRelation

Variables

EXTRA_TYPE_BRAND
MAPPERS
METHOD_LITERAL_BRAND

Functions

applyDiff
buildColumnMap
clearRow
createQuery
defineEntity
diffSchema
entitiesToSnapshot
entitySchemaToTableState
generateCreatePolymorphicTables
generateCreateTable
generateCreateTableSource
generateMigration
generateMigrationsForContext
getPrimaryKeyColumns
getRowVersionColumn
introspectDatabase
isDiffEmpty
loadSnapshot
mapObject
mapValue
query
rawQuery
resolveColumnRef
resolvePropertyKey
tableExistsInDb
writeSnapshot

References

any → any
array → array
boolean → boolean
COMPOSITE_PRIMARY_KEY_BRAND → COMPOSITE_PRIMARY_KEY_BRAND
date → date
dbExtension → dbExtension
ddlExtension → ddlExtension
func → func
getColumnName → getColumnName
getPolymorphicVariantSchemas → getPolymorphicVariantSchemas
getProjections → getProjections
getTableName → getTableName
getVariants → getVariants
number → number
object → object
POLYMORPHIC_TYPE_BRAND → POLYMORPHIC_TYPE_BRAND
PRIMARY_KEY_BRAND → PRIMARY_KEY_BRAND
string → string
union → union
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema.extension.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema.extension.html new file mode 100644 index 00000000..22c47535 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema.extension.html @@ -0,0 +1 @@ +extension | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema.html new file mode 100644 index 00000000..71044a35 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_knex-schema.html @@ -0,0 +1,247 @@ +@cleverbrush/knex-schema | Libraries

Module @cleverbrush/knex-schema

@cleverbrush/knex-schema

+

Type-safe, schema-driven query builder for Knex. Use @cleverbrush/schema object builders to describe your PostgreSQL tables — column name mapping, eager loading, and full CRUD are handled automatically with complete TypeScript inference.

+ +
npm install @cleverbrush/knex-schema
+
+ +

Peer dependency: knex >= 3.1.0

+ +
import knex from 'knex';
import { query, object, string, number, date } from '@cleverbrush/knex-schema';

// 1. Describe your table with a schema
const UserSchema = object({
id: number(),
firstName: string().hasColumnName('first_name'),
lastName: string().hasColumnName('last_name'),
age: number().optional(),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('users');

// 2. Create a Knex instance
const db = knex({ client: 'pg', connection: process.env.DB_URL });

// 3. Query — fully typed, column names resolved automatically
const adults = await query(db, UserSchema)
.where(t => t.age, '>', 18)
.orderBy(t => t.lastName);
// → typed as Array<{ id: number; firstName: string; lastName: string; age?: number; createdAt: Date }> +
+ + +

Import schema builders from @cleverbrush/knex-schema (re-exported with the database extensions applied) instead of from @cleverbrush/schema:

+
import { object, string, number, date, boolean, any } from '@cleverbrush/knex-schema';
// NOT from '@cleverbrush/schema' — those builders lack hasColumnName / hasTableName +
+ + +

Set the SQL column name for a property when it differs from the property key:

+
const OrderSchema = object({
id: number(),
customerId: number().hasColumnName('customer_id'), // snake_case column
totalAmount: number().hasColumnName('total_amount'),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('orders'); +
+ + +

Set the SQL table name on an object schema. Required before calling query().

+
+ + +
const users = await query(db, UserSchema);
// or explicitly:
const users = await query(db, UserSchema).execute(); +
+ + +
const user = await query(db, UserSchema)
.where(t => t.id, 1)
.first();
// → UserType | undefined +
+ + +
// Single row — returns the inserted record (including database-generated fields)
const newUser = await query(db, UserSchema).insert({
firstName: 'Alice',
lastName: 'Smith',
age: 30,
createdAt: new Date(),
});

// Multiple rows
const newUsers = await query(db, UserSchema).insertMany([
{ firstName: 'Bob', lastName: 'Jones', createdAt: new Date() },
{ firstName: 'Carol', lastName: 'White', createdAt: new Date() },
]); +
+ + +
// Updates rows matching the WHERE clause, returns updated records
const updated = await query(db, UserSchema)
.where(t => t.id, userId)
.update({ firstName: 'Alicia' }); +
+ + +
// Returns the number of deleted rows
const count = await query(db, UserSchema)
.where(t => t.id, userId)
.delete(); +
+ +
+ +

Column references accept either a property accessor (t => t.firstName) or a string property key ('firstName') — both are resolved to the correct SQL column name:

+
query(db, UserSchema)
.where(t => t.firstName, 'like', 'A%')
.andWhere(t => t.age, '>', 18)
.orWhere({ lastName: 'Smith' }) // record syntax — keys mapped to columns
.whereIn(t => t.id, [1, 2, 3])
.whereNotNull(t => t.createdAt)
.whereBetween(t => t.age, [20, 40])
.whereILike(t => t.lastName, 'sm%') // case-insensitive (PostgreSQL)
.whereRaw('extract(year from created_at) = ?', [2025]); +
+ +

Available WHERE methods: where, andWhere, orWhere, whereNot, whereIn, whereNotIn, orWhereIn, orWhereNotIn, whereNull, whereNotNull, orWhereNull, orWhereNotNull, whereBetween, whereNotBetween, whereLike, whereILike, whereRaw, whereExists.

+
+ +
query(db, UserSchema)
.orderBy(t => t.lastName)
.orderBy(t => t.firstName, 'desc')
.limit(20)
.offset(40)
.groupBy(t => t.age)
.having(t => t.age, '>', 18)
.select(t => t.firstName, t => t.age)
.distinct(t => t.age); +
+ +
+ +

Related rows are loaded in a single query using PostgreSQL CTEs and jsonb_agg.

+ +
const PostSchema = object({
id: number(),
title: string(),
authorId: number().hasColumnName('author_id'),
}).hasTableName('posts');

const posts = await query(db, PostSchema)
.joinOne({
foreignSchema: UserSchema,
localColumn: t => t.authorId,
foreignColumn: t => t.id,
as: 'author',
});
// posts[0].author.firstName — typed as string ✓ +
+ + +
const users = await query(db, UserSchema)
.joinMany({
foreignSchema: PostSchema,
localColumn: t => t.id,
foreignColumn: t => t.authorId,
as: 'posts',
limit: 5,
orderBy: { column: t => t.id, direction: 'desc' },
});
// users[0].posts — typed as Array<{ id: number; title: string; authorId: number }> ✓ +
+ +

The joinMany spec supports:

+
    +
  • limit / offset — per-parent pagination using row_number() window functions
  • +
  • orderBy{ column, direction } for the sub-collection
  • +
  • foreignQuery — pre-filtered Knex.QueryBuilder (e.g. for soft-delete scopes)
  • +
  • required (joinOne only) — true = inner join, false = left join (nullable result)
  • +
+
+ +

When you need a Knex feature not exposed by this API, use .apply():

+
const rows = await query(db, UserSchema)
.apply(qb => qb.forUpdate().noWait())
.where(t => t.id, id); +
+ +
+ +

Define reusable WHERE/ORDER/LIMIT conditions on the schema. A default scope is applied +automatically unless bypassed with .unscoped().

+
const PostSchema = object({
id: number(),
title: string(),
status: string(),
isActive: boolean().hasColumnName('is_active'),
})
.hasTableName('posts')
.scope('published', q => q.where(t => t.status, 'published'))
.scope('recent', q => q.orderBy(t => t.id, 'desc').limit(10))
.defaultScope( q => q.where(t => t.isActive, true));

// Apply named scopes
const posts = await query(db, PostSchema)
.scoped('published')
.scoped('recent');

// Bypass default scope (also skips soft-delete filter if present)
const all = await query(db, PostSchema).unscoped(); +
+ +

scoped() is statically typed: TypeScript only allows registered scope names.

+
+ +

Define named column subsets on the schema with .projection(name, columns). At query time, +.projected(name) restricts the SELECT clause and narrows the TypeScript result type to +Pick<Row, Keys> — accessing columns outside the projection is a compile-time error.

+ +
const PostSchema = object({
id: number().primaryKey(),
title: string(),
body: string(),
status: string(),
})
.hasTableName('posts')
.projection('summary', ['id', 'title'] as const)
.projection('withStatus', ['id', 'title', 'status'] as const);

const rows = await query(db, PostSchema)
.scoped('published')
.projected('summary');

// rows: Array<Pick<Post, 'id' | 'title'>>
// rows[0].body // ← TypeScript error: 'body' not in projection ✓ +
+ + +
.projection('withStatus', t => [t.id, t.title, t.status])
+
+ +

The accessor receives the schema's property-descriptor tree; each element resolves to the +property name at runtime. This form is more refactor-safe but does not provide the compile-time +Pick<> narrowing that the tuple form offers.

+ +

.projected() cannot be combined with .select(), .distinct(), or any aggregate +(.count(), .min(), etc.) on the same query. Attempting to do so throws at runtime.

+ +

hasColumnName() is respected: if isActive is mapped to is_active, the generated SQL +uses is_active automatically.

+
+ +

In addition to query building, this package provides the schema-level primitives that +@cleverbrush/orm and +@cleverbrush/orm-cli build on top of:

+ +

Wrap a schema to declare typed belongsTo / hasOne / hasMany / belongsToMany +relations that downstream packages use for eager-loading joins and ORM navigation properties.

+
import { defineEntity, object, number, string } from '@cleverbrush/knex-schema';

const UserSchema = object({
id: number().primaryKey(),
email: string(),
}).hasTableName('users');

const PostSchema = object({
id: number().primaryKey(),
title: string(),
authorId: number().hasColumnName('author_id'),
author: UserSchema.optional(),
}).hasTableName('posts');

export const PostEntity = defineEntity(PostSchema)
.belongsTo(t => t.author, l => l.authorId, r => r.id); +
+ +

The returned Entity carries the relation map in its type, so downstream query(db, entity) +calls (and @cleverbrush/orm's DbSet.include()) get full inference.

+ +

Mark a schema as polymorphic to support single-table or class-table inheritance — variants +are discoverable via getVariants() / getPolymorphicVariantSchemas():

+
import { POLYMORPHIC_TYPE_BRAND } from '@cleverbrush/knex-schema';
+
+ +

See the @cleverbrush/orm docs for the full inheritance API (.ofVariant() etc.).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionPurpose
entitiesToSnapshot(entities)Materialise entity definitions into a JSON-serialisable schema snapshot
loadSnapshot(path) / writeSnapshot(path, snap)Read/write the committed snapshot file
generateMigrationsForContext(entities, prevSnapshot)Diff entities against the snapshot and emit a TS migration source plus the next snapshot
generateMigration(snapshotA, snapshotB)Lower-level snapshot-vs-snapshot diff
diffSchema(schema, dbState) / applyDiff(knex, diff, table)Live-database diff/apply (used by cb-orm db push)
introspectDatabase(knex, table) / tableExistsInDb(knex, table)Database introspection helpers
generateCreateTable(schema) / generateCreatePolymorphicTables(schema)Knex-statement builders for fresh CREATE TABLE
+

Most users invoke these indirectly through the cb-orm +CLI (cb-orm migrate generate, cb-orm db push).

+ +

Mark a column as a row version with .rowVersion() to opt-in to optimistic concurrency +checks in @cleverbrush/orm's change tracker:

+
const TodoSchema = object({
id: number().primaryKey(),
title: string(),
rowVersion: number().rowVersion(),
}).hasTableName('todos'); +
+ +

getRowVersionColumn(schema) returns the marked column at runtime.

+
+ +

Both styles are equivalent and resolve to the same SQL column:

+
// 1. Property accessor (recommended — refactor-safe, IDE auto-complete)
.where(t => t.firstName, 'Alice')

// 2. String property key
.where('firstName', 'Alice') +
+ +

The schema's hasColumnName() metadata is used to map firstNamefirst_name in both cases.

+
+ + +

Creates a SchemaQueryBuilder. schema must have .hasTableName() set. +Optionally pass a baseQuery (e.g. a scoped knex('users').where('deleted_at', null)) as the starting point.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryMethods
Eager loading.joinOne(spec), .joinMany(spec)
Filtering.where(), .andWhere(), .orWhere(), .whereNot(), .whereIn(), .whereNotIn(), .orWhereIn(), .orWhereNotIn(), .whereNull(), .whereNotNull(), .orWhereNull(), .orWhereNotNull(), .whereBetween(), .whereNotBetween(), .whereLike(), .whereILike(), .whereRaw(), .whereExists()
Ordering.orderBy(col, dir?), .orderByRaw(sql)
Grouping.groupBy(...cols), .groupByRaw(sql), .having(col, op, val), .havingRaw(sql)
Pagination.limit(n), .offset(n)
Selection.select(...cols), .distinct(...cols), .projected(name)
Aggregates.count(col?), .countDistinct(col?), .min(col), .max(col), .sum(col), .avg(col)
Writes.insert(data), .insertMany(data[]), .update(data), .delete()
Execution.execute(), .first(), await builder (thenable)
Debugging.toQuery(), .toString()
Escape hatch.apply(fn)
+

Modules

extension
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log..html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log..html new file mode 100644 index 00000000..7f936d73 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log..html @@ -0,0 +1 @@ + | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log.clickhouse.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log.clickhouse.html new file mode 100644 index 00000000..2a586cf9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log.clickhouse.html @@ -0,0 +1 @@ +clickhouse | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log.html new file mode 100644 index 00000000..cc6576c5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_log.html @@ -0,0 +1,42 @@ +@cleverbrush/log | Libraries

Module @cleverbrush/log

@cleverbrush/log

+

Enterprise structured logging for TypeScript — Serilog-style message templates, CLEF format, batching sinks with circuit breaking, ambient correlation IDs.

+ +
npm install @cleverbrush/log
+
+ + +
import {
createLogger,
consoleSink,
hostnameEnricher,
processIdEnricher,
} from '@cleverbrush/log';

const logger = createLogger({
minimumLevel: 'information',
sinks: [consoleSink({ theme: 'dark' })],
enrichers: [hostnameEnricher(), processIdEnricher()],
});

logger.info('Server started on port {Port}', { Port: 3000 });
logger.error(new Error('oops'), 'Request failed for {UserId}', { UserId: 42 });

await logger.dispose(); +
+ + +
    +
  • Message Templates{Named} properties captured as structured data
  • +
  • Typed TemplatesTypedTemplate<T> via @cleverbrush/schema for compile-time checked, groupable log events
  • +
  • CLEF Format — Compact Log Event Format for Seq, ClickHouse, etc.
  • +
  • Sinks — Console, File (with rotation), Seq, ClickHouse, custom
  • +
  • Batching — All network sinks batch with retry & circuit breaking
  • +
  • Enrichers — hostname, processId, environment, application, correlationId, caller
  • +
  • Correlation IDs — UUID v7, extracted from headers, propagated via AsyncLocalStorage
  • +
  • Middleware — Request logging & correlation ID for @cleverbrush/server
  • +
  • DIconfigureLogging() for @cleverbrush/di
  • +
  • Sampling — Per-level sampling filters
  • +
+ +

Pass a ParseStringSchemaBuilder (from @cleverbrush/schema) directly to any log method. The logger uses the raw {Property} pattern as messageTemplate so all events of the same shape are grouped in Seq, SigNoz, ClickHouse, etc., while the rendered message is interpolated as usual.

+
import { s } from '@cleverbrush/schema';
import { createLogger, consoleSink } from '@cleverbrush/log';

// Define once — compile-time checked parameter types
const TodoCreated = s.parseString('Todo #{TodoId} "{Title}" created by {UserId}');

const logger = createLogger({ sinks: [consoleSink()] });

// TypeScript enforces { TodoId, Title, UserId }
logger.info(TodoCreated, { TodoId: 1, Title: 'Buy milk', UserId: 'u-42' }); +
+ + +
import { useLogging } from '@cleverbrush/log';

// Returns [correlationIdMiddleware, requestLoggingMiddleware]
const [correlationId, requestLogging] = useLogging(logger, {
excludePaths: ['/health'],
// Set to false when OTel traceparent already provides traceability
correlationResponseHeader: false,
}); +
+ +

correlationResponseHeader: false suppresses the X-Correlation-Id response header entirely — useful when @cleverbrush/otel's tracing middleware already sets a traceparent / traceresponse header and a second ID would be redundant.

+ +

Trace correlation, OTLP log export, and the traceEnricher (which copies the active span's traceId / spanId onto every log event) live in @cleverbrush/otel. Wire them up like this:

+
import { createLogger, consoleSink } from '@cleverbrush/log';
import { otelLogSink, traceEnricher } from '@cleverbrush/otel';

const logger = createLogger({
sinks: [consoleSink(), otelLogSink()],
enrichers: [traceEnricher()],
}); +
+ +

@cleverbrush/log itself stays free of any OpenTelemetry runtime dependency.

+ +

BSD-3-Clause

+

Modules

clickhouse
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_mapper.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_mapper.html new file mode 100644 index 00000000..c33ac154 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_mapper.html @@ -0,0 +1,206 @@ +@cleverbrush/mapper | Libraries

Module @cleverbrush/mapper

@cleverbrush/mapper

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A type-safe, declarative object mapper for converting objects between different @cleverbrush/schema representations. Uses PropertyDescriptors as pointers to properties (similar to expressions in C# .NET) and enforces compile-time completeness — TypeScript will produce an error if any target property is not mapped, auto-mapped, or explicitly ignored.

+ +

The problem: Converting between different object shapes — API responses to domain models, domain models to DTOs, database rows to view models — is tedious and error-prone. You write manual mapping functions full of destination.x = source.y assignments. Add a new property to a schema and nothing tells you the mapper is incomplete. The bug shows up at runtime, not at compile time.

+

The solution: @cleverbrush/mapper uses PropertyDescriptor-based selectors (similar to C# expression trees) for type-safe property mapping. The TypeScript compiler enforces that every target property is mapped — unmapped properties cause a compile-time error. You literally cannot forget a field.

+

What makes it different:

+
    +
  • Compile-time completeness — unmapped properties are a TypeScript error, not a runtime surprise
  • +
  • Type-safe selectors.for((t) => t.name).from((s) => s.name) — fully checked at compile time, not string-based
  • +
  • Auto-mapping — properties with the same name and compatible type are mapped automatically; you only configure what differs
  • +
  • Immutable registryconfigure() returns a new registry; safe to share and extend
  • +
  • No decorators or classes — works with plain objects and schemas
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/mapperAutoMapper-tsclass-transformermorphism
Compile-time completeness
Type-safe selectors
No decorators required
Works without classes
Auto-mapping
Immutable registry
Nested schema support~~
+ +
npm install @cleverbrush/mapper
+
+ +

Peer dependency: @cleverbrush/schema

+ +
import { object, string, number } from '@cleverbrush/schema';
import { mapper } from '@cleverbrush/mapper';

// Define source and target schemas
const ApiUser = object({
first_name: string(),
last_name: string(),
birth_year: number()
});

const DomainUser = object({
fullName: string(),
age: number()
});

// Configure the mapping — returns a new (immutable) registry
const registry = mapper().configure(
ApiUser,
DomainUser,
(m) =>
m
.for((t) => t.fullName)
.compute((src) => src.first_name + ' ' + src.last_name)
.for((t) => t.age)
.compute((src) => new Date().getFullYear() - src.birth_year)
);

// Get the mapper function and use it
const mapFn = registry.getMapper(ApiUser, DomainUser);

const dto = await mapFn({
first_name: 'Jane',
last_name: 'Doe',
birth_year: 1995
});
// { fullName: 'Jane Doe', age: <current year - 1995> } +
+ + +
    +
  1. Define schemas — use @cleverbrush/schema to define source and target shapes
  2. +
  3. Configure mappings — use .for() to select a target property, then .from(), .compute(), or .ignore() to define how it's populated
  4. +
  5. Auto-mapping fills the gaps — properties with the same name and compatible type are mapped automatically
  6. +
  7. Get a mapper functionregistry.getMapper(from, to) returns an async function that transforms objects
  8. +
  9. TypeScript enforces completeness — if any target property is unmapped, you get a compile-time error
  10. +
+ +

The mapper enforces multiple layers of compile-time safety:

+ +

Every target property must be either mapped, auto-mapped, or explicitly ignored. If you forget to map a property, TypeScript will produce a compile-time error on the configure callback return:

+
mapper().configure(
UserSchema,
UserDtoSchema,
(m) =>
m
.for((t) => t.name)
.from((f) => f.name)
.for((t) => t.cityName)
.from((f) => f.address.city)
// TS Error: Type 'Mapper<..., "fullAddress", ...>' is not assignable to
// type 'Mapper<..., never, ...>'.
// Types of property '[SYMBOL_UNMAPPED]' are incompatible.
// Type '"fullAddress"' is not assignable to type 'never'.
); +
+ +

The error message shows the names of the unmapped properties directly in the type mismatch.

+ +

from only shows source properties whose InferType is assignable to the target property's type. If you select an incompatible property (e.g., mapping a number to a string), TypeScript produces a compile-time error:

+
// Trying to map a string target from a number source
m.for((t) => t.cityName).from((f) => f.houseNr)
// TS Error: source property type is not assignable to target property type
// Use .compute() instead to transform the value +
+ + +

When from maps between two ObjectSchemaBuilder properties, a mapping for that schema pair must be registered in the registry first. Otherwise, TypeScript produces a compile-time error:

+
const PersonSchema = object({ name: string(), address: AddressSchema });
const PersonDtoSchema = object({ name: string(), address: AddressDtoSchema });

// Error — AddressSchema→AddressDtoSchema is not registered
mapper().configure(
PersonSchema,
PersonDtoSchema,
(m) =>
m
.for((t) => t.name)
.from((f) => f.name)
.for((t) => t.address)
.from((f) => f.address) // TS Error: Register a mapping for the
// source→target schema pair first
); +
+ + +

Properties that can be automatically determined don't need explicit mapping configuration. Auto-mapping activates in two scenarios:

+ +

When the source and target schemas have a property with the same name and compatible InferType, it is auto-mapped automatically:

+
const Source = object({
id: string(),
name: string(),
email: string(),
age: number()
});

const Target = object({
id: string(), // same name + type → auto-mapped
name: string(), // same name + type → auto-mapped
email: string(), // same name + type → auto-mapped
ageGroup: string() // different name → must be configured
});

const registry = mapper().configure(Source, Target, (m) =>
m
.for((t) => t.ageGroup)
.compute((src) => src.age < 18 ? 'minor' : 'adult')
// id, name, email are auto-mapped — no configuration needed!
); +
+ + +

When both the source and target have a same-name property that is an ObjectSchemaBuilder, and a mapping for that schema pair has been previously registered, the nested property is auto-mapped using the registered mapper:

+
const AddressSchema = object({ city: string(), houseNr: number() });
const AddressDtoSchema = object({ city: string() });

const PersonSchema = object({ name: string(), address: AddressSchema });
const PersonDtoSchema = object({ name: string(), address: AddressDtoSchema });

const registry = mapper()
// Register Address mapping first
.configure(AddressSchema, AddressDtoSchema, (m) =>
m.for((t) => t.city).from((f) => f.city)
)
// address is auto-mapped using the registered AddressSchema→AddressDtoSchema mapper
.configure(PersonSchema, PersonDtoSchema, (m) =>
m.for((t) => t.name).from((f) => f.name)
);

const mapFn = registry.getMapper(PersonSchema, PersonDtoSchema);
const result = await mapFn({
name: 'Alice',
address: { city: 'Berlin', houseNr: 10 }
});
// result: { name: 'Alice', address: { city: 'Berlin' } } +
+ +

Ordering matters: nested mappings must be registered before the parent mapping. Explicit mappings via compute or ignore take priority over auto-mapping.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StrategyUsagePurpose
.from(selector).for(t => t.x).from(s => s.y)Copy from a source property (supports nested paths)
.compute(fn).for(t => t.x).compute(s => s.a + s.b)Compute from a sync or async function
.ignore().for(t => t.x).ignore()Exclude a target property
(auto-mapped)(no configuration needed)Same-name, compatible-type primitives or registered nested schemas
+

Every non-auto-mappable target property must be either mapped or explicitly ignored. Unmapped properties cause:

+
    +
  • A compile-time TypeScript type error — a type-assignability mismatch that includes the unmapped property names in the type parameters
  • +
  • A runtime MapperConfigurationError if type checks are bypassed
  • +
+ + +

A convenience factory function that creates a new MappingRegistry:

+
const registry = mapper()
.configure(A, B, (m) => ...)
.configure(C, D, (m) => ...); +
+ + +

Defines a mapping between two schemas and returns a new immutable registry containing the mapping. The callback fn receives a fresh Mapper and must return it after configuring all non-auto-mappable property mappings.

+

Throws if schemas are invalid, the mapping is a duplicate, or if unmapped properties remain that cannot be auto-mapped.

+ +

Retrieves a previously registered mapper function. Throws if no mapper has been registered for the given schema pair.

+
const mapFn = registry.getMapper(ApiUser, DomainUser);
const result = await mapFn(sourceObject); +
+ + +

A fluent builder for configuring how each target property is populated:

+
    +
  • .for(selector) — selects a target property to configure
  • +
  • .from(selector) — maps from a source property (types must be compatible)
  • +
  • .compute(fn) — computes the value from the entire source object (sync or async)
  • +
  • .ignore() — explicitly excludes the property
  • +
  • .getMapper() — returns the mapping function (only available when all properties are mapped)
  • +
+
const mapper = new Mapper(SourceSchema, TargetSchema);
const mapFn = mapper
.for((t) => t.fullName)
.compute((src) => `${src.firstName} ${src.lastName}`)
.for((t) => t.age)
.from((src) => src.years)
.getMapper();

const result = await mapFn(sourceObject); +
+ + +

A complete example mapping API responses through multiple layers:

+
import { object, string, number } from '@cleverbrush/schema';
import { mapper } from '@cleverbrush/mapper';

// API response shape
const ApiOrderResponse = object({
order_id: string(),
customer_name: string(),
total_cents: number(),
status_code: number()
});

// Domain model
const Order = object({
id: string(),
customer: string(),
totalPrice: string(),
status: string()
});

const registry = mapper().configure(
ApiOrderResponse,
Order,
(m) =>
m
.for((t) => t.id)
.from((s) => s.order_id)
.for((t) => t.customer)
.from((s) => s.customer_name)
.for((t) => t.totalPrice)
.compute((s) => `$${(s.total_cents / 100).toFixed(2)}`)
.for((t) => t.status)
.compute((s) => {
const statuses: Record<number, string> = {
0: 'pending', 1: 'confirmed', 2: 'shipped', 3: 'delivered'
};
return statuses[s.status_code] ?? 'unknown';
})
);

const mapOrder = registry.getMapper(ApiOrderResponse, Order);
const order = await mapOrder({
order_id: 'ORD-123',
customer_name: 'Alice Smith',
total_cents: 4999,
status_code: 2
});
// { id: 'ORD-123', customer: 'Alice Smith', totalPrice: '$49.99', status: 'shipped' } +
+ + +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode — all type selectors and mapping configurations are validated at compile time
  • +
  • Unit tests: Vitest — runtime tests + type-level tests (expectTypeOf) covering auto-mapping, computed fields, nested schemas, and compile-time completeness errors
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Classes

Mapper
MapperConfigurationError
MappingRegistry
PropertyMappingBuilder

Type Aliases

SchemaToSchemaMapperResult

Functions

mapper
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_orm-cli.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_orm-cli.html new file mode 100644 index 00000000..2f59c583 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_orm-cli.html @@ -0,0 +1,147 @@ +@cleverbrush/orm-cli | Libraries

Module @cleverbrush/orm-cli

@cleverbrush/orm-cli

+

A standalone CLI for managing PostgreSQL schema migrations for projects built +with @cleverbrush/orm.

+
cb-orm migrate generate [name]   # diff DBschema, emit TS migration file (name defaults to "migration")
cb-orm migrate run # apply pending migrations
cb-orm migrate rollback # roll back last batch
cb-orm migrate status # list applied/pending migrations
cb-orm db push # sync schema in-place (dev only) +
+ +
+ +
npm install --save-dev @cleverbrush/orm-cli
+
+ +

knex is a peer dependency and must be installed in your project. tsx is a regular dependency and is installed automatically.

+
+ + +
// db.config.ts
import knex from 'knex';
import { defineConfig } from '@cleverbrush/orm-cli';
import { UserEntity, TodoEntity } from './src/db/schemas.js';

const db = knex({
client: 'pg',
connection: process.env.DATABASE_URL
});

export default defineConfig({
knex: db,
entities: { users: UserEntity, todos: TodoEntity },
migrations: {
directory: './migrations', // where .ts migration files are written
tableName: 'knex_migrations' // default; override if needed
}
}); +
+ + +
{
"scripts": {
"db:generate": "cb-orm migrate generate",
"db:run": "cb-orm migrate run",
"db:rollback": "cb-orm migrate rollback",
"db:status": "cb-orm migrate status",
"db:push": "cb-orm db push"
}
} +
+ +
+ + +

Compares every entity in config.entities against the live database and emits +a single timestamped TypeScript migration file when differences are found.

+
    +
  • New tables → CREATE TABLE.
  • +
  • Existing tables with column/index/FK changes → ALTER TABLE.
  • +
  • Multiple tables are FK-dependency-ordered (parents created first, dropped last).
  • +
  • Polymorphic (CTI) entities include one entry per variant table.
  • +
  • File written as <dir>/YYYYMMDDHHmmss_<name>.ts.
  • +
+
npx cb-orm migrate generate add_role_column
# → migrations/20260423120000_add_role_column.ts +
+ + +

Applies all pending migrations via knex.migrate.latest.

+
npx cb-orm migrate run
# Batch 1. Applied 2 migration(s):
# ✓ 20260423000001_init.ts
# ✓ 20260423120000_add_role_column.ts +
+ +

Use --to <filename> to migrate up to a specific file:

+
npx cb-orm migrate run --to 20260423000001_init.ts
+
+ + +

Rolls back the most recently applied batch.

+
npx cb-orm migrate rollback
# Roll back all batches:
npx cb-orm migrate rollback --all +
+ + +

Lists applied and pending migrations.

+
npx cb-orm migrate status

# Applied migrations:
# ✓ 20260423000001_init.ts
# Pending migrations:
# ○ 20260423120000_add_role_column.ts +
+ + +

Applies all schema changes directly to the database without writing a +migration file. Runs inside a single transaction.

+
+

Warning — dev only. Requires --yes when NODE_ENV=production.

+
+
npx cb-orm db push          # asks for confirmation
npx cb-orm db push --yes # skip confirmation +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagCommandsDescription
--config <path>allPath to config file (default: db.config.ts in cwd)
--dir <path>allMigrations directory (overrides config.migrations.directory)
--to <name>migrate runApply up to a specific migration filename
--allmigrate rollbackRoll back all batches
--yesdb pushSkip the interactive confirmation prompt
+
+ +

The CLI delegates all schema intelligence to @cleverbrush/knex-schema:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StepFunction
Detect new tablestableExistsInDb(knex, tableName)
Generate CREATE TABLE sourcegenerateCreateTableSource(schema)
Introspect live tableintrospectDatabase(knex, tableName)
Diff schema vs DBdiffSchema(schema, dbState)
Generate ALTER TABLE sourcegenerateMigration(diff, tableName)
Apply diff without fileapplyDiff(knex, diff, tableName)
Polymorphic variant tablesgetPolymorphicVariantSchemas(schema)
+

tsx is used to load db.config.ts at runtime by registering the +tsx/esm/api hook before any dynamic import() of the config file.

+

Interfaces

MigrationsConfig
OrmCliConfig

Functions

defineConfig
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_orm.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_orm.html new file mode 100644 index 00000000..5733416a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_orm.html @@ -0,0 +1,313 @@ +@cleverbrush/orm | Libraries

Module @cleverbrush/orm

@cleverbrush/orm

+

EF-Core-like typed ORM layer on top of @cleverbrush/knex-schema.

+
    +
  • Define entities with defineEntity(schema) and declare relations via +.hasOne() / .hasMany() / .belongsTo() / .belongsToMany().
  • +
  • Group entities into a typed context with createDb(knex, { todos, users }).
  • +
  • Access db.todos, db.users as fully-typed DbSet<TEntity> instances.
  • +
  • Eager-load related entities with .include(t => t.author).
  • +
  • Use { tracking: true } for an identity map + change-tracking context.
  • +
  • Model inheritance with STI (single-table) and CTI (class-table) variants.
  • +
  • Manage schema migrations with @cleverbrush/orm-cli.
  • +
+
+ +
npm install @cleverbrush/orm
+
+ +

knex is a peer dependency (install it alongside @cleverbrush/orm). @cleverbrush/knex-schema is a direct dependency and is installed automatically.

+
+ + +
import { number, object, string, defineEntity } from '@cleverbrush/orm';

const UserSchema = object({
id: number().primaryKey(),
email: string().hasColumnName('email_address'),
name: string(),
}).hasTableName('users');

export const UserEntity = defineEntity(UserSchema); +
+ + +
import knex from 'knex';
import { createDb } from '@cleverbrush/orm';
import { UserEntity } from './schemas.js';

const knexClient = knex({ client: 'pg', connection: process.env.DATABASE_URL });

const db = createDb(knexClient, { users: UserEntity }); +
+ + +
// Find by PK
const alice = await db.users.find(1);

// Find with WHERE clause
const user = await db.users.where(t => t.email, 'alice@example.com').first();

// Insert
const created = await db.users.save({ email: 'bob@example.com', name: 'Bob' });

// Update (PK present → UPDATE)
const updated = await db.users.save({ id: 1, email: 'alice@example.com', name: 'Alice' }); +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
.find(pk)Find one row by PK; returns undefined when not found
.findOrFail(pk)Like .find, but throws EntityNotFoundError when not found
.findMany([pk1, pk2, …])Fetch multiple rows by PK in one query
.all()Alias for .execute() — returns all rows
.first()Returns the first matching row or undefined
.where(col, value)Adds a WHERE predicate (chainable)
.include(t => t.rel)Eager-loads a relation (chainable)
.save(graph)Insert or update a row graph (transactional)
.ofVariant(key)Return a typed VariantDbSet scoped to a polymorphic variant
.query()Returns the underlying EntityQuery for advanced querying
.withTransaction(trx)Returns a new DbSet bound to an existing transaction
+

Any method from the underlying SchemaQueryBuilder (e.g. .execute(), +.where(), .orderBy(), .pluck(), .count()) is also available and +fully typed.

+
+ +

Declare relations on the entity using fluent builders. Relations are optional +by default (omit from the save-graph to skip them).

+
const TodoSchema = object({
id: number().primaryKey(),
title: string(),
userId: number().hasColumnName('user_id'),
author: object({ id: number().primaryKey(), name: string() })
.hasTableName('users').optional(),
}).hasTableName('todos');

const TodoEntity = defineEntity(TodoSchema)
.belongsTo(t => t.author, 'userId'); // FK is on todos.user_id → users.id

const UserEntity = defineEntity(UserSchema)
.hasMany(t => t.todos, TodoEntity, 'userId'); // FK on todos.user_id +
+ + +
const todo = await db.todos
.where(t => t.id, 42)
.include(t => t.author)
.first();

console.log(todo?.author?.name); // fully typed +
+ + +

db.todos.save(graph) traverses the whole object graph and persists every +level in the correct FK order inside a single transaction.

+
// Create a new user and a new todo in one call.
const result = await db.users.save({
name: 'Alice',
todos: [
{ title: 'Buy milk', completed: false, userId: 0 },
],
}); +
+ +

Topology rules:

+
    +
  • belongsTo parents are inserted first; their PK feeds the child FK.
  • +
  • The root entity is then written.
  • +
  • hasOne / hasMany children inherit the root PK into their FK.
  • +
  • belongsToMany children may be new objects (inserted + pivot) or bare +{ pk: value } references (pivot only).
  • +
+
+ +

Pass { tracking: true } to createDb to get a TrackedDbContext. The +context maintains an identity map (same PK → same object reference) and +tracks every mutation automatically.

+
const db = createDb(knex, { users: UserEntity }, { tracking: true });

// Load entity — it's now in the identity map.
const user = await db.users.find(1);

// Mutate normally.
user.name = 'Updated';

// Flush all dirty entries in a single transaction.
const { inserted, updated, deleted } = await db.saveChanges(); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method / propertyDescription
.attach(key, entity)Register an existing entity as Unchanged
.entry(entity)Return the EntityEntry for a tracked entity
.entry(entity).state'Added' | 'Modified' | 'Unchanged' | 'Deleted'
.entry(entity).isModified(field?)Check if a specific (or any) field changed
.entry(entity).reset()Revert the entity to its last snapshot
.detach(entity)Remove an entity from the tracker
.remove(entity)Mark a tracked entity as Deleted
.saveChanges()Flush all pending changes to the DB
.discardChanges()Roll back all in-memory changes
.reload(entity)Re-fetch the entity from the DB and refresh its snapshot
.onSavingChanges(hook)Register a pre-flush callback (e.g. for audit fields)
[Symbol.asyncDispose]()Usable in await using blocks; throws on pending changes
+ +

Mark any numeric or timestamp column as a row version:

+
const OrderSchema = object({
id: number().primaryKey(),
status: string(),
version: number().rowVersion(), // auto-incremented by the ORM on every UPDATE
}).hasTableName('orders'); +
+ +

saveChanges() appends AND version = <snapshot> to every UPDATE and throws +ConcurrencyError if rowCount === 0.

+ +
async function updateUser(userId: number) {
await using db = createDb(knex, { users: UserEntity }, { tracking: true });
const user = await db.users.find(userId);
if (!user) return;
user.name = 'Updated';
await db.saveChanges();
} // Symbol.asyncDispose fires here; throws if changes are still pending +
+ +
+ + +

All variants share one table; a discriminator column identifies the type.

+
const ActivityBase = object({
id: number().primaryKey(),
type: string(),
todoId: number().hasColumnName('todo_id'),
}).hasTableName('activities');

const ActivityEntity = defineEntity(ActivityBase)
.discriminator('type')
.stiVariant('assigned', object({
type: string('assigned'),
assigneeId: number().hasColumnName('assignee_id').optional(),
}))
.stiVariant('commented', object({
type: string('commented'),
body: string().optional(),
})); +
+ + +

The base row is in one table; each variant has its own extension table.

+
const AssignedExtras = defineEntity(
object({
activityId: number().hasColumnName('activity_id'),
assigneeId: number().hasColumnName('assignee_id'),
}).hasTableName('assigned_activities')
);

const ActivityEntity = defineEntity(ActivityBase)
.discriminator('type')
.ctiVariant('assigned', AssignedExtras, t => t.activityId); +
+ + +

Call db.set.ofVariant('key') to obtain a VariantDbSet — a typed view +scoped to that variant, analogous to EF Core's Set<DerivedType>(). All +reads are pre-filtered by the discriminator; writes use the correct STI / CTI +logic automatically.

+
// Insert a new variant row (discriminator is set automatically)
const activity = await db.activities.ofVariant('assigned').insert({
todoId: 42,
assigneeId: 9,
});
// activity.type === 'assigned'
// activity.assigneeId === 9

// Find a single variant by PK
const found = await db.activities.ofVariant('assigned').find(activityId);

// Update matching rows (chain .where() before .update())
await db.activities.ofVariant('assigned').where(t => t.id, 3).update({ assigneeId: 99 });

// Delete matching rows
await db.activities.ofVariant('assigned').where(t => t.id, 3).delete(); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
.insert(payload)Insert a new variant row; discriminator is set automatically
.update(patch)Update variant columns for rows matched by the current WHERE clause
.delete()Delete rows matched by the current WHERE clause (CTI: atomic)
.find(pk)Find a single variant row by PK; undefined if not found
.findOrFail(pk)Like .find, but throws EntityNotFoundError
.findMany([pk…])Fetch multiple variant rows by PK in one query
.where(col, value)Adds a WHERE predicate (chainable; returns VariantDbSet)
.include(t => t.rel)Eager-loads a relation (chainable; returns VariantDbSet)
.withTransaction(trx)Returns a new VariantDbSet bound to an existing transaction
+

Calling .insert() / .update() / .delete() directly on the polymorphic +base DbSet (without ofVariant) throws a runtime error — use ofVariant +for all writes on polymorphic entities.

+
+ +
// One-off transaction (non-tracking context)
await db.transaction(async trx => {
const user = await trx.users.save({ name: 'Alice' });
await trx.todos.save({ title: 'Buy milk', userId: user.id });
});

// Wrap existing transaction
const user = await db.users.withTransaction(existingTrx).save({ name: 'Alice' }); +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassThrown when
EntityNotFoundErrorfindOrFail can't locate the requested PK
ConcurrencyErrorsaveChanges UPDATE/DELETE hits a row-version mismatch
InvariantViolationErrorPK or discriminator column mutated on a tracked entity
PendingChangesError[Symbol.asyncDispose] fires with unsaved changes
+
+ +

Use @cleverbrush/orm-cli to generate and apply migration files +from your entity definitions:

+
# Diff schema vs DB → emit a TypeScript migration file
npx cb-orm migrate generate add_users_table

# Apply pending migrations
npx cb-orm migrate run +
+ +
+ + +

Classes

ConcurrencyError
Entity
EntityNotFoundError
InvariantViolationError
PendingChangesError
SchemaQueryBuilder

Interfaces

AddColumnDiff
AddForeignKeyDiff
AddIndexDiff
AlterColumnDiff
BoundQuery
CursorPaginationResult
DatabaseCheckInfo
DatabaseColumnInfo
DatabaseForeignKeyInfo
DatabaseIndexInfo
DatabaseTableState
DbSet
EntityEntry
EntityQuery
JoinManySpec
JoinOneSpec
MigrationDiff
PaginationResult
PrimaryKeyColumns
RelationInfo
RelationSpec
ResolvedVariantConfig
ResolvedVariantSpec
RowVersionColumn
SchemaSnapshot
ValidatedJoinManySpec
ValidatedJoinOneSpec
VariantDbSet

Type Aliases

ColumnRef
DbContext
EntityMap
EntityPropSelector
EntityRelationKeys
EntityRelations
EntityResult
EntityResultByVariant
EntitySchema
EntityVariantUnion
EntryState
ExtractBranch
HasVariants
InsertType
PrimaryKeyOf
PrimaryKeyValueOf
RelKeyTree
ResolvedRel
RowVersionStrategy
SaveGraph
SavingChangesHook
SchemaKeys
SchemaProps
SelectProjection
SelectSelector
TrackedDbContext
UnwrapNavSchema
ValidatedSpec
VariantBranch
VariantInsertPayload
VariantResult
VariantStorageType
VariantUpdatePayload
WithIncluded
WithJoinedMany
WithJoinedOne
WithRelation
WithVariantIncluded

Variables

any
array
boolean
COMPOSITE_PRIMARY_KEY_BRAND
date
dbExtension
ddlExtension
EXTRA_TYPE_BRAND
func
MAPPERS
METHOD_LITERAL_BRAND
number
object
POLYMORPHIC_TYPE_BRAND
PRIMARY_KEY_BRAND
string
union

Functions

applyDiff
buildColumnMap
clearRow
createDb
createQuery
defineEntity
diffSchema
entitiesToSnapshot
entitySchemaToTableState
generateCreatePolymorphicTables
generateCreateTable
generateCreateTableSource
generateMigration
generateMigrationsForContext
getColumnName
getPolymorphicVariantSchemas
getPrimaryKeyColumns
getProjections
getRowVersionColumn
getTableName
getVariants
introspectDatabase
isDiffEmpty
loadSnapshot
mapObject
mapValue
query
rawQuery
resolveColumnRef
resolvePropertyKey
tableExistsInDb
writeSnapshot
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel..html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel..html new file mode 100644 index 00000000..3041615b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel..html @@ -0,0 +1 @@ + | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.client.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.client.html new file mode 100644 index 00000000..1d89cc07 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.client.html @@ -0,0 +1 @@ +client | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.html new file mode 100644 index 00000000..252a3f79 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.html @@ -0,0 +1,100 @@ +@cleverbrush/otel | Libraries

Module @cleverbrush/otel

@cleverbrush/otel

+

OpenTelemetry instrumentation for the Cleverbrush framework — traces, logs, and metrics over OTLP for @cleverbrush/server, @cleverbrush/orm, and @cleverbrush/log. Designed to ship straight into SigNoz, Grafana Tempo, Jaeger, or any OTLP-compatible backend.

+ +
npm install @cleverbrush/otel @opentelemetry/api
# Optional auto-instrumentations (only if you want them):
npm install @opentelemetry/instrumentation-http \
@opentelemetry/instrumentation-undici \
@opentelemetry/instrumentation-runtime-node +
+ + + +
// telemetry.ts — load FIRST
import { setupOtel } from '@cleverbrush/otel';
import {
outboundHttpInstrumentations,
runtimeMetrics
} from '@cleverbrush/otel/instrumentations';

export const otel = setupOtel({
serviceName: 'todo-backend',
serviceVersion: '1.0.0',
environment: process.env.NODE_ENV,
otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
instrumentations: [
...outboundHttpInstrumentations(),
...runtimeMetrics()
]
}); +
+ +

Run with:

+
node --import ./dist/telemetry.js dist/index.js
+
+ +

Don't forget to await otel.shutdown() on SIGTERM / SIGINT so batched data flushes.

+ +
import { tracingMiddleware } from '@cleverbrush/otel';
import { createServer } from '@cleverbrush/server';

const server = createServer()
.use(tracingMiddleware({ excludePaths: ['/health'] })) // first!
.use(corsMiddleware)
// ... rest of the chain +
+ +

A SpanKind.SERVER span is opened per request, named operationId or METHOD route and tagged with the standard HTTP semantic-convention attributes. W3C traceparent is extracted, so spans link to upstream callers.

+ +
import { createClient } from '@cleverbrush/client';
import { clientTracingMiddleware } from '@cleverbrush/otel/client';

const client = createClient(api, {
baseUrl: 'http://todo-backend:3000',
middlewares: [clientTracingMiddleware()]
}); +
+ +

clientTracingMiddleware() opens a SpanKind.CLIENT span around each typed client call and injects W3C traceparent / tracestate / baggage headers. When the downstream Cleverbrush service uses tracingMiddleware(), SigNoz and other OTel backends show both services under one distributed trace.

+

Put the tracing middleware first in the client middleware list so it wraps retries, timeouts, and batching. If you use batching(), keep batching last so each logical subrequest carries its own trace context.

+ +
import { instrumentKnex } from '@cleverbrush/otel';
import knex from 'knex';

const db = instrumentKnex(
knex({ client: 'pg', connection: '...' })
); +
+ +

Every Knex query becomes a SpanKind.CLIENT span with db.system.name, db.namespace, db.operation.name, db.query.text, and parented under the active server span automatically.

+ +
import { createLogger, consoleSink } from '@cleverbrush/log';
import { otelLogSink, traceEnricher } from '@cleverbrush/otel';

const logger = createLogger({
minimumLevel: 'information',
sinks: [consoleSink({ theme: 'dark' }), otelLogSink()],
enrichers: [traceEnricher()] // attaches TraceId/SpanId to every event
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExportPurpose
setupOtel(config)Boot the Node SDK; returns { shutdown(), sdk }
tracingMiddleware(opts?)@cleverbrush/server middleware; opens SERVER span
clientTracingMiddleware(opts?)@cleverbrush/client middleware; opens CLIENT span
instrumentKnex(knex, opts?)Hook a Knex instance; emits CLIENT span per query
otelLogSink(opts?)@cleverbrush/log sink → OTLP log records
traceEnricher()@cleverbrush/log enricher → adds TraceId / SpanId
configureOtel(services, opts?)Register ITracer / IMeter in @cleverbrush/di
outboundHttpInstrumentations()Lazy-load HTTP / undici client auto-instrumentations
runtimeMetrics()Lazy-load Node runtime metrics
OTEL_SPAN_ITEM_KEYctx.items key under which the request span is stashed
+

All optional auto-instrumentations and knex are declared as optional peer dependencies, so the package is usable with only @opentelemetry/api installed.

+ +

tracingMiddleware stores the active server span on ctx.items under OTEL_SPAN_ITEM_KEY. Use this to attach custom attributes or events from inside endpoint handlers:

+
import { OTEL_SPAN_ITEM_KEY } from '@cleverbrush/otel';
import type { Span } from '@opentelemetry/api';

// Inside a @cleverbrush/server endpoint handler
const span = ctx.items.get(OTEL_SPAN_ITEM_KEY) as Span | undefined;
span?.setAttribute('app.user_id', userId);
span?.addEvent('cache.miss', { key: cacheKey }); +
+ + +

setupOtel reads OTEL_EXPORTER_OTLP_ENDPOINT from the environment by default (recommended). Per-signal endpoints (tracesEndpoint / logsEndpoint / metricsEndpoint) and signal toggles (disableTraces, disableLogs, disableMetrics) let you wire up split collectors. Headers (e.g. for SaaS tokens) are passed via headers: { authorization: 'Bearer …' }.

+ +

tracingMiddleware does not record query strings (recordQuery: false by default) and instrumentKnex lets you redact SQL via sanitizeStatement. otelLogSink accepts a sanitizeAttribute hook to drop sensitive fields per event.

+ +

BSD-3-Clause

+

Modules

client
instrumentations
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.instrumentations.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.instrumentations.html new file mode 100644 index 00000000..1d1a8146 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_otel.instrumentations.html @@ -0,0 +1,8 @@ +instrumentations | Libraries

Module instrumentations

Opt-in auto-instrumentations.

+

These helpers wrap upstream OpenTelemetry instrumentation packages +for outbound HTTP and Node.js runtime metrics. They are kept in a +separate entry point so projects that don't want them avoid the +extra dependencies and the require-in-the-middle patching at +startup.

+

Pass the returned arrays to setupOtel({ instrumentations: [...] }).

+

Functions

outboundHttpInstrumentations
runtimeMetrics
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_react-form.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_react-form.html new file mode 100644 index 00000000..18e39a57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_react-form.html @@ -0,0 +1,457 @@ +@cleverbrush/react-form | Libraries

Module @cleverbrush/react-form

@cleverbrush/react-form

+

CI +License: BSD-3-Clause

+ +

Coverage

+ +

A headless, schema-driven form system for React based on @cleverbrush/schema. Uses PropertyDescriptors for type-safe field binding, supports global UI renderer configuration via a provider, and is completely UI-agnostic — works with plain HTML, MUI, Ant Design, or any component library.

+ +

The problem: Every popular React form library — React Hook Form, Formik, React Final Form — requires you to reference fields by string names: register("email"), <Field name="address.city" />. The moment you pass a field name as a string, you lose TypeScript's type safety. Rename a property in your data model and the compiler stays silent — your form just silently breaks at runtime. The larger your codebase, the more of these invisible string references you accumulate, and the more fragile every refactor becomes.

+
// React Hook Form — field names are plain strings
const { register } = useForm<User>();
<input {...register("name")} /> // ← no compiler error if "name" is renamed
<input {...register("emial")} /> // ← typo: silently fails at runtime

// Formik — same problem
<Field name="address.city" /> // ← rename "city" → "town" and nothing warns you +
+ +

The solution: @cleverbrush/react-form binds fields via PropertyDescriptor selectors — actual TypeScript expressions like (t) => t.address.city — instead of strings. The compiler knows the exact shape of your schema, so a renamed or mistyped property is a compile-time error, not a runtime surprise. On top of that, the schema IS the validation, the type definition, AND the form field configuration. One source of truth.

+
// @cleverbrush/react-form — fully type-safe selectors
<Field forProperty={(t) => t.name} form={form} /> // ✓ checked at compile time
<Field forProperty={(t) => t.address.city} form={form} /> // ✓ rename "city" → compiler error
<Field forProperty={(t) => t.emial} form={form} /> // ✗ compile error: "emial" doesn't exist +
+ +

What makes it different:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/react-formReact Hook FormFormikReact Final Form
Schema-driven validation✓ built-in~ via resolver~ via plugin
Single source of truth (types + validation)
Type-safe field selectors~
Headless / UI-agnostic~
Global renderer system
Auto-field rendering by type + variant
Nested objects
Async validation
+ +
npm install @cleverbrush/react-form
+
+ +

Peer dependencies: react >=18, @cleverbrush/schema ^2.0.0

+ +
import { object, string, number } from '@cleverbrush/schema';
import { useSchemaForm, FormSystemProvider, Field } from '@cleverbrush/react-form';

// 1. Define schema — reuse across forms, API validation, mapping, etc.
const ContactSchema = object({
name: string().required('Name is required').minLength(2, 'Name must be at least 2 characters'),
email: string().required('Email is required'),
age: number().required('Age is required').min(18, 'Must be at least 18')
});

// 2. Define renderers once per app — maps schema types to UI components
const renderers = {
string: ({ value, onChange, onBlur, error, touched }) => (
<div>
<input
type="text"
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
/>
{touched && error && <span className="error">{error}</span>}
</div>
),
number: ({ value, onChange, onBlur, error, touched }) => (
<div>
<input
type="number"
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
/>
{touched && error && <span className="error">{error}</span>}
</div>
)
};

// 3. Each form component only picks which fields to show — no boilerplate
function ContactForm() {
const form = useSchemaForm(ContactSchema);

const handleSubmit = async () => {
const result = await form.submit();
if (result.valid) {
console.log('Submitted:', result.object);
}
};

return (
<div>
<Field forProperty={(t) => t.name} form={form} />
<Field forProperty={(t) => t.email} form={form} />
<Field forProperty={(t) => t.age} form={form} />
<button onClick={handleSubmit}>Submit</button>
</div>
);
}

// 4. Wrap once at the app root — all forms below share the renderers
function App() {
return (
<FormSystemProvider renderers={renderers}>
<ContactForm />
</FormSystemProvider>
);
} +
+ + +
    +
  1. Define a schema using @cleverbrush/schema — this is your single source of truth for types, validation rules, and field metadata
  2. +
  3. Register renderers via FormSystemProvider — plain functions that map schema types ("string", "number", "boolean") to your UI components (plain HTML, MUI, Ant Design, etc.)
  4. +
  5. Create a form instance via useSchemaForm(schema) — returns state management, validation, submit/reset lifecycle
  6. +
  7. Render fields via <Field forProperty={(t) => t.name} form={form} /> — the component looks up the registered renderer for the field's schema type
  8. +
  9. Submitform.submit() runs the schema's full validation and returns a typed result
  10. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PartResponsibilityWhen to Use
FormSystemProviderGlobal renderer registry via React ContextOnce at the app root
useSchemaFormPer-schema form instance (state, validation, lifecycle)In every component that needs a form
useFieldDescriptor-based field binding (value, dirty, touched, error)When you want fine-grained control
FieldUI-agnostic component that resolves renderers by schema typeFor most form fields — quick and declarative
+ +

Renderers are plain functions that receive field state and return React nodes. Define a renderer map keyed by schema type (string, number, boolean, etc.):

+ +
import { FieldRenderProps } from '@cleverbrush/react-form';

const htmlRenderers = {
string: ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input
type="text"
name={name}
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
{...fieldProps}
/>
{touched && error && <span className="error">{error}</span>}
</div>
),
number: ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input
type="number"
name={name}
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
{...fieldProps}
/>
{touched && error && <span className="error">{error}</span>}
</div>
),
boolean: ({ value, onChange, label }: FieldRenderProps) => (
<label>
<input
type="checkbox"
checked={value ?? false}
onChange={(e) => onChange(e.target.checked)}
/>
{label}
</label>
)
}; +
+ + +

You can register renderers for specific variants using a "type:variant" key. +When <Field variant="password" /> is rendered on a string field, the +registry is checked for "string:password" first, then falls back to "string":

+
const renderers = {
// Default string renderer
string: ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input type="text" name={name} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onBlur={onBlur}
{...fieldProps} />
{touched && error && <span className="error">{error}</span>}
</div>
),
// Password variant — rendered when <Field variant="password" /> is used on a string field
'string:password': ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<input type="password" name={name} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onBlur={onBlur}
{...fieldProps} />
{touched && error && <span className="error">{error}</span>}
</div>
),
// Textarea variant
'string:textarea': ({ value, onChange, onBlur, error, touched, label, name, fieldProps }: FieldRenderProps) => (
<div>
{label && <label>{label}</label>}
<textarea name={name} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onBlur={onBlur}
{...(fieldProps as any)} />
{touched && error && <span className="error">{error}</span>}
</div>
)
}; +
+ + +
import { TextField, Checkbox } from '@mui/material';

const muiRenderers = {
string: ({ value, onChange, onBlur, error, touched }: FieldRenderProps) => (
<TextField
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
/>
),
number: ({ value, onChange, onBlur, error, touched }: FieldRenderProps) => (
<TextField
type="number"
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
/>
),
boolean: ({ value, onChange }: FieldRenderProps) => (
<Checkbox
checked={value ?? false}
onChange={(e) => onChange(e.target.checked)}
/>
)
}; +
+ + +

Register renderers once at the top of your app. All <Field> components below resolve renderers by schema type automatically:

+
import { FormSystemProvider } from '@cleverbrush/react-form';

// Public website with plain HTML inputs
<FormSystemProvider renderers={htmlRenderers}>
<PublicApp />
</FormSystemProvider>

// Admin panel using MUI
<FormSystemProvider renderers={muiRenderers}>
<AdminApp />
</FormSystemProvider> +
+ + +

Inner providers override/extend outer providers:

+
<FormSystemProvider renderers={muiRenderers}>
<MainApp />
{/* Override just the string renderer in this section */}
<FormSystemProvider renderers={{ string: customStringRenderer }}>
<SpecialSection />
</FormSystemProvider>
</FormSystemProvider> +
+ + +

Creates a form instance bound to a schema. Returns field binding and form lifecycle methods:

+
const form = useSchemaForm(UserSchema, {
createMissingStructure: true, // default: true — auto-create parent objects when setting nested values
validateOnMount: false, // default: false — set to true to show errors immediately on mount
validationDebounceMs: 300 // optional — debounce onChange validation (ms); validate()/submit() are always immediate
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
form.useField(forProperty)Bind a field by PropertyDescriptor selector
form.submit()Validate and return ValidationResult (includes result.object on success)
form.validate()Run validation, propagate errors to fields
form.reset(values?)Reset all fields; optionally set new initial values
form.getValue()Get current form values as plain object
form.setValue(values)Merge values into form state
+ +

Binds a single field via PropertyDescriptor selector. Can be used via form.useField() or the context-based standalone useField():

+
// Via form instance
const name = form.useField((t) => t.name);
const city = form.useField((t) => t.address.city);

// Or via context (inside a FormProvider)
const name = useField((t) => t.name); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
valueT | undefinedCurrent field value
initialValueT | undefinedValue at form init / last reset
dirtybooleantrue if value differs from initialValue
touchedbooleantrue after onBlur has been called
errorstring | undefinedValidation error message from schema
validatingbooleantrue during async validation
onChange(value)(T) => voidUpdate field value
onBlur()() => voidMark field as touched
setValue(value)(T) => voidAlias for onChange
schemaSchemaBuilderThe field's schema builder
+ +

Resolves the renderer from the FormSystemProvider registry by schema type (and optional variant), or uses an explicit renderer prop:

+
// Auto-resolved from FormSystemProvider (string schema → string renderer)
<Field forProperty={(t) => t.name} form={form} />

// Variant-based resolution: looks up "string:password", falls back to "string"
<Field forProperty={(t) => t.password} form={form} variant="password" />

// With label, name, and extra props for the renderer
<Field
forProperty={(t) => t.email}
form={form}
label="Email address"
name="email"
fieldProps={{ placeholder: 'you@example.com', autoComplete: 'email' }}
/>

// Explicit renderer override
<Field forProperty={(t) => t.name} form={form} renderer={customRenderer} /> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropTypeDescription
forProperty(tree) => PropertyDescriptorPropertyDescriptor selector for the field
formSchemaFormInstanceForm instance from useSchemaForm
renderer?FieldRendererOptional explicit renderer (overrides provider)
variant?stringVariant hint for renderer resolution and forwarded to the renderer
label?stringVisible label text forwarded to the renderer
name?stringHTML name attribute forwarded to the renderer
fieldProps?Record<string, unknown>Extra renderer-specific props (e.g. placeholder, autoComplete)
+ +

For full control over rendering, use form.useField() directly:

+
function UserForm() {
const form = useSchemaForm(UserSchema);
const name = form.useField((t) => t.name);
const email = form.useField((t) => t.email);

return (
<>
<input
value={name.value ?? ''}
onChange={(e) => name.onChange(e.target.value)}
onBlur={name.onBlur}
/>
{name.touched && name.error && <span>{name.error}</span>}

<input
value={email.value ?? ''}
onChange={(e) => email.onChange(e.target.value)}
onBlur={email.onBlur}
/>
<button onClick={() => form.submit()}>Submit</button>
</>
);
} +
+ + +

Context bridge that allows standalone useField() usage outside of form.useField():

+
import { FormProvider, useField } from '@cleverbrush/react-form';

function NameInput() {
const name = useField((t) => t.name);
return <input value={name.value ?? ''} onChange={(e) => name.onChange(e.target.value)} />;
}

function UserForm() {
const form = useSchemaForm(UserSchema);

return (
<FormProvider form={form}>
<NameInput />
</FormProvider>
);
} +
+ + +

PropertyDescriptor selectors support nested paths:

+
const UserSchema = object({
name: string(),
address: object({
city: string(),
zip: number()
})
});

function UserForm() {
const form = useSchemaForm(UserSchema);

return (
<>
<Field forProperty={(t) => t.name} form={form} />
<Field forProperty={(t) => t.address.city} form={form} />
<Field forProperty={(t) => t.address.zip} form={form} />
</>
);
} +
+ + +

Validation uses @cleverbrush/schema validators. Errors are automatically propagated to the corresponding field state:

+
const SignupSchema = object({
username: string().addValidator(async (val) => {
if (val.length < 3) {
return {
valid: false,
errors: [{ message: 'Username must be at least 3 characters' }]
};
}
return { valid: true };
}),
email: string()
});

function SignupForm() {
const form = useSchemaForm(SignupSchema);

return (
<FormSystemProvider renderers={htmlRenderers}>
<Field forProperty={(t) => t.username} form={form} />
<Field forProperty={(t) => t.email} form={form} />
<button onClick={async () => {
const result = await form.submit();
if (result.valid) {
console.log('Success:', result.object);
}
}}>Submit</button>
</FormSystemProvider>
);
} +
+ + +
    +
  1. form.validate() or form.submit() runs the schema's full validation
  2. +
  3. Per-property errors are resolved via getErrorsFor() using PropertyDescriptors
  4. +
  5. Each field's error state is updated automatically
  6. +
  7. Renderers receive the error string and touched boolean to decide how/when to display errors
  8. +
+ +

Here's a complete, realistic example showing all pieces together — a registration form with nested address, custom validation, and MUI renderers:

+
import { object, string, number } from '@cleverbrush/schema';
import { useSchemaForm, FormSystemProvider, Field } from '@cleverbrush/react-form';
import { TextField } from '@mui/material';

// Schema — single source of truth for types, validation, and form fields
const RegistrationSchema = object({
name: string().required('Name is required').minLength(2, 'Too short'),
email: string().required('Email is required').matches(/^[^\s@]+@[^\s@]+\.[^\s@]+$/, 'Invalid email'),
age: number().required('Age is required').min(18, 'Must be 18+'),
address: object({
city: string().required('City is required'),
zip: string().required('ZIP is required').minLength(5, 'Invalid ZIP')
})
});

// Renderers — define once, reuse everywhere
const renderers = {
string: ({ value, onChange, onBlur, error, touched }) => (
<TextField
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
fullWidth
margin="normal"
/>
),
number: ({ value, onChange, onBlur, error, touched }) => (
<TextField
type="number"
value={value ?? ''}
onChange={(e) => onChange(Number(e.target.value))}
onBlur={onBlur}
error={touched && !!error}
helperText={touched ? error : undefined}
fullWidth
margin="normal"
/>
)
};

// Form component — just declare which fields to show
function RegistrationForm() {
const form = useSchemaForm(RegistrationSchema);

return (
<div>
<Field forProperty={(t) => t.name} form={form} />
<Field forProperty={(t) => t.email} form={form} />
<Field forProperty={(t) => t.age} form={form} />
<Field forProperty={(t) => t.address.city} form={form} />
<Field forProperty={(t) => t.address.zip} form={form} />
<button onClick={async () => {
const result = await form.submit();
if (result.valid) {
console.log('Registered:', result.object);
}
}}>Register</button>
</div>
);
}

// App — wrap with provider
function App() {
return (
<FormSystemProvider renderers={renderers}>
<RegistrationForm />
</FormSystemProvider>
);
} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExportTypeDescription
FormSystemProviderComponentGlobal renderer registry provider
FormProviderComponentForm context bridge for standalone useField
FieldComponentAuto-rendered field by schema type
useSchemaFormHookCreate a form instance from schema
useFieldHookContext-based field binding (use inside FormProvider)
useFormSystemHookAccess FormSystemProvider config
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
FieldRenderer(props: FieldRenderProps) => ReactNode
FieldRenderPropsProps passed to renderers: value, initialValue, dirty, touched, error, validating, onChange, onBlur, setValue, schema, variant?, label?, name?, fieldProps?
FormSystemConfig{ renderers?: Record<string, FieldRenderer> } — keys can be "type" or "type:variant"
FieldState{ value, initialValue, dirty, touched, error, validating }
UseFieldResultFieldState & { onChange, onBlur, setValue, schema }
UseSchemaFormOptions{ createMissingStructure?: boolean; validateOnMount?: boolean; validationDebounceMs?: number }
SchemaFormInstanceReturn type of useSchemaForm
FormSystemProviderPropsProps for FormSystemProvider
FormProviderPropsProps for FormProvider
FieldPropsProps for Field
+ +
    +
  • Linting: Biome — enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode — field selectors and form state are fully typed end-to-end
  • +
  • Unit tests: Vitest + Testing Library — covering form state management, validation, async validators, field rendering, and provider configuration
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Type Aliases

FieldProps
FieldRenderer
FieldRenderProps
FieldState
FormProviderProps
FormSystemConfig
FormSystemProviderProps
SchemaFormInstance
UseFieldResult
UseSchemaFormOptions

Functions

Field
FormProvider
FormSystemProvider
useField
useFormSystem
useSchemaForm
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_scheduler.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_scheduler.html new file mode 100644 index 00000000..83a3c0a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_scheduler.html @@ -0,0 +1,154 @@ +@cleverbrush/scheduler | Libraries

Module @cleverbrush/scheduler

@cleverbrush/scheduler

+ +

Coverage

+ +

A job scheduler for Node.js that runs tasks in worker threads on configurable schedules.

+ +
npm install @cleverbrush/scheduler
+
+ +

This library uses the Node.js worker_threads module. It is tested on Node.js v16+.

+ +
import { JobScheduler } from '@cleverbrush/scheduler';

const scheduler = new JobScheduler({
rootFolder: '/path/to/your/jobs'
});

scheduler.addJob({
id: 'my-job-1',
path: 'job1.js',
schedule: {
every: 'minute',
interval: 5
}
});

scheduler.addJob({
id: 'my-job-2',
path: 'job2.js',
schedule: {
every: 'week',
interval: 2,
dayOfWeek: [1, 3, 5],
hour: 9,
minute: 30
},
timeout: 1000 * 60 * 4,
maxRetries: 3
});

scheduler.start(); +
+ + + +

The main class for scheduling and running jobs. Extends EventEmitter.

+ +
const scheduler = new JobScheduler(props: JobSchedulerProps);
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDefaultDescription
rootFolderstringPath to the folder containing job files
defaultTimeZonestring'UTC'Timezone used for scheduling
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
start()Starts the scheduler
stop()Stops the scheduler
addJob(job)Adds a job to the scheduler
removeJob(jobId)Removes a job by ID
jobExists(jobId)Returns true if a job with the given ID exists
statusCurrent scheduler status: 'started' or 'stopped'
+ +
scheduler.on('job:start', ({ jobId, instanceId, startDate }) => {
console.log(`Job ${jobId} started`);
});

scheduler.on('job:end', ({ jobId, instanceId, startDate, endDate, stdout, stderr }) => {
console.log(`Job ${jobId} finished`);
});

scheduler.on('job:error', ({ jobId, instanceId, startDate, endDate, stdout, stderr }) => {
console.error(`Job ${jobId} failed`);
});

scheduler.on('job:timeout', ({ jobId, instanceId, startDate, endDate }) => {
console.warn(`Job ${jobId} timed out`);
});

scheduler.on('job:message', ({ jobId, instanceId, message }) => {
console.log(`Message from ${jobId}:`, message);
}); +
+ + +
scheduler.addJob({
id: 'unique-job-id',
path: 'relative/path/to/job.js',
schedule: { /* see Schedule Types */ },
timeout: 60000, // timeout in milliseconds
maxRetries: 3, // retry on failure
maxConsequentFails: 10, // disable after N consecutive failures
noConcurrentRuns: true, // prevent overlapping executions
props: { key: 'value' } // data passed to the worker
}); +
+ + +

All schedules share these optional properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
intervalnumberNumber of periods between repeats (1–356)
startsOnDateDo not start before this date
endsOnDateDo not repeat after this date
maxOccurencesnumberMaximum number of executions
skipFirstnumberSkip this many initial executions
+ +
{ every: 'minute', interval: 5 }
+
+ +

Runs every N minutes.

+ +
{ every: 'day', interval: 1, hour: 9, minute: 30 }
+
+ +

Runs every N days at the specified time.

+ +
{ every: 'week', interval: 2, dayOfWeek: [1, 3, 5], hour: 9, minute: 30 }
+
+ +

Runs every N weeks on the specified days (1 = Monday, 7 = Sunday).

+ +
{ every: 'month', interval: 1, day: 15, hour: 0, minute: 0 }
// or on the last day of the month:
{ every: 'month', interval: 1, day: 'last', hour: 0, minute: 0 } +
+ +

Runs every N months on the specified day (1–28 or 'last').

+ +
{ every: 'year', interval: 1, month: 6, day: 1, hour: 12, minute: 0 }
+
+ +

Runs every N years on the specified month (1–12) and day (1–28 or 'last').

+ +

BSD-3-Clause

+

Classes

JobScheduler
ScheduleCalculator

Type Aliases

TaskSchedule

Variables

Schemas
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.StandardJSONSchemaV1.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.StandardJSONSchemaV1.html new file mode 100644 index 00000000..1da8834d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.StandardJSONSchemaV1.html @@ -0,0 +1 @@ +StandardJSONSchemaV1 | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.StandardTypedV1.html new file mode 100644 index 00000000..391ea4c3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.StandardTypedV1.html @@ -0,0 +1 @@ +StandardTypedV1 | Libraries

Interfaces

Props
Types

Type Aliases

InferInput
InferOutput
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.html new file mode 100644 index 00000000..ffee9122 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema-json.html @@ -0,0 +1,335 @@ +@cleverbrush/schema-json | Libraries

Module @cleverbrush/schema-json

@cleverbrush/schema-json — Bidirectional JSON Schema interop for @cleverbrush/schema.

+
import { toJsonSchema, fromJsonSchema } from '@cleverbrush/schema-json';
import { object, string, number } from '@cleverbrush/schema';

// Schema → JSON Schema
const spec = toJsonSchema(object({ name: string(), age: number().optional() }));

// JSON Schema → Schema (use `as const` for type inference)
const schema = fromJsonSchema({ type: 'object', properties: { name: { type: 'string' } }, required: ['name'] } as const);
schema.parse({ name: 'Alice' }); // inferred as { name: string } +
+ +

@cleverbrush/schema-json

+ +

Coverage

+ +

Bidirectional JSON Schema (Draft 7 / 2020-12) interop for +@cleverbrush/schema.

+

Import a JSON Schema and get a fully-typed @cleverbrush/schema builder that +preserves every constraint. Or convert a builder back to a JSON Schema object +for use in OpenAPI specs, form generators, or any other JSON Schema consumer.

+ +
    +
  • Consuming external APIs — you have a JSON Schema from an OpenAPI spec or +a third-party service and want to validate incoming data with full TypeScript +type inference.
  • +
  • OpenAPI / JSON Schema round-trip — generate JSON Schemas from your +@cleverbrush/schema validators to embed in API specs.
  • +
  • Migrating from raw JSON Schema — convert an existing schema catalogue to +@cleverbrush/schema builders incrementally.
  • +
  • Code generation — introspect a JSON Schema at the type level via +JsonSchemaNodeToBuilder<S> without running any code.
  • +
+ +
npm install @cleverbrush/schema-json
+
+ +
+

Peer dependency: @cleverbrush/schema@^2.0.0 must already be installed.

+
+ +
import { fromJsonSchema, toJsonSchema } from '@cleverbrush/schema-json';
import { object, string, number } from '@cleverbrush/schema';

// ── JSON Schema → builder ──────────────────────────────────────────────────
const PersonSchema = fromJsonSchema({
type: 'object',
properties: {
name: { type: 'string', minLength: 1 },
email: { type: 'string', format: 'email' },
age: { type: 'integer', minimum: 0 },
},
required: ['name', 'email'],
} as const); // ← `as const` is required for precise type inference

const result = PersonSchema.parse({ name: 'Alice', email: 'alice@example.com', age: 30 });
// result.object is typed as { name: string; email: string; age?: number }

// ── Builder → JSON Schema ──────────────────────────────────────────────────
const ApiSchema = object({
id: string().uuid(),
title: string().minLength(1).maxLength(255),
score: number().min(0).max(100).optional(),
});

const spec = toJsonSchema(ApiSchema);
// {
// "$schema": "https://json-schema.org/draft/2020-12/schema",
// "type": "object",
// "properties": {
// "id": { "type": "string", "format": "uuid" },
// "title": { "type": "string", "minLength": 1, "maxLength": 255 },
// "score": { "type": "number" }
// },
// "required": ["id", "title"]
// } +
+ + + +

Converts a JSON Schema literal to a @cleverbrush/schema builder.

+
function fromJsonSchema<const S>(schema: S): JsonSchemaNodeToBuilder<S>
+
+ + + + + + + + + + + + + + + + +
ParameterTypeDescription
schemaJSON Schema literalPass with as const for precise TypeScript inference
+

Returns a @cleverbrush/schema builder (e.g. StringSchemaBuilder, +ObjectSchemaBuilder, UnionSchemaBuilder, etc.) whose static type mirrors the +JSON Schema structure.

+ +

Without as const, TypeScript widens string literals to string and object +shapes to Record<string, unknown>, so inference collapses to +SchemaBuilder<unknown>. Always annotate:

+
const S = { type: 'object', properties: { x: { type: 'number' } } } as const;
const schema = fromJsonSchema(S); // ObjectSchemaBuilder<{ x: NumberSchemaBuilder<...> }> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeywordBuilder equivalent
type: 'string'string()
type: 'number'number()
type: 'integer'number() with integer flag
type: 'boolean'boolean()
type: 'null'SchemaBuilder<null>
type: 'array' + itemsarray(itemBuilder)
type: 'object' + propertiesobject({ … })
required: […]required / optional per property
additionalProperties: true.acceptUnknownProps()
constliteral builder (.equals(...))
enumunion(…) of const builders
anyOfunion(…) of sub-builders
anyOf + discriminatorauto-emitted for discriminated union() branches (see below)
allOfintersection(...) — chains sub-schemas via the intersection() builder
minLength / maxLength.minLength() / .maxLength()
pattern.matches(regex) (invalid patterns silently ignored)
minimum / maximum.min() / .max()
exclusiveMinimum / exclusiveMaximumcustom validator (not round-trippable via toJsonSchema)
multipleOf.multipleOf()
minItems / maxItems.minLength() / .maxLength() on array
format: 'email'.email() extension
format: 'uuid'.uuid() extension
format: 'uri' or 'url'.url() extension
format: 'ipv4'.ip({ version: 'v4' })
format: 'ipv6'.ip({ version: 'v6' })
format: 'date-time'.matches(iso8601 regex)
readOnly: true.readonly()
description.describe(text)
+
+ +

Converts a @cleverbrush/schema builder to a JSON Schema object.

+
function toJsonSchema(
schema: SchemaBuilder<any, any, any>,
opts?: ToJsonSchemaOptions,
): Record<string, unknown> +
+ + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
schemaSchemaBuilderany builder from @cleverbrush/schema
optsToJsonSchemaOptionsoptional output configuration
+

Returns a plain JavaScript object that is safe to JSON.stringify.

+

Descriptions set via .describe(text) are emitted as the description field on the corresponding JSON Schema node (including nested object properties).

+

Examples set via .example(value) are emitted as the examples array on the corresponding JSON Schema node.

+ +

When a union() is a discriminated union — all branches are objects sharing a required property with unique literal values — toJsonSchema() automatically emits the discriminator keyword alongside anyOf:

+
const schema = union(
object({ type: string('cat'), name: string() })
).or(
object({ type: string('dog'), breed: string() })
);

toJsonSchema(schema, { $schema: false });
// {
// anyOf: [ { ... type: { const: 'cat' } ... }, { ... type: { const: 'dog' } ... } ],
// discriminator: { propertyName: 'type' }
// } +
+ +

When a nameResolver is provided and union branches resolve to $ref pointers, a mapping is also emitted:

+
// discriminator: { propertyName: 'type', mapping: { cat: '#/components/schemas/Cat', dog: '#/components/schemas/Dog' } }
+
+ +

This enables code-generation tools (openapi-generator, orval, etc.) to produce proper tagged union types.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
draft'2020-12' | '07''2020-12'JSON Schema draft version for the $schema URI
$schemabooleantrueWhether to include the $schema header in the output
nameResolver(schema: SchemaBuilder) => string | nullundefinedCalled for every node before conversion. Return a non-null string to emit { $ref: '#/components/schemas/<name>' } instead of an inline schema. Used by @cleverbrush/server-openapi to wire named schemas from .schemaName() into $ref pointers.
+
// Embed in OpenAPI (suppress the $schema header)
toJsonSchema(schema, { $schema: false });

// Use Draft 07
toJsonSchema(schema, { draft: '07' }); +
+ + +

toJsonSchema resolves lazy() schemas transparently. When the resolved schema +has a name returned by nameResolver, the output is a $ref pointer — which +is the key mechanism for breaking recursive cycles:

+
import { object, number, array, lazy } from '@cleverbrush/schema';
import { toJsonSchema } from '@cleverbrush/schema-json';

type TreeNode = { value: number; children: TreeNode[] };

const treeNode: ReturnType<typeof object> = object({
value: number(),
children: array(lazy(() => treeNode))
}).schemaName('TreeNode');

let rootSeen = false;
toJsonSchema(treeNode, {
$schema: false,
nameResolver: s => {
// Inline the root once (for the definition itself), then emit $ref
if (s === treeNode && !rootSeen) { rootSeen = true; return null; }
return (s.introspect() as any).schemaName ?? null;
}
});
// {
// type: 'object',
// properties: {
// value: { type: 'integer' },
// children: { type: 'array', items: { $ref: '#/components/schemas/TreeNode' } }
// },
// ...
// } +
+ +

When using @cleverbrush/server-openapi, this is handled automatically — call +.schemaName() on the root schema and generateOpenApiSpec will emit the +correct $ref pointers and component definition with no extra configuration.

+
+ + +

Recursively derives the TypeScript value type from a statically-known JSON +Schema. Useful when you want the type without calling fromJsonSchema at +runtime.

+
import type { InferFromJsonSchema } from '@cleverbrush/schema-json';

const S = {
type: 'object',
properties: {
id: { type: 'integer' },
label: { type: 'string' },
},
required: ['id'],
} as const;

type Item = InferFromJsonSchema<typeof S>;
// { id: number; label?: string } +
+ + +

Maps a statically-known JSON Schema literal to the @cleverbrush/schema +builder type — purely at the type level, no runtime code executed.

+
import type { JsonSchemaNodeToBuilder } from '@cleverbrush/schema-json';

const S = { type: 'string', format: 'email' } as const;
type B = JsonSchemaNodeToBuilder<typeof S>;
// StringSchemaBuilder<string, true> +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LimitationNotes
Custom validators (addValidator)Not representable in JSON Schema — omitted in toJsonSchema output, not recoverable by fromJsonSchema
Preprocessors (addPreprocessor)Same as above
$ref / $defsNot supported in fromJsonSchema
if / then / elseNot supported
notNot supported
Dual IP format (ip() with both v4 + v6)format is omitted in toJsonSchema output (no standard keyword covers both)
JSDoc comments on propertiesNot preserved in toJsonSchema output
nameResolver + $ref / $defs round-tripnameResolver emits $ref pointers based on external registry; fromJsonSchema does not resolve $ref references — they fall back to any()
+

Namespaces

StandardJSONSchemaV1
StandardTypedV1

Interfaces

StandardJSONSchemaV1
StandardTypedV1

Type Aliases

InferFromJsonSchema
JsonSchemaNode
JsonSchemaNodeToBuilder
ToJsonSchemaOptions

Functions

fromJsonSchema
toJsonSchema
withStandardJsonSchema
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.StandardSchemaV1.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.StandardSchemaV1.html new file mode 100644 index 00000000..f241808a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.StandardSchemaV1.html @@ -0,0 +1 @@ +StandardSchemaV1 | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.StandardTypedV1.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.StandardTypedV1.html new file mode 100644 index 00000000..ea6ef7d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.StandardTypedV1.html @@ -0,0 +1 @@ +StandardTypedV1 | Libraries

Namespace StandardTypedV1

Interfaces

Props
Types

Type Aliases

InferInput
InferOutput
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.html new file mode 100644 index 00000000..481afc80 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_schema.html @@ -0,0 +1,1034 @@ +@cleverbrush/schema | Libraries

Module @cleverbrush/schema

@cleverbrush/schema

+

CI +Standard Schema v1

+ +

Bundle size

+ +

License: BSD-3-Clause

+ +

Coverage

+ +

A schema definition and validation library for TypeScript — faster than Zod in 14/15 benchmarks (up to 204× faster on invalid input), 3× smaller than Zod v4, and compatible with 50+ ecosystem tools via Standard Schema v1.

+

Define a schema once and get TypeScript type inference, runtime validation, object mapping (@cleverbrush/mapper), auto-generated React forms (@cleverbrush/react-form), and bidirectional JSON Schema conversion (@cleverbrush/schema-json) — all from the same immutable, fluent API.

+ +

The problem: In a typical TypeScript project, types and runtime validation are separate concerns. You define a User type in one file, then write Joi / Yup / Zod schemas (or manual if checks) in another. Over time these drift apart — the type says a field is required, but the validation allows it to be undefined. Tests pass, but production data breaks because the validation didn't match the type.

+

The solution: @cleverbrush/schema lets you define a schema once and derive both the TypeScript type (via InferType) and runtime validation from the same source. Because every method returns a new builder instance (immutability), you can safely compose and extend schemas without accidentally mutating shared definitions.

+

What makes it different from Zod / Yup / Joi:

+
    +
  • PropertyDescriptors — a runtime descriptor tree that every tool in the ecosystem can introspect. The @cleverbrush/mapper uses it for type-safe property selectors. The @cleverbrush/react-form uses it to auto-generate form fields with correct validation. This makes the schema library a foundation for an entire ecosystem — not just a standalone validation tool. No other popular schema library exposes this level of runtime metadata.
  • +
  • Standard Schema v1 — the ['~standard'] getter is implemented on every builder. That means your schema works as-is with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, Elysia, next-safe-action, and every other Standard Schema consumer.
  • +
  • Extension system — add custom methods to any builder type (string, number, date, …) via defineExtension() + withExtensions(). Extensions are fully typed, chainable, composable, and appear in introspect(). No other popular schema library offers a comparable type-safe plugin system.
  • +
  • Built-in extension pack — common validators like email(), url(), uuid(), ip(), trim(), positive(), negative(), nonempty(), unique(), and more are included out of the box. The default import has them pre-applied; import from @cleverbrush/schema/core to get bare builders without extensions.
  • +
  • 14 KB gzipped (full) — 3× smaller than Zod v4 — sub-path imports (@cleverbrush/schema/string, /number, /object, /array) drop individual builders to ~4 KB.
  • +
  • First-class nullable support.nullable() and .notNullable() are native methods on every builder. The inferred type automatically includes or excludes null, and introspect() exposes isNullable for runtime metadata.
  • +
  • JSDoc comment preservation — JSDoc comments on schema properties carry through to the inferred TypeScript type, so IDE tooltips and autocomplete descriptions come from the schema definition itself.
  • +
  • Zero runtime dependencies.
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Feature@cleverbrush/schemaZodYupJoi
TypeScript type inference~
Standard Schema v1
PropertyDescriptors (runtime introspection)
Type-safe extension system
Built-in object mapper
Built-in form generation
Bidirectional JSON Schema~ (output only)
External schema interop (extern())
JSDoc preservation
Immutable schemas
Zero dependencies
Sync + async validation
Per-property error inspection~~~
Default values
Bundle size (full, gzipped)14 KB41 KB (v4)~19 KB~26 KB
+ +
npm install @cleverbrush/schema
+
+ + +

▶ Open in Playground

+
import {
object,
string,
number,
boolean,
InferType
} from '@cleverbrush/schema';

// 1. Define a schema with fluent constraints
const UserSchema = object({
name: string().nonempty('Name is required').minLength(2, 'Name must be at least 2 characters'),
email: string().email('Please enter a valid email'),
age: number().min(0, 'Age cannot be negative').max(150).positive(),
isActive: boolean()
});

// 2. TypeScript type is inferred automatically — no duplication!
type User = InferType<typeof UserSchema>;
// Equivalent to: { name: string; email: string; age: number; isActive: boolean }

// 3. Validate data at runtime — synchronous by default
const result = UserSchema.validate({
name: 'Alice',
email: 'alice@example.com',
age: 30,
isActive: true
});

// Or use validateAsync() when you have async validators/preprocessors
// const result = await UserSchema.validateAsync({ ... });

if (result.valid) {
console.log('Validated:', result.object); // typed as User
} else {
// For object schemas, prefer getErrorsFor() for per-property error inspection:
const nameErrors = result.getErrorsFor((p) => p.name);
console.log(nameErrors.isValid); // false
console.log(nameErrors.errors); // ['Name must be at least 2 characters']

// result.errors on object schemas is deprecated — use getErrorsFor() instead
console.log('Errors:', result.errors);
// Array of { message: string }
} +
+ +

Type inference works in plain JavaScript too, using JSDoc:

+
/**
* @type {import('@cleverbrush/schema').InferType<typeof UserSchema>}
*/
const user = {
// type is inferred as { name: string; email: string; age: number; isActive: boolean }
}; +
+ + +

▶ Open in Playground

+

The following builder functions are available:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionDescriptionKey Methods
any()Any value. Similar to TypeScript's any type..optional(), .nullable(), .notNullable(), .default(value), .addValidator(fn)
string()String value with constraints..minLength(n), .maxLength(n), .matches(re), .email(), .url(), .uuid(), .ip(), .trim(), .toLowerCase(), .nonempty(), .oneOf(...values), .nullable(), .notNullable(), .default(value)
number()Numeric value with constraints..min(n), .max(n), .integer(), .positive(), .negative(), .finite(), .multipleOf(n), .coerce(), .oneOf(...values), .nullable(), .notNullable(), .default(value)
boolean()Boolean value..coerce(), .optional(), .nullable(), .notNullable(), .default(value)
date()JavaScript Date instance..coerce(), .optional(), .nullable(), .notNullable(), .default(value)
func()Function value. Supports typed parameter and return-type schemas..addParameter(schema), .hasReturnType(schema), .optional(), .nullable(), .notNullable(), .default(value)
promise(schema?)JavaScript Promise. Optionally typed resolved value via promise(schema) or .hasResolvedType(schema)..hasResolvedType(schema), .optional(), .nullable(), .notNullable(), .default(value)
nul()Exactly null. Useful in nullable unions..optional(), .default(value)
object(props)Object with typed properties. Supports nesting..validate(data), .addProps({...}), .optional(), .nullable(), .notNullable(), .default(value)
array()Array with optional element schema (via .of())..minLength(n), .maxLength(n), .of(schema), .nonempty(), .unique(), .nullable(), .notNullable(), .default(value)
tuple([...schemas])Fixed-length array with per-position types. Each index validated against its own schema — mirrors TypeScript tuple types..rest(schema), .optional(), .nullable(), .notNullable(), .default(value)
record(keySchema, valSchema)Object with dynamic string keys. Every key must satisfy keySchema (a string schema) and every value must satisfy valSchema — mirrors TypeScript's Record<K, V>..optional(), .nullable(), .notNullable(), .default(value), .addValidator(fn)
union(schema)Union of schemas — e.g. string | number..or(schema), .validate(data), .optional(), .nullable(), .notNullable(), .default(value)
intersection(left, right)Intersection of two schemas — both must pass. Merges validated outputs. Use .acceptUnknownProps() on object schemas..optional(), .nullable(), .notNullable(), .default(value), .addValidator(fn)
enumOf(...values)String enum — sugar for string().oneOf(...)..optional(), .nullable(), .notNullable(), .default(value)
lazy(getter)Recursive/self-referential schema. The getter is called once and its result is cached. Enables tree structures, linked lists, and other recursive types..resolve(), .optional(), .addValidator(fn), .default(value)
generic(fn)Parameterized schema template. Call .apply(...schemas) with concrete schemas to obtain a fully typed concrete schema builder. TypeScript infers the result type from the template function's own generic signature. Optionally pass a defaults array as the first argument to enable direct validation without calling .apply()..apply(...schemas), .optional(), .nullable(), .default(value)
parseString(objectSchema, templateFn)Validates a string against a template pattern and parses it into a strongly-typed object. Property schemas handle their own coercion (e.g. number().coerce())..optional(), .nullable(), .default(value), .readonly(), .brand()
+ +

▶ Open in Playground

+

All schema builders are immutable. Every method call returns a new schema builder instance, so existing schemas are never modified:

+
const base = string().minLength(1);
const strict = base.maxLength(50); // new instance — base is unchanged
const loose = base.optional(); // another new instance

// base still only has minLength(1)
// strict has minLength(1) + maxLength(50)
// loose has minLength(1) + optional +
+ +

This is especially powerful when building a library of reusable schema fragments:

+
const Email = string().minLength(5).maxLength(255);
const Name = string().minLength(1).maxLength(100);

const CreateUser = object({ name: Name, email: Email });
const UpdateUser = object({ name: Name.optional(), email: Email.optional() });
// Both schemas share the same base constraints but differ in optionality +
+ + +

▶ Open in Playground

+

Schemas can be extended with additional properties, combined with unions, or nested inside arrays and objects:

+
import { object, string, number, array, union } from '@cleverbrush/schema';

// Extend an existing schema with new properties
const BaseEntity = object({
id: string(),
createdAt: string()
});

const UserEntity = BaseEntity.addProps({
name: string().minLength(2),
email: string().minLength(5)
});

// Nest objects inside arrays
const TeamSchema = object({
name: string().minLength(1),
members: array().of(UserEntity).minLength(1).maxLength(50)
});

// Union types
const IdOrEmail = union(string().minLength(1)).or(
string().matches(/^[^@]+@[^@]+$/)
);

// Intersection types — combine two schemas into one (both must pass)
import { intersection } from '@cleverbrush/schema';

const NameAndAge = intersection(
object({ name: string() }).acceptUnknownProps(),
object({ age: number() }).acceptUnknownProps()
);
const person = NameAndAge.parse({ name: 'Alice', age: 30 });
// typeof person === { name: string } & { age: number } +
+ + +

▶ Open in Playground

+

Use generic(fn) to create a reusable, parameterized schema template. The template function accepts one or more schema builders as arguments and returns a concrete schema. Call .apply(...schemas) to instantiate the template — TypeScript infers the resulting type automatically from the function's own generic signature.

+

Single type parameter — a paginated list that works for any element type:

+
import {
generic, object, array, number, string,
type SchemaBuilder, type InferType
} from '@cleverbrush/schema';

const PaginatedList = generic(
<T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
object({
items: array(itemSchema),
total: number(),
page: number(),
})
);

const PaginatedUsers = PaginatedList.apply(
object({ name: string(), age: number() })
);

type PaginatedUsersType = InferType<typeof PaginatedUsers>;
// → { items: { name: string; age: number }[]; total: number; page: number }

PaginatedUsers.validate({
items: [{ name: 'Alice', age: 30 }],
total: 1,
page: 1,
}); // { valid: true } +
+ +

Multiple type parameters — a Result / Either type:

+
import {
generic, object, boolean, string, number,
type SchemaBuilder, type InferType
} from '@cleverbrush/schema';

const Result = generic(
<
T extends SchemaBuilder<any, any, any, any, any>,
E extends SchemaBuilder<any, any, any, any, any>
>(
valueSchema: T,
errorSchema: E
) =>
object({
ok: boolean(),
value: valueSchema.optional(),
error: errorSchema.optional(),
})
);

const StringResult = Result.apply(string(), number());
// InferType → { ok: boolean; value?: string; error?: number }

StringResult.validate({ ok: true, value: 'hello' }); // valid
StringResult.validate({ ok: false, error: 404 }); // valid +
+ +

Default arguments — pass a defaults array as the first argument so the template can be validated directly without calling .apply() first:

+
import {
generic, object, array, number, any,
type SchemaBuilder
} from '@cleverbrush/schema';

const AnyList = generic(
[any()], // default for the single type parameter
<T extends SchemaBuilder<any, any, any, any, any>>(itemSchema: T) =>
object({ items: array(itemSchema), total: number() })
);

// Validate directly — uses the any() default
AnyList.validate({ items: [1, 'two', true], total: 3 }); // valid

// Or apply a stricter schema first
AnyList.apply(string()).validate({ items: ['a', 'b'], total: 2 }); // valid +
+ +
+

Tip: Each call to .apply() returns an independent schema builder. You can chain .optional(), .addValidator(), .default(value), and every other fluent method on the result.

+
+ +

▶ Open in Playground

+

Use func() to validate that a value is a function. Two fluent methods let you annotate the expected signature — the inferred TypeScript type reflects both the parameter types and the return type:

+
    +
  • .addParameter(schema) — appends a parameter schema. Each call extends the inferred tuple of parameter types. The schemas are accessible at runtime via introspect().parameters.
  • +
  • .hasReturnType(schema) — sets the return type schema. The inferred function type gains a concrete return type instead of any. Accessible via introspect().returnType.
  • +
+
import { func, string, number, boolean, InferType } from '@cleverbrush/schema';

// Plain function validator — accepts any () => any
const anyFn = func();
anyFn.validate(() => 42); // { valid: true }
anyFn.validate('not a fn'); // { valid: false }

// Typed parameter and return type
const greet = func()
.addParameter(string()) // first param: string
.addParameter(number().optional()) // second param: number | undefined
.hasReturnType(string()); // return type: string

// InferType preserves the declared parameter types and return type.
// Function schemas also remain compatible with callbacks of any arity.
type Greet = InferType<typeof greet>;
// → (param0: string, param1: number | undefined, ...args: any[]) => string

// Introspect at runtime
const info = greet.introspect();
// info.parameters → [StringSchemaBuilder, NumberSchemaBuilder]
// info.returnType → StringSchemaBuilder

// Optional function schemas infer a union with undefined
const optionalHandler = func()
.addParameter(string())
.addParameter(boolean())
.hasReturnType(boolean())
.optional();

type OptionalHandler = InferType<typeof optionalHandler>;
// → ((param0: string, param1: boolean, ...args: any[]) => boolean) | undefined +
+ + +

▶ Open in Playground

+

Use .addConstructor(funcSchema) on an object() schema to declare one or more constructor overloads. Each call appends a FunctionSchemaBuilder to an accumulated list; the inferred TypeScript type becomes an intersection of all construct signatures and the plain instance type.

+
    +
  • .addConstructor(funcSchema) — appends a constructor overload. Each call extends the inferred tuple of constructor schemas. Chainable.
  • +
  • .clearConstructors() — resets constructor schemas to an empty list, removing all construct signatures from the inferred type.
  • +
  • introspect().constructorSchemas — array of all accumulated constructor FunctionSchemaBuilder schemas.
  • +
+

Constructor signatures are type-only: runtime validate() continues to validate plain objects as before.

+
import { object, func, string, number, InferType } from '@cleverbrush/schema';

// Single constructor overload
const PersonSchema = object({ name: string(), age: number() })
.addConstructor(func().addParameter(string()));

type Person = InferType<typeof PersonSchema>;
// → { new(p0: string): { name: string; age: number } } & { name: string; age: number }

// Multiple chained constructors → overloaded construct signatures
const FlexPersonSchema = object({ name: string(), age: number() })
.addConstructor(func().addParameter(string()))
.addConstructor(func().addParameter(string()).addParameter(number()));

type FlexPerson = InferType<typeof FlexPersonSchema>;
// → { new(p0: string): { name: string; age: number } }
// & { new(p0: string, p1: number): { name: string; age: number } }
// & { name: string; age: number }

// Runtime validation is unchanged — plain objects still validate
FlexPersonSchema.validate({ name: 'Alice', age: 30 }); // { valid: true }

// Introspect constructor schemas at runtime
const { constructorSchemas } = FlexPersonSchema.introspect();
// constructorSchemas.length → 2

// Remove all constructor signatures
const PlainSchema = FlexPersonSchema.clearConstructors();
type Plain = InferType<typeof PlainSchema>;
// → { name: string; age: number } +
+ + +

▶ Open in Playground

+

Use promise() to validate that a value is a JavaScript Promise. Pass an optional schema to type the resolved value — the inferred TypeScript type becomes Promise<T>. You can also call .hasResolvedType(schema) on the returned builder to set or replace the resolved-value schema.

+
    +
  • promise(schema?) — factory shorthand. When schema is provided the inferred type is Promise<InferType<typeof schema>>.
  • +
  • .hasResolvedType(schema) — sets the resolved-value schema; replaces any previously set one. Accessible via introspect().resolvedType.
  • +
+
import { promise, string, number, InferType } from '@cleverbrush/schema';

// Untyped — validates that the value is any Promise
const anyPromise = promise();
anyPromise.validate(Promise.resolve(42)); // { valid: true }
anyPromise.validate('not a promise' as any); // { valid: false }

// Typed resolved value via factory argument
const stringPromise = promise(string());
type StringPromise = InferType<typeof stringPromise>;
// → Promise<string>

// Typed resolved value via fluent method
const numPromise = promise().hasResolvedType(number());
type NumPromise = InferType<typeof numPromise>;
// → Promise<number>

// Introspect at runtime
const info = numPromise.introspect();
// info.resolvedType → NumberSchemaBuilder

// Optional promise — undefined is also accepted
const optPromise = promise(string()).optional();
type OptPromise = InferType<typeof optPromise>;
// → Promise<string> | undefined

optPromise.validate(undefined as any); // { valid: true } +
+ + +

▶ Open in Playground

+

Use record(keySchema, valueSchema) to validate objects with dynamic string keys — lookup tables, i18n bundles, caches, or any Record<string, V> shape. Unlike object(), which requires a fixed set of known property names, record() validates objects whose keys are not known at schema-definition time.

+

Both the key and the value schema are enforced at runtime, and the inferred TypeScript type mirrors Record<K, V>.

+
import { record, string, number, object, InferType } from '@cleverbrush/schema';

// ── Basic: string keys → number values ──────────────────────────────────────
const scores = record(string(), number().min(0).max(100));
// InferType<typeof scores> → Record<string, number>

scores.validate({ alice: 95, bob: 87 }); // { valid: true }
scores.validate({ alice: 95, bob: -1 }); // { valid: false } — negative score

// ── Key constraint — only locale-style keys allowed ──────────────────────────
const i18n = record(
string().matches(/^[a-z]{2}(-[A-Z]{2})?$/),
string().nonempty()
);

i18n.validate({ en: 'Hello', 'fr-FR': 'Bonjour' }); // { valid: true }
i18n.validate({ '123': 'oops' }); // { valid: false } — bad key

// ── Nested: values are objects ───────────────────────────────────────────────
const userMap = record(
string(),
object({ name: string(), age: number() })
);
// InferType<typeof userMap> → Record<string, { name: string; age: number }>

// ── Optional with factory default ────────────────────────────────────────────
const cache = record(string(), number()).optional().default(() => ({}));

// ── getErrorsFor(key) — rich per-key result with descriptor ────────────────────
const schema = record(string(), number().min(0));
const result = schema.validate(
{ a: 1, b: -2, c: -3 },
{ doNotStopOnFirstError: true }
);

if (!result.valid) {
// Root-level errors (e.g. 'object expected')
const root = result.getErrorsFor();
console.log(root.isValid); // false if the container itself is invalid

// Per-key errors
const bResult = result.getErrorsFor('b');
console.log(bResult.isValid); // false
console.log(bResult.errors[0]); // 'the value must be >= 0'
console.log(bResult.seenValue); // -2

// Descriptor: read/write the entry on the original object
const descriptor = bResult.descriptor;
console.log(descriptor.key); // 'b'
descriptor.getSchema(); // → NumberSchemaBuilder
descriptor.getValue(result.object); // → { success: true, value: -2 }
descriptor.setValue(result.object, 0); // fixes the value in-place
} +
+ + +

▶ Open in Playground

+

Use parseString(objectSchema, templateFn) to validate a string against a template pattern and parse it into a strongly-typed object. The template expression uses a tagged-template syntax with type-safe property selectors — you get full IntelliSense in the selector lambdas.

+
import { parseString, object, string, number, type InferType } from '@cleverbrush/schema';

const RouteSchema = parseString(
object({ userId: string().uuid(), id: number().coerce() }),
$t => $t`/orders/${t => t.id}/${t => t.userId}`
);

type Route = InferType<typeof RouteSchema>;
// { userId: string; id: number }

const result = RouteSchema.validate('/orders/42/550e8400-e29b-41d4-a716-446655440000');
// result.valid === true
// result.object === { id: 42, userId: '550e8400-...' } +
+ +

Nested objects — navigate deep properties via t => t.parent.child:

+
const schema = parseString(
object({
order: object({ id: number().coerce() }),
user: object({ name: string() })
}),
$t => $t`/orders/${t => t.order.id}/by/${t => t.user.name}`
);
// InferType → { order: { id: number }; user: { name: string } }

schema.validate('/orders/42/by/Alice');
// { valid: true, object: { order: { id: 42 }, user: { name: 'Alice' } } } +
+ +

Coercion is the property schema's responsibility — the builder passes the raw captured substring directly to each property schema's validate(). Use .coerce() on number(), boolean(), or date() to convert from strings:

+
const LogEntry = parseString(
object({
level: string(),
ts: date().coerce(),
message: string()
}),
$t => $t`[${t => t.level}] ${t => t.ts} ${t => t.message}`
); +
+ +

Error messages include the property path for easy debugging:

+
const result = RouteSchema.validate('/orders/abc/bad-uuid');
// result.errors[0].message → "id: expected an integer number" +
+ +

Raw template access — the original {Property} pattern is exposed via the .template getter. This enables consumers to use a parse-string schema as a Serilog-style message template (used by @cleverbrush/log for typed log events):

+
const TodoCreated = parseString(
object({ TodoId: number(), Title: string(), UserId: string() }),
$t => $t`Todo #${t => t.TodoId} "${t => t.Title}" created by ${t => t.UserId}`
);

TodoCreated.template;
// → 'Todo #{TodoId} "{Title}" created by {UserId}' +
+ + +

The number(), boolean(), and date() builders each have a .coerce() method that adds a preprocessor to convert string values to the target type. This is especially useful with parse-string schemas where captured segments are always strings, but also works standalone for URL parameters, form inputs, or any other string source.

+
import { number, boolean, date } from '@cleverbrush/schema';

// number().coerce() — uses Number(value)
number().coerce().validate('42'); // { valid: true, object: 42 }
number().coerce().validate('hello'); // { valid: false } — NaN fails

// boolean().coerce() — "true" → true, "false" → false
boolean().coerce().validate('true'); // { valid: true, object: true }
boolean().coerce().validate('yes'); // { valid: false } — unrecognized

// date().coerce() — new Date(value) if valid
date().coerce().validate('2024-01-15'); // { valid: true, object: Date }
date().coerce().validate('nope'); // { valid: false } — invalid date +
+ +

Non-string values pass through unchanged, so .coerce() is safe to chain even when the input might already be the correct type. All three methods return a new immutable schema instance.

+ +

▶ Open in Playground

+

Use lazy(() => schema) to define recursive or self-referential schemas — tree structures, comment threads, nested menus, org charts, and any other type that refers to itself.

+

The getter function is called once on first validation, and the resolved schema is cached. Every subsequent call reuses the cache.

+
+

TypeScript limitation: TypeScript cannot infer recursive types automatically. You must provide an explicit type annotation on the variable holding the schema.

+
+
import {
object,
string,
number,
array,
lazy,
type SchemaBuilder
} from '@cleverbrush/schema';

// ── Tree structure ───────────────────────────────────────────────
type TreeNode = { value: number; children: TreeNode[] };

// Explicit annotation required — TypeScript can't infer recursive types
const treeNode: SchemaBuilder<TreeNode, true> = object({
value: number(),
children: array(lazy(() => treeNode))
});

treeNode.validate({
value: 1,
children: [
{ value: 2, children: [] },
{ value: 3, children: [{ value: 4, children: [] }] }
]
});
// { valid: true, object: { value: 1, children: [...] } }

// ── Comment thread ───────────────────────────────────────────────
type Comment = { text: string; replies: Comment[] };

const commentSchema: SchemaBuilder<Comment, true> = object({
text: string(),
replies: array(lazy(() => commentSchema))
});

// ── Navigation menu with optional sub-levels ─────────────────────
type MenuItem = { label: string; submenu?: MenuItem[] };

const menuItem: SchemaBuilder<MenuItem, true> = object({
label: string(),
submenu: array(lazy(() => menuItem)).optional()
}); +
+ +

lazy() is fully compatible with .optional(), .addPreprocessor(), .addValidator(), and all other fluent methods. The wrapper's own preprocessors and validators run before delegating to the resolved schema.

+
// Preprocessors and validators work on the lazy wrapper itself
const schema = lazy(() => string())
.addPreprocessor((v) => (typeof v === 'number' ? String(v) : v))
.addValidator((v) => ({ valid: v !== 'forbidden' })); +
+ + +

▶ Open in Playground

+

Some libraries ship a dedicated .discriminator() API for tagged unions. With @cleverbrush/schema you don't need one — union() combined with string-literal schemas gives you the same pattern naturally, with full type inference.

+

Use string('literal') for the discriminator field. Each branch of the union gets its own object schema whose discriminator can only match one exact value. TypeScript narrows the inferred type automatically:

+
import { object, string, number, union, type InferType } from '@cleverbrush/schema';

// Each variant has a literal "type" field acting as the discriminator
const Circle = object({
type: string('circle'),
radius: number().min(0)
});

const Rectangle = object({
type: string('rectangle'),
width: number().min(0),
height: number().min(0)
});

const Triangle = object({
type: string('triangle'),
base: number().min(0),
height: number().min(0)
});

// Combine with union() — no special .discriminator() call needed
const ShapeSchema = union(Circle).or(Rectangle).or(Triangle);

type Shape = InferType<typeof ShapeSchema>;
// Shape is automatically:
// | { type: 'circle'; radius: number }
// | { type: 'rectangle'; width: number; height: number }
// | { type: 'triangle'; base: number; height: number }

// Validation picks the matching branch by the literal field
const result = ShapeSchema.validate({ type: 'circle', radius: 5 }); +
+ + +

The @cleverbrush/scheduler library uses this exact pattern to validate job schedules. The every field acts as the discriminator, and each variant adds its own set of allowed properties:

+
import { object, string, number, array, date, union, type InferType } from '@cleverbrush/schema';

// Shared base with common schedule fields
const ScheduleBase = object({
interval: number().min(1).max(356),
hour: number().min(0).max(23).optional(),
minute: number().min(0).max(59).optional(),
startsOn: date().acceptJsonString().optional(),
endsOn: date().acceptJsonString().optional()
});

// Minute schedule — omit hour/minute (they don't apply)
const EveryMinute = ScheduleBase
.omit('hour').omit('minute')
.addProps({ every: string('minute') });

// Day schedule
const EveryDay = ScheduleBase
.addProps({ every: string('day') });

// Week schedule — adds dayOfWeek array
const EveryWeek = ScheduleBase.addProps({
every: string('week'),
dayOfWeek: array().of(number().min(1).max(7)).minLength(1).maxLength(7)
});

// Month schedule — adds day (number or 'last')
const EveryMonth = ScheduleBase.addProps({
every: string('month'),
day: union(string('last')).or(number().min(1).max(28))
});

// Combine all variants in a single union
const ScheduleSchema = union(EveryMinute)
.or(EveryDay)
.or(EveryWeek)
.or(EveryMonth);

type Schedule = InferType<typeof ScheduleSchema>;
// TypeScript infers a proper discriminated union on "every" +
+ +

Because each branch uses a string literal (string('minute'), string('day'), etc.) for the every field, TypeScript can narrow the full union based on that single property — exactly like zod's z.discriminatedUnion(), but without any extra API surface.

+ +

When you define an object schema, JSDoc comments on properties are preserved in the inferred TypeScript type. This means your IDE tooltips, hover documentation, and autocomplete descriptions all carry through from the schema definition — no need to maintain separate documentation:

+
const UserSchema = object({
/** Full display name of the user */
name: string().minLength(1).maxLength(200),
/** Contact email — must be unique across all users */
email: string().minLength(5),
/** Age in years. Must be a positive integer. */
age: number().min(0).max(150)
});

type User = InferType<typeof UserSchema>;
// Hovering over User.name in your IDE shows:
// "Full display name of the user"
// Hovering over User.email shows:
// "Contact email — must be unique across all users" +
+ + +

▶ Open in Playground

+

.deepPartial() recursively marks all properties at every nesting level as optional. It is the deep-object equivalent of a common DeepPartial<T> helper type in TypeScript, and is the recommended way to build PATCH API bodies or partial form state.

+ + + + + + + + + + + + + + + + + + + + + +
Schema typeEffect
object(…).deepPartial()All top-level and nested object properties become optional
Nested object(…) inside an objectRecursed — its properties are made optional too
array(…), union(…), primitivesThe property itself is made optional; internals are not modified
+
import { object, string, number, array, type InferType } from '@cleverbrush/schema';

const CreateUser = object({
name: string(),
address: object({
street: string(),
city: string()
})
});

const PatchUser = CreateUser.deepPartial();

type PatchUserPayload = InferType<typeof PatchUser>;
// {
// name?: string;
// address?: { street?: string; city?: string };
// }

// All three are valid:
PatchUser.validate({}); // { valid: true }
PatchUser.validate({ address: {} }); // { valid: true }
PatchUser.validate({ address: { city: 'Paris' } }); // { valid: true } +
+ +

Contrast with .partial(), which only affects the top level:

+
const ShallowPartial = CreateUser.partial();
// { name?: string; address?: { street: string; city: string } }
// ↑ still required inside

ShallowPartial.validate({ address: {} });
// { valid: false } — street and city are still required +
+ +

Chains naturally with other modifiers:

+
const Schema = CreateUser.deepPartial().readonly();
type T = InferType<typeof Schema>;
// Readonly<{ name?: string; address?: { street?: string; city?: string } }> +
+ +
+

Note: .deepPartial() recurses only into nested object() schemas. Array element schemas and union option schemas are not modified — array(object({…})) becomes an optional array but its element shape is unchanged. If you need deep-partialed array elements, apply .deepPartial() to the element schema before passing it to array():

+
array(InnerSchema.deepPartial()).optional()
+
+ +
+ +

▶ Open in Playground

+

Every schema builder has two validation methods:

+
    +
  • validate(data) — synchronous. Returns a ValidationResult directly. Throws if any preprocessor, validator, or error message provider returns a Promise.
  • +
  • validateAsync(data) — asynchronous. Returns a Promise<ValidationResult>. Supports async preprocessors, validators, and error message providers.
  • +
+

Use validate() by default for the best performance. Switch to validateAsync() only when your schema includes async operations (e.g. database lookups, API calls in validators).

+
// Synchronous validation (default — use when all validators are sync)
const result = UserSchema.validate(someObject);

if (result.valid) {
console.log(result.object); // typed as InferType<typeof UserSchema>
} else {
// For object schemas, prefer getErrorsFor() for per-property error inspection (see below)
console.log(result.errors); // deprecated for object schemas — Array of { message: string }
}

// Async validation (use when validators/preprocessors are async)
const asyncResult = await UserSchema.validateAsync(someObject); +
+ + +

By default, validation stops at the first error. Pass { doNotStopOnFirstError: true } to collect all errors at once:

+
const result = UserSchema.validate(
{ name: 'A', email: '', age: -5, isActive: true },
{ doNotStopOnFirstError: true }
);

console.log(result.errors);
// [
// { message: 'Name must be at least 2 characters' },
// { message: 'Please enter a valid email' },
// { message: 'Age cannot be negative' }
// ] +
+ + +

▶ Open in Playground

+

Every constraint accepts an optional error message — either a plain string or a function:

+
const Name = string()
.minLength(2, 'Name is too short')
.maxLength(50, (seen) => `"${seen}" exceeds 50 characters`);

const Age = number()
.min(0, 'Age cannot be negative')
.max(150, 'Age seems unrealistic'); +
+ + +

▶ Open in Playground

+

Add custom synchronous or asynchronous validators to any schema:

+
const EmailSchema = string()
.minLength(5, 'Email is too short')
.addValidator(async (value) => {
if (value === 'taken@example.com') {
return {
valid: false,
errors: [{ message: 'This email is already registered' }]
};
}
return { valid: true };
}); +
+ +

Object-level validators can validate cross-field constraints:

+
const SignupSchema = object({
password: string().minLength(8),
confirmPassword: string().minLength(8)
}).addValidator(async (value) => {
if (value.password !== value.confirmPassword) {
return {
valid: false,
errors: [{ message: 'Passwords do not match' }]
};
}
return { valid: true };
}); +
+ + +

By default, errors returned from object-level validators are attached to the root object. You can target an error to a specific property by providing a property selector — the same selector used by getErrorsFor() and react-form's forProperty:

+
const SignupSchema = object({
password: string().minLength(8),
confirmPassword: string().minLength(8)
}).addValidator((value) => {
if (value.password !== value.confirmPassword) {
return {
valid: false,
errors: [{
message: 'Passwords do not match',
property: (t) => t.confirmPassword
}]
};
}
return { valid: true };
});

const result = SignupSchema.validate(
{ password: 'secret1', confirmPassword: 'secret2' },
{ doNotStopOnFirstError: true }
);

// Error is routed to confirmPassword:
result.getErrorsFor((t) => t.confirmPassword).errors;
// → ['Passwords do not match']

// Other properties are unaffected:
result.getErrorsFor((t) => t.password).errors;
// → [] +
+ +

You can target multiple properties from a single validator by returning multiple errors with different property selectors. Errors without a property selector are attached to the root object as before.

+ +

ObjectSchemaBuilder.validate() returns an extended result with a getErrorsFor() method for inspecting errors on individual properties — perfect for showing inline form errors. This is the recommended way to inspect validation errors on object schemas and replaces the deprecated errors array on ObjectSchemaValidationResult:

+
const PersonSchema = object({
name: string().minLength(1),
address: object({
city: string(),
zip: number()
})
});

const result = PersonSchema.validate(person, {
doNotStopOnFirstError: true
});

if (!result.valid) {
// Get errors for a single property
const nameErrors = result.getErrorsFor((p) => p.name);
console.log(nameErrors.isValid); // false
console.log(nameErrors.errors); // ['must be at least 1 character']
console.log(nameErrors.seenValue); // the value that was validated

// Works with nested properties too
const cityErrors = result.getErrorsFor((p) => p.address.city);
console.log(cityErrors.errors);
} +
+ + +

PropertyDescriptors are a runtime metadata tree attached to each property in an object schema. They provide type-safe access to property values, schema builders, and parent descriptors. This is what makes the entire Cleverbrush ecosystem work:

+
    +
  • @cleverbrush/mapper uses them as selectors (like C# expression trees) to point at source and target properties type-safely.
  • +
  • @cleverbrush/react-form uses them to bind form fields to schema properties and read their validation constraints automatically.
  • +
+
import {
object,
string,
number,
ObjectSchemaBuilder
} from '@cleverbrush/schema';

const UserSchema = object({
name: string().minLength(2),
address: object({
city: string(),
zip: number()
})
});

// Get the PropertyDescriptor tree
const tree = ObjectSchemaBuilder.getPropertiesFor(UserSchema);

// Use descriptors as selectors in mapper and react-form:
// mapper: .for((t) => t.name).from((s) => s.name)
// react-form: <Field selector={(t) => t.address.city} form={form} /> +
+ + +

Every schema builder supports .default(value). When the input is undefined, the default value is used instead — and the result is still validated against the schema's constraints.

+
import { string, number, array, object, InferType } from '@cleverbrush/schema';

// Static default
const Name = string().default('Anonymous');
Name.validate(undefined); // { valid: true, object: 'Anonymous' }
Name.validate('Alice'); // { valid: true, object: 'Alice' }

// Factory function — useful for mutable defaults
const Tags = array(string()).default(() => []);

// Works with .optional() — removes undefined from the type
const Port = number().optional().default(3000);
type Port = InferType<typeof Port>; // number (not number | undefined) +
+ +

Use a factory function for mutable values (arrays, objects) to avoid shared references:

+
const Config = object({
host: string().default('localhost'),
port: number().default(8080),
tags: array(string()).default(() => [])
});

type Config = InferType<typeof Config>;
// { host: string; port: number; tags: string[] }
// All fields are non-optional — defaults fill in missing values +
+ +

Default values are exposed via .introspect():

+
const schema = string().default('hello');
const info = schema.introspect();
console.log(info.hasDefault); // true
console.log(info.defaultValue); // 'hello' +
+ + +

Attach example values to any schema with .example(value). The example is typed to the schema's result type, so the compiler catches mismatches. Examples are purely metadata — validation is unaffected.

+
import { string, number, object } from '@cleverbrush/schema';

const Email = string().example('user@example.com');
const Age = number().example(30);

const User = object({
email: Email,
age: Age,
}).example({ email: 'alice@example.com', age: 25 }); +
+ +

Examples are exposed via .introspect() and consumed by @cleverbrush/schema-json (emitted as the JSON Schema examples keyword) and @cleverbrush/server-openapi (pre-fills parameter and response schemas in generated specs).

+
Email.introspect().example; // 'user@example.com'
+
+ + +

Every schema builder supports .catch(value). When validation fails for any reason — wrong type, constraint violation, missing required value — the fallback is returned as a successful result instead of errors.

+

Unlike .default(), which only fires when the input is undefined, .catch() fires on any validation failure.

+
import { string, number, array, object } from '@cleverbrush/schema';

// Static fallback
const Name = string().catch('unknown');
Name.validate(42); // { valid: true, object: 'unknown' }
Name.validate(null); // { valid: true, object: 'unknown' }
Name.validate('Alice'); // { valid: true, object: 'Alice' }

// Constraint violation also triggers catch
const Age = number().min(0).catch(-1);
Age.validate(-5); // { valid: true, object: -1 }

// .parse() and .parseAsync() never throw when .catch() is set
Name.parse(42); // 'unknown' (no SchemaValidationError thrown) +
+ +

Use a factory function for mutable fallback values to avoid shared references:

+
const Tags = array(string()).catch(() => []);

const r1 = Tags.validate(null); // { valid: true, object: [] }
const r2 = Tags.validate(null); // { valid: true, object: [] }
// r1.object !== r2.object — separate array instances each time +
+ +

The fallback state is exposed via .introspect():

+
const schema = string().catch('unknown');
const info = schema.introspect();
console.log(info.hasCatch); // true
console.log(info.catchValue); // 'unknown' +
+ + +

Every schema builder supports .readonly(). This is a type-level-only modifier — it marks the inferred TypeScript type as immutable, but does not alter validation behaviour or freeze the validated value at runtime.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BuilderEffect on InferType<T>
object(…).readonly()Readonly<{ … }> — all top-level properties become readonly
array(…).readonly()ReadonlyArray<T> — no push, pop, etc. at the type level
string().readonly()string (identity — primitives are already immutable)
number().readonly()number (identity)
boolean().readonly()boolean (identity)
date().readonly()Readonly<Date>
+
import { object, array, string, number, InferType } from '@cleverbrush/schema';

// Readonly object
const UserSchema = object({ name: string(), age: number() }).readonly();
type User = InferType<typeof UserSchema>;
// Readonly<{ name: string; age: number }>

// Readonly array
const TagsSchema = array(string()).readonly();
type Tags = InferType<typeof TagsSchema>;
// ReadonlyArray<string>

// Validation behaviour is unchanged
const result = UserSchema.validate({ name: 'Alice', age: 30 });
// { valid: true, object: { name: 'Alice', age: 30 } } +
+ +

Chains naturally with .optional() and .default():

+
const Schema = object({ id: number() }).readonly().optional();
type T = InferType<typeof Schema>;
// Readonly<{ id: number }> | undefined +
+ +

The isReadonly flag is exposed via .introspect() for tooling:

+
const schema = object({ name: string() }).readonly();
console.log(schema.introspect().isReadonly); // true +
+ +
+

Note: .readonly() is shallow — only top-level object properties or the array itself are marked readonly. For deeply nested immutability consider applying .readonly() at each level, or use a DeepReadonly utility type post-validation.

+
+ +

Every schema builder supports .schemaName(name). This is a metadata-only modifier — it attaches a component name to the schema for use by OpenAPI tooling. It has no effect on validation or type inference.

+
import { object, string, number } from '@cleverbrush/schema';

export const UserSchema = object({
id: number(),
name: string(),
}).schemaName('User');

// Accessible at runtime
UserSchema.introspect().schemaName; // 'User' +
+ +

Chains naturally with all other modifiers:

+
const ProductSchema = object({
sku: string().nonempty(),
price: number().min(0),
})
.schemaName('Product')
.describe('A product in the catalogue'); +
+ +

When used with @cleverbrush/server-openapi, any schema that carries a schemaName is automatically extracted into components/schemas and all usages in the document are replaced with $ref pointers — eliminating repeated inline definitions:

+
import { generateOpenApiSpec } from '@cleverbrush/server-openapi';

// UserSchema is emitted once under components.schemas.User
// Every endpoint that references it gets: { $ref: '#/components/schemas/User' }
generateOpenApiSpec({ registrations, info: { title: 'My API', version: '1.0.0' } }); +
+ +
+

Name uniqueness: Registering two different schema instances under the same name throws an error. Always export named schemas as constants and reuse the same reference everywhere.

+
+ + + + + + + + + + + + + + + + + + + + +
Method / PropertySignatureNotes
.schemaName(name)schemaName(name: string): thisReturns a new builder; original is unchanged
.introspect().schemaNamestring | undefinedThe name passed to .schemaName(), or undefined
+ +

Every schema builder supports .describe(text). This is a metadata-only modifier — it stores a human-readable description on the schema at runtime with no effect on validation.

+
const UserSchema = object({
name: string().describe("The user's full name"),
age: number().optional().describe('Age in years'),
}).describe('A user object');

// Read the description back at runtime
UserSchema.introspect().description; // 'A user object' +
+ +

The description is accessible via .introspect().description and chains naturally with all other modifiers:

+
string().describe('A name').optional().readonly()
// ^ InferType is string | undefined, isReadonly: true, description: 'A name' +
+ +

When using @cleverbrush/schema-json, descriptions round-trip through JSON Schema's standard description field:

+
import { toJsonSchema, fromJsonSchema } from '@cleverbrush/schema-json';

const spec = toJsonSchema(string().describe('A name'), { $schema: false });
// { type: 'string', description: 'A name' }

const schema = fromJsonSchema({ type: 'string', description: 'A name' } as const);
schema.introspect().description; // 'A name' +
+ + +

▶ Open in Playground

+

The extension system lets you add custom methods to any schema builder type without modifying the core library. Define an extension once, apply it with withExtensions(), and every builder produced by the returned factories includes your new methods — fully typed and chainable.

+ +

Use defineExtension() to declare which builder types your extension targets and what methods it adds. Extension methods receive this bound to the builder instance and must return a builder to support fluent chaining:

+
import {
defineExtension,
withExtensions,
StringSchemaBuilder,
NumberSchemaBuilder,
DateSchemaBuilder
} from '@cleverbrush/schema';

// Email extension — adds .email() to string builders
const emailExt = defineExtension({
string: {
email(this: StringSchemaBuilder) {
return this.addValidator((val) => {
const valid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val as string);
return {
valid,
errors: valid
? []
: [{ message: 'Invalid email address' }]
};
});
}
}
});

// Port extension — adds .port() to number builders
const portExt = defineExtension({
number: {
port(this: NumberSchemaBuilder) {
return this.isInteger().min(1).max(65535);
}
}
});

// Slug extension — adds .slug() to string builders
const slugExt = defineExtension({
string: {
slug(this: StringSchemaBuilder) {
return this.addValidator((val) => {
const valid = /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(val as string);
return {
valid,
errors: valid
? []
: [{ message: 'Must be a valid URL slug' }]
};
});
}
}
}); +
+ + +

Pass one or more extension descriptors to withExtensions() to get augmented factory functions. All original builder methods remain available and fully chainable alongside the new ones:

+
const s = withExtensions(emailExt, portExt, slugExt);

// .email() and .slug() are now available on string builders
const EmailSchema = s.string().email().minLength(5);
const SlugSchema = s.string().slug().minLength(1).maxLength(200);

// .port() is now available on number builders
const PortSchema = s.number().port();

// Use in object schemas — just like normal builders
const ServerConfig = s.object({
adminEmail: s.string().email(),
port: s.number().port(),
slug: s.string().slug(),
name: s.string().minLength(1)
});

// Validate as usual
const result = ServerConfig.validate({
adminEmail: 'admin@example.com',
port: 8080,
slug: 'my-server',
name: 'Production'
}); +
+ + +

A single extension can target multiple builder types:

+
const timestampsExt = defineExtension({
string: {
/** Marks this string property as an ISO timestamp */
isoTimestamp(this: StringSchemaBuilder) {
return this.addValidator((val) => {
const valid = !isNaN(Date.parse(val as string));
return {
valid,
errors: valid
? []
: [{ message: 'Must be a valid ISO timestamp' }]
};
});
}
},
date: {
/** Adds a validator that rejects dates in the future */
pastOnly(this: DateSchemaBuilder) {
return this.addValidator((val) => {
const valid = (val as Date) <= new Date();
return {
valid,
errors: valid ? [] : [{ message: 'Date must be in the past' }]
};
});
}
}
}); +
+ + +

Extension methods automatically record metadata that can be inspected at runtime via .introspect().extensions. The system auto-infers the metadata value based on the arguments passed to the extension method:

+
    +
  • Zero-arg methods → metadata value is true
  • +
  • Single-arg methods → metadata value is the argument itself
  • +
  • Multi-arg methods → metadata value is the arguments array
  • +
+
const s = withExtensions(emailExt, portExt);

// Zero-arg method — metadata is `true`
const emailSchema = s.string().email();
console.log(emailSchema.introspect().extensions.email); // true

// Single-arg method — metadata is the argument
const rangeExt = defineExtension({
number: {
percentage(this: NumberSchemaBuilder) {
return this.min(0).max(100);
}
}
});
const s2 = withExtensions(rangeExt);
const pctSchema = s2.number().percentage();
console.log(pctSchema.introspect().extensions.percentage); // true

// Multi-arg method — metadata is the arguments array
const rangeExt2 = defineExtension({
number: {
range(this: NumberSchemaBuilder, min: number, max: number) {
return this.min(min).max(max);
}
}
});
const s3 = withExtensions(rangeExt2);
const rangeSchema = s3.number().range(0, 100);
console.log(rangeSchema.introspect().extensions.range); // [0, 100] +
+ + +

If you need structured metadata (e.g. an object with named fields rather than the raw arguments), call this.withExtension(key, value) explicitly inside the method. The auto-infer logic detects the existing key and skips automatic attachment:

+
const currencyExt = defineExtension({
number: {
currency(this: NumberSchemaBuilder, opts?: { maxDecimals?: number }) {
const maxDec = opts?.maxDecimals ?? 2;
// Explicit withExtension() call — auto-infer is skipped
return this
.withExtension('currency', { maxDecimals: maxDec })
.min(0)
.addValidator((val) => {
const decimals = (String(val).split('.')[1] ?? '').length;
const valid = decimals <= maxDec;
return {
valid,
errors: valid
? []
: [{ message: `Max ${maxDec} decimal places` }]
};
});
}
}
});

const s = withExtensions(currencyExt);
const priceSchema = s.number().currency({ maxDecimals: 4 });
console.log(priceSchema.introspect().extensions.currency);
// { maxDecimals: 4 } — structured metadata, not the raw args +
+ + +

Multiple extensions can be stacked — their methods are merged per builder type. A runtime error is thrown if two extensions define the same method name on the same builder type:

+
// All three extensions target StringSchemaBuilder
const s = withExtensions(emailExt, slugExt, trimmedExt);

// All methods are available and chainable
const schema = s.string().email().slug().trimmed().minLength(5); +
+ + +

defineExtension() validates the configuration eagerly:

+
    +
  • Unknown builder type names throw immediately (e.g. { str: { ... } } instead of { string: { ... } })
  • +
  • Reserved method names cannot be overridden — validate, introspect, optional, required, addValidator, addPreprocessor, withExtension, getExtension, etc.
  • +
  • Non-function values in the method record are rejected
  • +
+
// ❌ Throws: Unknown builder type "str"
defineExtension({ str: { foo() { return this; } } });

// ❌ Throws: Cannot override reserved method "validate"
defineExtension({ string: { validate() { return this; } } }); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function / TypeDescription
defineExtension(config)Defines an extension. config is an ExtensionConfig keyed by builder type name. Returns an ExtensionDescriptor.
withExtensions(...exts)Accepts one or more ExtensionDescriptors. Returns an object with augmented factory functions (string, number, boolean, date, object, array, union, func, any).
ExtensionConfigType for the configuration object passed to defineExtension. Maps builder type names to method records.
ExtensionDescriptorBranded type returned by defineExtension. Pass to withExtensions() to apply.
+ +

▶ Open in Playground

+

The default import from @cleverbrush/schema includes a pre-applied extension pack with common validators. You get these methods automatically — no extra setup required:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescriptionMetadata
.email(errorMessage?)Validates email formattrue
.url(opts?, errorMessage?)Validates URL format. opts.protocols narrows allowed schemes (default: http, https)true or { protocols }
.uuid(errorMessage?)Validates RFC 4122 UUID format (versions 1–5)true
.ip(opts?, errorMessage?)Validates IPv4 or IPv6 address. opts.version narrows to 'v4' or 'v6'true or { version }
.trim()Preprocessor — trims whitespace before validationtrue
.toLowerCase()Preprocessor — lowercases value before validationtrue
.nonempty(errorMessage?)Rejects empty stringstrue
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodDescriptionMetadata
.positive(errorMessage?)Value must be > 0true
.negative(errorMessage?)Value must be < 0true
.finite(errorMessage?)Value must be finite (not Infinity / -Infinity)true
.multipleOf(n, errorMessage?)Value must be an exact multiple of n (float-safe)n
+ + + + + + + + + + + + + + + + + + + + + +
MethodDescriptionMetadata
.nonempty(errorMessage?)Array must have at least one elementtrue
.unique(keyFn?, errorMessage?)All elements must be unique. Optional keyFn extracts comparison key for objectstrue or keyFn
+ +

.nullable() and .notNullable() are native methods available on every builder — no extension required.

+ + + + + + + + + + + + + + + + + + + + +
MethodAvailable onDescription
.nullable()all buildersMarks the schema as nullable — null is accepted as a valid value. The inferred type changes from T to T | null.
.notNullable()all buildersRemoves the nullable mark — null is no longer accepted. The inferred type changes from T | null back to T.
+
import { string, number, object, InferType } from '@cleverbrush/schema';

const name = string().nullable();
type Name = InferType<typeof name>; // string | null

// Works with any builder
const score = number().positive().nullable(); // number | null

// Chaining: validators before .nullable()
const email = string().email().nullable(); // string | null

// Optional + nullable: accepts string | null | undefined
const bio = string().optional().nullable();

// Nested inside objects
const User = object({
name: string().nonempty(),
bio: string().nullable(), // string | null
age: number().nullable(), // number | null
});

User.validate({ name: 'Alice', bio: null, age: null }); // valid

// Toggle back with .notNullable()
const strictName = string().nullable().notNullable();
type StrictName = InferType<typeof strictName>; // string (not string | null)

strictName.validate(null); // invalid
strictName.validate('Alice'); // valid

// Introspect at runtime
string().nullable().introspect().isNullable; // true
string().nullable().notNullable().introspect().isNullable; // false +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodAvailable onDescription
.oneOf(...values)string, numberConstrains the value to one of the given literals and narrows the inferred type to the literal union.
.oneOf(valuesArray, errorMessage?)string, numberArray-form with an optional custom error message (string or factory).
enumOf(...values)top-level factorySugar for string().oneOf(...). Mirrors Zod's z.enum().
enumOf(valuesArray, errorMessage?)top-level factoryArray-form with an optional custom error message.
+
import { string, number, enumOf, InferType } from '@cleverbrush/schema';

// String enum — infers 'admin' | 'user' | 'guest'
const Role = enumOf('admin', 'user', 'guest');
type Role = InferType<typeof Role>;

Role.validate('admin'); // valid
Role.validate('other'); // invalid — "must be one of: admin, user, guest"

// Equivalent long-form
const Role2 = string().oneOf('admin', 'user', 'guest');

// Number enum — infers 1 | 2 | 3
const Priority = number().oneOf(1, 2, 3);
type Priority = InferType<typeof Priority>;

// Chains with nullable / optional
const OptionalRole = enumOf('admin', 'user').nullable(); // 'admin' | 'user' | null

// Runtime access to allowed values via introspect
Role.introspect().extensions?.oneOf; // ['admin', 'user', 'guest'] +
+ + +

.oneOf() accepts a custom error message via the array form, where the allowed values are passed as an array and the error message is the second argument:

+
import { string, number, enumOf } from '@cleverbrush/schema';

// String — array form with custom string error message
const role = string().oneOf(['admin', 'user', 'guest'], 'Invalid role');
role.validate('other'); // invalid — "Invalid role"

// String — array form with factory function
const role2 = string().oneOf(
['admin', 'user'],
(val) => `"${val}" is not a valid role`
);

// enumOf — array form with custom error message
const Role = enumOf(['admin', 'user', 'guest'], 'Invalid role');

// Number — trailing error message (unambiguous since values are numbers)
const priority = number().oneOf(1, 2, 3, 'Priority must be 1, 2, or 3');
priority.validate(99); // invalid — "Priority must be 1, 2, or 3"

// Number — array form
const priority2 = number().oneOf([1, 2, 3], 'Invalid priority');

// Number — factory function
const priority3 = number().oneOf(
1, 2, 3,
(val) => `${val} is not a valid priority`
); +
+ +
+

Note on string .oneOf() error messages: Because .oneOf() accepts a variadic list of string values, a trailing string argument is treated as another allowed value (not an error message). To provide a string error message for a string enum, use the array formstring().oneOf(['a', 'b'], 'error message'). A trailing function is always unambiguously treated as an error message factory in the rest-params form.

+
+

All validator extensions accept an optional error message as the last parameter — either a string or a function (matching the same ValidationErrorMessageProvider pattern used by built-in constraints like .minLength()):

+
import { string, number, array } from '@cleverbrush/schema';

// String error messages
const email = string().email('Please enter a valid email');
const age = number().positive('Age must be positive');
const tags = array().of(string()).nonempty('At least one tag required');

// Function error messages — receive the invalid value
const name = string().nonempty((val) => `"${val}" is not allowed`);
const score = number().multipleOf(5, (val) => `${val} is not a multiple of 5`); +
+ + +

If you need bare builders without the built-in extensions (e.g. to apply only your own custom extensions), import from the /core sub-path:

+
// Bare builders — no built-in extensions
import { string, number, array, withExtensions } from '@cleverbrush/schema/core';

// Apply only your own extensions
const s = withExtensions(myCustomExtension); +
+ +

The default import (@cleverbrush/schema) re-exports everything from /core and overrides the nine factory functions (string, number, boolean, date, object, array, union, func, any) with pre-extended versions. The extension descriptors themselves are also exported (stringExtensions, numberExtensions, arrayExtensions, nullableExtension) so you can compose them with your own.

+ +

@cleverbrush/schema is the foundation of a three-library ecosystem:

+
@cleverbrush/schemaDefine once
↓ ↓ ↓
Validate data Map between schemas Render React forms
↓ ↓ ↓
.validate() @cleverbrush/mapper @cleverbrush/react-form +
+ +

Define a schema once and use it for runtime validation, object mapping between different shapes, and type-safe React forms — all from a single source of truth.

+ +

Builder functions: any, lazy, string, number, boolean, func, promise, object, date, array, union, parseString

+

Builder classes (for extending): SchemaBuilder, AnySchemaBuilder, ArraySchemaBuilder, BooleanSchemaBuilder, DateSchemaBuilder, FunctionSchemaBuilder, ParseStringSchemaBuilder, LazySchemaBuilder, NumberSchemaBuilder, ObjectSchemaBuilder, PromiseSchemaBuilder, StringSchemaBuilder, UnionSchemaBuilder

+

Extension system: defineExtension, withExtensions, stringExtensions, numberExtensions, arrayExtensions, nullableExtension

+

Sub-path exports: @cleverbrush/schema/core — bare builders without built-in extensions

+

Types: InferType, ValidationResult, ValidationError, MakeOptional, SchemaPropertySelector, PropertyDescriptor, PropertyDescriptorTree, ExtensionConfig, ExtensionDescriptor

+

See API documentation for the full reference.

+ +

Benchmarked against Zod v4 with Vitest bench. Run the benchmarks yourself from the repo root: npm run bench.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Benchmark@cleverbrush/schemaZodRatio
Array 100 objects — valid35,228 ops/s13,277 ops/s2.65× faster
Array 100 objects — invalid899,329 ops/s4,396 ops/s204× faster
Complex order — valid198,988 ops/s136,090 ops/s1.46× faster
Complex order — invalid884,706 ops/s26,106 ops/s33.9× faster
Flat object — valid1,001,194 ops/s840,725 ops/s1.19× faster
Flat object — invalid2,653,630 ops/s176,222 ops/s15.1× faster
Nested object — valid690,556 ops/s368,893 ops/s1.87× faster
Nested object — invalid2,739,319 ops/s87,245 ops/s31.4× faster
String — valid5,348,564 ops/s3,533,945 ops/s1.51× faster
String — invalid5,749,087 ops/s482,961 ops/s11.9× faster
Number — valid7,911,266 ops/s4,806,511 ops/s1.65× faster
Number — invalid5,387,475 ops/s637,513 ops/s8.45× faster
Union first branch1,925,508 ops/s1,529,547 ops/s1.26× faster
Union last branch676,107 ops/s732,682 ops/s0.92×
Union no match — invalid5,873,118 ops/s385,453 ops/s15.2× faster
+

The large gains on invalid data come from the early-exit optimization: validation stops at the first failing constraint in each field and skips the rest of the object. For APIs and form handlers where invalid submissions are common, this translates directly to measurable throughput improvements.

+ +

Already using Zod, Valibot, or ArkType? The extern() factory wraps any Standard Schema v1 compatible schema into a @cleverbrush/schema builder — so you can mix external schemas with native ones inside an object() without rewriting anything.

+
import { z } from 'zod';
import { object, number, extern, InferType } from '@cleverbrush/schema';

// Existing Zod schema — keep as-is
const ZodAddress = z.object({
street: z.string().min(1),
city: z.string(),
zip: z.string().length(5),
});

// Compose with @cleverbrush/schema
const OrderSchema = object({
address: extern(ZodAddress),
totalCents: number().min(1),
});

// Type is inferred from *both* libraries:
type Order = InferType<typeof OrderSchema>;
// { address: { street: string; city: string; zip: string }; totalCents: number }

const result = OrderSchema.validate({
address: { street: '5th Ave', city: 'NYC', zip: '10001' },
totalCents: 4999,
});

if (!result.valid) {
// Navigate into the extern property — no type annotation needed
const zipErrors = result.getErrorsFor(t => t.address.zip);
console.log(zipErrors.errors);
} +
+ +

Key points:

+
    +
  • One parameter: extern(standardSchema) — types and property descriptors are derived automatically.
  • +
  • getErrorsFor() works through extern boundaries: t => t.address.city navigates into the Zod schema.
  • +
  • Validation is delegated to the external schema’s ['~standard'].validate() — @cleverbrush/schema never re-implements the external library’s validation logic.
  • +
  • Works with any library that implements Standard Schema v1 (Zod ≥ 3.24, Valibot ≥ 1.0, ArkType, etc.).
  • +
+ +

@cleverbrush/schema implements Standard Schema v1. Every builder exposes a ['~standard'] getter, which means schemas work as-is with any Standard Schema consumer — no adapters, no wrappers, no configuration:

+
import { object, string, number } from '@cleverbrush/schema';

const UserSchema = object({
name: string().nonempty(),
age: number().min(18),
});

// Works with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, Elysia, …
const standardSchema = UserSchema['~standard']; +
+ +

The ['~standard'].validate() method returns a Promise, supporting both sync +and async preprocessors, validators, and error message providers:

+
const result = await UserSchema['~standard'].validate(input);
if ('issues' in result) {
console.error(result.issues[0].message);
} +
+ +

Confirmed integrations: tRPC, TanStack Form, React Hook Form, T3 Env, Hono, Elysia, next-safe-action, and 50+ others listed on standardschema.dev.

+ +
    +
  • Linting: Biome — strict rules enforced on every PR via CI
  • +
  • Type checking: TypeScript strict mode (strictNullChecks, noImplicitAny, full coverage)
  • +
  • Unit tests: Vitest — runtime tests + type-level tests (expectTypeOf) covering all builders, extensions, edge cases, and error paths
  • +
  • Type-level tests: expectTypeOf assertions validate that inferred types are exactly correct, not just assignable
  • +
  • CI: Every pull request must pass lint + build + test before merge — see .github/workflows/ci.yml
  • +
+ +

BSD-3-Clause

+

Namespaces

StandardSchemaV1
StandardTypedV1

Classes

AnySchemaBuilder
ArraySchemaBuilder
BooleanSchemaBuilder
DateSchemaBuilder
ExternSchemaBuilder
FunctionSchemaBuilder
GenericSchemaBuilder
IntersectionSchemaBuilder
LazySchemaBuilder
NullSchemaBuilder
NumberSchemaBuilder
ObjectSchemaBuilder
ParseStringSchemaBuilder
PromiseSchemaBuilder
RecordSchemaBuilder
SchemaBuilder
SchemaValidationError
StringSchemaBuilder
TupleSchemaBuilder
UnionSchemaBuilder

Interfaces

ArrayBuiltinExtensions
NumberBuiltinExtensions
StandardSchemaV1
StandardTypedV1
StringBuiltinExtensions

Type Aliases

ArraySchemaValidationResult
Brand
BRAND
CleanExtended
ElementValidationResult
ExtendedAny
ExtendedArray
ExtendedBoolean
ExtendedDate
ExtendedFunc
ExtendedNumber
ExtendedObject
ExtendedPromise
ExtendedRecord
ExtendedString
ExtendedTuple
ExtendedUnion
ExtensionConfig
ExtensionDescriptor
ExtraTypeBrandSymbol
FixedMethods
HiddenExtensionMethods
InferType
IntersectionSchemaValidationResult
MakeOptional
MethodLiteralBrandSymbol
NestedValidationResult
NumberOneOfExtension
ObjectSchemaValidationResult
OptionValidationResults
ParseStringTemplateTag
PropertyDescriptor
PropertyDescriptorInner
PropertyDescriptorTree
PropertySetterOptions
RecordSchemaValidationResult
SchemaPropertySelector
SchemaTypeBrand
StringOneOfExtension
TupleElementValidationResults
TupleSchemaValidationResult
UnionSchemaValidationResult
ValidationError
ValidationErrorMessageProvider
ValidationResult

Variables

any
array
arrayExtensions
boolean
date
EXTRA_TYPE_BRAND
func
METHOD_LITERAL_BRAND
number
numberExtensions
object
promise
record
string
stringExtensions
SYMBOL_HAS_PROPERTIES
SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR
tuple
union

Functions

defineExtension
enumOf
extern
generic
intersection
lazy
nul
parseString
withExtensions
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server-openapi.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server-openapi.html new file mode 100644 index 00000000..a056da5e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server-openapi.html @@ -0,0 +1,209 @@ +@cleverbrush/server-openapi | Libraries

Module @cleverbrush/server-openapi

@cleverbrush/server-openapi

+

CI +License: BSD-3-Clause

+

OpenAPI 3.1 specification generation for @cleverbrush/server. Converts endpoint registrations, schema definitions, and authentication configuration into a fully-formed OpenAPI document — no annotations, no decorators. Also generates AsyncAPI 3.0 documents for WebSocket subscription endpoints.

+ +
    +
  • generateOpenApiSpec() — converts @cleverbrush/server endpoint registrations into an OpenAPI 3.1 document.
  • +
  • generateAsyncApiSpec() — converts @cleverbrush/server WebSocket subscription registrations into an AsyncAPI 3.0 document.
  • +
  • serveAsyncApi() — middleware that lazily generates and caches the AsyncAPI spec; serves it at a configurable path (default: /asyncapi.json).
  • +
  • Schema conversion — maps @cleverbrush/schema builders to JSON Schema Draft 2020-12 via @cleverbrush/schema-json.
  • +
  • Path resolution — converts both colon-style paths (:id) and ParseStringSchemaBuilder templates to OpenAPI {param} format with per-parameter schemas.
  • +
  • Security mapping — translates @cleverbrush/auth authentication schemes to OpenAPI securitySchemes; maps per-endpoint authorize() to security arrays. Auto-detects OAuth 2.0 flows (authorizationCodeScheme, clientCredentialsScheme) and OpenID Connect (oidcScheme).
  • +
  • Top-level tags — pass tags: [{ name, description?, externalDocs? }] to OpenApiOptions; tag names are also auto-collected from endpoint registrations.
  • +
  • Request body examples — emit example / examples on Media Type Objects via .example() and .examples() on EndpointBuilder. Schema-level examples propagate automatically.
  • +
  • Binary / file responses.producesFile(contentType?, description?) emits binary content types instead of JSON schemas for file download endpoints.
  • +
  • Multiple content types.produces({ 'text/csv': {}, 'application/xml': { schema } }) emits a multi-entry content map for content-negotiated endpoints; an optional per-type schema override is supported.
  • +
  • Response headers.responseHeaders(schema) documents response headers (X-Total-Count, rate-limit, cache-control, etc.) across every response code; each property becomes a named header entry with schema and description.
  • +
  • External docs.externalDocs(url, description?) attaches an externalDocs object to the OpenAPI Operation Object.
  • +
  • Links.links(defs) declares follow-up links from a response; emitted under the primary 2xx response's links map. Parameters can be raw runtime expression strings or a type-safe callback (response) => Record<string, unknown> where property accesses are resolved to $response.body#/<pointer> expressions automatically.
  • +
  • Callbacks.callbacks(defs) declares async out-of-band callbacks on the Operation Object. The callback URL can be a raw expression string or a type-safe urlFrom callback resolved from the request body schema via property descriptors.
  • +
  • Webhooks — pass webhooks: [defineWebhook('name', options)] to OpenApiOptions (and register via ServerBuilder.webhook(def)) to emit a top-level webhooks map in the OpenAPI document.
  • +
  • serveOpenApi() — middleware that lazily generates and caches the spec; serves it at a configurable path (default: /openapi.json).
  • +
  • createOpenApiEndpoint() — returns a typed endpoint + handler pair for use with ServerBuilder.handle().
  • +
  • CLI / build scriptwriteOpenApiSpec() writes the spec to a file.
  • +
+ +
npm install @cleverbrush/server-openapi @cleverbrush/server @cleverbrush/schema
+
+ + +
import { ServerBuilder, endpoint } from '@cleverbrush/server';
import { serveOpenApi } from '@cleverbrush/server-openapi';
import { object, string, number } from '@cleverbrush/schema';

const GetUser = endpoint
.get('/api/users/:id')
.summary('Get a user by ID')
.tags('users');

const server = new ServerBuilder();

server
.use(serveOpenApi({
server,
info: { title: 'My API', version: '1.0.0' }
}))
.handle(GetUser, ({ params }) => ({ id: params.id }));

await server.listen(3000);
// GET /openapi.json → OpenAPI 3.1 document +
+ +

When server is provided, endpoint registrations, authentication config, and webhooks are derived automatically. You can still pass getRegistrations, authConfig, or webhooks explicitly to override any server-derived value.

+ + +
import { serveOpenApi } from '@cleverbrush/server-openapi';

server.use(serveOpenApi({
server,
info: { title: 'My API', version: '1.0.0' },
servers: [{ url: 'https://api.example.com', description: 'Production' }],
path: '/openapi.json' // default
})); +
+ + +
import { createOpenApiEndpoint } from '@cleverbrush/server-openapi';

const { endpoint: openApiEp, handler } = createOpenApiEndpoint({
server,
info: { title: 'My API', version: '1.0.0' }
});

server.handle(openApiEp, handler); +
+ + +
import { writeOpenApiSpec } from '@cleverbrush/server-openapi';

await writeOpenApiSpec({
registrations: server.getRegistrations(),
info: { title: 'My API', version: '1.0.0' },
outputPath: './openapi.json'
}); +
+ + +

When the same schema definition is used by multiple endpoints, you can mark it with .schemaName() from @cleverbrush/schema so that generateOpenApiSpec() extracts it once into components/schemas and replaces every inline occurrence with a $ref pointer.

+ +
    +
  1. Call .schemaName('ComponentName') on any @cleverbrush/schema builder you want to extract.
  2. +
  3. Export the result as a constant and reuse the same reference wherever the schema is needed.
  4. +
  5. generateOpenApiSpec() detects all named schemas via a pre-pass walk, emits them under components.schemas, and replaces inline definitions with $ref pointers.
  6. +
+
import { object, string, number, array } from '@cleverbrush/schema';
import { endpoint } from '@cleverbrush/server';
import { generateOpenApiSpec } from '@cleverbrush/server-openapi';

// Mark once — reuse everywhere
const UserSchema = object({
id: number(),
name: string(),
}).schemaName('User');

const GetUser = endpoint.get('/api/users/:id').returns(UserSchema);
const ListUsers = endpoint.get('/api/users').returns(array(UserSchema));

const spec = generateOpenApiSpec({
registrations: [GetUser.registration, ListUsers.registration],
info: { title: 'My API', version: '1.0.0' }
});
// components.schemas.User → { type: 'object', properties: { id: …, name: … } }
// GET /api/users/:id → responses.200.content['application/json'].schema: { $ref: '#/components/schemas/User' }
// GET /api/users → responses.200.content['application/json'].schema: { type: 'array', items: { $ref: '…/User' } } +
+ +

Nested named schemas inside request bodies are also resolved:

+
const AddressSchema = object({ street: string(), city: string() }).schemaName('Address');

// The wrapper is anonymous — inlined. The nested AddressSchema → $ref.
const CreateUserBody = object({ address: AddressSchema, name: string() }); +
+ + +

Registering two different schema instances under the same name throws immediately during spec generation:

+
const A = object({ x: string() }).schemaName('Thing');
const B = object({ y: number() }).schemaName('Thing'); // different instance!

generateOpenApiSpec({ registrations: [...], info: { … } });
// Error: Schema name "Thing" is already registered by a different schema instance. +
+ +

Re-registering the same instance (because it appears in multiple endpoints) is a no-op.

+ +

SchemaRegistry and walkSchemas are also exported from @cleverbrush/server-openapi for custom tooling:

+
import { SchemaRegistry, walkSchemas } from '@cleverbrush/server-openapi';

const registry = new SchemaRegistry();
walkSchemas(MySchema, registry);

registry.getName(MySchema); // 'MyComponentName' | null
registry.entries(); // IterableIterator<[name, SchemaBuilder]>
registry.isEmpty; // boolean +
+ + +

When a request body, response, or parameter schema is a discriminated union — all branches are objects sharing a required property with unique literal values — the generated spec automatically includes the OpenAPI discriminator keyword alongside anyOf.

+

If the union branches use .schemaName() and are extracted as $ref components, the discriminator also includes a mapping from each literal value to its $ref path:

+
const Cat = object({ type: string('cat'), name: string() }).schemaName('Cat');
const Dog = object({ type: string('dog'), breed: string() }).schemaName('Dog');
const PetBody = union(Cat).or(Dog);

const CreatePet = endpoint.post('/api/pets').body(PetBody);

// Generated spec:
// requestBody.content['application/json'].schema:
// {
// anyOf: [{ $ref: '#/components/schemas/Cat' }, { $ref: '#/components/schemas/Dog' }],
// discriminator: { propertyName: 'type', mapping: { cat: '#/components/schemas/Cat', dog: '#/components/schemas/Dog' } }
// } +
+ +

Code generators like openapi-generator and orval use the discriminator to produce proper tagged union types.

+ +

Self-referential schemas (tree nodes, nested menus, threaded comments) are +supported via lazy() from @cleverbrush/schema. Call .schemaName() on the +root schema and generateOpenApiSpec will:

+
    +
  1. Register the named schema in components.schemas, expanding its definition +exactly once.
  2. +
  3. Replace every recursive reference inside the definition with the appropriate +$ref pointer — breaking the cycle automatically.
  4. +
+
import { object, number, array, lazy } from '@cleverbrush/schema';

type TreeNode = { value: number; children: TreeNode[] };

// TypeScript needs an explicit annotation for recursive types
const treeNode: ReturnType<typeof object> = object({
value: number(),
children: array(lazy(() => treeNode))
}).schemaName('TreeNode');

// Use treeNode as a body / response schema — no extra configuration needed
const CreateTree = endpoint.post('/api/tree').body(treeNode); +
+ +

Generated spec (abbreviated):

+
components:
schemas:
TreeNode:
type: object
properties:
value: { type: integer }
children:
type: array
items: { $ref: '#/components/schemas/TreeNode' }
paths:
/api/tree:
post:
requestBody:
content:
application/json:
schema: { $ref: '#/components/schemas/TreeNode' } +
+ + +

Pre-fill the Try it out panel in Swagger UI by attaching examples to endpoints.

+ +
const CreateUser = endpoint
.post('/api/users')
.body(UserSchema)
.example({ name: 'Alice', email: 'alice@example.com' }); +
+ +

Emits example on the OpenAPI Media Type Object:

+
requestBody:
content:
application/json:
schema: { ... }
example: { name: Alice, email: alice@example.com } +
+ + +
const CreateUser = endpoint
.post('/api/users')
.body(UserSchema)
.examples({
minimal: { summary: 'Minimal', value: { name: 'Alice' } },
full: {
summary: 'Complete',
description: 'A fully populated user',
value: { name: 'Alice', email: 'alice@example.com', age: 30 }
}
}); +
+ + +

Examples attached directly to schemas via .example() propagate to parameter and response schemas in the generated spec:

+
const PageParam = number().example(1);
const UserResponse = object({ id: number(), name: string() }).example({ id: 1, name: 'Alice' }); +
+ + +

Use .producesFile() to declare that an endpoint returns a binary file instead of JSON. The generated spec emits the appropriate binary content type.

+
const ExportCsv = endpoint
.get('/api/export')
.producesFile('text/csv', 'CSV export');

const Download = endpoint
.get('/api/download')
.producesFile(); // defaults to application/octet-stream +
+ +

Produces:

+
responses:
'200':
description: CSV export
content:
text/csv:
schema: { type: string, format: binary } +
+ +

When both .returns() and .producesFile() are set, the binary response takes precedence.

+ +

When you pass the server option, authentication configuration is picked up automatically from server.getAuthenticationConfig(). Security schemes and per-operation security arrays are generated without any extra configuration:

+
import { jwtScheme } from '@cleverbrush/auth';

const server = new ServerBuilder()
.useAuthentication({
defaultScheme: 'jwt',
schemes: [jwtScheme({ secret: '...', mapClaims: c => c })]
})
.useAuthorization();

server.use(serveOpenApi({
server,
info: { title: 'My API', version: '1.0.0' }
})); +
+ +

You can also pass authConfig explicitly (useful when not using the server option):

+
server.use(serveOpenApi({
getRegistrations: () => server.getRegistrations(),
info: { title: 'My API', version: '1.0.0' },
authConfig: server.getAuthenticationConfig()
})); +
+ +

JWT schemes generate { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' }; cookie schemes generate { type: 'apiKey', in: 'cookie' }.

+ +

OpenAPI supports a top-level tags array where each entry can carry a description and optional externalDocs. Pass a tags array to generateOpenApiSpec() (or any serving helper) to define them:

+
generateOpenApiSpec({
registrations,
info: { title: 'My API', version: '1.0.0' },
tags: [
{
name: 'users',
description: 'User management endpoints',
externalDocs: { url: 'https://docs.example.com/users' }
},
{ name: 'orders', description: 'Order management endpoints' }
]
}); +
+ +

When tags is omitted, unique tag names are automatically collected from all registered endpoints and emitted as name-only entries — so Swagger UI and Redoc still group operations correctly. Any endpoint tag not present in the explicit list is appended alphabetically.

+ +
const info: OpenApiInfo = {
title: 'My API',
version: '2.0.0',
description: 'Full description of my API.',
termsOfService: 'https://example.com/tos',
contact: { name: 'Support', email: 'support@example.com' },
license: { name: 'MIT', url: 'https://opensource.org/licenses/MIT' }
}; +
+ + +

Both path styles are supported:

+
// Colon style — converted to {id}
endpoint.get('/api/users/:id');

// ParseStringSchemaBuilder — type-safe, with schema
import { route } from '@cleverbrush/server';
import { object, number } from '@cleverbrush/schema';

endpoint.get(route(object({ id: number().coerce() }), $t => $t`/api/users/${t => t.id}`));
// produces path "/api/users/{id}" with schema { type: 'number' } +
+ + +

generateAsyncApiSpec() and serveAsyncApi() convert @cleverbrush/server WebSocket subscription registrations into an AsyncAPI 3.0 document — no annotations required.

+ +
import { serveAsyncApi } from '@cleverbrush/server-openapi';

server.use(serveAsyncApi({
server,
info: { title: 'My API', version: '1.0.0' },
// Optional: document the WebSocket servers
servers: {
production: { host: 'api.example.com', protocol: 'wss' },
local: { host: 'localhost:3000', protocol: 'ws' },
},
path: '/asyncapi.json', // default
}));
// GET /asyncapi.json → AsyncAPI 3.0 document (lazily generated, cached) +
+ + +
import { generateAsyncApiSpec } from '@cleverbrush/server-openapi';

const spec = generateAsyncApiSpec({
subscriptions: server.getSubscriptionRegistrations(),
info: { title: 'My API', version: '1.0.0' },
servers: {
production: { host: 'api.example.com', protocol: 'wss' },
},
});

// write to file, validate, upload to AsyncAPI Studio, etc.
await fs.writeFile('asyncapi.json', JSON.stringify(spec, null, 2)); +
+ + +

Each subscription endpoint becomes:

+
    +
  • A channel (keyed by the subscription's operationId or a sanitised form of its path) with an address containing the WebSocket URL path.
  • +
  • A send operation if the endpoint has an outgoing schema (server → client events).
  • +
  • A receive operation if the endpoint has an incoming schema (client → server messages).
  • +
+

Named schemas (registered via .schemaName()) are collected into components.schemas and referenced via $ref pointers in the channel messages.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDefaultDescription
subscriptionsreadonly SubscriptionRegistration[]From server.getSubscriptionRegistrations()
infoAsyncApiInfo{ title, version, description?, ... }
serversRecord<string, AsyncApiServerEntry>{}Named WebSocket server entries
defaultHoststringFallback host when servers is empty
+ +

BSD-3-Clause — see LICENSE.

+

Classes

SchemaRegistry

Interfaces

AsyncApiInfo
AsyncApiOptions
AsyncApiServer_ServerLike
AsyncApiServerEntry
OpenApiEndpointOptions
OpenApiInfo
OpenApiOptions
OpenApiSecurityScheme
OpenApiServer
OpenApiServer_ServerLike
OpenApiTag
PathParameterInfo
ResolvedPath
ServeAsyncApiOptions
ServeOpenApiOptions

Type Aliases

AsyncApiDocument
OpenApiDocument

Functions

convertSchema
createOpenApiEndpoint
generateAsyncApiSpec
generateOpenApiSpec
mapOperationSecurity
mapSecuritySchemes
resolvePath
serveAsyncApi
serveOpenApi
walkSchemas
writeOpenApiSpec
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server..html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server..html new file mode 100644 index 00000000..34a33cd7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server..html @@ -0,0 +1 @@ + | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server.contract.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server.contract.html new file mode 100644 index 00000000..c5118e65 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server.contract.html @@ -0,0 +1,9 @@ +contract | Libraries

Browser-safe entry point for @cleverbrush/server.

+

Re-exports the endpoint builder, factory functions and type helpers +needed to define API contracts without pulling in the Node.js server +runtime. Use this entry point in shared packages that are consumed by +both the backend (Node.js) and the frontend (browser).

+
import { defineApi, endpoint, route } from '@cleverbrush/server/contract';
import { array, number, object, string } from '@cleverbrush/schema';

const TodoSchema = object({ id: number(), title: string() });

export const api = defineApi({
todos: {
list: endpoint.resource('/api/todos').get()
.responses({ 200: array(TodoSchema) }),
get: endpoint.resource('/api/todos').get(
route({ id: number().coerce() })`/${t => t.id}`
).responses({ 200: TodoSchema }),
},
}); +
+ +

Type Aliases

ApiContract
ApiGroup
MergedContracts

Functions

defineApi
mergeContracts
omitGroups
pickGroups

References

ActionContext → ActionContext
AllowedResponseReturn → AllowedResponseReturn
CacheTagDefinition → CacheTagDefinition
CacheTagPropertyAccessor → CacheTagPropertyAccessor
CallbackDefinition → CallbackDefinition
createEndpoints → createEndpoints
endpoint → endpoint
EndpointBuilder → EndpointBuilder
EndpointMetadata → EndpointMetadata
EndpointMetadataDescriptors → EndpointMetadataDescriptors
FilePart → FilePart
Handler → Handler
LinkDefinition → LinkDefinition
PropertyRefTree → PropertyRefTree
ResponsesOf → ResponsesOf
route → route
ScopedEndpointFactory → ScopedEndpointFactory
SubscriptionBuilder → SubscriptionBuilder
SubscriptionContext → SubscriptionContext
SubscriptionHandler → SubscriptionHandler
SubscriptionHandlerEntry → SubscriptionHandlerEntry
SubscriptionMetadata → SubscriptionMetadata
tracked → tracked
TrackedEvent → TrackedEvent
UploadOptions → UploadOptions
diff --git a/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server.html b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server.html new file mode 100644 index 00000000..27dca6e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/modules/_cleverbrush_server.html @@ -0,0 +1,320 @@ +@cleverbrush/server | Libraries

Module @cleverbrush/server

@cleverbrush/server

+

CI +License: BSD-3-Clause

+

A schema-first HTTP server framework for Node.js. Combines @cleverbrush/schema for request validation, @cleverbrush/di for dependency injection, and @cleverbrush/auth for authentication — all wired together through a fluent builder API.

+ +
    +
  • Fluent endpoint builderendpoint.get('/users').body(schema).query(schema).authorize() with fully typed handler context.
  • +
  • Action resultsActionResult.ok(), .created(), .noContent(), .redirect(), .file(), .stream(), .status() — no manual res.write() / res.end().
  • +
  • Content negotiation — pluggable ContentTypeHandler registry; JSON registered by default; honours the Accept request header.
  • +
  • Middleware pipelineserver.use(middleware) for global middleware; per-endpoint middleware via handle(ep, handler, { middlewares }).
  • +
  • DI integrationendpoint.inject({ db: IDbContext }) resolves services per-request from a @cleverbrush/di container.
  • +
  • Authentication & authorizationserver.useAuthentication() / server.useAuthorization() wired to @cleverbrush/auth schemes and policies.
  • +
  • RFC 9457 Problem Details — validation errors and HttpError subclasses are serialized as application/problem+json.
  • +
  • Type-safe routesroute() builds typed path parameters using ParseStringSchemaBuilder segments.
  • +
  • OpenAPI-readygetRegistrations() exposes endpoint metadata for @cleverbrush/server-openapi.
  • +
  • AsyncAPI-readygetSubscriptionRegistrations() exposes subscription metadata for generateAsyncApiSpec() in @cleverbrush/server-openapi.
  • +
  • Health check — optional /health endpoint via server.withHealthcheck().
  • +
  • WebSocket subscriptionsendpoint.subscription('/ws/path') with typed incoming/outgoing schemas, tracked() events, and async generator handlers.
  • +
  • Contract compositionmergeContracts, pickGroups, and omitGroups enable audience-scoped bundles: ship only the endpoints each consumer needs.
  • +
+ +
npm install @cleverbrush/server @cleverbrush/schema
+
+ + +
import { ServerBuilder, endpoint, ActionResult } from '@cleverbrush/server';
import { object, string, number } from '@cleverbrush/schema';

const CreateUserBody = object({ name: string(), age: number() });

const createUser = endpoint
.post('/api/users')
.body(CreateUserBody);

const server = new ServerBuilder();

server.handle(createUser, ({ body }) => {
// body is fully typed: { name: string; age: number }
return ActionResult.created({ id: 1, ...body }, '/api/users/1');
});

await server.listen(3000); +
+ + + +

Use the endpoint singleton to start a builder chain:

+
import { endpoint } from '@cleverbrush/server';

const getUser = endpoint.get('/api/users/:id');
const postUser = endpoint.post('/api/users');
const putUser = endpoint.put('/api/users/:id');
const delUser = endpoint.delete('/api/users/:id'); +
+ + +

Attach schemas for body, query string, and headers. Validation errors automatically produce a 400 Problem Details response.

+
import { object, string, number } from '@cleverbrush/schema';

const ListUsers = endpoint
.get('/api/users')
.query(object({ page: number().coerce().optional(), search: string().optional() }));

const CreateUser = endpoint
.post('/api/users')
.body(object({ name: string(), email: string() })); +
+ + +

Use route() to define path parameters with the full schema type system:

+
import { route } from '@cleverbrush/server';
import { number } from '@cleverbrush/schema';

const GetUser = endpoint.get(
route({ id: number().coerce() })`/api/users/${t => t.id}`
);

server.handle(GetUser, ({ params }) => {
params.id; // number (already coerced from the URL)
}); +
+ + +
import { object, string } from '@cleverbrush/schema';

const UserPrincipal = object({ sub: string(), role: string() });

// Any authenticated user
const ProtectedEp = endpoint.get('/api/profile').authorize(UserPrincipal);

// Specific roles
const AdminEp = endpoint.delete('/api/users/:id').authorize(UserPrincipal, 'admin'); +
+ + +
const CreateUser = endpoint
.post('/api/users')
.body(CreateUserBody)
.returns(UserSchema)
.summary('Create a new user')
.description('Creates a user and returns the full record.')
.tags('users')
.operationId('createUser'); +
+ + +

Tag-based cache invalidation. Tags declared on endpoints flow to the +cacheTags middleware for automatic HTTP caching and +invalidation on mutating requests.

+
const ListTodos = endpoint
.get('/api/todos')
.query(TodoListQuerySchema)
.cacheTag('todo-list', p => ({ page: p.query.page, limit: p.query.limit }))
.returns(array(TodoSchema));

const UpdateTodo = endpoint
.patch('/api/todos/:id')
.body(UpdateTodoBody)
.clearsCacheTag('todo-list') // clears the collection cache
.clearsCacheTag('todo', p => ({ id: p.params.id })) // clears specific entity
.returns(TodoSchema); +
+ +
    +
  • .cacheTag(name) — declares the endpoint's data belongs to a cache +group. Use on GET endpoints.
  • +
  • .clearsCacheTag(name) — declares that this mutation clears matching +cache entries on success. Use on POST / PUT / PATCH / DELETE.
  • +
  • .cacheTag(name, p => ({ ... })) — property-based tag; each selected +property becomes part of the cache key (different pages → different entries).
  • +
  • Immutability — both methods return a new builder; the original is +unchanged.
  • +
+ +
const server = new ServerBuilder();

server.handle(CreateUser, ({ body, context }) => {
return ActionResult.created({ id: 42, ...body }, `/api/users/42`);
});

// Per-endpoint middleware
server.handle(AdminEp, ({ params }) => { /* … */ }, {
middlewares: [loggingMiddleware]
});

await server.listen(3000); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodStatusNotes
ActionResult.ok(body)200Content-negotiated JSON
ActionResult.created(body, location?)201Sets Location header
ActionResult.noContent()204No body
ActionResult.redirect(url, permanent?)302 / 301
ActionResult.json(body, status?)anyForces application/json
ActionResult.file(buffer, fileName)200Attachment download
ActionResult.content(body, contentType)200Arbitrary string body
ActionResult.stream(readable, contentType)200Pipes a Readable
ActionResult.status(status)anyBare status, no body
+ +

Accept file uploads via multipart/form-data by chaining .upload() on an endpoint:

+
import { endpoint } from '@cleverbrush/server';
import { object, string } from '@cleverbrush/schema';

const UploadAvatar = endpoint
.post('/api/avatar')
.upload({ maxFileSize: 2 * 1024 * 1024, allowedMimeTypes: ['image/*'] })
.body(object({ description: string().optional() }))
.authorize(UserPrincipal);

const handler: Handler<typeof UploadAvatar> = async ({ body, files }) => {
const avatar = files['avatar'];
// avatar: FilePart { filename, mimeType, buffer, size }
return ActionResult.created({ name: avatar.filename });
}; +
+ +

The files object on the handler context contains one FilePart entry per uploaded file field. Non-file form fields are validated against the body schema and available via body.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
maxFileSizenumber10 MBMaximum file size per file in bytes
allowedMimeTypesstring[]allMIME type allowlist (supports image/* glob)
maxFileCountnumber10Maximum number of files per request
+ +
interface FilePart {
readonly filename: string;
readonly mimeType: string;
readonly buffer: Buffer;
readonly size: number;
} +
+ + +
import type { Middleware } from '@cleverbrush/server';

const logger: Middleware = async (ctx, next) => {
console.log(ctx.method, ctx.url.pathname);
await next();
};

server.use(logger); +
+ + +
import { ServiceCollection } from '@cleverbrush/di';
import { object, func, string } from '@cleverbrush/schema';

const IUserRepo = object({ findById: func() });

const GetUser = endpoint
.get('/api/users/:id')
.inject({ repo: IUserRepo });

server
.services(svc => svc.addSingleton(IUserRepo, () => new UserRepository()))
.handle(GetUser, ({ params }, { repo }) => {
return repo.findById(params.id);
}); +
+ + +
import { jwtScheme } from '@cleverbrush/auth';

server.useAuthentication({
defaultScheme: 'jwt',
schemes: [
jwtScheme({
secret: process.env.JWT_SECRET!,
mapClaims: claims => ({ sub: claims.sub as string, role: claims.role as string })
})
]
});

server.useAuthorization(); +
+ + +

Throw any HttpError subclass from a handler — it becomes a Problem Details response automatically:

+
import { NotFoundError, BadRequestError, ForbiddenError } from '@cleverbrush/server';

server.handle(GetUser, ({ params }) => {
const user = db.find(params.id);
if (!user) throw new NotFoundError(`User ${params.id} not found`);
return user;
}); +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassStatus
BadRequestError400
UnauthorizedError401
ForbiddenError403
NotFoundError404
ConflictError409
HttpErrorany (base class)
+ +

Define real-time endpoints using endpoint.subscription():

+
import { endpoint, tracked } from '@cleverbrush/server';
import { object, string, number } from '@cleverbrush/schema';

// Server-push subscription
const liveUpdates = endpoint
.subscription('/ws/updates')
.outgoing(object({ action: string(), id: number() }))
.summary('Live updates');

// Bidirectional subscription
const chat = endpoint
.subscription('/ws/chat')
.incoming(object({ text: string() }))
.outgoing(object({ user: string(), text: string(), ts: number() }))
.authorize('user'); +
+ + +

Handlers are async generators that yield outgoing events:

+
import type { SubscriptionHandler } from '@cleverbrush/server';

const handler: SubscriptionHandler<typeof liveUpdates> = async function* () {
while (true) {
await new Promise(r => setTimeout(r, 1000));
yield { action: 'tick', id: Date.now() };
}
};

// Bidirectional — read from `incoming` async iterable
const chatHandler: SubscriptionHandler<typeof chat> = async function* ({ incoming, principal }) {
yield { user: 'system', text: `${principal.name} joined`, ts: Date.now() };
for await (const msg of incoming) {
yield { user: principal.name, text: msg.text, ts: Date.now() };
}
}; +
+ + +

Use tracked(id, data) to send events with a unique ID for client-side deduplication:

+
yield tracked('evt-123', { action: 'created', id: 42 });
+
+ + +
// Direct subscription
const sub = client.live.updates();
for await (const event of sub) {
console.log(event); // typed as { action: string, id: number }
}

// Send messages (bidirectional)
const chat = client.live.chat();
chat.send({ text: 'hello' }); +
+ + +
import { useSubscription } from '@cleverbrush/client/react';

function LiveFeed() {
const { events, state, send, close } = useSubscription(
() => client.live.updates(),
{ maxEvents: 100 }
);

return (
<div>
<p>Status: {state}</p>
{events.map((e, i) => <div key={i}>{e.action} #{e.id}</div>)}
</div>
);
} +
+ + +

Enable the server-side batch endpoint so the client can coalesce many concurrent requests into a single HTTP round-trip.

+
import { createServer } from '@cleverbrush/server';

const server = await createServer()
.useBatching() // enables POST /__batch
.handleAll(mapping)
.listen(3000); +
+ + +

The batch endpoint (POST /__batch by default) accepts a JSON body:

+
{
"requests": [
{ "method": "GET", "url": "/api/todos", "headers": { "authorization": "Bearer ..." } },
{ "method": "POST", "url": "/api/todos", "headers": { "content-type": "application/json", "authorization": "Bearer ..." }, "body": "{\"title\":\"Buy milk\"}" }
]
} +
+ +

Each sub-request is processed through the full middleware and handler pipeline (including auth and DI) in parallel by default. The response is:

+
{
"responses": [
{ "status": 200, "headers": { "content-type": "application/json" }, "body": "[{\"id\":1}]" },
{ "status": 201, "headers": { "content-type": "application/json" }, "body": "{\"id\":2,\"title\":\"Buy milk\"}" }
]
} +
+ +

One sub-request failing returns its error status in its own slot — the rest succeed normally.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescription
pathstring'/__batch'URL path for the batch endpoint
maxSizenumber20Maximum sub-requests per batch (400 if exceeded)
parallelbooleantrueRun sub-requests in parallel (false for sequential)
+
createServer()
.useBatching({ path: '/_batch', maxSize: 50, parallel: false })
.handleAll(mapping)
.listen(3000); +
+ + +

When building applications with distinct audiences — a public client and an admin panel, for example — you want each consumer to import only the endpoints it needs. This eliminates leaking admin schemas into the client bundle and improves tree-shaking.

+

The @cleverbrush/server/contract entry point ships three utilities for this.

+ +

Combine two ApiContract objects into one. Groups that only exist in one contract are kept as-is; groups that share a key have their endpoint maps shallowly merged.

+
import { defineApi, mergeContracts } from '@cleverbrush/server/contract';

// public-api.ts — safe to import in every consumer
export const publicApi = defineApi({
todos: { list: ..., get: ..., create: ... },
auth: { login: ..., register: ... },
});

// admin-api.ts — only imported by the admin application
const adminApi = defineApi({
admin: { activityLog: ..., banUser: ... },
});

// admin-app/contract.ts
export const fullAdminApi = mergeContracts(publicApi, adminApi);
// TypeScript sees: { todos, auth, admin } — all fully typed

// client-app/contract.ts
import { publicApi } from '../shared/public-api';
// TypeScript sees: { todos, auth } — admin is absent from the bundle +
+ + +

Returns a new contract containing only the listed groups. The TypeScript return type is Pick<T, K> — the compiler sees exactly the selected groups.

+
import { pickGroups } from '@cleverbrush/server/contract';

const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

// Only expose what the frontend needs
const clientApi = pickGroups(fullApi, 'todos', 'auth');
// TypeScript: { todos: ..., auth: ... }
// 'admin' and 'debug' do not exist on the type or at runtime +
+ + +

Inverse of pickGroups — strips the listed groups and keeps everything else. Return type is Omit<T, K>.

+
import { omitGroups } from '@cleverbrush/server/contract';

const publicApi = omitGroups(fullApi, 'admin', 'debug');
// TypeScript: { todos: ..., auth: ... } +
+ + +

The key to keeping admin endpoints out of the client bundle is file-level separation. Export different slices from different entry points:

+
packages/
shared-contracts/
src/
public.ts // export const publicApi = defineApi({ ... })
admin.ts // export const adminApi = defineApi({ ... })
full.ts // export const fullApi = mergeContracts(publicApi, adminApi)

apps/
client/ // imports publicApi — admin endpoints never bundled
admin-panel/ // imports fullApi — full set of endpoints
backend/ // imports fullApi — handles all routes +
+ + +

BSD-3-Clause — see LICENSE.

+

Modules

contract
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthenticationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthenticationResult.html new file mode 100644 index 00000000..b22ee949 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthenticationResult.html @@ -0,0 +1,3 @@ +AuthenticationResult | Libraries

Type Alias AuthenticationResult<T>

AuthenticationResult:
    | { principal: Principal<T>; succeeded: true }
    | { failure?: string; succeeded: false }

The result returned by AuthenticationScheme.authenticate. +On success, provides a typed Principal; on failure, an optional reason.

+

Type Parameters

  • T = unknown
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthorizationRequirement.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthorizationRequirement.html new file mode 100644 index 00000000..e0692a51 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthorizationRequirement.html @@ -0,0 +1,3 @@ +AuthorizationRequirement | Libraries

Type Alias AuthorizationRequirement

AuthorizationRequirement: (
    principal: Principal<any>,
) => boolean | Promise<boolean>

A predicate that a principal must satisfy. +Return true to allow, false to deny.

+

Type Declaration

    • (principal: Principal<any>): boolean | Promise<boolean>
    • Parameters

      Returns boolean | Promise<boolean>

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthorizationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthorizationResult.html new file mode 100644 index 00000000..eace5dcd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_auth.AuthorizationResult.html @@ -0,0 +1,2 @@ +AuthorizationResult | Libraries

Type Alias AuthorizationResult

AuthorizationResult: { allowed: true } | { allowed: false; reason: string }

The result of an authorization check performed by AuthorizationService.authorize.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..ApiContract.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..ApiContract.html new file mode 100644 index 00000000..97000739 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..ApiContract.html @@ -0,0 +1,7 @@ +ApiContract | Libraries

Type Alias ApiContract

ApiContract: Record<string, ApiGroup>

A typed API contract with one level of grouping.

+

Each key is a group name and each value is an ApiGroup — a +record of named endpoints.

+
const contract: ApiContract = {
todos: { list: todosResource.get(), create: todosResource.post() },
auth: { login: endpoint.post('/api/auth/login') },
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointCall.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointCall.html new file mode 100644 index 00000000..746111bc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointCall.html @@ -0,0 +1,8 @@ +EndpointCall | Libraries

Type Alias EndpointCall<E>

EndpointCall: (
    EndpointCallArgs<E> extends undefined
        ? (args?: PerCallOverrides) => Promise<EndpointResponse<E>>
        : (
            args: EndpointCallArgs<E> & PerCallOverrides,
        ) => Promise<EndpointResponse<E>>
) & {
    file: EndpointCallArgs<E> extends undefined
        ? (args?: PerCallOverrides) => Promise<Blob>
        : (args: EndpointCallArgs<E> & PerCallOverrides) => Promise<Blob>;
    stream: EndpointCallArgs<E> extends undefined
        ? (options?: { signal?: AbortSignal }) => AsyncIterable<string>
        : (
            args: EndpointCallArgs<E> & { signal?: AbortSignal },
        ) => AsyncIterable<string>;
}

The callable signature for a single endpoint on the typed client.

+

When the endpoint requires arguments (path params, body, query, or +headers) the function takes a single argument object. When no arguments +are needed the function can be called with no arguments.

+

Every endpoint call also exposes a .stream() method that returns an +AsyncIterable<string> yielding newline-delimited chunks (e.g. NDJSON). +An optional AbortSignal can be passed to cancel an in-flight stream.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointCallArgs.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointCallArgs.html new file mode 100644 index 00000000..2cb7145d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointCallArgs.html @@ -0,0 +1,15 @@ +EndpointCallArgs | Libraries

Type Alias EndpointCallArgs<E>

EndpointCallArgs: E extends EndpointBuilder<
    infer TParams,
    infer TBody,
    infer TQuery,
    infer THeaders,
    any,
    any,
    any,
    any,
    any,
    infer TUpload,
>
    ? HasKeys<
        Simplify<CallArgsParts<TParams, TBody, TQuery, THeaders, TUpload>>,
    > extends true
        ? Simplify<CallArgsParts<TParams, TBody, TQuery, THeaders, TUpload>>
        : undefined
    : never

Extracts the typed request argument shape from an EndpointBuilder.

+

The resulting type includes only the keys that carry data:

+
    +
  • params — path parameters (when the endpoint uses route())
  • +
  • body — request body (when .body() was called)
  • +
  • query — query string parameters (when .query() was called)
  • +
  • headers — request headers (when .headers() was called)
  • +
+

When no keys are required the type collapses to void so the call can +be made without arguments: client.users.me().

+

Type Parameters

  • E

    An EndpointBuilder instance type.

    +
// Endpoint with body:
type Args = EndpointCallArgs<typeof CreateTodoEndpoint>;
// ^? { body: { title: string; description?: string } }

// Endpoint with path params:
type Args = EndpointCallArgs<typeof GetTodoEndpoint>;
// ^? { params: { id: number } }

// Endpoint with no required args:
type Args = EndpointCallArgs<typeof GetProfileEndpoint>;
// ^? void +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointResponse.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointResponse.html new file mode 100644 index 00000000..873a04c7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..EndpointResponse.html @@ -0,0 +1,12 @@ +EndpointResponse | Libraries

Type Alias EndpointResponse<E>

EndpointResponse: E extends EndpointBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    infer TResponse,
    infer TResponses,
>
    ? HasKeys<TResponses> extends true
        ? FirstSuccessResponse<TResponses>
        : TResponse extends SchemaBuilder<any, any, any, any, any>
            ? InferType<TResponse>
            : TResponse
    : never

Extracts the success response type from an EndpointBuilder.

+
    +
  • When .responses() was used, returns the body type of the first +declared 2xx status code (200 → 201 → 202 → 204).
  • +
  • When .returns(schema) was used, returns the inferred schema type.
  • +
  • A null response schema (e.g. for 204) maps to void.
  • +
+

Type Parameters

  • E

    An EndpointBuilder instance type.

    +
type Resp = EndpointResponse<typeof ListTodosEndpoint>;
// ^? TodoResponse[]

type Resp = EndpointResponse<typeof DeleteTodoEndpoint>;
// ^? void +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..FetchLike.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..FetchLike.html new file mode 100644 index 00000000..bca5511c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..FetchLike.html @@ -0,0 +1,4 @@ +FetchLike | Libraries

Type Alias FetchLike

FetchLike: (url: string, init: RequestInit) => Promise<Response>

A function with the same signature as fetch.

+

Middlewares wrap and delegate to a FetchLike function, forming a chain +that terminates at the real fetch call.

+

Type Declaration

    • (url: string, init: RequestInit): Promise<Response>
    • Parameters

      • url: string
      • init: RequestInit

      Returns Promise<Response>

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..Middleware.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..Middleware.html new file mode 100644 index 00000000..eb557a2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..Middleware.html @@ -0,0 +1,6 @@ +Middleware | Libraries

Type Alias Middleware

Middleware: (next: FetchLike) => FetchLike

A middleware is a function that accepts the next handler in the chain +and returns a new handler that wraps it.

+

Type Declaration

const timing: Middleware = (next) => async (url, init) => {
const start = performance.now();
const res = await next(url, init);
console.log(`${url} took ${performance.now() - start}ms`);
return res;
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionCall.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionCall.html new file mode 100644 index 00000000..e757a9a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionCall.html @@ -0,0 +1,6 @@ +SubscriptionCall | Libraries

Type Alias SubscriptionCall<E>

SubscriptionCall: SubscriptionCallArgs<E> extends undefined
    ? (
        args?: {
            reconnect?: SubscriptionReconnectOptions | boolean;
            signal?: AbortSignal;
        },
    ) => Subscription<SubscriptionOutgoing<E>, SubscriptionIncoming<E>>
    : (
        args: SubscriptionCallArgs<E> & {
            reconnect?: SubscriptionReconnectOptions | boolean;
            signal?: AbortSignal;
        },
    ) => Subscription<SubscriptionOutgoing<E>, SubscriptionIncoming<E>>

The callable signature for a subscription endpoint on the typed client.

+

Returns a Subscription handle that is both an AsyncIterable +and has send() / close() methods.

+

Pass reconnect: false to disable automatic reconnection for this call +even when a global subscriptionReconnect is configured.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionCallArgs.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionCallArgs.html new file mode 100644 index 00000000..2bb23063 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionCallArgs.html @@ -0,0 +1,2 @@ +SubscriptionCallArgs | Libraries

Type Alias SubscriptionCallArgs<E>

SubscriptionCallArgs: E extends SubscriptionBuilder<
    infer TParams,
    infer TQuery,
    infer THeaders,
    any,
    any,
    any,
    any,
    any,
>
    ? HasKeys<Simplify<SubscriptionArgsParts<TParams, TQuery, THeaders>>> extends true
        ? Simplify<SubscriptionArgsParts<TParams, TQuery, THeaders>>
        : undefined
    : never

Extracts the subscribe call argument shape from a SubscriptionBuilder.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionIncoming.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionIncoming.html new file mode 100644 index 00000000..cfed5955 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionIncoming.html @@ -0,0 +1,2 @@ +SubscriptionIncoming | Libraries

Type Alias SubscriptionIncoming<E>

SubscriptionIncoming: E extends SubscriptionBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    infer TIncoming,
    any,
>
    ? TIncoming extends SchemaBuilder<any, any, any, any, any>
        ? InferType<TIncoming>
        : TIncoming
    : never

Extracts the incoming (client→server) message type from a SubscriptionBuilder.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionOutgoing.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionOutgoing.html new file mode 100644 index 00000000..43ea9180 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..SubscriptionOutgoing.html @@ -0,0 +1,2 @@ +SubscriptionOutgoing | Libraries

Type Alias SubscriptionOutgoing<E>

SubscriptionOutgoing: E extends SubscriptionBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    infer TOutgoing,
>
    ? TOutgoing extends SchemaBuilder<any, any, any, any, any>
        ? InferType<TOutgoing>
        : TOutgoing
    : unknown

Extracts the outgoing (server→client) event type from a SubscriptionBuilder.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..TypedClient.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..TypedClient.html new file mode 100644 index 00000000..0be33fcd --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client..TypedClient.html @@ -0,0 +1,8 @@ +TypedClient | Libraries

Type Alias TypedClient<T>

TypedClient: {
    [G in keyof T]: { [E in keyof T[G]]: ContractMemberCall<T[G][E]> }
}

Maps an ApiContract to a fully typed client object.

+

Each group becomes a namespace and each endpoint within that group +becomes a callable async function (HTTP) or subscription factory (WS).

+

Type Parameters

  • T extends ApiContract

    The exact API contract type (preserving endpoint builder generics).

    +
// Given:
const api = defineApi({
todos: { list: ..., create: ..., delete: ... },
auth: { login: ... },
});

type Client = TypedClient<typeof api>;
// {
// todos: {
// list: (args: { query: ... }) => Promise<TodoResponse[]>,
// create: (args: { body: ... }) => Promise<TodoResponse>,
// delete: (args: { params: ... }) => Promise<void>,
// },
// auth: {
// login: (args: { body: ... }) => Promise<{ token: string }>,
// },
// } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.EndpointQueryHooks.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.EndpointQueryHooks.html new file mode 100644 index 00000000..3e82d7b5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.EndpointQueryHooks.html @@ -0,0 +1,7 @@ +EndpointQueryHooks | Libraries

Type Alias EndpointQueryHooks<TArgs, TData>

EndpointQueryHooks: TArgs extends undefined
    ? {
        prefetch(queryClient: QueryClient): Promise<void>;
        queryKey(): readonly unknown[];
        useMutation(
            options?: MutationHookOptions<TData, void>,
        ): UseMutationResult<TData, WebError, void>;
        useQuery(
            options?: QueryHookOptions<TData>,
        ): UseQueryResult<TData, WebError>;
        useSuspenseQuery(
            options?: SuspenseQueryHookOptions<TData>,
        ): UseSuspenseQueryResult<TData, WebError>;
    }
    : {
        prefetch(queryClient: QueryClient, args: TArgs): Promise<void>;
        queryKey(args?: TArgs): readonly unknown[];
        useInfiniteQuery<TPageParam = unknown>(
            getArgs: (pageParam: TPageParam) => TArgs,
            options: InfiniteQueryHookOptions<TData, TPageParam>,
        ): UseInfiniteQueryResult<InfiniteData<TData, TPageParam>, WebError>;
        useMutation(
            options?: MutationHookOptions<TData, TArgs>,
        ): UseMutationResult<TData, WebError, TArgs>;
        useQuery(
            args?: TArgs,
            options?: QueryHookOptions<TData>,
        ): UseQueryResult<TData, WebError>;
        useSuspenseQuery(
            args?: TArgs,
            options?: SuspenseQueryHookOptions<TData>,
        ): UseSuspenseQueryResult<TData, WebError>;
    }

The set of TanStack Query hooks and helpers exposed for each endpoint +on the typed query client.

+

When TArgs is undefined (endpoint requires no arguments), the hooks +can be called without an arguments parameter.

+

Type Parameters

  • TArgs

    The endpoint's call arguments type (EndpointCallArgs<E>).

    +
  • TData

    The endpoint's success response type (EndpointResponse<E>).

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.InfiniteQueryHookOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.InfiniteQueryHookOptions.html new file mode 100644 index 00000000..37478868 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.InfiniteQueryHookOptions.html @@ -0,0 +1,6 @@ +InfiniteQueryHookOptions | Libraries

Type Alias InfiniteQueryHookOptions<TData, TPageParam>

InfiniteQueryHookOptions: Omit<
    UseInfiniteQueryOptions<
        TData,
        WebError,
        InfiniteData<TData, TPageParam>,
        QueryKey,
        TPageParam,
    >,
    "queryKey" | "queryFn",
>

Options for useInfiniteQuery hooks. You must provide +initialPageParam and getNextPageParam as required by TanStack Query. +queryKey and queryFn are managed automatically.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
  • TPageParam

    The page parameter type (e.g. number).

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.MutationHookOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.MutationHookOptions.html new file mode 100644 index 00000000..5ff6f449 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.MutationHookOptions.html @@ -0,0 +1,4 @@ +MutationHookOptions | Libraries

Type Alias MutationHookOptions<TData, TArgs>

MutationHookOptions: Omit<
    UseMutationOptions<TData, WebError, TArgs>,
    "mutationFn",
>

Options for useMutation hooks, with mutationFn managed automatically.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
  • TArgs

    The endpoint's call arguments type.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.QueryHookOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.QueryHookOptions.html new file mode 100644 index 00000000..47f2e536 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.QueryHookOptions.html @@ -0,0 +1,4 @@ +QueryHookOptions | Libraries

Type Alias QueryHookOptions<TData>

QueryHookOptions: Omit<
    UseQueryOptions<TData, WebError, TData, QueryKey>,
    "queryKey" | "queryFn",
>

Options for useQuery hooks, with queryKey and queryFn managed +automatically by the library.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.SuspenseQueryHookOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.SuspenseQueryHookOptions.html new file mode 100644 index 00000000..35b8b77a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.SuspenseQueryHookOptions.html @@ -0,0 +1,4 @@ +SuspenseQueryHookOptions | Libraries

Type Alias SuspenseQueryHookOptions<TData>

SuspenseQueryHookOptions: Omit<
    UseSuspenseQueryOptions<TData, WebError, TData, QueryKey>,
    "queryKey" | "queryFn",
>

Options for useSuspenseQuery hooks, with queryKey and queryFn +managed automatically.

+

Type Parameters

  • TData

    The endpoint's success response type.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.TypedQueryClient.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.TypedQueryClient.html new file mode 100644 index 00000000..60e892bb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.TypedQueryClient.html @@ -0,0 +1,8 @@ +TypedQueryClient | Libraries

Type Alias TypedQueryClient<T>

TypedQueryClient: { [G in keyof T]: TypedQueryGroup<T[G]> }

Maps an API contract to a fully typed query client.

+

Each group becomes a namespace containing endpoint hooks, plus a +group-level queryKey() method for bulk invalidation.

+

Type Parameters

  • T extends ApiContract

    The exact API contract type from defineApi().

    +
const queryApi = createQueryClient(api, { baseUrl: '/api' });

// In a component:
const { data } = queryApi.todos.list.useQuery({ query: { page: 1 } });
const mutation = queryApi.todos.create.useMutation({
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: queryApi.todos.queryKey()
});
}
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.TypedQueryGroup.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.TypedQueryGroup.html new file mode 100644 index 00000000..3ac213a5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.TypedQueryGroup.html @@ -0,0 +1,11 @@ +TypedQueryGroup | Libraries

Type Alias TypedQueryGroup<TGroup>

TypedQueryGroup: {
    [E in keyof TGroup]: EndpointQueryHooks<
        EndpointCallArgs<TGroup[E]>,
        EndpointResponse<TGroup[E]>,
    >
} & { queryKey(): readonly unknown[] }

A single API group on the typed query client.

+

Each endpoint in the group is mapped to its EndpointQueryHooks. +The group also exposes a queryKey() method for group-level +cache invalidation.

+

Type Parameters

  • TGroup extends Record<string, any>

Type Declaration

  • queryKey: function
    • Returns a query key prefix for this entire group. +Use with queryClient.invalidateQueries() to invalidate all +queries in the group at once.

      +

      Returns readonly unknown[]

      queryClient.invalidateQueries({
      queryKey: queryApi.todos.queryKey()
      }); +
      + +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedClient.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedClient.html new file mode 100644 index 00000000..530b0ea9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedClient.html @@ -0,0 +1,8 @@ +UnifiedClient | Libraries

Type Alias UnifiedClient<T>

UnifiedClient: { [G in keyof T]: UnifiedGroup<T[G]> }

Maps an API contract to a unified client where every endpoint is both +a callable function (direct HTTP fetch) and an object with TanStack +Query hooks.

+

Type Parameters

  • T extends ApiContract

    The exact API contract type from defineApi().

    +
const client = createClient(api, { baseUrl: '/api' });

// Direct fetch
const todos = await client.todos.list();

// React hooks
const { data } = client.todos.list.useQuery(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedEndpointCall.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedEndpointCall.html new file mode 100644 index 00000000..31a2033e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedEndpointCall.html @@ -0,0 +1,9 @@ +UnifiedEndpointCall | Libraries

Type Alias UnifiedEndpointCall<E>

UnifiedEndpointCall: EndpointCall<E> & EndpointQueryHooks<
    EndpointCallArgs<E>,
    EndpointResponse<E>,
>

A single endpoint on the unified client.

+

The endpoint is callable (direct HTTP fetch, same as @cleverbrush/web) +and also exposes TanStack Query hooks (useQuery, useMutation, etc.) +as properties on the same object.

+

Type Parameters

  • E

    An EndpointBuilder instance type.

    +
// Direct fetch
const todos = await client.todos.list();

// React Query hooks
const { data } = client.todos.list.useQuery();
const mutation = client.todos.create.useMutation();

// Streaming
for await (const line of client.todos.export.stream()) { ... } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedGroup.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedGroup.html new file mode 100644 index 00000000..4f7c9d7f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_client.react.UnifiedGroup.html @@ -0,0 +1,5 @@ +UnifiedGroup | Libraries

Type Alias UnifiedGroup<TGroup>

UnifiedGroup: { [E in keyof TGroup]: UnifiedMemberCall<TGroup[E]> } & {
    queryKey(): readonly unknown[];
}

A group on the unified client.

+

Each endpoint is a UnifiedEndpointCall — callable with hooks. +The group also exposes a queryKey() method for bulk cache invalidation.

+

Type Parameters

  • TGroup extends Record<string, any>

Type Declaration

  • queryKey: function
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_deep.Merge.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_deep.Merge.html new file mode 100644 index 00000000..16562b4e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_deep.Merge.html @@ -0,0 +1,2 @@ +Merge | Libraries

Type Alias Merge<T>

Merge: T["length"] extends 3
    ? MergeTwo<T[0], MergeTwo<T[1], T[2]>>
    : T["length"] extends 2
        ? MergeTwo<T[0], T[1]>
        : T["length"] extends 1
            ? T[0]
            : T extends [...(infer K), infer PL, infer L]
                ? Merge<[Merge<[...K]>, MergeTwo<PL, L>]>
                : never

Recursively merges a tuple of object types from left to right.

+

Type Parameters

  • T extends unknown[]
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_deep.MergeTwo.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_deep.MergeTwo.html new file mode 100644 index 00000000..46894083 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_deep.MergeTwo.html @@ -0,0 +1,2 @@ +MergeTwo | Libraries

Type Alias MergeTwo<T1, T2>

MergeTwo: PropsInFirstOnly<T1, T2> & PropsInFirstOnly<T2, T1> & {
    [k in keyof CommonProps<T1, T2>]: T1[k] extends Record<string, unknown>
        ? T2[k] extends Record<string, unknown>
            ? MergeTwo<T1[k], T2[k]>
            : T2[k]
        : T2[k]
}

Recursively merges two object types. Matching keys are merged; unique keys are kept.

+

Type Parameters

  • T1
  • T2
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_di.ServiceFactory.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_di.ServiceFactory.html new file mode 100644 index 00000000..7c77dd2b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_di.ServiceFactory.html @@ -0,0 +1,8 @@ +ServiceFactory | Libraries

Type Alias ServiceFactory<T>

ServiceFactory: (provider: IServiceProvider) => T

A factory function that creates a service instance, optionally resolving +other services from the provided ServiceProvider.

+

Type Parameters

  • T

    The type of the service instance the factory creates.

    +

Type Declaration

const loggerFactory: ServiceFactory<Logger> = (provider) => {
const config = provider.get(IConfig);
return new Logger(config.logLevel);
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvConfig.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvConfig.html new file mode 100644 index 00000000..0a4a06c7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvConfig.html @@ -0,0 +1,2 @@ +EnvConfig | Libraries

Type Alias EnvConfig

EnvConfig: Record<string, EnvConfigNode>

Top-level config descriptor: a record of EnvConfigNodes.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvConfigNode.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvConfigNode.html new file mode 100644 index 00000000..fd397541 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvConfigNode.html @@ -0,0 +1,8 @@ +EnvConfigNode | Libraries

Type Alias EnvConfigNode

EnvConfigNode: EnvField<any> | { readonly [key: string]: EnvConfigNode }

A node in the config descriptor tree.

+
    +
  • Leaf: an EnvField (created via env())
  • +
  • Branch: a plain object whose values are themselves EnvConfigNodes
  • +
+

Schema builders without env() wrapping intentionally fail to satisfy +this type, producing a compile-time error.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvField.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvField.html new file mode 100644 index 00000000..59cf135f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.EnvField.html @@ -0,0 +1,6 @@ +EnvField | Libraries

Type Alias EnvField<T>

A branded wrapper around a schema builder that associates it with an +environment variable name. Created exclusively by the env function.

+
type EnvField<T extends SchemaBuilder<any, any, any, any, any>> = {
    "[ENV_FIELD_BRAND]": true;
    schema: T;
    varName: string;
}

Type Parameters

  • T extends SchemaBuilder<any, any, any, any, any>
Index

Properties

"[ENV_FIELD_BRAND]": true
schema: T
varName: string
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.InferEnvConfig.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.InferEnvConfig.html new file mode 100644 index 00000000..c26c8606 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_env.InferEnvConfig.html @@ -0,0 +1,6 @@ +InferEnvConfig | Libraries

Type Alias InferEnvConfig<T>

InferEnvConfig: {
    [K in keyof T]: T[K] extends EnvField<infer S>
        ? InferType<S>
        : T[K] extends Record<string, any> ? InferEnvConfig<T[K]> : never
}

Recursively infers the runtime type from an EnvConfig descriptor tree.

+
    +
  • EnvField<S> leaves resolve to InferType<S>
  • +
  • Object branches resolve to { [K]: InferEnvConfig<V> }
  • +
+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..ColumnRef.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..ColumnRef.html new file mode 100644 index 00000000..5fadebca --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..ColumnRef.html @@ -0,0 +1 @@ +ColumnRef | Libraries

Type Alias ColumnRef<T>

ColumnRef:
    | SchemaKeys<T>
    | (
        (
            tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
        ) => PropertyDescriptor<SchemaBase<T>, any, any>
    )

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityPropSelector.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityPropSelector.html new file mode 100644 index 00000000..a1c05e56 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityPropSelector.html @@ -0,0 +1,6 @@ +EntityPropSelector | Libraries

Type Alias EntityPropSelector<TSchema, TKey>

EntityPropSelector: (
    t: EntityTree<TSchema>,
) => { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

Selector callback that receives a real PropertyDescriptorTree so +t => t.someProp navigates to the property definition and preserves its +JSDoc in IDE tooltips. The return shape is matched structurally on the +[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR].propertyName field, which captures +the literal property key as TKey.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TKey extends string = string

Type Declaration

    • (
          t: EntityTree<TSchema>,
      ): { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }
    • Parameters

      Returns { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityRelationKeys.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityRelationKeys.html new file mode 100644 index 00000000..6f4bef92 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityRelationKeys.html @@ -0,0 +1,4 @@ +EntityRelationKeys | Libraries

Type Alias EntityRelationKeys<E>

EntityRelationKeys: E extends Entity<any, infer R, any>
    ? keyof R & string
    : never

Type-level helper: union of relation key names declared on an entity. +Used by SchemaQueryBuilder.insert()/update()/upsert() to omit relation +navigation properties from accepted input.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityRelations.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityRelations.html new file mode 100644 index 00000000..12dfa1b5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityRelations.html @@ -0,0 +1,2 @@ +EntityRelations | Libraries

Type Alias EntityRelations<E>

EntityRelations: E extends Entity<any, infer R, any> ? R : never

Type-level helper: extract TRels from any Entity type.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntitySchema.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntitySchema.html new file mode 100644 index 00000000..89988a3b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntitySchema.html @@ -0,0 +1,2 @@ +EntitySchema | Libraries

Type Alias EntitySchema<E>

EntitySchema: E extends Entity<infer S, any, any> ? S : never

Type-level helper: extract the underlying schema type from any Entity.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityVariantUnion.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityVariantUnion.html new file mode 100644 index 00000000..bf65bdf6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..EntityVariantUnion.html @@ -0,0 +1,3 @@ +EntityVariantUnion | Libraries

Type Alias EntityVariantUnion<E>

EntityVariantUnion: E extends Entity<any, any, infer U> ? U : never

Type-level helper: extract the accumulated variant union from any Entity. +Resolves to never for non-polymorphic entities.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..InsertType.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..InsertType.html new file mode 100644 index 00000000..d8d389bc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..InsertType.html @@ -0,0 +1 @@ +InsertType | Libraries

Type Alias InsertType<T>

InsertType: InferType<ReturnType<T["makeAllPropsOptional"]>>

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..PrimaryKeyOf.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..PrimaryKeyOf.html new file mode 100644 index 00000000..1fcc7d9d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..PrimaryKeyOf.html @@ -0,0 +1,13 @@ +PrimaryKeyOf | Libraries

Type Alias PrimaryKeyOf<S>

PrimaryKeyOf: S extends { "[COMPOSITE_PRIMARY_KEY_BRAND]"?: infer TCols }
    ? TCols extends readonly string[] ? TCols : never
    : {
        [K in keyof SchemaPropsForPk<S> & string]: IsPkBranded<
            SchemaPropsForPk<S>[K],
        > extends true
            ? K
            : never
    }[keyof SchemaPropsForPk<S> & string]

Extract the primary-key column descriptor for a schema.

+

Returns:

+
    +
  • the literal property-key string for a single-column primary key +(e.g. 'id'),
  • +
  • a tuple of property-key strings for a composite primary key +(e.g. ['userId', 'roleId']),
  • +
  • or never if no primary key is declared.
  • +
+

Composite primary keys are detected via the COMPOSITE_PRIMARY_KEY_BRAND +placed on the object schema by .hasPrimaryKey([...] as const). Use +as const on the column tuple to preserve ordering at the type level.

+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..PrimaryKeyValueOf.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..PrimaryKeyValueOf.html new file mode 100644 index 00000000..6d9318b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..PrimaryKeyValueOf.html @@ -0,0 +1,9 @@ +PrimaryKeyValueOf | Libraries

Type Alias PrimaryKeyValueOf<S>

PrimaryKeyValueOf: PrimaryKeyOf<S> extends readonly (infer _Item extends string)[]
    ? PrimaryKeyOf<S> extends readonly string[]
        ? PkTupleValue<S, PrimaryKeyOf<S>>
        : never
    : PrimaryKeyOf<S> extends string
        ? InferType<S>[PrimaryKeyOf<S> & keyof InferType<S>]
        : never

The runtime value type of a schema's primary key.

+
    +
  • For a single-column PK, the inferred type of that property +(e.g. number).
  • +
  • For a composite PK, a tuple of inferred property types in declared +order (e.g. [number, number]).
  • +
  • never if no primary key is declared.
  • +
+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..RowVersionStrategy.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..RowVersionStrategy.html new file mode 100644 index 00000000..5f553eda --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..RowVersionStrategy.html @@ -0,0 +1,7 @@ +RowVersionStrategy | Libraries

Type Alias RowVersionStrategy

RowVersionStrategy: "increment" | "timestamp" | "manual"

Concurrency-token strategy stored by .rowVersion().

+
    +
  • 'increment' — ORM increments an integer counter on each UPDATE.
  • +
  • 'timestamp' — ORM sets the value to new Date() on each UPDATE.
  • +
  • 'manual' — caller supplies the new value; ORM only enforces the check.
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SchemaKeys.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SchemaKeys.html new file mode 100644 index 00000000..51583f02 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SchemaKeys.html @@ -0,0 +1 @@ +SchemaKeys | Libraries

Type Alias SchemaKeys<T>

SchemaKeys: keyof InferType<T> & string

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SchemaProps.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SchemaProps.html new file mode 100644 index 00000000..b04e67d7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SchemaProps.html @@ -0,0 +1,3 @@ +SchemaProps | Libraries

Type Alias SchemaProps<T>

SchemaProps: T extends ObjectSchemaBuilder<
    infer P,
    any,
    any,
    any,
    any,
    any,
    any,
>
    ? P
    : never

Extract the property record { [name]: SchemaBuilder } from any +ObjectSchemaBuilder regardless of variance positions.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SelectProjection.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SelectProjection.html new file mode 100644 index 00000000..74d0b7b8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SelectProjection.html @@ -0,0 +1,5 @@ +SelectProjection | Libraries

Type Alias SelectProjection<R>

SelectProjection: { [K in keyof R]: InferType<DescriptorPropertySchema<R[K]>> }

Result row type produced by a SelectProjection selector.

+

Each entry's value is the InferType of the property schema the +descriptor points at, so .select(t => ({ id: t.id, n: t.title })) +yields { id: number; n: string }.

+

Type Parameters

  • R extends Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SelectSelector.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SelectSelector.html new file mode 100644 index 00000000..c11205ea --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..SelectSelector.html @@ -0,0 +1,4 @@ +SelectSelector | Libraries

Type Alias SelectSelector<T>

SelectSelector: (
    tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
) => Record<string, PropertyDescriptor<any, any, any>>

Callback shape accepted by the projection overload of select. The +callback receives the schema's property-descriptor tree and returns an +{ alias: descriptor } record.

+

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

Type Declaration

    • (
          tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
      ): Record<string, PropertyDescriptor<any, any, any>>
    • Parameters

      • tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>

      Returns Record<string, PropertyDescriptor<any, any, any>>

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..UnwrapNavSchema.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..UnwrapNavSchema.html new file mode 100644 index 00000000..f73e7f6a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..UnwrapNavSchema.html @@ -0,0 +1,3 @@ +UnwrapNavSchema | Libraries

Type Alias UnwrapNavSchema<TProp>

UnwrapNavSchema: TProp extends ArraySchemaBuilder<infer TEl, any, any, any>
    ? TEl extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TEl
        : never
    : TProp extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TProp
        : TProp extends SchemaBuilder<infer T, any, any, any, any>
            ? T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
                ? T
                : never
            : never

Peel .optional() / array(...) wrappers off a navigation property's +schema to recover the underlying foreign ObjectSchemaBuilder.

+

Type Parameters

  • TProp
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..ValidatedSpec.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..ValidatedSpec.html new file mode 100644 index 00000000..545fa291 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..ValidatedSpec.html @@ -0,0 +1 @@ +ValidatedSpec | Libraries
ValidatedSpec:
    | { type: "one" } & ValidatedJoinOneSpec
    | { type: "many" } & ValidatedJoinManySpec
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..VariantBranch.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..VariantBranch.html new file mode 100644 index 00000000..e35a8292 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..VariantBranch.html @@ -0,0 +1,4 @@ +VariantBranch | Libraries

Type Alias VariantBranch<TBaseSchema, TVarSchema>

VariantBranch: Omit<InferType<TBaseSchema>, keyof InferType<TVarSchema>> & InferType<
    TVarSchema,
>

Merge type for a single polymorphic variant branch: variant schema fields +overlay base schema fields (narrowing the discriminator from string to its +specific literal value).

+

Type Parameters

  • TBaseSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVarSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..VariantStorageType.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..VariantStorageType.html new file mode 100644 index 00000000..ea42e689 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..VariantStorageType.html @@ -0,0 +1,2 @@ +VariantStorageType | Libraries

Type Alias VariantStorageType

VariantStorageType: "cti" | "sti"

Storage strategy for a polymorphic variant.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithJoinedMany.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithJoinedMany.html new file mode 100644 index 00000000..84d6aef2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithJoinedMany.html @@ -0,0 +1,2 @@ +WithJoinedMany | Libraries

Type Alias WithJoinedMany<TBase, TFieldName, TForeignSchema>

WithJoinedMany: TBase & { [K in TFieldName]: InferType<TForeignSchema>[] }

Adds a joined collection field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithJoinedOne.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithJoinedOne.html new file mode 100644 index 00000000..6f3cbd58 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithJoinedOne.html @@ -0,0 +1,2 @@ +WithJoinedOne | Libraries

Type Alias WithJoinedOne<TBase, TFieldName, TForeignSchema, TRequired>

WithJoinedOne: TBase & {
    [K in TFieldName]: TRequired extends true
        ? InferType<TForeignSchema>
        : InferType<TForeignSchema> | null
}

Adds a single joined object field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRequired extends boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithRelation.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithRelation.html new file mode 100644 index 00000000..beca572f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_knex-schema..WithRelation.html @@ -0,0 +1,3 @@ +WithRelation | Libraries

Type Alias WithRelation<TSchema, TRels, TKey, TKind, TForeign, TVariantUnion>

WithRelation: Entity<
    TSchema,
    TRels & Record<TKey, RelationInfo<TKind, TForeign>>,
    TVariantUnion,
>

Return type for an Entity method that adds a relation: keeps TSchema, +extends TRels with one more entry, and preserves TVariantUnion.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRels extends Record<string, RelationInfo>
  • TKey extends string
  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVariantUnion = never
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..Enricher.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..Enricher.html new file mode 100644 index 00000000..a96dccaf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..Enricher.html @@ -0,0 +1,4 @@ +Enricher | Libraries

Type Alias Enricher

Enricher: (event: LogEvent) => LogEvent

An enricher adds or transforms properties on a log event.

+

Enrichers are pure functions that return a new event with additional +properties — they must not mutate the input event.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogFilter.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogFilter.html new file mode 100644 index 00000000..ec994347 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogFilter.html @@ -0,0 +1,3 @@ +LogFilter | Libraries

Type Alias LogFilter

LogFilter: (event: LogEvent) => boolean

A filter that determines whether a log event should be emitted.

+

Return true to keep the event, false to discard it.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogLevel.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogLevel.html new file mode 100644 index 00000000..f3b2b25d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogLevel.html @@ -0,0 +1,7 @@ +LogLevel | Libraries

Type Alias LogLevel

LogLevel: typeof LogLevel[keyof typeof LogLevel]

Log severity levels as a const object.

+

Use as values (LogLevel.Information) or as a type (LogLevel). +Levels are ordered numerically — higher values indicate greater severity.

+
if (logger.isEnabled(LogLevel.Debug)) {
logger.debug('Expensive computation: {@Result}', { Result: compute() });
} +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogLevelName.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogLevelName.html new file mode 100644 index 00000000..434427ab --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..LogLevelName.html @@ -0,0 +1,2 @@ +LogLevelName | Libraries

Type Alias LogLevelName

LogLevelName: "trace" | "debug" | "information" | "warning" | "error" | "fatal"

Log level name strings for configuration and display.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..SamplingRates.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..SamplingRates.html new file mode 100644 index 00000000..b53b5b66 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_log..SamplingRates.html @@ -0,0 +1,3 @@ +SamplingRates | Libraries

Type Alias SamplingRates

SamplingRates: Partial<Record<LogLevelName, number>>

Sampling rates per log level. Values are 0–1 where 1 = keep all, 0 = drop all. +Unspecified levels pass through unfiltered.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_mapper.SchemaToSchemaMapperResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_mapper.SchemaToSchemaMapperResult.html new file mode 100644 index 00000000..63a90c60 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_mapper.SchemaToSchemaMapperResult.html @@ -0,0 +1 @@ +SchemaToSchemaMapperResult | Libraries

Type Alias SchemaToSchemaMapperResult<TFromSchema, TToSchema>

SchemaToSchemaMapperResult: (
    from: InferType<TFromSchema>,
) => Promise<InferType<TToSchema>>

Type Parameters

  • TFromSchema extends ObjectSchemaBuilder<any, any, any>
  • TToSchema extends ObjectSchemaBuilder<any, any, any>

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ColumnRef.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ColumnRef.html new file mode 100644 index 00000000..40aa395d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ColumnRef.html @@ -0,0 +1 @@ +ColumnRef | Libraries

Type Alias ColumnRef<T>

ColumnRef:
    | SchemaKeys<T>
    | (
        (
            tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
        ) => PropertyDescriptor<SchemaBase<T>, any, any>
    )

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.DbContext.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.DbContext.html new file mode 100644 index 00000000..ddbc2f63 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.DbContext.html @@ -0,0 +1,8 @@ +DbContext | Libraries

Type Alias DbContext<TMap>

DbContext: { readonly [K in keyof TMap]: DbSet<TMap[K]> } & {
    knex: Knex;
    transaction<T>(callback: (db: DbContext<TMap>) => Promise<T>): Promise<T>;
    withTransaction(trx: Transaction): DbContext<TMap>;
}

The shape of the context object returned by createDb: every +registered entity becomes a typed DbSet property.

+

Type Parameters

Type Declaration

  • Readonlyknex: Knex

    The underlying Knex instance the context was constructed with.

    +
  • transaction: function
    • Run callback inside a Knex transaction. The callback receives a new +DbContext whose DbSets are bound to the transaction.

      +

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

  • withTransaction: function
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityMap.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityMap.html new file mode 100644 index 00000000..6286401d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityMap.html @@ -0,0 +1,2 @@ +EntityMap | Libraries

Type Alias EntityMap

EntityMap: Record<string, Entity<any, any, any>>

The map of entity name → entity definition passed to createDb.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityPropSelector.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityPropSelector.html new file mode 100644 index 00000000..885a9854 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityPropSelector.html @@ -0,0 +1,6 @@ +EntityPropSelector | Libraries

Type Alias EntityPropSelector<TSchema, TKey>

EntityPropSelector: (
    t: EntityTree<TSchema>,
) => { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

Selector callback that receives a real PropertyDescriptorTree so +t => t.someProp navigates to the property definition and preserves its +JSDoc in IDE tooltips. The return shape is matched structurally on the +[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR].propertyName field, which captures +the literal property key as TKey.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TKey extends string = string

Type Declaration

    • (
          t: EntityTree<TSchema>,
      ): { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }
    • Parameters

      Returns { "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": { propertyName: TKey } }

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityRelationKeys.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityRelationKeys.html new file mode 100644 index 00000000..0f8986e9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityRelationKeys.html @@ -0,0 +1,4 @@ +EntityRelationKeys | Libraries

Type Alias EntityRelationKeys<E>

EntityRelationKeys: E extends Entity<any, infer R, any>
    ? keyof R & string
    : never

Type-level helper: union of relation key names declared on an entity. +Used by SchemaQueryBuilder.insert()/update()/upsert() to omit relation +navigation properties from accepted input.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityRelations.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityRelations.html new file mode 100644 index 00000000..8aaaf161 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityRelations.html @@ -0,0 +1,2 @@ +EntityRelations | Libraries

Type Alias EntityRelations<E>

EntityRelations: E extends Entity<any, infer R, any> ? R : never

Type-level helper: extract TRels from any Entity type.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityResult.html new file mode 100644 index 00000000..ac0b6a67 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityResult.html @@ -0,0 +1,8 @@ +EntityResult | Libraries

Type Alias EntityResult<TEntity>

EntityResult: TEntity extends Entity<any, any, infer U>
    ? [U] extends [never] ? InferType<EntitySchema<TEntity>> : U
    : InferType<EntitySchema<TEntity>>

The natural result row for a freshly initiated query against an entity.

+

For ordinary entities this is InferType<EntitySchema<T>>. For +polymorphic entities (declared via .withVariants()), this resolves to +the discriminated union of all variant rows, so:

+
const a = await db.activities.find(1);
if (a?.type === 'assigned') {
a.assigneeId; // narrowed
} +
+ +

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityResultByVariant.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityResultByVariant.html new file mode 100644 index 00000000..eef9584b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityResultByVariant.html @@ -0,0 +1,3 @@ +EntityResultByVariant | Libraries

Type Alias EntityResultByVariant<TEntity>

EntityResultByVariant: TEntity extends Entity<any, any, infer U>
    ? [U] extends [never] ? never : U
    : never

Discriminated-union variant rows for a polymorphic entity. Resolves to +never for non-polymorphic entities.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntitySchema.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntitySchema.html new file mode 100644 index 00000000..e1d4f53d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntitySchema.html @@ -0,0 +1,2 @@ +EntitySchema | Libraries

Type Alias EntitySchema<E>

EntitySchema: E extends Entity<infer S, any, any> ? S : never

Type-level helper: extract the underlying schema type from any Entity.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityVariantUnion.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityVariantUnion.html new file mode 100644 index 00000000..834c1cb0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntityVariantUnion.html @@ -0,0 +1,3 @@ +EntityVariantUnion | Libraries

Type Alias EntityVariantUnion<E>

EntityVariantUnion: E extends Entity<any, any, infer U> ? U : never

Type-level helper: extract the accumulated variant union from any Entity. +Resolves to never for non-polymorphic entities.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntryState.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntryState.html new file mode 100644 index 00000000..a62b2439 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.EntryState.html @@ -0,0 +1,2 @@ +EntryState | Libraries

Type Alias EntryState

EntryState: "Added" | "Unchanged" | "Modified" | "Deleted"

Entry state in the identity map. Mirrors EF Core's EntityState.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ExtractBranch.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ExtractBranch.html new file mode 100644 index 00000000..e3dd5c39 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ExtractBranch.html @@ -0,0 +1,8 @@ +ExtractBranch | Libraries

Type Alias ExtractBranch<Union, K>Internal

ExtractBranch: Union extends infer B
    ? {
        [P in keyof B]-?: B[P] extends K
            ? K extends B[P] ? true : never
            : never
    }[keyof B] extends never
        ? never
        : B
    : never

Extract the branch of a discriminated union whose discriminator +property has exactly the literal type K. Works without knowing the +discriminator property name by scanning all properties of each branch.

+

Example:

+
// Union = { type: 'assigned'; ... } | { type: 'commented'; ... }
ExtractBranch<Union, 'assigned'> // → { type: 'assigned'; ... } +
+ +

Type Parameters

  • Union
  • K extends string
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.HasVariants.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.HasVariants.html new file mode 100644 index 00000000..bb1742f4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.HasVariants.html @@ -0,0 +1,3 @@ +HasVariants | Libraries

Type Alias HasVariants<TEntity>

HasVariants: EntityResultByVariant<TEntity> extends never ? false : true

true when TEntity is a polymorphic entity (has at least one variant +declared via .stiVariant() / .ctiVariant()); false otherwise.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.InsertType.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.InsertType.html new file mode 100644 index 00000000..ea40934e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.InsertType.html @@ -0,0 +1 @@ +InsertType | Libraries

Type Alias InsertType<T>

InsertType: InferType<ReturnType<T["makeAllPropsOptional"]>>

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.PrimaryKeyOf.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.PrimaryKeyOf.html new file mode 100644 index 00000000..fea5cc25 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.PrimaryKeyOf.html @@ -0,0 +1,13 @@ +PrimaryKeyOf | Libraries

Type Alias PrimaryKeyOf<S>

PrimaryKeyOf: S extends { "[COMPOSITE_PRIMARY_KEY_BRAND]"?: infer TCols }
    ? TCols extends readonly string[] ? TCols : never
    : {
        [K in keyof SchemaPropsForPk<S> & string]: IsPkBranded<
            SchemaPropsForPk<S>[K],
        > extends true
            ? K
            : never
    }[keyof SchemaPropsForPk<S> & string]

Extract the primary-key column descriptor for a schema.

+

Returns:

+
    +
  • the literal property-key string for a single-column primary key +(e.g. 'id'),
  • +
  • a tuple of property-key strings for a composite primary key +(e.g. ['userId', 'roleId']),
  • +
  • or never if no primary key is declared.
  • +
+

Composite primary keys are detected via the COMPOSITE_PRIMARY_KEY_BRAND +placed on the object schema by .hasPrimaryKey([...] as const). Use +as const on the column tuple to preserve ordering at the type level.

+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.PrimaryKeyValueOf.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.PrimaryKeyValueOf.html new file mode 100644 index 00000000..c7fd44a0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.PrimaryKeyValueOf.html @@ -0,0 +1,9 @@ +PrimaryKeyValueOf | Libraries

Type Alias PrimaryKeyValueOf<S>

PrimaryKeyValueOf: PrimaryKeyOf<S> extends readonly (infer _Item extends string)[]
    ? PrimaryKeyOf<S> extends readonly string[]
        ? PkTupleValue<S, PrimaryKeyOf<S>>
        : never
    : PrimaryKeyOf<S> extends string
        ? InferType<S>[PrimaryKeyOf<S> & keyof InferType<S>]
        : never

The runtime value type of a schema's primary key.

+
    +
  • For a single-column PK, the inferred type of that property +(e.g. number).
  • +
  • For a composite PK, a tuple of inferred property types in declared +order (e.g. [number, number]).
  • +
  • never if no primary key is declared.
  • +
+

Type Parameters

  • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.RelKeyTree.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.RelKeyTree.html new file mode 100644 index 00000000..a39aa0ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.RelKeyTree.html @@ -0,0 +1,4 @@ +RelKeyTree | Libraries

Type Alias RelKeyTree<TEntity>

RelKeyTree: { readonly [K in keyof EntityRelations<TEntity> & string]: K }

{ [relName]: relName } — the accessor object passed to t => t.relName +selectors on .include(). Restricted to the relation keys declared on +TEntity.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ResolvedRel.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ResolvedRel.html new file mode 100644 index 00000000..d18ff707 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ResolvedRel.html @@ -0,0 +1,3 @@ +ResolvedRel | Libraries

Type Alias ResolvedRel<R>

ResolvedRel: R extends RelationInfo<infer Kind, infer F>
    ? F extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? Kind extends "hasMany"
        | "belongsToMany"
            ? InferType<F>[]
            : InferType<F> | undefined
        : never
    : never

Project the navigation-property type added by a single relation: arrays +for one-to-many / many-to-many, optional singletons for to-one.

+

Type Parameters

  • R
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.RowVersionStrategy.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.RowVersionStrategy.html new file mode 100644 index 00000000..fbe4675c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.RowVersionStrategy.html @@ -0,0 +1,7 @@ +RowVersionStrategy | Libraries

Type Alias RowVersionStrategy

RowVersionStrategy: "increment" | "timestamp" | "manual"

Concurrency-token strategy stored by .rowVersion().

+
    +
  • 'increment' — ORM increments an integer counter on each UPDATE.
  • +
  • 'timestamp' — ORM sets the value to new Date() on each UPDATE.
  • +
  • 'manual' — caller supplies the new value; ORM only enforces the check.
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SaveGraph.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SaveGraph.html new file mode 100644 index 00000000..605e249c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SaveGraph.html @@ -0,0 +1,10 @@ +SaveGraph | Libraries

Type Alias SaveGraph<TEntity>

SaveGraph: Partial<EntityResult<TEntity>> & {
    [K in keyof EntityRelations<TEntity>]?: EntityRelations<TEntity>[K] extends RelationInfo<
        infer Kind,
        infer F,
    >
        ? Kind extends "hasMany"
        | "belongsToMany"
            ? ReadonlyArray<SaveGraph<EntityFromForeign<F>>>
            : SaveGraph<EntityFromForeign<F>>
        : never
}

Shape accepted by DbSet.save(graph) — a partial of the entity row +plus optional nested relation values:

+
    +
  • belongsTo / hasOne relations accept a single nested object.
  • +
  • hasMany / belongsToMany relations accept an array of nested objects.
  • +
+

Each nested object is itself a SaveGraph of the foreign entity, +so belongsToMany can pass { id } to attach an existing row, or a +full nested graph to create a new row and link it.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SavingChangesHook.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SavingChangesHook.html new file mode 100644 index 00000000..a13a03ea --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SavingChangesHook.html @@ -0,0 +1,3 @@ +SavingChangesHook | Libraries

Type Alias SavingChangesHook

SavingChangesHook: (entry: EntityEntry<object>) => void | Promise<void>

Pre-save hook callback signature registered via +TrackedDbContext.onSavingChanges(hook).

+

Type Declaration

    • (entry: EntityEntry<object>): void | Promise<void>
    • Parameters

      Returns void | Promise<void>

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SchemaKeys.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SchemaKeys.html new file mode 100644 index 00000000..d6cdbde2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SchemaKeys.html @@ -0,0 +1 @@ +SchemaKeys | Libraries

Type Alias SchemaKeys<T>

SchemaKeys: keyof InferType<T> & string

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SchemaProps.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SchemaProps.html new file mode 100644 index 00000000..c1c4dfb5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SchemaProps.html @@ -0,0 +1,3 @@ +SchemaProps | Libraries

Type Alias SchemaProps<T>

SchemaProps: T extends ObjectSchemaBuilder<
    infer P,
    any,
    any,
    any,
    any,
    any,
    any,
>
    ? P
    : never

Extract the property record { [name]: SchemaBuilder } from any +ObjectSchemaBuilder regardless of variance positions.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SelectProjection.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SelectProjection.html new file mode 100644 index 00000000..7a727896 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SelectProjection.html @@ -0,0 +1,5 @@ +SelectProjection | Libraries

Type Alias SelectProjection<R>

SelectProjection: { [K in keyof R]: InferType<DescriptorPropertySchema<R[K]>> }

Result row type produced by a SelectProjection selector.

+

Each entry's value is the InferType of the property schema the +descriptor points at, so .select(t => ({ id: t.id, n: t.title })) +yields { id: number; n: string }.

+

Type Parameters

  • R extends Record<string, unknown>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SelectSelector.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SelectSelector.html new file mode 100644 index 00000000..c57e3a7d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.SelectSelector.html @@ -0,0 +1,4 @@ +SelectSelector | Libraries

Type Alias SelectSelector<T>

SelectSelector: (
    tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
) => Record<string, PropertyDescriptor<any, any, any>>

Callback shape accepted by the projection overload of select. The +callback receives the schema's property-descriptor tree and returns an +{ alias: descriptor } record.

+

Type Parameters

  • T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

Type Declaration

    • (
          tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>,
      ): Record<string, PropertyDescriptor<any, any, any>>
    • Parameters

      • tree: PropertyDescriptorTree<SchemaBase<T>, SchemaBase<T>>

      Returns Record<string, PropertyDescriptor<any, any, any>>

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.TrackedDbContext.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.TrackedDbContext.html new file mode 100644 index 00000000..98a69c6d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.TrackedDbContext.html @@ -0,0 +1,26 @@ +TrackedDbContext | Libraries

Type Alias TrackedDbContext<TMap>

TrackedDbContext: DbContext<TMap> & {
    "[asyncDispose]"(): Promise<void>;
    attach<T extends object>(entitySetKey: string, entity: T): T;
    detach(entity: object): void;
    discardChanges(): void;
    entry<T extends object>(entity: T): EntityEntry<T>;
    onSavingChanges(hook: SavingChangesHook): void;
    reload(entity: object): Promise<void>;
    remove(entity: object): void;
    saveChanges(): Promise<
        { deleted: number; inserted: number; updated: number },
    >;
}

Extended context returned when { tracking: true } is passed to +createDb. Adds identity-map tracking, unit-of-work saveChanges, +and [Symbol.asyncDispose] support for await using blocks.

+

Type Parameters

Type Declaration

  • [asyncDispose]: function
    • Implements Symbol.asyncDispose for await using blocks.

      +

      Throws PendingChangesError when there are unsaved changes at +the time of disposal — callers must call saveChanges() or +discardChanges() before the scope exits.

      +

      Returns Promise<void>

  • attach: function
    • Attach an entity to the identity map so its changes will be tracked. +If an entity with the same primary key is already tracked, the existing +tracked object is returned (identity-map guarantee).

      +

      Type Parameters

      • T extends object

      Parameters

      • entitySetKey: string

        — the property name used when registering the entity +(e.g. 'todos' for createDb(knex, { todos: TodoEntity })).

        +
      • entity: T

      Returns T

  • detach: function
    • Remove an entity from the identity map. Any subsequent changes to the +object will not be persisted by saveChanges.

      +

      Parameters

      • entity: object

      Returns void

  • discardChanges: function
    • Discard all pending changes. Modified entries are reset to their +snapshots; Added entries are detached; Deleted entries are restored +to Unchanged.

      +

      Returns void

  • entry: function
  • onSavingChanges: function
  • reload: function
    • Reload a tracked entity from the database, overwriting its current +values and refreshing the internal snapshot.

      +

      Parameters

      • entity: object

      Returns Promise<void>

  • remove: function
    • Mark a tracked entity for deletion on the next saveChanges() call.

      +

      Parameters

      • entity: object

      Returns void

  • saveChanges: function
    • Flush all pending changes to the database inside a single transaction.

      +

      Returns Promise<{ deleted: number; inserted: number; updated: number }>

      Counts of inserted, updated, and deleted rows.

      +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.UnwrapNavSchema.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.UnwrapNavSchema.html new file mode 100644 index 00000000..7d8dcc79 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.UnwrapNavSchema.html @@ -0,0 +1,3 @@ +UnwrapNavSchema | Libraries

Type Alias UnwrapNavSchema<TProp>

UnwrapNavSchema: TProp extends ArraySchemaBuilder<infer TEl, any, any, any>
    ? TEl extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TEl
        : never
    : TProp extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
        ? TProp
        : TProp extends SchemaBuilder<infer T, any, any, any, any>
            ? T extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
                ? T
                : never
            : never

Peel .optional() / array(...) wrappers off a navigation property's +schema to recover the underlying foreign ObjectSchemaBuilder.

+

Type Parameters

  • TProp
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ValidatedSpec.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ValidatedSpec.html new file mode 100644 index 00000000..2a08e9a2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.ValidatedSpec.html @@ -0,0 +1 @@ +ValidatedSpec | Libraries

Type Alias ValidatedSpec

ValidatedSpec:
    | { type: "one" } & ValidatedJoinOneSpec
    | { type: "many" } & ValidatedJoinManySpec
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantBranch.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantBranch.html new file mode 100644 index 00000000..2959be82 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantBranch.html @@ -0,0 +1,4 @@ +VariantBranch | Libraries

Type Alias VariantBranch<TBaseSchema, TVarSchema>

VariantBranch: Omit<InferType<TBaseSchema>, keyof InferType<TVarSchema>> & InferType<
    TVarSchema,
>

Merge type for a single polymorphic variant branch: variant schema fields +overlay base schema fields (narrowing the discriminator from string to its +specific literal value).

+

Type Parameters

  • TBaseSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVarSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantInsertPayload.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantInsertPayload.html new file mode 100644 index 00000000..a00a5e4e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantInsertPayload.html @@ -0,0 +1,8 @@ +VariantInsertPayload | Libraries

Type Alias VariantInsertPayload<TEntity, K>

VariantInsertPayload: VariantResult<TEntity, K> extends infer B extends
    Record<string, unknown>
    ? Omit<
        { [P in keyof B]?: B[P] },
        { [P in keyof B]-?: B[P] extends K ? K extends B[P] ? P : never : never }[keyof B],
    >
    : never

Write payload for DbSet.insertVariant(key, payload).

+

All columns from the matching variant branch are optional (so +auto-generated PKs and columns with DB defaults can be omitted), and the +discriminator field is excluded (it is set automatically from key).

+

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string
// Only valid fields for the 'assigned' variant; type-checked at compile time:
await db.activities.insertVariant('assigned', {
todoId: 42,
userId: 7,
assigneeId: 9,
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantResult.html new file mode 100644 index 00000000..a42bf247 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantResult.html @@ -0,0 +1,8 @@ +VariantResult | Libraries

Type Alias VariantResult<TEntity, K>

The concrete result shape for a specific polymorphic variant.

+

For a polymorphic entity that uses .withVariants(), resolves to the +branch of the discriminated union where the discriminator equals K. +Resolves to never for non-polymorphic entities or unknown keys.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string
type AssignedActivity = VariantResult<typeof ActivityEntity, 'assigned'>;
// → { type: 'assigned'; id: number; todoId: number; assigneeId: number; … } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantStorageType.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantStorageType.html new file mode 100644 index 00000000..f7153871 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantStorageType.html @@ -0,0 +1,2 @@ +VariantStorageType | Libraries

Type Alias VariantStorageType

VariantStorageType: "cti" | "sti"

Storage strategy for a polymorphic variant.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantUpdatePayload.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantUpdatePayload.html new file mode 100644 index 00000000..4d54a431 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.VariantUpdatePayload.html @@ -0,0 +1,4 @@ +VariantUpdatePayload | Libraries

Type Alias VariantUpdatePayload<TEntity, K>

VariantUpdatePayload: VariantInsertPayload<TEntity, K>

Write payload for EntityQuery.updateVariant(key, set).

+

Same shape as VariantInsertPayload — partial of the variant +branch with the discriminator excluded.

+

Type Parameters

  • TEntity extends Entity<any, any, any>
  • K extends string
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithIncluded.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithIncluded.html new file mode 100644 index 00000000..9e000405 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithIncluded.html @@ -0,0 +1,2 @@ +WithIncluded | Libraries

Type Alias WithIncluded<TEntity, TResult, K>

WithIncluded: TResult & { [P in K]: ResolvedRel<EntityRelations<TEntity>[P]> }

Result type after .include('rel') is applied.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithJoinedMany.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithJoinedMany.html new file mode 100644 index 00000000..37cbec13 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithJoinedMany.html @@ -0,0 +1,2 @@ +WithJoinedMany | Libraries

Type Alias WithJoinedMany<TBase, TFieldName, TForeignSchema>

WithJoinedMany: TBase & { [K in TFieldName]: InferType<TForeignSchema>[] }

Adds a joined collection field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithJoinedOne.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithJoinedOne.html new file mode 100644 index 00000000..30e4edd0 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithJoinedOne.html @@ -0,0 +1,2 @@ +WithJoinedOne | Libraries

Type Alias WithJoinedOne<TBase, TFieldName, TForeignSchema, TRequired>

WithJoinedOne: TBase & {
    [K in TFieldName]: TRequired extends true
        ? InferType<TForeignSchema>
        : InferType<TForeignSchema> | null
}

Adds a single joined object field to TBase

+

Type Parameters

  • TBase
  • TFieldName extends string
  • TForeignSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRequired extends boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithRelation.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithRelation.html new file mode 100644 index 00000000..48aba20c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithRelation.html @@ -0,0 +1,3 @@ +WithRelation | Libraries

Type Alias WithRelation<TSchema, TRels, TKey, TKind, TForeign, TVariantUnion>

WithRelation: Entity<
    TSchema,
    TRels & Record<TKey, RelationInfo<TKind, TForeign>>,
    TVariantUnion,
>

Return type for an Entity method that adds a relation: keeps TSchema, +extends TRels with one more entry, and preserves TVariantUnion.

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TRels extends Record<string, RelationInfo>
  • TKey extends string
  • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
  • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TVariantUnion = never
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithVariantIncluded.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithVariantIncluded.html new file mode 100644 index 00000000..b468f161 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_orm.WithVariantIncluded.html @@ -0,0 +1,4 @@ +WithVariantIncluded | Libraries

Type Alias WithVariantIncluded<TEntity, TResult, Variant, Rel>

WithVariantIncluded: TResult extends infer U
    ? U extends Record<string, unknown>
        ? Extract<U, Record<string, Variant>> extends never
            ? U
            : Extract<U, Record<string, Variant>> extends U
                ? U & { [P in Rel]: ResolvedRel<EntityRelations<TEntity>[P]> }
                :
                    | Exclude<U, Extract<U, Record<string, Variant>>>
                    | Extract<U, Record<string, Variant>> & {
                        [P in Rel]: ResolvedRel<EntityRelations<(...)>[P]>
                    }
        : U
    : never

Result type after .includeVariant(variant, rel) is applied — adds +Rel only on the discriminated branch matching Variant, leaving +other branches untouched.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_otel.client.ClientMiddleware.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_otel.client.ClientMiddleware.html new file mode 100644 index 00000000..87c337a8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_otel.client.ClientMiddleware.html @@ -0,0 +1,2 @@ +ClientMiddleware | Libraries

Type Alias ClientMiddleware

ClientMiddleware: (next: FetchLike) => FetchLike

Middleware shape accepted by @cleverbrush/client.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_otel.client.FetchLike.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_otel.client.FetchLike.html new file mode 100644 index 00000000..8d82f0c2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_otel.client.FetchLike.html @@ -0,0 +1,4 @@ +FetchLike | Libraries
FetchLike: (url: string, init: RequestInit) => Promise<Response>

A function with the same shape as fetch.

+

Kept local instead of importing from @cleverbrush/client so this +entrypoint remains structurally compatible without a runtime dependency.

+

Type Declaration

    • (url: string, init: RequestInit): Promise<Response>
    • Parameters

      • url: string
      • init: RequestInit

      Returns Promise<Response>

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldProps.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldProps.html new file mode 100644 index 00000000..3a29d926 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldProps.html @@ -0,0 +1,16 @@ +FieldProps | Libraries

Type Alias FieldProps<TSchema>

type FieldProps<TSchema extends ObjectSchemaBuilder<any, any, any>> = {
    fieldProps?: Record<string, unknown>;
    form: SchemaFormInstance<TSchema>;
    forProperty: (
        tree: PropertyDescriptorTree<TSchema, TSchema>,
    ) => PropertyDescriptor<TSchema, any, any>;
    label?: string;
    name?: string;
    renderer?: FieldRenderer;
    variant?: string;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any>
Index

Properties

fieldProps?: Record<string, unknown>

Bag of extra renderer-specific props forwarded to the renderer via +FieldRenderProps.fieldProps (e.g. placeholder, autoComplete).

+
forProperty: (
    tree: PropertyDescriptorTree<TSchema, TSchema>,
) => PropertyDescriptor<TSchema, any, any>
label?: string

Visible label text forwarded to the renderer via FieldRenderProps.label.

+
name?: string

HTML name attribute forwarded to the renderer via FieldRenderProps.name.

+
renderer?: FieldRenderer
variant?: string

Rendering variant hint. Participates in renderer resolution: +the registry is checked for "type:variant" (e.g. "string:password") +before falling back to the base "type" key. +Also forwarded to the renderer via FieldRenderProps.variant.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldRenderProps.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldRenderProps.html new file mode 100644 index 00000000..d06f1e65 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldRenderProps.html @@ -0,0 +1,41 @@ +FieldRenderProps | Libraries

Type Alias FieldRenderProps

Props passed to a field renderer.

+
type FieldRenderProps = {
    dirty: boolean;
    error: string | undefined;
    fieldProps?: Record<string, unknown>;
    initialValue: any;
    label?: string;
    name?: string;
    onBlur: () => void;
    onChange: (value: any) => void;
    schema: SchemaBuilder<any, any, any>;
    setValue: (value: any) => void;
    touched: boolean;
    validating: boolean;
    value: any;
    variant?: string;
}
Index

Properties

dirty: boolean
error: string | undefined
fieldProps?: Record<string, unknown>

Bag of extra renderer-specific props forwarded from the Field component. +Useful for passing HTML attributes (placeholder, autoComplete, type) +or UI-library-specific options without extending FieldRenderProps itself.

+
<Field
forProperty={(t) => t.email}
form={form}
fieldProps={{ placeholder: "you@example.com", autoComplete: "email" }}
/> +
+ +
initialValue: any
label?: string

Visible label text forwarded from the Field component. +Renderers can use this to render a <label> element.

+
<Field forProperty={(t) => t.name} form={form} label="Full name" />
+
+ +
name?: string

HTML name attribute forwarded from the Field component. +Renderers can apply this to the underlying input for FormData submission.

+
<Field forProperty={(t) => t.email} form={form} name="email" />
+
+ +
onBlur: () => void
onChange: (value: any) => void
schema: SchemaBuilder<any, any, any>
setValue: (value: any) => void
touched: boolean
validating: boolean
value: any
variant?: string

Rendering variant hint passed from the Field component. +Used by renderers to select a sub-variant of the base schema type +(e.g. "password" for a string field rendered as a password input).

+

Also participates in renderer resolution: when set, the renderer +registry is first checked for "type:variant" (e.g. "string:password") +before falling back to the base "type" key.

+
<Field forProperty={(t) => t.secret} form={form} variant="password" />
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldRenderer.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldRenderer.html new file mode 100644 index 00000000..c1514218 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldRenderer.html @@ -0,0 +1,2 @@ +FieldRenderer | Libraries

Type Alias FieldRenderer

FieldRenderer: (props: FieldRenderProps) => ReactNode

A renderer function that receives field state and returns a React node.

+

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldState.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldState.html new file mode 100644 index 00000000..d34d322c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FieldState.html @@ -0,0 +1,8 @@ +FieldState | Libraries

Field state tracked per-field.

+
type FieldState = {
    dirty: boolean;
    error: string | undefined;
    initialValue: any;
    touched: boolean;
    validating: boolean;
    value: any;
}
Index

Properties

dirty: boolean
error: string | undefined
initialValue: any
touched: boolean
validating: boolean
value: any
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormProviderProps.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormProviderProps.html new file mode 100644 index 00000000..a37edbff --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormProviderProps.html @@ -0,0 +1,3 @@ +FormProviderProps | Libraries

Type Alias FormProviderProps<TSchema>

type FormProviderProps<TSchema extends ObjectSchemaBuilder<any, any, any>> = {
    children: React.ReactNode;
    form: SchemaFormInstance<TSchema>;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any>
Index

Properties

Properties

children: React.ReactNode
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormSystemConfig.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormSystemConfig.html new file mode 100644 index 00000000..755e392e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormSystemConfig.html @@ -0,0 +1,3 @@ +FormSystemConfig | Libraries

Type Alias FormSystemConfig

Configuration for FormSystemProvider.

+
type FormSystemConfig = {
    renderers?: Record<string, FieldRenderer>;
}
Index

Properties

Properties

renderers?: Record<string, FieldRenderer>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormSystemProviderProps.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormSystemProviderProps.html new file mode 100644 index 00000000..a5ac454e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.FormSystemProviderProps.html @@ -0,0 +1,8 @@ +FormSystemProviderProps | Libraries

Type Alias FormSystemProviderProps

type FormSystemProviderProps = {
    children: React.ReactNode;
    config?: FormSystemConfig;
    renderers?: Record<string, FieldRenderer>;
}
Index

Properties

children: React.ReactNode

Full configuration object (for future extensibility). +If both renderers and config.renderers are provided, renderers takes precedence.

+
renderers?: Record<string, FieldRenderer>

Renderer registry mapping schema types to renderer functions. +Example: { string: (props) => <input .../>, number: (props) => <input type="number" .../> }

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.SchemaFormInstance.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.SchemaFormInstance.html new file mode 100644 index 00000000..e6c379d8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.SchemaFormInstance.html @@ -0,0 +1,11 @@ +SchemaFormInstance | Libraries

Type Alias SchemaFormInstance<TSchema>

Return type for useSchemaForm — fully typed for IntelliSense. +The useField method infers the field value type from the schema via PropertyDescriptor.

+
type SchemaFormInstance<TSchema extends ObjectSchemaBuilder<any, any, any>> = {
    _getFormContext: () => FormContextValue;
    getValue: () => InferType<TSchema>;
    reset: (values?: Partial<InferType<TSchema>>) => void;
    setValue: (values: Partial<InferType<TSchema>>) => void;
    submit: () => Promise<ValidationResult<InferType<TSchema>>>;
    useField: <TPropertySchema extends SchemaBuilder<any, any, any>>(
        forProperty: (
            tree: PropertyDescriptorTree<TSchema, TSchema>,
        ) => PropertyDescriptor<TSchema, TPropertySchema, any>,
    ) => UseFieldResult<InferType<TPropertySchema>>;
    validate: () => Promise<ValidationResult<InferType<TSchema>>>;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any>
Index

Properties

_getFormContext: () => FormContextValue

— Used by FormProvider and Field to access internal context

+
getValue: () => InferType<TSchema>
reset: (values?: Partial<InferType<TSchema>>) => void
setValue: (values: Partial<InferType<TSchema>>) => void
submit: () => Promise<ValidationResult<InferType<TSchema>>>
useField: <TPropertySchema extends SchemaBuilder<any, any, any>>(
    forProperty: (
        tree: PropertyDescriptorTree<TSchema, TSchema>,
    ) => PropertyDescriptor<TSchema, TPropertySchema, any>,
) => UseFieldResult<InferType<TPropertySchema>>
validate: () => Promise<ValidationResult<InferType<TSchema>>>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.UseFieldResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.UseFieldResult.html new file mode 100644 index 00000000..cf4bbc49 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.UseFieldResult.html @@ -0,0 +1,13 @@ +UseFieldResult | Libraries

Type Alias UseFieldResult<T>

Return type for useField — strongly typed with the inferred property value type. +When the value type cannot be inferred, falls back to any.

+
type UseFieldResult<T = any> = {
    dirty: boolean;
    error: string | undefined;
    initialValue: T | undefined;
    onBlur: () => void;
    onChange: (value: T) => void;
    schema: SchemaBuilder<any, any, any>;
    setValue: (value: T) => void;
    touched: boolean;
    validating: boolean;
    value: T | undefined;
}

Type Parameters

  • T = any
Index

Properties

dirty: boolean
error: string | undefined
initialValue: T | undefined
onBlur: () => void
onChange: (value: T) => void
schema: SchemaBuilder<any, any, any>
setValue: (value: T) => void
touched: boolean
validating: boolean
value: T | undefined
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.UseSchemaFormOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.UseSchemaFormOptions.html new file mode 100644 index 00000000..800a63e2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_react-form.UseSchemaFormOptions.html @@ -0,0 +1,19 @@ +UseSchemaFormOptions | Libraries

Type Alias UseSchemaFormOptions

Options for useSchemaForm.

+
type UseSchemaFormOptions = {
    createMissingStructure?: boolean;
    validateOnMount?: boolean;
    validationDebounceMs?: number;
}
Index

Properties

createMissingStructure?: boolean
validateOnMount?: boolean

When true, runs full schema validation on mount and marks all fields +as touched so that error messages (e.g. for required fields) are visible +immediately without waiting for user interaction.

+
false
+
+ +
validationDebounceMs?: number

Debounce delay in milliseconds for onChange-triggered validation. +When set, rapid field changes only trigger one validation run after +the user stops typing for the specified duration.

+

Explicit calls to form.validate(), form.submit(), and +validateOnMount are not debounced — they always run immediately.

+
const form = useSchemaForm(Schema, { validationDebounceMs: 300 });
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_scheduler.TaskSchedule.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_scheduler.TaskSchedule.html new file mode 100644 index 00000000..fe1883f1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_scheduler.TaskSchedule.html @@ -0,0 +1,13 @@ +TaskSchedule | Libraries

Type Alias TaskSchedule

TaskSchedule: InferType<typeof ScheduleSchema>

Schedule for job. Can be one of:

+
    +
  • every N minutes
  • +
  • every N days
  • +
  • every N weeks
  • +
  • every N months
  • +
  • every N years
  • +
  • every N days of week
  • +
  • every N months on N day
  • +
  • every N years on N day of N month
  • +
  • every N years on last day of N month
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.InferFromJsonSchema.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.InferFromJsonSchema.html new file mode 100644 index 00000000..f0ee72c8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.InferFromJsonSchema.html @@ -0,0 +1,8 @@ +InferFromJsonSchema | Libraries

Type Alias InferFromJsonSchema<S>

InferFromJsonSchema: S extends { const: infer V }
    ? V
    : S extends { enum: readonly (infer V)[] }
        ? V
        : S extends { type: "string" }
            ? string
            : S extends { type: "number"
            | "integer" }
                ? number
                : S extends { type: "boolean" }
                    ? boolean
                    : S extends { type: "null" }
                        ? null
                        : S extends { items: infer I; type: "array" }
                            ? InferFromJsonSchema<I>[]
                            : S extends { type: "array" }
                                ? unknown[]
                                : S extends {
                                    properties: infer P;
                                    required: readonly (...);
                                    type: "object";
                                }
                                    ? { [K in (...) as (...)]: (...) } & {
                                        [K in (...) as (...)]?: (...)
                                    }
                                    : S extends { properties: ...; type: ... }
                                        ? { [K in (...)]?: (...) }
                                        : (...) extends (...) ? (...) : (...)

Recursively infers a TypeScript type from a statically-known JSON Schema node.

+

Requires as const on the input object for precise inference — +without it TypeScript widens string literals to string and inference +collapses to unknown.

+

Type Parameters

  • S
type User = InferFromJsonSchema<typeof UserJsonSchema>;
// { name: string; age?: number } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.JsonSchemaNode.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.JsonSchemaNode.html new file mode 100644 index 00000000..84f48fb8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.JsonSchemaNode.html @@ -0,0 +1,4 @@ +JsonSchemaNode | Libraries
JsonSchemaNode:
    | {
        format?: string;
        maxLength?: number;
        minLength?: number;
        pattern?: string;
        type: "string";
        [k: string]: unknown;
    }
    | {
        exclusiveMaximum?: number;
        exclusiveMinimum?: number;
        maximum?: number;
        minimum?: number;
        multipleOf?: number;
        type: "number"
        | "integer";
        [k: string]: unknown;
    }
    | { type: "boolean"; [k: string]: unknown }
    | { type: "null"; [k: string]: unknown }
    | {
        items?: JsonSchemaNode;
        maxItems?: number;
        minItems?: number;
        type: "array";
        [k: string]: unknown;
    }
    | {
        additionalProperties?: boolean;
        properties?: Readonly<Record<string, JsonSchemaNode>>;
        required?: readonly string[];
        type: "object";
        [k: string]: unknown;
    }
    | { const: unknown; [k: string]: unknown }
    | { enum: readonly unknown[]; [k: string]: unknown }
    | {
        anyOf: readonly JsonSchemaNode[];
        discriminator?: {
            mapping?: Readonly<Record<string, string>>;
            propertyName: string;
        };
        [k: string]: unknown;
    }
    | { allOf: readonly JsonSchemaNode[]; [k: string]: unknown }
    | Record<string, never>

Subset of JSON Schema (Draft 7 / 2020-12) accepted as input.

+

For accurate TypeScript type inference via InferFromJsonSchema, +pass schema literals with as const.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.JsonSchemaNodeToBuilder.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.JsonSchemaNodeToBuilder.html new file mode 100644 index 00000000..e70328b2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.JsonSchemaNodeToBuilder.html @@ -0,0 +1,19 @@ +JsonSchemaNodeToBuilder | Libraries

Type Alias JsonSchemaNodeToBuilder<S, TRequired>

JsonSchemaNodeToBuilder: S extends { const: infer V }
    ? ConstToBuilder<V, TRequired>
    : S extends { enum: infer Vals extends readonly unknown[] }
        ? UnionSchemaBuilder<EnumTupleToBuilders<Vals>, TRequired>
        : S extends { anyOf: infer Opts extends readonly unknown[] }
            ? UnionSchemaBuilder<SchemaNodesTupleToBuilders<Opts>, TRequired>
            : S extends { allOf: infer Opts extends readonly unknown[] }
                ? AllOfNodesToBuilder<Opts, TRequired>
                : S extends { type: "string" }
                    ? ExtendedStringBuilder<string, TRequired>
                    : S extends { type: "number" }
                        ? ExtendedNumberBuilder<number, TRequired>
                        : S extends { type: "integer" }
                            ? ExtendedNumberBuilder<number, TRequired>
                            : S extends { type: "boolean" }
                                ? BooleanSchemaBuilder<boolean, TRequired>
                                : S extends { type: "null" }
                                    ? SchemaBuilder<null, TRequired>
                                    : S extends { items: ...; type: ... }
                                        ? ExtendedArrayBuilder<(...), (...)>
                                        : (...) extends (...) ? (...) : (...)

Recursively maps a statically-known JSON Schema node (passed with +as const) to the exact @cleverbrush/schema builder type, including:

+
    +
  • StringSchemaBuilder, NumberSchemaBuilder, BooleanSchemaBuilder +for primitive types and const literals
  • +
  • ArraySchemaBuilder<ElementBuilder> with the element builder inferred +from items
  • +
  • ObjectSchemaBuilder<PropertyDescriptors> where each property is a +typed builder with TRequired = true/false driven by the required +array
  • +
  • UnionSchemaBuilder<[...Builders]> for enum and anyOf
  • +
+

Type Parameters

  • S

    The JSON Schema node type (inferred from as const).

    +
  • TRequired extends boolean = true

    Whether this node represents a required (true) or +optional (false) value in its parent context. Defaults to true.

    +
import { fromJsonSchema } from '@cleverbrush/schema-json';
import type { JsonSchemaNodeToBuilder } from '@cleverbrush/schema-json';

const S = {
type: 'object',
properties: {
name: { type: 'string' },
score: { type: 'number' },
},
required: ['name'],
} as const;

type Builder = JsonSchemaNodeToBuilder<typeof S>;
// ObjectSchemaBuilder<
// { name: ExtendedStringBuilder<string, true> } &
// { score: ExtendedNumberBuilder<number, false> }
// >

const schema = fromJsonSchema(S);
// TypeScript knows schema is ObjectSchemaBuilder<...>
// with full intellisense on .parse(), .addProp(), etc. +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferInput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferInput.html new file mode 100644 index 00000000..ba1c737f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries

Infers the input type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferOutput.html new file mode 100644 index 00000000..f5e31556 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries

Infers the output type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.Target.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.Target.html new file mode 100644 index 00000000..62ac260d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardJSONSchemaV1.Target.html @@ -0,0 +1,4 @@ +Target | Libraries
Target: "draft-2020-12" | "draft-07" | "openapi-3.0" | {} & string

The target version of the generated JSON Schema.

+

It is strongly recommended that implementers support "draft-2020-12" and "draft-07", as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.

+

The "openapi-3.0" target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema "draft-04".

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardTypedV1.InferInput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardTypedV1.InferInput.html new file mode 100644 index 00000000..3e8c44e1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardTypedV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries
InferInput: NonNullable<Schema["~standard"]["types"]>["input"]

Infers the input type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardTypedV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardTypedV1.InferOutput.html new file mode 100644 index 00000000..26da1343 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.StandardTypedV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries
InferOutput: NonNullable<Schema["~standard"]["types"]>["output"]

Infers the output type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.ToJsonSchemaOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.ToJsonSchemaOptions.html new file mode 100644 index 00000000..fc5eaa56 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema-json.ToJsonSchemaOptions.html @@ -0,0 +1,26 @@ +ToJsonSchemaOptions | Libraries

Type Alias ToJsonSchemaOptions

Options accepted by toJsonSchema.

+
type ToJsonSchemaOptions = {
    $schema?: boolean;
    draft?: "2020-12" | "07";
    nameResolver?: (schema: SchemaBuilder) => string | null;
}
Index

Properties

$schema?: boolean

Whether to include the $schema header in the output. +Set to false when embedding in an OpenAPI spec.

+
true
+
+ +
draft?: "2020-12" | "07"

JSON Schema draft version to reference in the $schema header.

+
'2020-12'
+
+ +
nameResolver?: (schema: SchemaBuilder) => string | null

Optional hook called for every schema node before conversion.

+

When provided, the function receives each SchemaBuilder instance +encountered during recursive conversion (including nested ones inside +objects, arrays, and unions). If the function returns a non-null string, +conversion of that node is short-circuited and a +{ $ref: '#/components/schemas/<name>' } object is returned instead of +the full inline JSON Schema.

+

Return null to let conversion proceed normally.

+

Primarily used by @cleverbrush/server-openapi to emit $ref pointers +for schemas registered via .schemaName().

+

Type Declaration

    • (schema: SchemaBuilder): string | null
    • Parameters

      • schema: SchemaBuilder

        The schema node currently being converted.

        +

      Returns string | null

      The component name to reference, or null to inline.

      +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ArraySchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ArraySchemaValidationResult.html new file mode 100644 index 00000000..e4cd8d14 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ArraySchemaValidationResult.html @@ -0,0 +1,9 @@ +ArraySchemaValidationResult | Libraries

Type Alias ArraySchemaValidationResult<TResult, TElementSchema>

ArraySchemaValidationResult: ValidationResult<TResult> & {
    getNestedErrors(): ElementValidationResult<TElementSchema>[] & NestedValidationResult<
        any,
        any,
        any,
    >;
}

Validation result type returned by ArraySchemaBuilder.validate(). +Extends ValidationResult with getNestedErrors for root-level array +errors and per-element validation results.

+

Type Parameters

  • TResult
  • TElementSchema extends SchemaBuilder<any, any, any, any, any>

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.BRAND-1.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.BRAND-1.html new file mode 100644 index 00000000..64bcbe0f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.BRAND-1.html @@ -0,0 +1,2 @@ +BRAND | Libraries

Type Alias BRAND

BRAND: typeof __brand

Symbol used as the key for branded/opaque types.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.Brand.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.Brand.html new file mode 100644 index 00000000..077dcbb7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.Brand.html @@ -0,0 +1,6 @@ +Brand | Libraries

Type Alias Brand<T, TBrand>

Brand: T & { readonly [K in BRAND]: TBrand }

Intersects a base type with a phantom brand tag. +The brand exists only at the type level — zero runtime cost.

+

Type Parameters

  • T
  • TBrand extends string | symbol
type Email = Brand<string, 'Email'>;
type UserId = Brand<number, 'UserId'>; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.CleanExtended.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.CleanExtended.html new file mode 100644 index 00000000..305f18bf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.CleanExtended.html @@ -0,0 +1,5 @@ +CleanExtended | Libraries

Type Alias CleanExtended<TBuilder, TExt>

Produces the consumer-facing type for an extended builder: the base +builder intersected with its fixed extension methods, with +withExtension / getExtension overridden to never so they +don't appear as callable in consumer code.

+

Type Parameters

  • TBuilder
  • TExt
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ElementValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ElementValidationResult.html new file mode 100644 index 00000000..04df3b85 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ElementValidationResult.html @@ -0,0 +1,5 @@ +ElementValidationResult | Libraries

Type Alias ElementValidationResult<TElementSchema>

ElementValidationResult: TElementSchema extends UnionSchemaBuilder<
    infer UOptions extends readonly SchemaBuilder<any, any, any, any, any>[],
    any,
    any,
>
    ? UnionSchemaValidationResult<InferType<TElementSchema>, UOptions>
    : TElementSchema extends ObjectSchemaBuilder<any, any, any, any, any>
        ? ObjectSchemaValidationResult<
            InferType<TElementSchema>,
            TElementSchema,
        >
        : ValidationResult<InferType<TElementSchema>>

Maps an element schema type to the appropriate validation result type. +Union schema elements get UnionSchemaValidationResult, +Object schema elements get ObjectSchemaValidationResult, +other types get ValidationResult.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedAny.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedAny.html new file mode 100644 index 00000000..f44d23b9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedAny.html @@ -0,0 +1,2 @@ +ExtendedAny | Libraries

Type Alias ExtendedAny

ExtendedAny: AnySchemaBuilder<true, false, undefined, false, {}> & HiddenExtensionMethods

An AnySchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedArray.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedArray.html new file mode 100644 index 00000000..b8b1d812 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedArray.html @@ -0,0 +1,2 @@ +ExtendedArray | Libraries

Type Alias ExtendedArray<TElementSchema>

ExtendedArray: ArraySchemaBuilder<
    TElementSchema,
    true,
    false,
    undefined,
    false,
    ArrayBuiltinExtensions<TElementSchema>,
> & ArrayBuiltinExtensions<TElementSchema> & HiddenExtensionMethods

An ArraySchemaBuilder with built-in extension methods.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedBoolean.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedBoolean.html new file mode 100644 index 00000000..d63797e6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedBoolean.html @@ -0,0 +1,2 @@ +ExtendedBoolean | Libraries

Type Alias ExtendedBoolean

ExtendedBoolean: BooleanSchemaBuilder<
    boolean,
    true,
    false,
    undefined,
    false,
    {},
> & HiddenExtensionMethods

A BooleanSchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedDate.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedDate.html new file mode 100644 index 00000000..43a4805d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedDate.html @@ -0,0 +1,2 @@ +ExtendedDate | Libraries

Type Alias ExtendedDate

ExtendedDate: DateSchemaBuilder<Date, true, false, false, {}> & HiddenExtensionMethods

A DateSchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedFunc.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedFunc.html new file mode 100644 index 00000000..da13581b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedFunc.html @@ -0,0 +1,2 @@ +ExtendedFunc | Libraries

Type Alias ExtendedFunc

ExtendedFunc: FunctionSchemaBuilder<true, false, undefined, false, {}> & HiddenExtensionMethods

A FunctionSchemaBuilder with built-in extension methods.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedNumber.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedNumber.html new file mode 100644 index 00000000..5baa6cdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedNumber.html @@ -0,0 +1,2 @@ +ExtendedNumber | Libraries

Type Alias ExtendedNumber<T>

ExtendedNumber: NumberSchemaBuilder<
    T,
    true,
    false,
    false,
    NumberBuiltinExtensions<T>,
> & NumberBuiltinExtensions<T> & HiddenExtensionMethods

A NumberSchemaBuilder with built-in extension methods.

+

Type Parameters

  • T extends number = number
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedObject.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedObject.html new file mode 100644 index 00000000..fa9ffd3d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedObject.html @@ -0,0 +1,2 @@ +ExtendedObject | Libraries

Type Alias ExtendedObject<TProps>

ExtendedObject: ObjectSchemaBuilder<
    TProps,
    true,
    false,
    undefined,
    false,
    {},
    [],
> & HiddenExtensionMethods

An ObjectSchemaBuilder with built-in extension methods.

+

Type Parameters

  • TProps extends Record<string, SchemaBuilder<any, any, any, any, any>> = {}
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedPromise.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedPromise.html new file mode 100644 index 00000000..81923205 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedPromise.html @@ -0,0 +1,2 @@ +ExtendedPromise | Libraries

Type Alias ExtendedPromise<TResolvedTypeSchema>

ExtendedPromise: PromiseSchemaBuilder<
    true,
    false,
    undefined,
    false,
    {},
    TResolvedTypeSchema,
> & HiddenExtensionMethods

A PromiseSchemaBuilder with built-in extension methods.

+

Type Parameters

  • TResolvedTypeSchema extends SchemaBuilder<any, any, any, any, any> | undefined = undefined
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedRecord.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedRecord.html new file mode 100644 index 00000000..9210ae62 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedRecord.html @@ -0,0 +1,2 @@ +ExtendedRecord | Libraries

Type Alias ExtendedRecord<TKeySchema, TValueSchema>

ExtendedRecord: RecordSchemaBuilder<
    TKeySchema,
    TValueSchema,
    true,
    false,
    undefined,
    false,
    {},
> & HiddenExtensionMethods

A RecordSchemaBuilder with built-in extension methods.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedString.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedString.html new file mode 100644 index 00000000..d4785c34 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedString.html @@ -0,0 +1,2 @@ +ExtendedString | Libraries

Type Alias ExtendedString<T>

ExtendedString: StringSchemaBuilder<
    T,
    true,
    false,
    false,
    StringBuiltinExtensions<T>,
> & StringBuiltinExtensions<T> & HiddenExtensionMethods

A StringSchemaBuilder with built-in extension methods.

+

Type Parameters

  • T extends string = string
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedTuple.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedTuple.html new file mode 100644 index 00000000..d0368488 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedTuple.html @@ -0,0 +1,2 @@ +ExtendedTuple | Libraries

Type Alias ExtendedTuple<TElements>

ExtendedTuple: TupleSchemaBuilder<TElements, true, false, undefined, false, {}> & HiddenExtensionMethods

A TupleSchemaBuilder with built-in extension methods.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedUnion.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedUnion.html new file mode 100644 index 00000000..8bb40298 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtendedUnion.html @@ -0,0 +1,2 @@ +ExtendedUnion | Libraries

Type Alias ExtendedUnion<TOptions>

ExtendedUnion: UnionSchemaBuilder<TOptions, true, false, undefined, false, {}> & HiddenExtensionMethods

A UnionSchemaBuilder with built-in extension methods.

+

Type Parameters

  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtensionConfig.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtensionConfig.html new file mode 100644 index 00000000..41575af9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtensionConfig.html @@ -0,0 +1,19 @@ +ExtensionConfig | Libraries

Type Alias ExtensionConfig

ExtensionConfig: {
    [K in BuilderTypeName]?: Record<
        string,
        (this: BuilderMap[K], ...args: any[]) => any,
    >
}

Defines the shape of an extension configuration object passed to +defineExtension.

+

Each key is a builder type name — one of "string", "number", +"boolean", "date", "object", "array", "union", "func", or +"any". The value is a record of method implementations to add to +that builder type.

+

Method implementations receive this bound to the target builder instance +(e.g. StringSchemaBuilder for the "string" key) and must return a +builder of the same type to support fluent chaining.

+

Extension methods that only add validators/preprocessors do not need to +call this.withExtension() — the system will auto-attach metadata using +the method name as the key and the arguments as the value. Call +this.withExtension(key, value) explicitly only when you need custom +metadata (e.g. a transformed value or a different key).

+
// Minimal extension config — auto-inferred metadata
const config: ExtensionConfig = {
string: {
slug(this: StringSchemaBuilder) {
return this.addValidator((v) => ({ valid: /^[a-z0-9-]+$/.test(v), errors: [] }));
}
},
number: {
port(this: NumberSchemaBuilder) {
return this.isInteger().min(1).max(65535);
}
}
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtensionDescriptor.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtensionDescriptor.html new file mode 100644 index 00000000..a7c0614f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtensionDescriptor.html @@ -0,0 +1,19 @@ +ExtensionDescriptor | Libraries

Type Alias ExtensionDescriptor<T>

A branded descriptor returned by defineExtension.

+

The descriptor captures the extension's method signatures at the type +level so that withExtensions can produce correctly-typed factory +functions. At runtime it holds the (possibly wrapped) configuration object.

+

Extension descriptors are intentionally opaque — consumers should not +access config directly. Instead, pass descriptors to +withExtensions to obtain augmented builder factories.

+
// The type is inferred — no need to annotate
const myExt: ExtensionDescriptor<{ string: { slug: ... } }> = defineExtension({ ... }); +
+ +
type ExtensionDescriptor<T extends ExtensionConfig = ExtensionConfig> = {
    __brand: unique symbol;
    config: T;
}

Type Parameters

Index

Properties

Properties

__brand: unique symbol
config: T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtraTypeBrandSymbol.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtraTypeBrandSymbol.html new file mode 100644 index 00000000..d2e08b90 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ExtraTypeBrandSymbol.html @@ -0,0 +1 @@ +ExtraTypeBrandSymbol | Libraries

Type Alias ExtraTypeBrandSymbol

ExtraTypeBrandSymbol: typeof EXTRA_TYPE_BRAND
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.FixedMethods.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.FixedMethods.html new file mode 100644 index 00000000..39cd7343 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.FixedMethods.html @@ -0,0 +1,21 @@ +FixedMethods | Libraries

Type Alias FixedMethods<TRawMethods, TBase, TAccum, TExtraTypes>

FixedMethods: {
    [K in keyof TRawMethods]: TRawMethods[K] extends (
        this: any,
        ...args: infer A,
    ) => infer R
        ? R extends { __cleverbrush_extra_type_brand__?: any }
            ? <const TName extends string & A[0], const TKey extends string>(
                name: TName,
                ...columns: ReadonlyArray<
                    | TKey
                    | (
                        TBase extends ObjectSchemaBuilder<any, any, any, any, any>
                            ? (t: PropertyDescriptorTree<TBase, TBase>) => any
                            : (t: any) => any
                    ),
                >,
            ) => TBase & FixedMethods<
                TRawMethods,
                TBase,
                TAccum,
                TExtraTypes & Record<TName, readonly TKey[]>,
            > & HiddenExtensionMethods & {
                __cleverbrush_extra_type_brand__?: TExtraTypes & Record<
                    TName,
                    readonly TKey[],
                >;
            } & (
                [TAccum] extends [never]
                    ? {}
                    : { __cleverbrush_method_literal_brand__?: TAccum }
            )
            : R extends { __cleverbrush_method_literal_brand__?: any }
                ? <const TName extends string & A[0]>(
                    name: TName,
                    ...rest: TailArgs<A>,
                ) => TBase & FixedMethods<
                    TRawMethods,
                    TBase,
                    TAccum
                    | TName,
                    TExtraTypes,
                > & HiddenExtensionMethods & {
                    __cleverbrush_method_literal_brand__?: TAccum | TName;
                } & (
                    [keyof TExtraTypes] extends [never]
                        ? {}
                        : { __cleverbrush_extra_type_brand__?: TExtraTypes }
                )
                : (
                    ...args: A,
                ) => TBase & FixedMethods<TRawMethods, TBase, TAccum, TExtraTypes> & HiddenExtensionMethods & (
                    [TAccum] extends [never]
                        ? {}
                        : { __cleverbrush_method_literal_brand__?: TAccum }
                ) & (
                    [keyof TExtraTypes] extends [never]
                        ? {}
                        : { __cleverbrush_extra_type_brand__?: TExtraTypes }
                )
        : TRawMethods[K]
}

Overrides extension method return types so they always return the full +extended builder type. This ensures extension methods preserve all other +extension methods through chaining (e.g. s.string().email().slug()).

+

The self-reference (FixedMethods appears in its own mapped return +types) is resolved lazily by TypeScript because the recursion sits +inside a function-return position within a conditional mapped type.

+

The optional third parameter TAccum accumulates literal string names +registered by methods whose raw return type includes +{ readonly [METHOD_LITERAL_BRAND]?: any }. Those methods are rewritten +as const-generic so the literal flows through; all other methods thread +the accumulator unchanged.

+

The optional fourth parameter TExtraTypes accumulates a +Record<name, readonly string[]> map contributed by methods whose raw +return type includes { readonly [EXTRA_TYPE_BRAND]?: any }. Those +methods are rewritten as const-generic for both the name and the keys +tuple so the mapping flows through; all other methods thread it unchanged.

+

For object-schema methods the accessor-form callback parameter is +automatically typed as PropertyDescriptorTree<TBase, TBase> when +TBase is an ObjectSchemaBuilder, giving callers IDE autocomplete over +the schema's own properties.

+

Type Parameters

  • TRawMethods
  • TBase
  • TAccum extends string = never
  • TExtraTypes extends Record<string, readonly string[]> = Record<never, never>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.HiddenExtensionMethods.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.HiddenExtensionMethods.html new file mode 100644 index 00000000..a077ef89 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.HiddenExtensionMethods.html @@ -0,0 +1,9 @@ +HiddenExtensionMethods | Libraries

Type Alias HiddenExtensionMethods

Intersected onto consumer-facing builder types to make withExtension +and getExtension uncallable (never). Using an intersection instead +of Omit preserves the class identity so extended builders remain +assignable to SchemaBuilder<any, any, any, any, any>.

+
type HiddenExtensionMethods = {
    getExtension: never;
    withExtension: never;
}
Index

Properties

getExtension: never

Extension-author only — use inside defineExtension().

+
withExtension: never

Extension-author only — use inside defineExtension().

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.InferType.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.InferType.html new file mode 100644 index 00000000..7ec53c54 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.InferType.html @@ -0,0 +1,6 @@ +InferType | Libraries

Type Alias InferType<T>

InferType: T extends {
    optimize: (
        ...args: any[],
    ) => { readonly [K in SchemaTypeBrand]: infer TOptimized };
}
    ? TOptimized
    : T extends { readonly [K in SchemaTypeBrand]: infer TType } ? TType : T

Infers the TypeScript type that a SchemaBuilder instance validates. +Takes into account type optimizations (via optimize()) and whether the schema is optional.

+

Type Parameters

  • T
const userSchema = object({ name: string(), age: number().optional() });
type User = InferType<typeof userSchema>;
// { name: string; age?: number } +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.IntersectionSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.IntersectionSchemaValidationResult.html new file mode 100644 index 00000000..5ab175b4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.IntersectionSchemaValidationResult.html @@ -0,0 +1 @@ +IntersectionSchemaValidationResult | Libraries

Type Alias IntersectionSchemaValidationResult<T>

IntersectionSchemaValidationResult: ValidationResult<T>

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.MakeOptional.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.MakeOptional.html new file mode 100644 index 00000000..2f49c243 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.MakeOptional.html @@ -0,0 +1,3 @@ +MakeOptional | Libraries

Type Alias MakeOptional<T>

MakeOptional: { prop?: T }["prop"]

Utility type that makes a value T optional (i.e. T | undefined). +Used internally by InferType to represent optional schema fields.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.MethodLiteralBrandSymbol.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.MethodLiteralBrandSymbol.html new file mode 100644 index 00000000..7f1daf6f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.MethodLiteralBrandSymbol.html @@ -0,0 +1 @@ +MethodLiteralBrandSymbol | Libraries

Type Alias MethodLiteralBrandSymbol

MethodLiteralBrandSymbol: typeof METHOD_LITERAL_BRAND
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.NestedValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.NestedValidationResult.html new file mode 100644 index 00000000..9b8bbc47 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.NestedValidationResult.html @@ -0,0 +1,11 @@ +NestedValidationResult | Libraries

Type Alias NestedValidationResult<TSchema, TRootSchema, TParentPropertyDescriptor>

Used to represent a validation result for nested +objects/properties. Contains a list of errors and +the value that caused them.

+
type NestedValidationResult<
    TSchema,
    TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>,
    TParentPropertyDescriptor,
> = {
    errors: ReadonlyArray<string>;
    isValid: boolean;
    seenValue?: InferType<TSchema>;
    get descriptor(): PropertyDescriptorInner<
        TRootSchema,
        TSchema,
        TParentPropertyDescriptor,
    >;
}

Type Parameters

  • TSchema
  • TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>
  • TParentPropertyDescriptor
Index

Properties

Accessors

Properties

errors: ReadonlyArray<string>

A list of errors, empty if object satisfies a schema

+
isValid: boolean

Whether validation passed for this property and all of its children.

+
seenValue?: InferType<TSchema>

Value that property had and which caused error or errors

+

Accessors

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.NumberOneOfExtension.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.NumberOneOfExtension.html new file mode 100644 index 00000000..6d916a13 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.NumberOneOfExtension.html @@ -0,0 +1,3 @@ +NumberOneOfExtension | Libraries

Type Alias NumberOneOfExtension

NumberOneOfExtension: Pick<NumberBuiltinExtensions, "oneOf">

Subset of NumberBuiltinExtensions containing only the .oneOf() overloads. +Exported for backward compatibility.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ObjectSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ObjectSchemaValidationResult.html new file mode 100644 index 00000000..edc0610f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ObjectSchemaValidationResult.html @@ -0,0 +1,15 @@ +ObjectSchemaValidationResult | Libraries

Type Alias ObjectSchemaValidationResult<T, TRootSchema, TSchema>

ObjectSchemaValidationResult: Omit<ValidationResult<T>, "errors"> & {
    errors?: ValidationError[];
    getErrorsFor<TPropertySchema, TParentPropertyDescriptor>(
        selector?: (
            properties: PropertyDescriptorTree<TSchema, TRootSchema>,
        ) => PropertyDescriptor<
            TRootSchema,
            TPropertySchema,
            TParentPropertyDescriptor,
        >,
    ): TPropertySchema extends ObjectSchemaBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
    >
        ? PropertyValidationResult<
            TPropertySchema,
            TRootSchema,
            TParentPropertyDescriptor,
        >
        : NestedValidationResult<
            TPropertySchema,
            TRootSchema,
            TParentPropertyDescriptor,
        >;
    getInvalidProperties(): readonly NestedValidationResult<
        any,
        TRootSchema,
        any,
    >[];
}

Type Parameters

Type Declaration

  • Optionalerrors?: ValidationError[]

    A flat list of validation errors.

    +

    Use getErrorsFor() instead for +per-property error inspection with type-safe property selectors. The errors array on +ObjectSchemaBuilder validation results will be removed in a future major version.

    +
  • getErrorsFor: function
    • Returns a nested validation error for the property selected by the selector function. +This is the recommended way to inspect validation errors — it provides type-safe, +per-property error details including isValid, errors, and seenValue.

      +

      Prefer this over the deprecated errors array.

      +

      Type Parameters

      • TPropertySchema
      • TParentPropertyDescriptor

      Parameters

      Returns TPropertySchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
          ? PropertyValidationResult<
              TPropertySchema,
              TRootSchema,
              TParentPropertyDescriptor,
          >
          : NestedValidationResult<
              TPropertySchema,
              TRootSchema,
              TParentPropertyDescriptor,
          >

  • getInvalidProperties: function
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.OptionValidationResults.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.OptionValidationResults.html new file mode 100644 index 00000000..2cce5b45 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.OptionValidationResults.html @@ -0,0 +1,6 @@ +OptionValidationResults | Libraries

Type Alias OptionValidationResults<TOptions>

OptionValidationResults: {
    [K in keyof TOptions]: TOptions[K] extends UnionSchemaBuilder<
        infer UOptions extends
            readonly SchemaBuilder<any, any, any, any, any>[],
        any,
        any,
    >
        ? UnionSchemaValidationResult<InferType<TOptions[K]>, UOptions>
        : TOptions[K] extends ObjectSchemaBuilder<any, any, any, any>
            ? ObjectSchemaValidationResult<InferType<TOptions[K]>, TOptions[K]>
            : ValidationResult<InferType<TOptions[K]>>
}

Mapped tuple type that converts a tuple of SchemaBuilder options into +a tuple of their corresponding validation results. +Union schema options get UnionSchemaValidationResult with recursive +getNestedErrors navigation; object schema options get +ObjectSchemaValidationResult; other types get ValidationResult.

+

Type Parameters

  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ParseStringTemplateTag.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ParseStringTemplateTag.html new file mode 100644 index 00000000..2256a348 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ParseStringTemplateTag.html @@ -0,0 +1,7 @@ +ParseStringTemplateTag | Libraries

Type Alias ParseStringTemplateTag<TSchema>

ParseStringTemplateTag: (
    strings: TemplateStringsArray,
    ...selectors: (
        (
            tree: PropertyDescriptorTree<
                TSchema,
                TSchema,
                string
                | number
                | boolean
                | Date,
            >,
        ) => PropertyDescriptor<TSchema, any, any>
    )[],
) => ParseStringTemplateDefinition

The typed tagged-template function passed to the parseString +callback. Template expressions must be property-selector lambdas that +navigate the PropertyDescriptorTree of the object schema.

+

Only properties whose inferred type extends string | number | boolean | Date +are selectable — nested ObjectSchemaBuilder children are navigable but +not themselves endpoints.

+

Type Parameters

Type Declaration

    • (
          strings: TemplateStringsArray,
          ...selectors: (
              (
                  tree: PropertyDescriptorTree<
                      TSchema,
                      TSchema,
                      string
                      | number
                      | boolean
                      | Date,
                  >,
              ) => PropertyDescriptor<TSchema, any, any>
          )[],
      ): ParseStringTemplateDefinition
    • Parameters

      • strings: TemplateStringsArray
      • ...selectors: (
            (
                tree: PropertyDescriptorTree<
                    TSchema,
                    TSchema,
                    string
                    | number
                    | boolean
                    | Date,
                >,
            ) => PropertyDescriptor<TSchema, any, any>
        )[]

      Returns ParseStringTemplateDefinition

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptor.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptor.html new file mode 100644 index 00000000..618f5dcb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptor.html @@ -0,0 +1,5 @@ +PropertyDescriptor | Libraries

Type Alias PropertyDescriptor<TRootSchema, TPropertySchema, TParentPropertyDescriptor, TPropertyKey>

A wrapper object keyed by SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR that +holds a PropertyDescriptorInner for a particular property within +an object schema. Used to get/set property values on validated objects.

+
type PropertyDescriptor<
    TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>,
    TPropertySchema,
    TParentPropertyDescriptor,
    TPropertyKey extends string = string,
> = {
    "[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": PropertyDescriptorInner<
        TRootSchema,
        TPropertySchema,
        TParentPropertyDescriptor,
        TPropertyKey,
    >;
}

Type Parameters

  • TRootSchema extends ObjectSchemaBuilder<any, any, any, any, any>
  • TPropertySchema
  • TParentPropertyDescriptor
  • TPropertyKey extends string = string
Index

Properties

"[SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR]": PropertyDescriptorInner<
    TRootSchema,
    TPropertySchema,
    TParentPropertyDescriptor,
    TPropertyKey,
>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptorInner.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptorInner.html new file mode 100644 index 00000000..a3c4a512 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptorInner.html @@ -0,0 +1,40 @@ +PropertyDescriptorInner | Libraries

Type Alias PropertyDescriptorInner<TSchema, TPropertySchema, TParentPropertyDescriptor, TPropertyKey>

type PropertyDescriptorInner<
    TSchema extends ObjectSchemaBuilder<any, any, any, any, any>,
    TPropertySchema,
    TParentPropertyDescriptor,
    TPropertyKey extends string = string,
> = {
    getSchema: () => TPropertySchema;
    getValue: (
        obj: InferType<TSchema>,
    ) => { success: boolean; value?: InferType<TPropertySchema> };
    parent: PropertyDescriptorInnerFromPropertyDescriptor<
        TParentPropertyDescriptor,
    >;
    propertyName: TPropertyKey
    | undefined;
    setValue: (
        obj: InferType<TSchema>,
        value: InferType<TPropertySchema>,
        options?: PropertySetterOptions,
    ) => boolean;
    toJsonPointer: () => string;
}

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any>
  • TPropertySchema
  • TParentPropertyDescriptor
  • TPropertyKey extends string = string
Index

Properties

getSchema: () => TPropertySchema

Gets the schema for the property described by the property descriptor.

+

Type Declaration

getValue: (
    obj: InferType<TSchema>,
) => { success: boolean; value?: InferType<TPropertySchema> }

Gets the value of the property from the object.

+

Type Declaration

    • (
          obj: InferType<TSchema>,
      ): { success: boolean; value?: InferType<TPropertySchema> }
    • Parameters

      Returns { success: boolean; value?: InferType<TPropertySchema> }

      an object containing a value and success properties. value is the value of the property +if it was found in the object, success is a boolean value indicating if the property was found in the object.

      +
parent: PropertyDescriptorInnerFromPropertyDescriptor<TParentPropertyDescriptor>
propertyName: TPropertyKey | undefined

The name of this property within its parent object, or undefined +for the root descriptor.

+

When the property was created from a PropertyDescriptorTree leaf the +type narrows to the literal key string (e.g. 'id'), enabling +accessor-function-based column inference in query builders.

+

The literal property name, or string for root/unknown descriptors.

+
setValue: (
    obj: InferType<TSchema>,
    value: InferType<TPropertySchema>,
    options?: PropertySetterOptions,
) => boolean

Sets a new value to the property. If the process was successful, +the method returns true, otherwise false. +It can return false if the property could not be set to the object +which can happen if the setValue method is called with an object +which does not comply with the schema. +for example, if you have a schema and property descriptopr like this:

+
const schema = object({
name: string(),
address: object({
city: string(),
country: string()
}),
id: number()
});

const addressCityDescriptor = object.getPropertiesFor(schema).address.city; +
+ +

And then you try to set a new value to the address.city property on the object +which does not have address property:

+
const obj = {
name: 'Leo'
};

const success = addressCityDescriptor.setValue(obj, 'Venyov');
// success === false +
+ +

Type Declaration

toJsonPointer: () => string

Returns a JSON Pointer (RFC 6901) string representing this +property's path from the root descriptor.

+

Property names are escaped per RFC 6901 (~~0, /~1). +The root descriptor returns an empty string ('').

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptorTree.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptorTree.html new file mode 100644 index 00000000..af6eb68a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertyDescriptorTree.html @@ -0,0 +1,3 @@ +PropertyDescriptorTree | Libraries

Type Alias PropertyDescriptorTree<TSchema, TRootSchema, TAssignableTo, TParentPropertyDescriptor>

PropertyDescriptorTree: PropertyDescriptor<
    TRootSchema,
    TSchema,
    TParentPropertyDescriptor,
> & (
    TSchema extends ObjectSchemaBuilder<infer TProperties, any, any>
        ? {
            [K in keyof TProperties]: TProperties[K] extends ObjectSchemaBuilder<
                any,
                any,
                any,
            >
                ? PropertyDescriptorTree<
                    TProperties[K],
                    TRootSchema,
                    any,
                    PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                >
                : TProperties[K] extends ExternSchemaBuilder<
                    any,
                    any,
                    any,
                    any,
                    any,
                    any,
                    infer TExternResult,
                >
                    ? PropertyDescriptor<
                        TRootSchema,
                        TProperties[K],
                        PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                        K & string,
                    > & ExternOutputPropertyDescriptors<
                        TExternResult,
                        TRootSchema,
                        PropertyDescriptor<
                            TRootSchema,
                            TProperties[K],
                            PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                            K & string,
                        >,
                    >
                    : TProperties[K] extends ArraySchemaBuilder<
                        infer TArrayElement,
                        any,
                        any,
                    >
                        ? TArrayElement extends ObjectSchemaBuilder<
                            any,
                            any,
                            any,
                            any,
                            any,
                        >
                            ? PropertyDescriptor<
                                TRootSchema,
                                TProperties[K],
                                PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                                K & string,
                            >
                            : InferType<(...)[(...)]> extends TAssignableTo
                                ? PropertyDescriptor<
                                    TRootSchema,
                                    (...)[(...)],
                                    PropertyDescriptor<(...), (...), (...)>,
                                    (...) & (...),
                                >
                                : never
                        : InferType<TProperties[K]> extends TAssignableTo
                            ? PropertyDescriptor<
                                TRootSchema,
                                TProperties[K],
                                PropertyDescriptor<TRootSchema, TSchema, TParentPropertyDescriptor>,
                                K & string,
                            >
                            : never
        }
        : never
)

A tree of property descriptors for the schema. +Has a possibility to filter properties by the type (TAssignableTo type parameter).

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertySetterOptions.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertySetterOptions.html new file mode 100644 index 00000000..3886baed --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.PropertySetterOptions.html @@ -0,0 +1,28 @@ +PropertySetterOptions | Libraries

Type Alias PropertySetterOptions

Describes a property in a schema. And gives you +a possibility to access property value and set it. +suppose you have a schema like this:

+
const schema = object({
name: string(),
address: object({
city: string(),
country: string()
}),
id: number()
}); +
+ +

then you can get a property descriptor for the address.city property +like this:

+
const addressCityDescriptor = object.getPropertiesFor(schema).address.city;
+
+ +

And then you can use it to get and set the value of this property having the object:

+
const obj = {
name: 'Leo',
address: {
city: 'Kozelsk',
country: 'Russia'
},
id: 123
};

const success = addressCityDescriptor.setValue(obj, 'Venyov');
// this returns you a boolean value indicating if the value was set successfully +
+ +
type PropertySetterOptions = {
    createMissingStructure?: boolean;
}
Index

Properties

createMissingStructure?: boolean

If set to true, the method will create missing structure +in the object to set the value. For example, if you have a schema +and property descriptor like this:

+
const schema = object({
address: object({
city: string(),
country: string()
}),
});
const addressCityDescriptor = object.getPropertiesFor(schema).address.city; +
+ +

And then you try to set a new value to the address.city property on the object +which does not have address property:

+
const obj = {
name: 'Leo'
};
const success = addressCityDescriptor.setValue(obj, 'Venyov', { createMissingStructure: true });
// success === true
// obj === {
// name: 'Leo',
// address: {
// city: 'Venyov'
// }
+
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.RecordSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.RecordSchemaValidationResult.html new file mode 100644 index 00000000..6139fec8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.RecordSchemaValidationResult.html @@ -0,0 +1,34 @@ +RecordSchemaValidationResult | Libraries

Type Alias RecordSchemaValidationResult<TResult, TValueSchema>

RecordSchemaValidationResult: ValidationResult<TResult> & {
    getErrorsFor(): RecordRootValidationResult<TResult>;
    getErrorsFor(key: string): RecordKeyValidationResult<TResult, TValueSchema>;
    getNestedErrors(): Record<
        string,
        ValidationResult<InferType<TValueSchema>>,
    >;
}

Validation result type returned by RecordSchemaBuilder.validate().

+

Extends ValidationResult with:

+
    +
  • getNestedErrors() — a per-key map of ValidationResult objects.
  • +
  • getErrorsFor() — root-level errors for the record container itself.
  • +
  • getErrorsFor(key) — errors, seen value, and descriptor for a specific key.
  • +
+

Type Parameters

  • TResult
  • TValueSchema extends SchemaBuilder<any, any, any, any, any>

Type Declaration

  • getErrorsFor: function
    • Returns root-level errors for the record container itself +(e.g. "object expected" when a non-object value is passed, +or errors from custom validators added to the record schema).

      +

      Returns RecordRootValidationResult<TResult>

      const schema = record(string(), number());
      const root = schema.validate(42 as any).getErrorsFor();
      // root.errors[0] === 'object expected'
      // root.isValid === false +
      + +
    • Returns the validation result for the entry with the given key, +including error messages, the seen value, and a descriptor for +accessing and modifying the value at that key.

      +

      If the key was not reached during validation (e.g. an earlier key +already failed in stop-on-first-error mode), an empty result with +isValid: true and no errors is returned.

      +

      Parameters

      • key: string

        the key whose validation result to retrieve

        +

      Returns RecordKeyValidationResult<TResult, TValueSchema>

      const schema = record(string(), number().min(0));
      const result = schema.validate(
      { a: 5, b: -2 },
      { doNotStopOnFirstError: true }
      );

      const bErrors = result.getErrorsFor('b');
      // bErrors.isValid === false
      // bErrors.errors[0] === 'the value must be >= 0'
      // bErrors.seenValue === -2
      // bErrors.descriptor.key === 'b'
      // bErrors.descriptor.getSchema() === valueSchema +
      + +
  • getNestedErrors: function
    • Returns per-key validation results as a plain object.

      +

      Each key in the returned object corresponds to a key in the input that +failed validation (in doNotStopOnFirstError mode) or the single +first failing key (in the default stop-on-first-error mode). Keys that +passed are not included.

      +

      Returns Record<string, ValidationResult<InferType<TValueSchema>>>

      Prefer getErrorsFor for a richer per-entry result +that also includes a descriptor and seenValue.

      +
      const schema = record(string(), number().positive());
      const result = schema.validate(
      { a: 1, b: -2, c: 'oops' },
      { doNotStopOnFirstError: true }
      );

      if (!result.valid) {
      const nested = result.getNestedErrors();
      console.log(nested['b']); // ValidationResult for key 'b'
      console.log(nested['c']); // ValidationResult for key 'c'
      } +
      + +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.SchemaPropertySelector.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.SchemaPropertySelector.html new file mode 100644 index 00000000..abd564ab --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.SchemaPropertySelector.html @@ -0,0 +1,5 @@ +SchemaPropertySelector | Libraries

Type Alias SchemaPropertySelector<TSchema, TPropertySchema, TAssignableTo, TParentPropertyDescriptor>

A callback function to select properties from the schema. +Normally it's provided by the user to select property descriptors +from the schema for the further usage. e.g. to select source and destination +properties for object mappings

+

Type Parameters

  • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
  • TPropertySchema extends SchemaBuilder<any, any, any, any, any>
  • TAssignableTo = any
  • TParentPropertyDescriptor = undefined
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.SchemaTypeBrand.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.SchemaTypeBrand.html new file mode 100644 index 00000000..1aaae9d1 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.SchemaTypeBrand.html @@ -0,0 +1 @@ +SchemaTypeBrand | Libraries

Type Alias SchemaTypeBrandInternal

SchemaTypeBrand: typeof __type
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.InferInput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.InferInput.html new file mode 100644 index 00000000..2bf25f97 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries

Infers the input type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.InferOutput.html new file mode 100644 index 00000000..3f355054 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries

Infers the output type of a Standard.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.Result.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.Result.html new file mode 100644 index 00000000..80195c96 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardSchemaV1.Result.html @@ -0,0 +1,2 @@ +Result | Libraries

The result interface of the validate function.

+

Type Parameters

  • Output
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardTypedV1.InferInput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardTypedV1.InferInput.html new file mode 100644 index 00000000..087e8143 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardTypedV1.InferInput.html @@ -0,0 +1,2 @@ +InferInput | Libraries
InferInput: NonNullable<Schema["~standard"]["types"]>["input"]

Infers the input type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardTypedV1.InferOutput.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardTypedV1.InferOutput.html new file mode 100644 index 00000000..aade4f54 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StandardTypedV1.InferOutput.html @@ -0,0 +1,2 @@ +InferOutput | Libraries

Type Alias InferOutput<Schema>

InferOutput: NonNullable<Schema["~standard"]["types"]>["output"]

Infers the output type of a Standard Typed.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StringOneOfExtension.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StringOneOfExtension.html new file mode 100644 index 00000000..85c27a12 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.StringOneOfExtension.html @@ -0,0 +1,3 @@ +StringOneOfExtension | Libraries

Type Alias StringOneOfExtension

StringOneOfExtension: Pick<StringBuiltinExtensions, "oneOf">

Subset of StringBuiltinExtensions containing only the .oneOf() overloads. +Exported for backward compatibility.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.TupleElementValidationResults.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.TupleElementValidationResults.html new file mode 100644 index 00000000..d4c5ba10 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.TupleElementValidationResults.html @@ -0,0 +1,6 @@ +TupleElementValidationResults | Libraries

Type Alias TupleElementValidationResults<TElements>

TupleElementValidationResults: {
    [K in keyof TElements]: TElements[K] extends UnionSchemaBuilder<
        infer UOptions extends
            readonly SchemaBuilder<any, any, any, any, any>[],
        any,
        any,
    >
        ? UnionSchemaValidationResult<InferType<TElements[K]>, UOptions>
        : TElements[K] extends ObjectSchemaBuilder<any, any, any, any, any>
            ? ObjectSchemaValidationResult<InferType<TElements[K]>, TElements[K]>
            : ValidationResult<InferType<TElements[K]>>
}

Maps a tuple of schema builders to a tuple of their per-position +validation result types. +Union schema elements get UnionSchemaValidationResult, +object schema elements get ObjectSchemaValidationResult, +other types get ValidationResult.

+

Type Parameters

  • TElements extends readonly SchemaBuilder<any, any, any, any, any>[]
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.TupleSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.TupleSchemaValidationResult.html new file mode 100644 index 00000000..93422d12 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.TupleSchemaValidationResult.html @@ -0,0 +1,9 @@ +TupleSchemaValidationResult | Libraries

Type Alias TupleSchemaValidationResult<TResult, TElements>

TupleSchemaValidationResult: ValidationResult<TResult> & {
    getNestedErrors(): TupleElementValidationResults<TElements> & NestedValidationResult<
        any,
        any,
        any,
    >;
}

Validation result type returned by TupleSchemaBuilder.validate(). +Extends ValidationResult with getNestedErrors for root-level tuple +errors and per-position validation results.

+

Type Parameters

  • TResult
  • TElements extends readonly SchemaBuilder<any, any, any, any, any>[]

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.UnionSchemaValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.UnionSchemaValidationResult.html new file mode 100644 index 00000000..9006b500 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.UnionSchemaValidationResult.html @@ -0,0 +1,11 @@ +UnionSchemaValidationResult | Libraries

Type Alias UnionSchemaValidationResult<T, TOptions>

UnionSchemaValidationResult: ValidationResult<T> & {
    getNestedErrors(): OptionValidationResults<TOptions> & NestedValidationResult<
        any,
        any,
        any,
    >;
}

Validation result type returned by UnionSchemaBuilder.validate(). +Extends ValidationResult with:

+
    +
  • getNestedErrors for root-level union errors and per-branch validation results
  • +
+

Type Parameters

  • T
  • TOptions extends readonly SchemaBuilder<any, any, any, any, any>[]

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationError.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationError.html new file mode 100644 index 00000000..4af6624e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationError.html @@ -0,0 +1,14 @@ +ValidationError | Libraries

Type Alias ValidationError

Represents a single validation error with a human-readable error message.

+

When returned from an object-level validator (via addValidator), +the optional property selector can route the error to a specific property +so that ObjectSchemaValidationResult.getErrorsFor | getErrorsFor() reports it +on that property rather than only on the root object.

+
.addValidator((v) => ({
valid: false,
errors: [{
message: 'Passwords do not match',
property: (t) => t.confirmPassword
}]
})) +
+ +
type ValidationError = {
    message: string;
    property?: (tree: any) => any;
}
Index

Properties

Properties

message: string
property?: (tree: any) => any

Optional property selector that targets this error to a specific +property of the validated object. Uses the same selector signature +as getErrorsFor() and react-form's forProperty.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationErrorMessageProvider.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationErrorMessageProvider.html new file mode 100644 index 00000000..1555c935 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationErrorMessageProvider.html @@ -0,0 +1,5 @@ +ValidationErrorMessageProvider | Libraries

Type Alias ValidationErrorMessageProvider<TSchema>

ValidationErrorMessageProvider:
    | string
    | (
        (
            seenValue: InferType<TSchema>,
            schema: TSchema,
        ) => string | Promise<string>
    )

Type of the function that provides a validation error message for +the given seenValue and schema. Can be a string or a function +returning a string or a promise of a string. +Should be used to provide a custom validation error message.

+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationResult.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationResult.html new file mode 100644 index 00000000..92382368 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_schema.ValidationResult.html @@ -0,0 +1,7 @@ +ValidationResult | Libraries

Type Alias ValidationResult<T>

type ValidationResult<T> = {
    errors?: ValidationError[];
    object?: T;
    valid: boolean;
}

Type Parameters

  • T
Index

Properties

Properties

errors?: ValidationError[]
object?: T

Contains validated object. Can be different (if there are any preprocessors in the schema) from object +passed to the validate method of the SchemaBuilder class.

+
valid: boolean

If true - object satisfies schema

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server-openapi.AsyncApiDocument.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server-openapi.AsyncApiDocument.html new file mode 100644 index 00000000..e1550503 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server-openapi.AsyncApiDocument.html @@ -0,0 +1,3 @@ +AsyncApiDocument | Libraries
AsyncApiDocument: Record<string, unknown>

A generated AsyncAPI 3.0 document. Typed as a plain object map to allow +extension fields without requiring a full AsyncAPI type library.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server-openapi.OpenApiDocument.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server-openapi.OpenApiDocument.html new file mode 100644 index 00000000..f7bb0eb9 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server-openapi.OpenApiDocument.html @@ -0,0 +1,3 @@ +OpenApiDocument | Libraries
OpenApiDocument: Record<string, unknown>

A generated OpenAPI 3.1 document. Typed as a plain object map to allow +any extension fields without requiring a full OpenAPI type library.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ActionContext.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ActionContext.html new file mode 100644 index 00000000..9592d4b7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ActionContext.html @@ -0,0 +1,4 @@ +ActionContext | Libraries

Type Alias ActionContext<E>

ActionContext: E extends EndpointBuilder<
    infer TParams,
    infer TBody,
    infer TQuery,
    infer THeaders,
    any,
    infer TPrincipal,
    any,
    any,
    any,
    infer TUpload,
>
    ? Simplify<
        ActionContextParts<
            TParams,
            TBody,
            TQuery,
            THeaders,
            TPrincipal,
            TUpload,
        >,
    >
    : never

The fully-typed argument object passed to endpoint handlers.

+

The shape is inferred from the EndpointBuilder chain — only the keys +actually configured (body, query, headers, params, principal) are present.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..AllowedResponseReturn.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..AllowedResponseReturn.html new file mode 100644 index 00000000..563141b3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..AllowedResponseReturn.html @@ -0,0 +1,10 @@ +AllowedResponseReturn | Libraries

Type Alias AllowedResponseReturn<TResponses>

AllowedResponseReturn:
    | {
        [K in keyof TResponses & number]: TResponses[K] extends null
            ? K extends 204 ? NoContentResult : StatusCodeResult<K>
            : JsonResult<K, TResponses[K]>
    }[keyof TResponses & number]
    | (
        200 extends keyof TResponses
            ? TResponses[200] extends null ? never : TResponses[200]
            : never
    )
    | FileResult
    | StreamResult
    | ContentResult
    | RedirectResult

The union of permitted return values for a handler whose endpoint +declared .responses(). Each member corresponds to one declared code:

+
    +
  • null schema (e.g. 204) → NoContentResult for 204, StatusCodeResult<K> otherwise
  • +
  • Non-null schema for code 200 → also allows a plain object (treated as 200 by the server)
  • +
  • Non-null schema for other codes → JsonResult<K, Body>
  • +
+

FileResult, StreamResult, ContentResult, and RedirectResult are always +permitted as an escape hatch for non-JSON responses.

+

Type Parameters

  • TResponses extends Record<number, any>
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..EndpointMetadataDescriptors.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..EndpointMetadataDescriptors.html new file mode 100644 index 00000000..5d0aef16 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..EndpointMetadataDescriptors.html @@ -0,0 +1,7 @@ +EndpointMetadataDescriptors | Libraries

Type Alias EndpointMetadataDescriptors

Optional OpenAPI metadata fields accepted by createEndpoint / createEndpoints.

+
type EndpointMetadataDescriptors = {
    deprecated?: boolean;
    description?: string;
    operationId?: string;
    summary?: string;
    tags?: string[];
}
Index

Properties

deprecated?: boolean
description?: string
operationId?: string
summary?: string
tags?: string[]
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..Handler.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..Handler.html new file mode 100644 index 00000000..a6470c1a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..Handler.html @@ -0,0 +1 @@ +Handler | Libraries

Type Alias Handler<E>

Handler: HasKeys<ServiceSchemas<E>> extends true
    ? (
        arg: ActionContext<E>,
        services: Simplify<InferServices<ServiceSchemas<E>>>,
    ) => HandlerReturn<E> | Promise<HandlerReturn<E>>
    : (arg: ActionContext<E>) => HandlerReturn<E> | Promise<HandlerReturn<E>>

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..HandlerEntry.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..HandlerEntry.html new file mode 100644 index 00000000..390930cb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..HandlerEntry.html @@ -0,0 +1,4 @@ +HandlerEntry | Libraries

Type Alias HandlerEntry<E>

HandlerEntry: Handler<E> | { handler: Handler<E>; middlewares?: Middleware[] }

A single handler entry in a HandlerMap.

+

Either a bare handler function or an object with a handler function and +optional per-endpoint middlewares.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..HandlerMap.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..HandlerMap.html new file mode 100644 index 00000000..032238e3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..HandlerMap.html @@ -0,0 +1,9 @@ +HandlerMap | Libraries

Type Alias HandlerMap<TEndpoints>

HandlerMap: {
    [G in keyof TEndpoints]: {
        [E in keyof TEndpoints[G]]: TEndpoints[G][E] extends AnySubscriptionBuilder
            ? SubscriptionHandlerEntry<TEndpoints[G][E]>
            : TEndpoints[G][E] extends AnyEndpoint
                ? HandlerEntry<TEndpoints[G][E]>
                : never
    }
}

A compile-time complete mapping from an endpoint group structure to +handler entries. Every endpoint key in every group must have a +corresponding HandlerEntry — omitting one is a type error.

+

Subscription endpoints (created via endpoint.subscription()) are +mapped to SubscriptionHandlerEntry instead of HandlerEntry.

+

Type Parameters

  • TEndpoints

    A record of groups, each a record of endpoint +builders. Typically the return type of defineApi() with server-side +extensions applied.

    +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..Middleware.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..Middleware.html new file mode 100644 index 00000000..f5c0436b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..Middleware.html @@ -0,0 +1,7 @@ +Middleware | Libraries

Type Alias Middleware

Middleware: (
    context: RequestContext,
    next: () => Promise<void>,
) => Promise<void>

A middleware function in the request pipeline.

+

Call next() to pass control to the next middleware or the endpoint +handler. If next() is not called, the pipeline short-circuits.

+

Type Declaration

    • (context: RequestContext, next: () => Promise<void>): Promise<void>
    • Parameters

      Returns Promise<void>

const logger: Middleware = async (ctx, next) => {
console.log(ctx.method, ctx.url.pathname);
await next();
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..PropertyRefTree.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..PropertyRefTree.html new file mode 100644 index 00000000..626a984d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..PropertyRefTree.html @@ -0,0 +1,7 @@ +PropertyRefTree | Libraries

Type Alias PropertyRefTree<T>

PropertyRefTree: { readonly [K in keyof T]-?: PropertyRefTree<T[K]> }

Lightweight recursive property reference tree for type-safe runtime +expression building in .links() and .callbacks().

+

At runtime the actual value is a PropertyDescriptorTree from +ObjectSchemaBuilder.getPropertiesFor(), which provides toJsonPointer() +and the SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR marker used by the OpenAPI +generator to resolve path expressions automatically.

+

Type Parameters

  • T
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ResponsesOf.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ResponsesOf.html new file mode 100644 index 00000000..9b4151b5 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ResponsesOf.html @@ -0,0 +1,3 @@ +ResponsesOf | Libraries

Type Alias ResponsesOf<E>

ResponsesOf: E extends EndpointBuilder<
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    any,
    infer TResponses,
    any,
>
    ? TResponses
    : never

Extracts the TResponses map from an EndpointBuilder type. +TResponses is a Record<number, BodyType> inferred from .responses().

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ScopedEndpointFactory.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ScopedEndpointFactory.html new file mode 100644 index 00000000..8ee1a4dc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..ScopedEndpointFactory.html @@ -0,0 +1,8 @@ +ScopedEndpointFactory | Libraries

Type Alias ScopedEndpointFactory<TRoles>

ScopedEndpointFactory: ScopedEndpointFactoryMethods<undefined, TRoles> & {
    authorize<TSchema extends SchemaBuilder<any, any, any, any, any>>(
        principalSchema: TSchema,
        ...roles: TRoles[],
    ): ScopedEndpointFactoryMethods<InferType<TSchema>, TRoles>;
    authorize(
        ...roles: TRoles[],
    ): ScopedEndpointFactoryMethods<unknown, TRoles>;
    public(): ScopedEndpointFactoryMethods<TRoles>;
}

Type Parameters

  • TRoles extends string = string

Type Declaration

  • authorize: function
    • Returns a new resource factory where all endpoints inherit +the given authorization requirements.

      +
        +
      • authorize(principalSchema, ...roles) — typed principal
      • +
      • authorize(...roles) — untyped principal
      • +
      +

      Type Parameters

      Parameters

      • principalSchema: TSchema
      • ...roles: TRoles[]

      Returns ScopedEndpointFactoryMethods<InferType<TSchema>, TRoles>

    • Parameters

      Returns ScopedEndpointFactoryMethods<unknown, TRoles>

  • public: function
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionContext.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionContext.html new file mode 100644 index 00000000..999510be --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionContext.html @@ -0,0 +1,5 @@ +SubscriptionContext | Libraries

Type Alias SubscriptionContext<E>

SubscriptionContext: E extends SubscriptionBuilder<
    infer TParams,
    infer TQuery,
    infer THeaders,
    any,
    infer TPrincipal,
    any,
    infer TIncoming,
    any,
>
    ? Simplify<
        SubscriptionContextParts<
            TParams,
            TQuery,
            THeaders,
            TPrincipal,
            TIncoming,
        >,
    >
    : never

The fully-typed argument object passed to subscription handlers.

+

The shape is inferred from the SubscriptionBuilder chain — only the keys +actually configured (query, headers, params, principal, incoming) are present. +Always includes context (RequestContext) and signal (AbortSignal).

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionHandler.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionHandler.html new file mode 100644 index 00000000..d27da7ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionHandler.html @@ -0,0 +1,7 @@ +SubscriptionHandler | Libraries

Type Alias SubscriptionHandler<E>

SubscriptionHandler: HasKeys<SubscriptionServiceSchemas<E>> extends true
    ? (
        arg: SubscriptionContext<E>,
        services: Simplify<InferServices<SubscriptionServiceSchemas<E>>>,
    ) => AsyncGenerator<OutgoingType<E>>
    : (arg: SubscriptionContext<E>) => AsyncGenerator<OutgoingType<E>>

The handler function type inferred from a SubscriptionBuilder.

+

Must be an async generator that yields outgoing events. When the endpoint +has injected services, the handler receives a second services argument.

+

Type Parameters

  • E
const handler: SubscriptionHandler<typeof chatEndpoint> =
async function* ({ incoming, principal }) {
yield tracked('welcome', { text: 'Hello!' });
for await (const msg of incoming) {
yield { text: `${principal.name}: ${msg.text}` };
}
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionHandlerEntry.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionHandlerEntry.html new file mode 100644 index 00000000..6b0ccd7e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server..SubscriptionHandlerEntry.html @@ -0,0 +1,4 @@ +SubscriptionHandlerEntry | Libraries

Type Alias SubscriptionHandlerEntry<E>

SubscriptionHandlerEntry:
    | SubscriptionHandler<E>
    | { handler: SubscriptionHandler<E>; middlewares?: Middleware[] }

A single handler entry for a subscription in a handler map.

+

Either a bare handler function or an object with a handler function +and optional per-subscription middlewares.

+

Type Parameters

  • E
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.ApiContract.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.ApiContract.html new file mode 100644 index 00000000..e2052ee3 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.ApiContract.html @@ -0,0 +1,7 @@ +ApiContract | Libraries
ApiContract: Record<string, ApiGroup>

A typed API contract with one level of grouping.

+

Each key is a group name and each value is an ApiGroup — a +record of named endpoints.

+
const contract: ApiContract = {
todos: { list: todosResource.get(), create: todosResource.post() },
auth: { login: endpoint.post('/api/auth/login') },
}; +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.ApiGroup.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.ApiGroup.html new file mode 100644 index 00000000..895dc500 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.ApiGroup.html @@ -0,0 +1,3 @@ +ApiGroup | Libraries
ApiGroup: Record<
    string,
    | EndpointBuilder<any, any, any, any, any, any, any, any, any>
    | SubscriptionBuilder<any, any, any, any, any, any, any, any>,
>

A record of named EndpointBuilder or SubscriptionBuilder +instances that form a single logical API group (e.g. "todos", "auth", "live").

+
diff --git a/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.MergedContracts.html b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.MergedContracts.html new file mode 100644 index 00000000..99f0f596 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/types/_cleverbrush_server.contract.MergedContracts.html @@ -0,0 +1,9 @@ +MergedContracts | Libraries

Type Alias MergedContracts<A, B>

MergedContracts: {
    readonly [K in keyof A | keyof B]: K extends keyof A
        ? K extends keyof B ? A[K] & B[K] : A[K]
        : K extends keyof B ? B[K] : never
}

Computes the merged type of two ApiContract objects.

+
    +
  • Groups that only exist in A are kept as-is.
  • +
  • Groups that only exist in B are kept as-is.
  • +
  • Groups whose key appears in both A and B have their endpoint maps +intersected (A[K] & B[K]), making all endpoints from both sources +visible on the merged group.
  • +
+

Type Parameters

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client..PER_CALL_OPTIONS.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client..PER_CALL_OPTIONS.html new file mode 100644 index 00000000..707c5b82 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client..PER_CALL_OPTIONS.html @@ -0,0 +1,6 @@ +PER_CALL_OPTIONS | Libraries

Variable PER_CALL_OPTIONSConst

PER_CALL_OPTIONS: unique symbol = ...

Symbol used to attach per-call middleware overrides to a RequestInit +object. Middlewares can read their own options from this property.

+
// Inside a middleware:
const opts = getPerCallOptions<MyOptions>(init, 'myMiddleware'); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client.optimistic-update.OPTIMISTIC_MUTATION_ID.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client.optimistic-update.OPTIMISTIC_MUTATION_ID.html new file mode 100644 index 00000000..f8ef1d38 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client.optimistic-update.OPTIMISTIC_MUTATION_ID.html @@ -0,0 +1 @@ +OPTIMISTIC_MUTATION_ID | Libraries
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client.react.QUERY_KEY_PREFIX.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client.react.QUERY_KEY_PREFIX.html new file mode 100644 index 00000000..bc54ed6a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_client.react.QUERY_KEY_PREFIX.html @@ -0,0 +1,4 @@ +QUERY_KEY_PREFIX | Libraries

Variable QUERY_KEY_PREFIXConst

QUERY_KEY_PREFIX: "@cleverbrush" = ...

Prefix used for all query keys generated by @cleverbrush/react-query.

+

This ensures keys do not collide with other TanStack Query consumers +in the same application.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_deep.deepExtend.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_deep.deepExtend.html new file mode 100644 index 00000000..3497711a --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_deep.deepExtend.html @@ -0,0 +1,9 @@ +deepExtend | Libraries

Variable deepExtendConst

deepExtend: <T extends unknown[]>(...args: T) => Merge<T> = ...

Deep-merges multiple objects into one. Later values override earlier ones; +nested objects are merged recursively rather than replaced.

+

Type Declaration

    • <T extends unknown[]>(...args: T): Merge<T>
    • Type Parameters

      • T extends unknown[]

      Parameters

      • ...args: T

        Two or more non-null objects to merge.

        +

      Returns Merge<T>

      A new object containing the deep-merged result.

      +
const a = { x: 1, nested: { a: true } };
const b = { y: 2, nested: { b: false } };
const result = deepExtend(a, b);
// { x: 1, y: 2, nested: { a: true, b: false } } +
+ +

If no arguments are provided or any argument is not a non-null object.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..EXTRA_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..EXTRA_TYPE_BRAND.html new file mode 100644 index 00000000..a27d1eb4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..EXTRA_TYPE_BRAND.html @@ -0,0 +1,18 @@ +EXTRA_TYPE_BRAND | Libraries

Variable EXTRA_TYPE_BRANDConst

EXTRA_TYPE_BRAND: "__cleverbrush_extra_type_brand__"

Generic accumulator brand for extension methods that want to thread +a Record<name, readonly string[]> map through the builder chain.

+

Extension authors can declare a method's return type as +this & { readonly [EXTRA_TYPE_BRAND]?: { [name]: TKeys } } +and FixedMethods will automatically:

+
    +
  • Make the first argument const-generic (to capture the literal name).
  • +
  • Make the second argument const-generic when it is a readonly string[] +tuple (to capture the literal key list).
  • +
  • Accumulate both into the 4th TExtraTypes parameter of FixedMethods +so the information survives subsequent method calls on the same builder.
  • +
+

This is deliberately projection-agnostic — any extension that follows the +(name: string, data: readonly string[] | function) signature convention +can use it. Projection-specific semantics (e.g. PROJECTION_BRAND) live +in the consuming library, not here.

+

FixedMethods for how the accumulation works.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..MAPPERS.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..MAPPERS.html new file mode 100644 index 00000000..090d0a31 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..MAPPERS.html @@ -0,0 +1,9 @@ +MAPPERS | Libraries

Variable MAPPERSConst

MAPPERS: Record<string, (value: any) => any> = ...

Built-in named value mapper functions.

+

Each entry maps a string key to a transformation function. Pass the key as +the mapper argument to mapValue instead of a custom function.

+

Currently available:

+
    +
  • date_from_json — converts a JSON date string (string | null) to a +JavaScript Date object (or passes through falsy values unchanged).
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..METHOD_LITERAL_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..METHOD_LITERAL_BRAND.html new file mode 100644 index 00000000..a7db37e7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema..METHOD_LITERAL_BRAND.html @@ -0,0 +1,9 @@ +METHOD_LITERAL_BRAND | Libraries

Variable METHOD_LITERAL_BRANDConst

METHOD_LITERAL_BRAND: "__cleverbrush_method_literal_brand__"

Unique string-literal brand key used by FixedMethods to detect +extension methods whose first-argument literal should be accumulated in the +return type.

+

Declare the return type of any extension method as +this & { readonly [METHOD_LITERAL_BRAND]?: N } (where N extends string) +and FixedMethods will automatically make it generic so the literal name +flows through the type system and accumulates across multiple calls.

+

This powers scope-name autocomplete in SchemaQueryBuilder.scoped().

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.COMPOSITE_PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.COMPOSITE_PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..5a01a126 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.COMPOSITE_PRIMARY_KEY_BRAND.html @@ -0,0 +1,3 @@ +COMPOSITE_PRIMARY_KEY_BRAND | Libraries

Variable COMPOSITE_PRIMARY_KEY_BRANDConst

COMPOSITE_PRIMARY_KEY_BRAND: unique symbol = ...

Phantom-type brand placed on an object schema by .hasPrimaryKey([cols]) +to record the composite primary-key column tuple at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.POLYMORPHIC_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.POLYMORPHIC_TYPE_BRAND.html new file mode 100644 index 00000000..4a71ae9f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.POLYMORPHIC_TYPE_BRAND.html @@ -0,0 +1,5 @@ +POLYMORPHIC_TYPE_BRAND | Libraries
POLYMORPHIC_TYPE_BRAND: unique symbol = ...

Phantom-type brand placed on an ObjectSchemaBuilder by .withVariants(). +The brand carries the discriminated-union result type so that +query(db, polymorphicSchema) automatically infers the correct union type +without any extra type annotation.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..c734c194 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.PRIMARY_KEY_BRAND.html @@ -0,0 +1,4 @@ +PRIMARY_KEY_BRAND | Libraries
PRIMARY_KEY_BRAND: unique symbol = ...

Phantom-type brand placed on a column schema by .primaryKey(). +Carried on the property schema's type so that PrimaryKeyOf can +locate primary-key columns at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.any.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.any.html new file mode 100644 index 00000000..84b93442 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.any.html @@ -0,0 +1 @@ +any | Libraries
any: ExtendedAnyFactory<
    {
        hasColumnName(
            this: AnySchemaBuilder<any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.any
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.array.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.array.html new file mode 100644 index 00000000..76a52cf4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.array.html @@ -0,0 +1 @@ +array | Libraries
array: ExtendedArrayFactory<
    {
        nonempty(
            this: ArraySchemaBuilder<any>,
            errorMessage?: ValidationErrorMessageProvider<
                ArraySchemaBuilder<
                    any,
                    true,
                    false,
                    undefined,
                    false,
                    {},
                    any[]
                    | unknown[],
                >,
            >,
        ): ArraySchemaBuilder<
            any,
            true,
            false,
            undefined,
            false,
            {},
            any[]
            | unknown[],
        >;
        unique(
            this: ArraySchemaBuilder<any>,
            keyFn?: (item: any) => unknown,
            errorMessage?: ValidationErrorMessageProvider<
                ArraySchemaBuilder<
                    any,
                    true,
                    false,
                    undefined,
                    false,
                    {},
                    any[]
                    | unknown[],
                >,
            >,
        ): ArraySchemaBuilder<
            any,
            true,
            false,
            undefined,
            false,
            {},
            any[]
            | unknown[],
        >;
    } & {
        hasColumnName(
            this: ArraySchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.array
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.boolean.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.boolean.html new file mode 100644 index 00000000..155a46cf --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.boolean.html @@ -0,0 +1 @@ +boolean | Libraries
boolean: ExtendedBooleanFactory<
    {
        hasColumnName(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        columnType(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            type: string,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        defaultTo(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            value: boolean,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        index(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            name?: string,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        unique(
            this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
            name?: string,
        ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
    },
> = extended.boolean
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.date.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.date.html new file mode 100644 index 00000000..69fc9f27 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.date.html @@ -0,0 +1 @@ +date | Libraries
date: ExtendedDateFactory<
    {
        hasColumnName(
            this: DateSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        columnType(
            this: DateSchemaBuilder<any, any, any, any, any>,
            type: string,
        ): DateSchemaBuilder<any, any, any, any, any>;
        dateOnly(
            this: DateSchemaBuilder<any, any, any, any, any>,
        ): DateSchemaBuilder<any, any, any, any, any>;
        defaultTo(
            this: DateSchemaBuilder<any, any, any, any, any>,
            value: "now",
        ): DateSchemaBuilder<any, any, any, any, any>;
        defaultToRaw(
            this: DateSchemaBuilder<any, any, any, any, any>,
            expression: string,
        ): DateSchemaBuilder<any, any, any, any, any>;
        index(
            this: DateSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): DateSchemaBuilder<any, any, any, any, any>;
        rowVersion(
            this: DateSchemaBuilder<any, any, any, any, any>,
        ): DateSchemaBuilder<any, any, any, any, any>;
        timestamptz(
            this: DateSchemaBuilder<any, any, any, any, any>,
        ): DateSchemaBuilder<any, any, any, any, any>;
    },
> = extended.date
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.dbExtension.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.dbExtension.html new file mode 100644 index 00000000..ea049978 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.dbExtension.html @@ -0,0 +1,8 @@ +dbExtension | Libraries
dbExtension: ExtensionDescriptor<
    {
        any: {
            hasColumnName(
                this: AnySchemaBuilder<any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        array: {
            hasColumnName(
                this: ArraySchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        boolean: {
            hasColumnName(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        date: {
            hasColumnName(
                this: DateSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        func: {
            hasColumnName(
                this: FunctionSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        generic: {
            hasColumnName(
                this: GenericSchemaBuilder<any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        number: {
            hasColumnName(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        object: {
            hasTableName(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        };
        string: {
            hasColumnName(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
        union: {
            hasColumnName(
                this: UnionSchemaBuilder<any, any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        };
    },
> = ...

Schema extension that adds database-mapping metadata to schema builders.

+

Import the typed factory functions (string, number, object, etc.) from +this package instead of from @cleverbrush/schema to gain access to the +.hasColumnName() and .hasTableName() methods.

+
import { object, string, number } from '@cleverbrush/knex-schema';

const UserSchema = object({
id: number(),
firstName: string().hasColumnName('first_name'),
lastName: string().hasColumnName('last_name'),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('users'); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.ddlExtension.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.ddlExtension.html new file mode 100644 index 00000000..aafc3c96 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.ddlExtension.html @@ -0,0 +1,10 @@ +ddlExtension | Libraries
ddlExtension: ExtensionDescriptor<
    {
        boolean: {
            columnType(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                type: string,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
            defaultTo(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                value: boolean,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
            index(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                name?: string,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
            unique(
                this: BooleanSchemaBuilder<any, any, any, any, any, any, any>,
                name?: string,
            ): BooleanSchemaBuilder<any, any, any, any, any, any, any>;
        };
        date: {
            columnType(
                this: DateSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): DateSchemaBuilder<any, any, any, any, any>;
            dateOnly(
                this: DateSchemaBuilder<any, any, any, any, any>,
            ): DateSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: DateSchemaBuilder<any, any, any, any, any>,
                value: "now",
            ): DateSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: DateSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): DateSchemaBuilder<any, any, any, any, any>;
            index(
                this: DateSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): DateSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: DateSchemaBuilder<any, any, any, any, any>,
            ): DateSchemaBuilder<any, any, any, any, any>;
            timestamptz(
                this: DateSchemaBuilder<any, any, any, any, any>,
            ): DateSchemaBuilder<any, any, any, any, any>;
        };
        number: {
            bigint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            decimal(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                precision: number,
                scale: number,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                value: number | "auto_increment",
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            index(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            references(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                opts?: { strategy?: "increment" | "manual" },
            ): NumberSchemaBuilder<any, any, any, any, any>;
            smallint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            unique(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
        };
        object: {
            afterInsert(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            beforeDelete(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            beforeInsert(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            beforeUpdate(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            belongsTo(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: { foreignKey: any; schema: any },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            belongsToMany(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: {
                    schema: any;
                    through: { foreignKey: string; localKey: string; table: string };
                },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            columnType(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                type: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            defaultScope(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasCheck(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                sql: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasIndex(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                columns: string[],
                opts?: { name?: string; unique?: boolean },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasMany(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: { foreignKey: any; schema: any },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasOne(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                opts: { foreignKey: any; schema: any },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasRawColumn(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: string,
                definition: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasRawIndex(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                sql: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasTimestamps(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                opts?: { createdAt?: string; updatedAt?: string },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            hasUnique(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                columns: string[],
                name?: string,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            json(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            jsonb(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
            projection<
                TProperties extends
                    Record<string, SchemaBuilder<any, any, any, any, any>>,
                const N extends string,
                const TKey extends string,
            >(
                this: ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                name: N,
                ...columns: readonly (
                    | TKey
                    | (
                        (
                            t: PropertyDescriptorTree<
                                ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                                ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                            >,
                        ) => PropertyDescriptor<any, any, any, TKey>
                    )
                )[],
            ): ObjectSchemaBuilder<TProperties, any, any, any, any, any, any> & {
                __cleverbrush_extra_type_brand__?: { [P in string]: readonly TKey[] };
            };
            scope<N extends string>(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                name: N,
                fn: Function,
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any> & {
                __cleverbrush_method_literal_brand__?: N;
            };
            softDelete(
                this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
                opts?: { column?: string },
            ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        };
        string: {
            asUuid(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            check(
                this: StringSchemaBuilder<any, any, any, any, any>,
                sql: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            citext(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: StringSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: StringSchemaBuilder<any, any, any, any, any>,
                value: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: StringSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            index(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            jsonb(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            references(
                this: StringSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            text(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            tsvector(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            unique(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
        };
    },
> = ...

DDL and ORM extension that adds database DDL metadata, relationship +definitions, and ORM conveniences to schema builders.

+

Column-level methods: .primaryKey(), .references(), .unique(), +.index(), .defaultTo(), .columnType(), .check(), .defaultToRaw().

+

Object-level methods: .hasIndex(), .hasUnique(), .hasCheck(), +.hasPrimaryKey(), .hasRawColumn(), .hasRawIndex(), .hasMany(), +.hasOne(), .belongsTo(), .belongsToMany(), .hasTimestamps(), +.softDelete(), .scope(), .defaultScope(), .beforeInsert(), +.afterInsert(), .beforeUpdate(), .beforeDelete().

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.func.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.func.html new file mode 100644 index 00000000..d1332f9b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.func.html @@ -0,0 +1 @@ +func | Libraries
func: ExtendedFuncFactory<
    {
        hasColumnName(
            this: FunctionSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.func
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.number.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.number.html new file mode 100644 index 00000000..03418084 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.number.html @@ -0,0 +1 @@ +number | Libraries
number: ExtendedNumberFactory<
    {
        finite(
            this: NumberSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        multipleOf(
            this: NumberSchemaBuilder,
            n: number,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        negative(
            this: NumberSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        oneOf(
            this: NumberSchemaBuilder,
            ...args: any[],
        ): NumberSchemaBuilder<number, true, false, false, {}>;
        positive(
            this: NumberSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                NumberSchemaBuilder<number, true, false, false, {}>,
            >,
        ): NumberSchemaBuilder<number, true, false, false, {}>;
    } & {
        hasColumnName(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        bigint(
            this: NumberSchemaBuilder<any, any, any, any, any>,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        columnType(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            type: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        decimal(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            precision: number,
            scale: number,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        defaultTo(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            value: number | "auto_increment",
        ): NumberSchemaBuilder<any, any, any, any, any>;
        defaultToRaw(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            expression: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        index(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        onDelete(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        onUpdate(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        references(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            table: string,
            column?: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        rowVersion(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            opts?: { strategy?: "increment" | "manual" },
        ): NumberSchemaBuilder<any, any, any, any, any>;
        smallint(
            this: NumberSchemaBuilder<any, any, any, any, any>,
        ): NumberSchemaBuilder<any, any, any, any, any>;
        unique(
            this: NumberSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): NumberSchemaBuilder<any, any, any, any, any>;
    },
> = extended.number
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.object.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.object.html new file mode 100644 index 00000000..3c5cf9b7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.object.html @@ -0,0 +1 @@ +object | Libraries
object: ExtendedObjectFactory<
    {
        hasTableName(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    } & {
        afterInsert(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        beforeDelete(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        beforeInsert(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        beforeUpdate(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        belongsTo(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: { foreignKey: any; schema: any },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        belongsToMany(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: {
                schema: any;
                through: { foreignKey: string; localKey: string; table: string };
            },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        columnType(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            type: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        defaultScope(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasCheck(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            sql: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasIndex(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            columns: string[],
            opts?: { name?: string; unique?: boolean },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasMany(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: { foreignKey: any; schema: any },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasOne(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            opts: { foreignKey: any; schema: any },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasRawColumn(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: string,
            definition: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasRawIndex(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            sql: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasTimestamps(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            opts?: { createdAt?: string; updatedAt?: string },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        hasUnique(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            columns: string[],
            name?: string,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        json(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        jsonb(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
        projection<
            TProperties extends
                Record<string, SchemaBuilder<any, any, any, any, any>>,
            const N extends string,
            const TKey extends string,
        >(
            this: ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
            name: N,
            ...columns: readonly (
                | TKey
                | (
                    (
                        t: PropertyDescriptorTree<
                            ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                            ObjectSchemaBuilder<TProperties, any, any, any, any, any, any>,
                        >,
                    ) => PropertyDescriptor<any, any, any, TKey>
                )
            )[],
        ): ObjectSchemaBuilder<TProperties, any, any, any, any, any, any> & {
            __cleverbrush_extra_type_brand__?: { [P in string]: readonly TKey[] };
        };
        scope<N extends string>(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            name: N,
            fn: Function,
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any> & {
            __cleverbrush_method_literal_brand__?: N;
        };
        softDelete(
            this: ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            opts?: { column?: string },
        ): ObjectSchemaBuilder<any, any, any, any, any, any, any>;
    },
> = extended.object
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.string.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.string.html new file mode 100644 index 00000000..f9875a64 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.string.html @@ -0,0 +1 @@ +string | Libraries
string: ExtendedStringFactory<
    {
        email(
            this: StringSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        ip(
            this: StringSchemaBuilder,
            opts?: { version?: "v4" | "v6" },
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        nonempty(
            this: StringSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        oneOf(
            this: StringSchemaBuilder,
            ...args: any[],
        ): StringSchemaBuilder<string, true, false, false, {}>;
        toLowerCase(
            this: StringSchemaBuilder,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        trim(
            this: StringSchemaBuilder,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        url(
            this: StringSchemaBuilder,
            optsOrError?:
                | ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >
                | { protocols?: string[] },
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
        uuid(
            this: StringSchemaBuilder,
            errorMessage?: ValidationErrorMessageProvider<
                StringSchemaBuilder<string, true, false, false, {}>,
            >,
        ): StringSchemaBuilder<string, true, false, false, {}>;
    } & {
        hasColumnName(
            this: StringSchemaBuilder<any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    } & {
        asUuid(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        check(
            this: StringSchemaBuilder<any, any, any, any, any>,
            sql: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        citext(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        columnType(
            this: StringSchemaBuilder<any, any, any, any, any>,
            type: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        defaultTo(
            this: StringSchemaBuilder<any, any, any, any, any>,
            value: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        defaultToRaw(
            this: StringSchemaBuilder<any, any, any, any, any>,
            expression: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        index(
            this: StringSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        jsonb(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        onDelete(
            this: StringSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): StringSchemaBuilder<any, any, any, any, any>;
        onUpdate(
            this: StringSchemaBuilder<any, any, any, any, any>,
            action: FKAction,
        ): StringSchemaBuilder<any, any, any, any, any>;
        references(
            this: StringSchemaBuilder<any, any, any, any, any>,
            table: string,
            column?: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
        rowVersion(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        text(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        tsvector(
            this: StringSchemaBuilder<any, any, any, any, any>,
        ): StringSchemaBuilder<any, any, any, any, any>;
        unique(
            this: StringSchemaBuilder<any, any, any, any, any>,
            name?: string,
        ): StringSchemaBuilder<any, any, any, any, any>;
    },
> = extended.string
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.union.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.union.html new file mode 100644 index 00000000..584945e6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_knex-schema.extension.union.html @@ -0,0 +1 @@ +union | Libraries
union: ExtendedUnionFactory<
    {
        hasColumnName(
            this: UnionSchemaBuilder<any, any, any, any, any, any>,
            name: string,
        ): SchemaBuilder<any, any, any, false, {}>;
    },
> = extended.union
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..ILogger.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..ILogger.html new file mode 100644 index 00000000..8e2d9306 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..ILogger.html @@ -0,0 +1,4 @@ +ILogger | Libraries

Variable ILoggerConst

ILogger: { __brand: "ILogger" } = ...

DI service key for the Logger instance.

+

Uses a symbol-based key for use with @cleverbrush/di ServiceCollection. +In the absence of @cleverbrush/di, this serves as a plain token.

+

Type Declaration

  • __brand: "ILogger"
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..LogContext.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..LogContext.html new file mode 100644 index 00000000..694630b8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..LogContext.html @@ -0,0 +1,22 @@ +LogContext | Libraries

Variable LogContextConst

LogContext: {
    current(): Logger | undefined;
    enrichWith<T>(properties: Record<string, unknown>, fn: () => T): T;
    getStore(): LogContextStore | undefined;
    run<T>(logger: Logger, fn: () => T): T;
    runWithCorrelationId<T>(correlationId: string, fn: () => T): T;
} = ...

Ambient logger context using AsyncLocalStorage.

+

Zero overhead when not used — the AsyncLocalStorage instance +is only created once, and getStore() is a near-zero-cost operation.

+

Type Declaration

  • current: function
  • enrichWith: function
    • Runs a callback with additional enrichment properties added +to the ambient logger context.

      +

      Type Parameters

      • T

      Parameters

      • properties: Record<string, unknown>

        additional properties to add to the context logger

        +
      • fn: () => T

        the async function to run

        +

      Returns T

      the result of the callback

      +
  • getStore: function
  • run: function
    • Runs a callback with the given logger as the ambient context.

      +

      Type Parameters

      • T

      Parameters

      • logger: Logger

        the logger to set as ambient

        +
      • fn: () => T

        the async function to run within the context

        +

      Returns T

      the result of the callback

      +
  • runWithCorrelationId: function
    • Runs a callback with a correlation ID set in the ambient context.

      +

      Type Parameters

      • T

      Parameters

      • correlationId: string

        the correlation ID to set

        +
      • fn: () => T

        the async function to run

        +

      Returns T

      the result of the callback

      +
LogContext.run(logger, async () => {
const log = LogContext.current()!;
log.info('Inside context');
}); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..LogLevel.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..LogLevel.html new file mode 100644 index 00000000..4feddd57 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..LogLevel.html @@ -0,0 +1,7 @@ +LogLevel | Libraries

Variable LogLevelConst

LogLevel: { Debug: 1; Error: 4; Fatal: 5; Information: 2; Trace: 0; Warning: 3 } = ...

Log severity levels as a const object.

+

Use as values (LogLevel.Information) or as a type (LogLevel). +Levels are ordered numerically — higher values indicate greater severity.

+

Type Declaration

  • ReadonlyDebug: 1
  • ReadonlyError: 4
  • ReadonlyFatal: 5
  • ReadonlyInformation: 2
  • ReadonlyTrace: 0
  • ReadonlyWarning: 3
if (logger.isEnabled(LogLevel.Debug)) {
logger.debug('Expensive computation: {@Result}', { Result: compute() });
} +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..SelfLog.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..SelfLog.html new file mode 100644 index 00000000..8e25d961 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_log..SelfLog.html @@ -0,0 +1,14 @@ +SelfLog | Libraries

Variable SelfLogConst

SelfLog: {
    _enabled: boolean;
    _output: { write(s: string): void } | null;
    disable(): void;
    enable(): void;
    setOutput(output: { write(s: string): void }): void;
    write(message: string, error?: unknown): void;
} = ...

Internal diagnostic channel for the logging library's own errors.

+

Sinks use this when they fail, instead of throwing and crashing +the application. By default writes to process.stderr.

+

Type Declaration

  • _enabled: boolean
  • _output: { write(s: string): void } | null
  • disable: function
  • enable: function
  • setOutput: function
    • Sets a custom output stream for self-diagnostics.

      +

      Parameters

      • output: { write(s: string): void }

        writable stream with a write method

        +

      Returns void

  • write: function
    • Writes an internal diagnostic message. Includes optional error details.

      +

      Parameters

      • message: string

        diagnostic message

        +
      • Optionalerror: unknown

        optional associated error

        +

      Returns void

SelfLog.setOutput(fs.createWriteStream('./logs/selflog.txt'));
SelfLog.disable(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.COMPOSITE_PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.COMPOSITE_PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..756c8dba --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.COMPOSITE_PRIMARY_KEY_BRAND.html @@ -0,0 +1,3 @@ +COMPOSITE_PRIMARY_KEY_BRAND | Libraries

Variable COMPOSITE_PRIMARY_KEY_BRANDConst

COMPOSITE_PRIMARY_KEY_BRAND: unique symbol

Phantom-type brand placed on an object schema by .hasPrimaryKey([cols]) +to record the composite primary-key column tuple at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.EXTRA_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.EXTRA_TYPE_BRAND.html new file mode 100644 index 00000000..2b37badb --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.EXTRA_TYPE_BRAND.html @@ -0,0 +1,18 @@ +EXTRA_TYPE_BRAND | Libraries

Variable EXTRA_TYPE_BRANDConst

EXTRA_TYPE_BRAND: "__cleverbrush_extra_type_brand__"

Generic accumulator brand for extension methods that want to thread +a Record<name, readonly string[]> map through the builder chain.

+

Extension authors can declare a method's return type as +this & { readonly [EXTRA_TYPE_BRAND]?: { [name]: TKeys } } +and FixedMethods will automatically:

+
    +
  • Make the first argument const-generic (to capture the literal name).
  • +
  • Make the second argument const-generic when it is a readonly string[] +tuple (to capture the literal key list).
  • +
  • Accumulate both into the 4th TExtraTypes parameter of FixedMethods +so the information survives subsequent method calls on the same builder.
  • +
+

This is deliberately projection-agnostic — any extension that follows the +(name: string, data: readonly string[] | function) signature convention +can use it. Projection-specific semantics (e.g. PROJECTION_BRAND) live +in the consuming library, not here.

+

FixedMethods for how the accumulation works.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.MAPPERS.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.MAPPERS.html new file mode 100644 index 00000000..0926f731 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.MAPPERS.html @@ -0,0 +1,9 @@ +MAPPERS | Libraries

Variable MAPPERSConst

MAPPERS: Record<string, (value: any) => any>

Built-in named value mapper functions.

+

Each entry maps a string key to a transformation function. Pass the key as +the mapper argument to mapValue instead of a custom function.

+

Currently available:

+
    +
  • date_from_json — converts a JSON date string (string | null) to a +JavaScript Date object (or passes through falsy values unchanged).
  • +
+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.METHOD_LITERAL_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.METHOD_LITERAL_BRAND.html new file mode 100644 index 00000000..9947000f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.METHOD_LITERAL_BRAND.html @@ -0,0 +1,9 @@ +METHOD_LITERAL_BRAND | Libraries

Variable METHOD_LITERAL_BRANDConst

METHOD_LITERAL_BRAND: "__cleverbrush_method_literal_brand__"

Unique string-literal brand key used by FixedMethods to detect +extension methods whose first-argument literal should be accumulated in the +return type.

+

Declare the return type of any extension method as +this & { readonly [METHOD_LITERAL_BRAND]?: N } (where N extends string) +and FixedMethods will automatically make it generic so the literal name +flows through the type system and accumulates across multiple calls.

+

This powers scope-name autocomplete in SchemaQueryBuilder.scoped().

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.POLYMORPHIC_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.POLYMORPHIC_TYPE_BRAND.html new file mode 100644 index 00000000..2dc3b397 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.POLYMORPHIC_TYPE_BRAND.html @@ -0,0 +1,5 @@ +POLYMORPHIC_TYPE_BRAND | Libraries

Variable POLYMORPHIC_TYPE_BRANDConst

POLYMORPHIC_TYPE_BRAND: unique symbol

Phantom-type brand placed on an ObjectSchemaBuilder by .withVariants(). +The brand carries the discriminated-union result type so that +query(db, polymorphicSchema) automatically infers the correct union type +without any extra type annotation.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.PRIMARY_KEY_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.PRIMARY_KEY_BRAND.html new file mode 100644 index 00000000..df347f49 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.PRIMARY_KEY_BRAND.html @@ -0,0 +1,4 @@ +PRIMARY_KEY_BRAND | Libraries

Variable PRIMARY_KEY_BRANDConst

PRIMARY_KEY_BRAND: unique symbol

Phantom-type brand placed on a column schema by .primaryKey(). +Carried on the property schema's type so that PrimaryKeyOf can +locate primary-key columns at the type level.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.any.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.any.html new file mode 100644 index 00000000..9482c26d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.any.html @@ -0,0 +1 @@ +any | Libraries

Variable anyConst

any: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.array.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.array.html new file mode 100644 index 00000000..7dd394ce --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.array.html @@ -0,0 +1 @@ +array | Libraries

Variable arrayConst

array: <TElementSchema extends SchemaBuilder<any, any, any, any, any>>(
    elementSchema?: TElementSchema,
) => CleanExtended

Type Declaration

    • <TElementSchema extends SchemaBuilder<any, any, any, any, any>>(
          elementSchema?: TElementSchema,
      ): CleanExtended
    • Type Parameters

      • TElementSchema extends SchemaBuilder<any, any, any, any, any>

      Parameters

      Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.boolean.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.boolean.html new file mode 100644 index 00000000..19a1d18d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.boolean.html @@ -0,0 +1 @@ +boolean | Libraries

Variable booleanConst

boolean: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.date.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.date.html new file mode 100644 index 00000000..760f6c81 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.date.html @@ -0,0 +1 @@ +date | Libraries

Variable dateConst

date: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.dbExtension.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.dbExtension.html new file mode 100644 index 00000000..c7902316 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.dbExtension.html @@ -0,0 +1,8 @@ +dbExtension | Libraries

Variable dbExtensionConst

dbExtension: ExtensionDescriptor

Schema extension that adds database-mapping metadata to schema builders.

+

Import the typed factory functions (string, number, object, etc.) from +this package instead of from @cleverbrush/schema to gain access to the +.hasColumnName() and .hasTableName() methods.

+
import { object, string, number } from '@cleverbrush/knex-schema';

const UserSchema = object({
id: number(),
firstName: string().hasColumnName('first_name'),
lastName: string().hasColumnName('last_name'),
createdAt: date().hasColumnName('created_at'),
}).hasTableName('users'); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.ddlExtension.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.ddlExtension.html new file mode 100644 index 00000000..6777b842 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.ddlExtension.html @@ -0,0 +1,10 @@ +ddlExtension | Libraries

Variable ddlExtensionConst

ddlExtension: ExtensionDescriptor

DDL and ORM extension that adds database DDL metadata, relationship +definitions, and ORM conveniences to schema builders.

+

Column-level methods: .primaryKey(), .references(), .unique(), +.index(), .defaultTo(), .columnType(), .check(), .defaultToRaw().

+

Object-level methods: .hasIndex(), .hasUnique(), .hasCheck(), +.hasPrimaryKey(), .hasRawColumn(), .hasRawIndex(), .hasMany(), +.hasOne(), .belongsTo(), .belongsToMany(), .hasTimestamps(), +.softDelete(), .scope(), .defaultScope(), .beforeInsert(), +.afterInsert(), .beforeUpdate(), .beforeDelete().

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.func.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.func.html new file mode 100644 index 00000000..abcdda9e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.func.html @@ -0,0 +1 @@ +func | Libraries

Variable funcConst

func: () => CleanExtended

Type Declaration

    • (): CleanExtended
    • Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.number.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.number.html new file mode 100644 index 00000000..e2431cdc --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.number.html @@ -0,0 +1 @@ +number | Libraries

Variable numberConst

number: {
    (): CleanExtended<
        NumberSchemaBuilder<
            number,
            true,
            false,
            false,
            {
                finite(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                multipleOf(
                    this: NumberSchemaBuilder,
                    n: number,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                negative(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                oneOf(
                    this: NumberSchemaBuilder,
                    ...args: any[],
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                positive(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                bigint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                decimal(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    precision: number,
                    scale: number,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    value: number | "auto_increment",
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                index(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                references(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    opts?: { strategy?: "increment" | "manual" },
                ): NumberSchemaBuilder<any, any, any, any, any>;
                smallint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            finite(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            multipleOf(
                this: NumberSchemaBuilder,
                n: number,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            negative(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            oneOf(
                this: NumberSchemaBuilder,
                ...args: any[],
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            positive(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
        } & {
            hasColumnName(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            bigint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            decimal(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                precision: number,
                scale: number,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                value: number | "auto_increment",
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            index(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            references(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                opts?: { strategy?: "increment" | "manual" },
            ): NumberSchemaBuilder<any, any, any, any, any>;
            smallint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            unique(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
        },
    >;
    <T extends number>(
        equals: T,
    ): CleanExtended<
        NumberSchemaBuilder<
            T,
            true,
            false,
            false,
            {
                finite(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                multipleOf(
                    this: NumberSchemaBuilder,
                    n: number,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                negative(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                oneOf(
                    this: NumberSchemaBuilder,
                    ...args: any[],
                ): NumberSchemaBuilder<number, true, false, false, {}>;
                positive(
                    this: NumberSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        NumberSchemaBuilder<number, true, false, false, {}>,
                    >,
                ): NumberSchemaBuilder<number, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                bigint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                decimal(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    precision: number,
                    scale: number,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    value: number | "auto_increment",
                ): NumberSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                index(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                references(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    opts?: { strategy?: "increment" | "manual" },
                ): NumberSchemaBuilder<any, any, any, any, any>;
                smallint(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                ): NumberSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: NumberSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): NumberSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            finite(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            multipleOf(
                this: NumberSchemaBuilder,
                n: number,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            negative(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            oneOf(
                this: NumberSchemaBuilder,
                ...args: any[],
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            positive(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
        } & {
            hasColumnName(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            bigint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            decimal(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                precision: number,
                scale: number,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                value: number | "auto_increment",
            ): NumberSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            index(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            references(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                opts?: { strategy?: "increment" | "manual" },
            ): NumberSchemaBuilder<any, any, any, any, any>;
            smallint(
                this: NumberSchemaBuilder<any, any, any, any, any>,
            ): NumberSchemaBuilder<any, any, any, any, any>;
            unique(
                this: NumberSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): NumberSchemaBuilder<any, any, any, any, any>;
        },
    >;
}

Type Declaration

    • (): CleanExtended<
          NumberSchemaBuilder<
              number,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Returns CleanExtended<
          NumberSchemaBuilder<
              number,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >

    • <T extends number>(
          equals: T,
      ): CleanExtended<
          NumberSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Type Parameters

      • T extends number

      Parameters

      • equals: T

      Returns CleanExtended<
          NumberSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  finite(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  multipleOf(
                      this: NumberSchemaBuilder,
                      n: number,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  negative(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  oneOf(
                      this: NumberSchemaBuilder,
                      ...args: any[],
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
                  positive(
                      this: NumberSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          NumberSchemaBuilder<number, true, false, false, {}>,
                      >,
                  ): NumberSchemaBuilder<number, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  bigint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  decimal(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      precision: number,
                      scale: number,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      value: number | "auto_increment",
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      opts?: { strategy?: "increment" | "manual" },
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  smallint(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: NumberSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): NumberSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              finite(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              multipleOf(
                  this: NumberSchemaBuilder,
                  n: number,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              negative(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              oneOf(
                  this: NumberSchemaBuilder,
                  ...args: any[],
              ): NumberSchemaBuilder<number, true, false, false, {}>;
              positive(
                  this: NumberSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      NumberSchemaBuilder<number, true, false, false, {}>,
                  >,
              ): NumberSchemaBuilder<number, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              bigint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              decimal(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  precision: number,
                  scale: number,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  value: number | "auto_increment",
              ): NumberSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              index(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              references(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  opts?: { strategy?: "increment" | "manual" },
              ): NumberSchemaBuilder<any, any, any, any, any>;
              smallint(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
              ): NumberSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: NumberSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): NumberSchemaBuilder<any, any, any, any, any>;
          },
      >

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.object.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.object.html new file mode 100644 index 00000000..0d5dc6b2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.object.html @@ -0,0 +1 @@ +object | Libraries

Variable objectConst

object: <P extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
    properties?: P,
) => CleanExtended

Type Declaration

    • <P extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
          properties?: P,
      ): CleanExtended
    • Type Parameters

      • P extends Record<string, SchemaBuilder<any, any, any, any, any>>

      Parameters

      • Optionalproperties: P

      Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.string.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.string.html new file mode 100644 index 00000000..3eaaa15e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.string.html @@ -0,0 +1 @@ +string | Libraries

Variable stringConst

string: {
    (): CleanExtended<
        StringSchemaBuilder<
            string,
            true,
            false,
            false,
            {
                email(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                ip(
                    this: StringSchemaBuilder,
                    opts?: { version?: "v4" | "v6" },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                nonempty(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                oneOf(
                    this: StringSchemaBuilder,
                    ...args: any[],
                ): StringSchemaBuilder<string, true, false, false, {}>;
                toLowerCase(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                trim(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                url(
                    this: StringSchemaBuilder,
                    optsOrError?:
                        | ValidationErrorMessageProvider<
                            StringSchemaBuilder<string, true, false, false, {}>,
                        >
                        | { protocols?: string[] },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                uuid(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                asUuid(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                check(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    sql: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                citext(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    value: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                index(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                jsonb(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                references(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                text(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                tsvector(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            email(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            ip(
                this: StringSchemaBuilder,
                opts?: { version?: "v4" | "v6" },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            nonempty(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            oneOf(
                this: StringSchemaBuilder,
                ...args: any[],
            ): StringSchemaBuilder<string, true, false, false, {}>;
            toLowerCase(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            trim(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            url(
                this: StringSchemaBuilder,
                optsOrError?:
                    | ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >
                    | { protocols?: string[] },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            uuid(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
        } & {
            hasColumnName(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            asUuid(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            check(
                this: StringSchemaBuilder<any, any, any, any, any>,
                sql: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            citext(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: StringSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: StringSchemaBuilder<any, any, any, any, any>,
                value: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: StringSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            index(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            jsonb(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            references(
                this: StringSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            text(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            tsvector(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            unique(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
        },
    >;
    <T extends string>(
        equals: T,
    ): CleanExtended<
        StringSchemaBuilder<
            T,
            true,
            false,
            false,
            {
                email(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                ip(
                    this: StringSchemaBuilder,
                    opts?: { version?: "v4" | "v6" },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                nonempty(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                oneOf(
                    this: StringSchemaBuilder,
                    ...args: any[],
                ): StringSchemaBuilder<string, true, false, false, {}>;
                toLowerCase(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                trim(
                    this: StringSchemaBuilder,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                url(
                    this: StringSchemaBuilder,
                    optsOrError?:
                        | ValidationErrorMessageProvider<
                            StringSchemaBuilder<string, true, false, false, {}>,
                        >
                        | { protocols?: string[] },
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
                uuid(
                    this: StringSchemaBuilder,
                    errorMessage?: ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >,
                ): StringSchemaBuilder<string, true, false, false, {}>;
            } & {
                hasColumnName(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name: string,
                ): SchemaBuilder<any, any, any, false, {}>;
            } & {
                asUuid(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                check(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    sql: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                citext(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                columnType(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    type: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultTo(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    value: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                defaultToRaw(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    expression: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                index(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                jsonb(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onDelete(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                onUpdate(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    action: FKAction,
                ): StringSchemaBuilder<any, any, any, any, any>;
                references(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    table: string,
                    column?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
                rowVersion(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                text(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                tsvector(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                ): StringSchemaBuilder<any, any, any, any, any>;
                unique(
                    this: StringSchemaBuilder<any, any, any, any, any>,
                    name?: string,
                ): StringSchemaBuilder<any, any, any, any, any>;
            },
        >,
        {
            email(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            ip(
                this: StringSchemaBuilder,
                opts?: { version?: "v4" | "v6" },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            nonempty(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            oneOf(
                this: StringSchemaBuilder,
                ...args: any[],
            ): StringSchemaBuilder<string, true, false, false, {}>;
            toLowerCase(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            trim(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            url(
                this: StringSchemaBuilder,
                optsOrError?:
                    | ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >
                    | { protocols?: string[] },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            uuid(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
        } & {
            hasColumnName(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name: string,
            ): SchemaBuilder<any, any, any, false, {}>;
        } & {
            asUuid(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            check(
                this: StringSchemaBuilder<any, any, any, any, any>,
                sql: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            citext(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            columnType(
                this: StringSchemaBuilder<any, any, any, any, any>,
                type: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultTo(
                this: StringSchemaBuilder<any, any, any, any, any>,
                value: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            defaultToRaw(
                this: StringSchemaBuilder<any, any, any, any, any>,
                expression: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            index(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            jsonb(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onDelete(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            onUpdate(
                this: StringSchemaBuilder<any, any, any, any, any>,
                action: FKAction,
            ): StringSchemaBuilder<any, any, any, any, any>;
            references(
                this: StringSchemaBuilder<any, any, any, any, any>,
                table: string,
                column?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
            rowVersion(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            text(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            tsvector(
                this: StringSchemaBuilder<any, any, any, any, any>,
            ): StringSchemaBuilder<any, any, any, any, any>;
            unique(
                this: StringSchemaBuilder<any, any, any, any, any>,
                name?: string,
            ): StringSchemaBuilder<any, any, any, any, any>;
        },
    >;
}

Type Declaration

    • (): CleanExtended<
          StringSchemaBuilder<
              string,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Returns CleanExtended<
          StringSchemaBuilder<
              string,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >

    • <T extends string>(
          equals: T,
      ): CleanExtended<
          StringSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >
    • Type Parameters

      • T extends string

      Parameters

      • equals: T

      Returns CleanExtended<
          StringSchemaBuilder<
              T,
              true,
              false,
              false,
              {
                  email(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  ip(
                      this: StringSchemaBuilder,
                      opts?: { version?: "v4" | "v6" },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  nonempty(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  oneOf(
                      this: StringSchemaBuilder,
                      ...args: any[],
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  toLowerCase(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  trim(
                      this: StringSchemaBuilder,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  url(
                      this: StringSchemaBuilder,
                      optsOrError?:
                          | ValidationErrorMessageProvider<
                              StringSchemaBuilder<string, true, false, false, {}>,
                          >
                          | { protocols?: string[] },
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
                  uuid(
                      this: StringSchemaBuilder,
                      errorMessage?: ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >,
                  ): StringSchemaBuilder<string, true, false, false, {}>;
              } & {
                  hasColumnName(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name: string,
                  ): SchemaBuilder<any, any, any, false, {}>;
              } & {
                  asUuid(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  check(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      sql: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  citext(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  columnType(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      type: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultTo(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      value: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  defaultToRaw(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      expression: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  index(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  jsonb(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onDelete(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  onUpdate(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      action: FKAction,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  references(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      table: string,
                      column?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  rowVersion(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  text(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  tsvector(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                  ): StringSchemaBuilder<any, any, any, any, any>;
                  unique(
                      this: StringSchemaBuilder<any, any, any, any, any>,
                      name?: string,
                  ): StringSchemaBuilder<any, any, any, any, any>;
              },
          >,
          {
              email(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              ip(
                  this: StringSchemaBuilder,
                  opts?: { version?: "v4" | "v6" },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              nonempty(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              oneOf(
                  this: StringSchemaBuilder,
                  ...args: any[],
              ): StringSchemaBuilder<string, true, false, false, {}>;
              toLowerCase(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              trim(
                  this: StringSchemaBuilder,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              url(
                  this: StringSchemaBuilder,
                  optsOrError?:
                      | ValidationErrorMessageProvider<
                          StringSchemaBuilder<string, true, false, false, {}>,
                      >
                      | { protocols?: string[] },
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
              uuid(
                  this: StringSchemaBuilder,
                  errorMessage?: ValidationErrorMessageProvider<
                      StringSchemaBuilder<string, true, false, false, {}>,
                  >,
              ): StringSchemaBuilder<string, true, false, false, {}>;
          } & {
              hasColumnName(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name: string,
              ): SchemaBuilder<any, any, any, false, {}>;
          } & {
              asUuid(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              check(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  sql: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              citext(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              columnType(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  type: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultTo(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  value: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              defaultToRaw(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  expression: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              index(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              jsonb(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onDelete(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              onUpdate(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  action: FKAction,
              ): StringSchemaBuilder<any, any, any, any, any>;
              references(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  table: string,
                  column?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
              rowVersion(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              text(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              tsvector(
                  this: StringSchemaBuilder<any, any, any, any, any>,
              ): StringSchemaBuilder<any, any, any, any, any>;
              unique(
                  this: StringSchemaBuilder<any, any, any, any, any>,
                  name?: string,
              ): StringSchemaBuilder<any, any, any, any, any>;
          },
      >

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.union.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.union.html new file mode 100644 index 00000000..d7af99e8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_orm.union.html @@ -0,0 +1 @@ +union | Libraries

Variable unionConst

union: <T extends SchemaBuilder<any, any, any, any, any>>(
    schema: T,
) => CleanExtended

Type Declaration

    • <T extends SchemaBuilder<any, any, any, any, any>>(schema: T): CleanExtended
    • Type Parameters

      • T extends SchemaBuilder<any, any, any, any, any>

      Parameters

      • schema: T

      Returns CleanExtended

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..IMeter.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..IMeter.html new file mode 100644 index 00000000..55a69290 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..IMeter.html @@ -0,0 +1,4 @@ +IMeter | Libraries

Variable IMeterConst

IMeter: { __brand: "IMeter" } = ...

DI service key for an OpenTelemetry Meter.

+

Resolved from the global MeterProvider set by +import('./setupOtel.js').setupOtel.

+

Type Declaration

  • __brand: "IMeter"
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..ITracer.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..ITracer.html new file mode 100644 index 00000000..15cb4819 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..ITracer.html @@ -0,0 +1,5 @@ +ITracer | Libraries

Variable ITracerConst

ITracer: { __brand: "ITracer" } = ...

DI service key for an OpenTelemetry Tracer.

+

Resolved from the global TracerProvider set by +import('./setupOtel.js').setupOtel. Components that prefer +dependency injection over the global API can inject this token.

+

Type Declaration

  • __brand: "ITracer"
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..OTEL_SPAN_ITEM_KEY.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..OTEL_SPAN_ITEM_KEY.html new file mode 100644 index 00000000..7d1cd402 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_otel..OTEL_SPAN_ITEM_KEY.html @@ -0,0 +1,6 @@ +OTEL_SPAN_ITEM_KEY | Libraries

Variable OTEL_SPAN_ITEM_KEYConst

OTEL_SPAN_ITEM_KEY: "otel.span" = 'otel.span'

Attribute key under which the OTel server span is stashed on the +per-request RequestContext.items map.

+

Downstream middleware/handlers can read this with +ctx.items.get(OTEL_SPAN_ITEM_KEY) to attach custom attributes +or events to the active server span.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_scheduler.Schemas.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_scheduler.Schemas.html new file mode 100644 index 00000000..347058d4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_scheduler.Schemas.html @@ -0,0 +1,3 @@ +Schemas | Libraries

Variable SchemasConst

Schemas: {
    CreateJobRequestSchema: ExtendedObject<
        {
            id: ExtendedString<string>;
            maxConsequentFails: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxRetries: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            noConcurrentRuns: BooleanSchemaBuilder<
                boolean,
                false,
                false,
                undefined,
                false,
                {},
                boolean,
            >;
            path: StringSchemaBuilder<
                string,
                true,
                false,
                false,
                StringBuiltinExtensions<string>,
            > & StringBuiltinExtensions<string>;
            props: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<{}, true, false, undefined, false, {}, []>,
                    ExtendedFunc,
                ],
                false,
                false,
                undefined,
                false,
                {},
            >;
            schedule: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<
                        Omit<
                            Omit<
                                {
                                    endsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                    hour: (...) & (...);
                                    interval: (...) & (...);
                                    maxOccurences: (...) & (...);
                                    minute: (...) & (...);
                                    skipFirst: (...) & (...);
                                    startsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                },
                                "hour",
                            >,
                            "minute",
                        > & { every: ExtendedString<"minute"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & { every: ExtendedString<"day"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            dayOfWeek: ArraySchemaBuilder<
                                (...) & (...),
                                true,
                                false,
                                undefined,
                                false,
                                ArrayBuiltinExtensions<(...)>,
                                (...)[],
                            > & ArrayBuiltinExtensions<
                                SchemaBuilder<(...), (...), (...), (...), (...)>,
                            >;
                            every: ExtendedString<"week">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"month">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"year">;
                            month: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            timeout: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
    >;
    ScheduleDaySchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & { every: ExtendedString<"day"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleMinuteSchema: ObjectSchemaBuilder<
        Omit<
            Omit<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                },
                "hour",
            >,
            "minute",
        > & { every: ExtendedString<"minute"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleMonthSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"month">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleSchema: UnionSchemaBuilder<
        [
            ObjectSchemaBuilder<
                Omit<
                    Omit<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        },
                        "hour",
                    >,
                    "minute",
                > & { every: ExtendedString<"minute"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & { every: ExtendedString<"day"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    dayOfWeek: ArraySchemaBuilder<
                        NumberSchemaBuilder<
                            number,
                            true,
                            false,
                            false,
                            NumberBuiltinExtensions<(...)>,
                        > & NumberBuiltinExtensions<number>,
                        true,
                        false,
                        undefined,
                        false,
                        ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                        number[],
                    > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
                    every: ExtendedString<"week">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"month">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"year">;
                    month: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
        ],
        true,
        false,
        undefined,
        false,
        {},
    >;
    ScheduleSchemaBase: ExtendedObject<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        },
    >;
    ScheduleWeekSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            dayOfWeek: ArraySchemaBuilder<
                NumberSchemaBuilder<
                    number,
                    true,
                    false,
                    false,
                    NumberBuiltinExtensions<number>,
                > & NumberBuiltinExtensions<number>,
                true,
                false,
                undefined,
                false,
                ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                number[],
            > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
            every: ExtendedString<"week">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
    ScheduleYearSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"year">;
            month: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >;
} = ...

Pre-built @cleverbrush/schema schemas used internally by the scheduler. +Exported for consumers who need to validate schedule/job payloads manually.

+

Type Declaration

  • CreateJobRequestSchema: ExtendedObject<
        {
            id: ExtendedString<string>;
            maxConsequentFails: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxRetries: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            noConcurrentRuns: BooleanSchemaBuilder<
                boolean,
                false,
                false,
                undefined,
                false,
                {},
                boolean,
            >;
            path: StringSchemaBuilder<
                string,
                true,
                false,
                false,
                StringBuiltinExtensions<string>,
            > & StringBuiltinExtensions<string>;
            props: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<{}, true, false, undefined, false, {}, []>,
                    ExtendedFunc,
                ],
                false,
                false,
                undefined,
                false,
                {},
            >;
            schedule: UnionSchemaBuilder<
                [
                    ObjectSchemaBuilder<
                        Omit<
                            Omit<
                                {
                                    endsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                    hour: (...) & (...);
                                    interval: (...) & (...);
                                    maxOccurences: (...) & (...);
                                    minute: (...) & (...);
                                    skipFirst: (...) & (...);
                                    startsOn: DateSchemaBuilder<(...), (...), (...), (...), (...)>;
                                },
                                "hour",
                            >,
                            "minute",
                        > & { every: ExtendedString<"minute"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & { every: ExtendedString<"day"> },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            dayOfWeek: ArraySchemaBuilder<
                                (...) & (...),
                                true,
                                false,
                                undefined,
                                false,
                                ArrayBuiltinExtensions<(...)>,
                                (...)[],
                            > & ArrayBuiltinExtensions<
                                SchemaBuilder<(...), (...), (...), (...), (...)>,
                            >;
                            every: ExtendedString<"week">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"month">;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                    ObjectSchemaBuilder<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        } & {
                            day: UnionSchemaBuilder<
                                [ExtendedString<(...)>, (...) & (...)],
                                true,
                                false,
                                undefined,
                                false,
                                {},
                            >;
                            every: ExtendedString<"year">;
                            month: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                        },
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        [],
                    >,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            timeout: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
    >
  • ScheduleDaySchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & { every: ExtendedString<"day"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleMinuteSchema: ObjectSchemaBuilder<
        Omit<
            Omit<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                },
                "hour",
            >,
            "minute",
        > & { every: ExtendedString<"minute"> },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleMonthSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"month">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleSchema: UnionSchemaBuilder<
        [
            ObjectSchemaBuilder<
                Omit<
                    Omit<
                        {
                            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                            hour: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            interval: NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            maxOccurences: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            minute: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            skipFirst: NumberSchemaBuilder<
                                number,
                                false,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>;
                            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                        },
                        "hour",
                    >,
                    "minute",
                > & { every: ExtendedString<"minute"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & { every: ExtendedString<"day"> },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    dayOfWeek: ArraySchemaBuilder<
                        NumberSchemaBuilder<
                            number,
                            true,
                            false,
                            false,
                            NumberBuiltinExtensions<(...)>,
                        > & NumberBuiltinExtensions<number>,
                        true,
                        false,
                        undefined,
                        false,
                        ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                        number[],
                    > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
                    every: ExtendedString<"week">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"month">;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
            ObjectSchemaBuilder<
                {
                    endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                    hour: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    interval: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    maxOccurences: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    minute: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    skipFirst: NumberSchemaBuilder<
                        number,
                        false,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                    startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
                } & {
                    day: UnionSchemaBuilder<
                        [
                            ExtendedString<"last">,
                            NumberSchemaBuilder<
                                number,
                                true,
                                false,
                                false,
                                NumberBuiltinExtensions<(...)>,
                            > & NumberBuiltinExtensions<number>,
                        ],
                        true,
                        false,
                        undefined,
                        false,
                        {},
                    >;
                    every: ExtendedString<"year">;
                    month: NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>;
                },
                true,
                false,
                undefined,
                false,
                {},
                [],
            >,
        ],
        true,
        false,
        undefined,
        false,
        {},
    >
  • ScheduleSchemaBase: ExtendedObject<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        },
    >
  • ScheduleWeekSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            dayOfWeek: ArraySchemaBuilder<
                NumberSchemaBuilder<
                    number,
                    true,
                    false,
                    false,
                    NumberBuiltinExtensions<number>,
                > & NumberBuiltinExtensions<number>,
                true,
                false,
                undefined,
                false,
                ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>,
                number[],
            > & ArrayBuiltinExtensions<SchemaBuilder<any, any, any, any, any>>;
            every: ExtendedString<"week">;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
  • ScheduleYearSchema: ObjectSchemaBuilder<
        {
            endsOn: DateSchemaBuilder<Date, false, false, false, {}>;
            hour: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            interval: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            maxOccurences: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            minute: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            skipFirst: NumberSchemaBuilder<
                number,
                false,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
            startsOn: DateSchemaBuilder<Date, false, false, false, {}>;
        } & {
            day: UnionSchemaBuilder<
                [
                    ExtendedString<"last">,
                    NumberSchemaBuilder<
                        number,
                        true,
                        false,
                        false,
                        NumberBuiltinExtensions<number>,
                    > & NumberBuiltinExtensions<number>,
                ],
                true,
                false,
                undefined,
                false,
                {},
            >;
            every: ExtendedString<"year">;
            month: NumberSchemaBuilder<
                number,
                true,
                false,
                false,
                NumberBuiltinExtensions<number>,
            > & NumberBuiltinExtensions<number>;
        },
        true,
        false,
        undefined,
        false,
        {},
        [],
    >
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.EXTRA_TYPE_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.EXTRA_TYPE_BRAND.html new file mode 100644 index 00000000..01ed146d --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.EXTRA_TYPE_BRAND.html @@ -0,0 +1,18 @@ +EXTRA_TYPE_BRAND | Libraries

Variable EXTRA_TYPE_BRANDConst

EXTRA_TYPE_BRAND: "__cleverbrush_extra_type_brand__" = ...

Generic accumulator brand for extension methods that want to thread +a Record<name, readonly string[]> map through the builder chain.

+

Extension authors can declare a method's return type as +this & { readonly [EXTRA_TYPE_BRAND]?: { [name]: TKeys } } +and FixedMethods will automatically:

+
    +
  • Make the first argument const-generic (to capture the literal name).
  • +
  • Make the second argument const-generic when it is a readonly string[] +tuple (to capture the literal key list).
  • +
  • Accumulate both into the 4th TExtraTypes parameter of FixedMethods +so the information survives subsequent method calls on the same builder.
  • +
+

This is deliberately projection-agnostic — any extension that follows the +(name: string, data: readonly string[] | function) signature convention +can use it. Projection-specific semantics (e.g. PROJECTION_BRAND) live +in the consuming library, not here.

+

FixedMethods for how the accumulation works.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.METHOD_LITERAL_BRAND.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.METHOD_LITERAL_BRAND.html new file mode 100644 index 00000000..79a8dae2 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.METHOD_LITERAL_BRAND.html @@ -0,0 +1,9 @@ +METHOD_LITERAL_BRAND | Libraries

Variable METHOD_LITERAL_BRANDConst

METHOD_LITERAL_BRAND: "__cleverbrush_method_literal_brand__" = ...

Unique string-literal brand key used by FixedMethods to detect +extension methods whose first-argument literal should be accumulated in the +return type.

+

Declare the return type of any extension method as +this & { readonly [METHOD_LITERAL_BRAND]?: N } (where N extends string) +and FixedMethods will automatically make it generic so the literal name +flows through the type system and accumulates across multiple calls.

+

This powers scope-name autocomplete in SchemaQueryBuilder.scoped().

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.SYMBOL_HAS_PROPERTIES.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.SYMBOL_HAS_PROPERTIES.html new file mode 100644 index 00000000..354ed4f7 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.SYMBOL_HAS_PROPERTIES.html @@ -0,0 +1,9 @@ +SYMBOL_HAS_PROPERTIES | Libraries

Variable SYMBOL_HAS_PROPERTIESConst

SYMBOL_HAS_PROPERTIES: typeof SYMBOL_HAS_PROPERTIES = ...

A symbol that marks a schema as having sub-properties that can +participate in property descriptor trees. When a schema exposes +[SYMBOL_HAS_PROPERTIES] = true and its introspect() returns +a properties record, it will be recursed into by +ObjectSchemaBuilder.getPropertiesFor() — the same way nested +ObjectSchemaBuilder instances are.

+

Currently implemented by ObjectSchemaBuilder (always) and +ExternSchemaBuilder (when created with an explicit property map).

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR.html new file mode 100644 index 00000000..474feef8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR.html @@ -0,0 +1,5 @@ +SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR | Libraries

Variable SYMBOL_SCHEMA_PROPERTY_DESCRIPTORConst

SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR: typeof SYMBOL_SCHEMA_PROPERTY_DESCRIPTOR = ...

A symbol to mark property descriptors in the schema. +Normally, you should not use it directly unless you want +to develop some advanced features or extend the library. +In normal conditions it's used internally by the library.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.any.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.any.html new file mode 100644 index 00000000..2dd2a2c8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.any.html @@ -0,0 +1 @@ +any | Libraries

Variable anyConst

any: () => ExtendedAny = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.array.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.array.html new file mode 100644 index 00000000..1e111c02 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.array.html @@ -0,0 +1 @@ +array | Libraries

Variable arrayConst

array: <TElementSchema extends SchemaBuilder<any, any, any, any, any>>(
    elementSchema?: TElementSchema,
) => ExtendedArray<TElementSchema> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.arrayExtensions.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.arrayExtensions.html new file mode 100644 index 00000000..3fdffc7e --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.arrayExtensions.html @@ -0,0 +1,7 @@ +arrayExtensions | Libraries

Variable arrayExtensionsConst

arrayExtensions: ExtensionDescriptor<
    {
        array: {
            nonempty(
                this: ArraySchemaBuilder<any>,
                errorMessage?: ValidationErrorMessageProvider<
                    ArraySchemaBuilder<
                        any,
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        any[]
                        | unknown[],
                    >,
                >,
            ): ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >;
            unique(
                this: ArraySchemaBuilder<any>,
                keyFn?: (item: any) => unknown,
                errorMessage?: ValidationErrorMessageProvider<
                    ArraySchemaBuilder<
                        any,
                        true,
                        false,
                        undefined,
                        false,
                        {},
                        any[]
                        | unknown[],
                    >,
                >,
            ): ArraySchemaBuilder<
                any,
                true,
                false,
                undefined,
                false,
                {},
                any[]
                | unknown[],
            >;
        };
    },
> = ...

Extension descriptor that adds common array validators +to ArraySchemaBuilder.

+

Included methods: nonempty, unique.

+
import { withExtensions } from '@cleverbrush/schema/core';
import { arrayExtensions } from '@cleverbrush/schema';

const s = withExtensions(arrayExtensions);
const schema = s.array().nonempty().unique(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.boolean.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.boolean.html new file mode 100644 index 00000000..0b7b4e1f --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.boolean.html @@ -0,0 +1 @@ +boolean | Libraries

Variable booleanConst

boolean: () => ExtendedBoolean = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.date.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.date.html new file mode 100644 index 00000000..fdab3887 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.date.html @@ -0,0 +1 @@ +date | Libraries

Variable dateConst

date: () => ExtendedDate = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.func.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.func.html new file mode 100644 index 00000000..bce39f46 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.func.html @@ -0,0 +1 @@ +func | Libraries

Variable funcConst

func: () => ExtendedFunc = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.number.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.number.html new file mode 100644 index 00000000..cbeeacf8 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.number.html @@ -0,0 +1 @@ +number | Libraries

Variable numberConst

number: { (): ExtendedNumber; <T extends number>(equals: T): ExtendedNumber<T> } = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.numberExtensions.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.numberExtensions.html new file mode 100644 index 00000000..f5a7515c --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.numberExtensions.html @@ -0,0 +1,7 @@ +numberExtensions | Libraries

Variable numberExtensionsConst

numberExtensions: ExtensionDescriptor<
    {
        number: {
            finite(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            multipleOf(
                this: NumberSchemaBuilder,
                n: number,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            negative(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            oneOf(
                this: NumberSchemaBuilder,
                ...args: any[],
            ): NumberSchemaBuilder<number, true, false, false, {}>;
            positive(
                this: NumberSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    NumberSchemaBuilder<number, true, false, false, {}>,
                >,
            ): NumberSchemaBuilder<number, true, false, false, {}>;
        };
    },
> = ...

Extension descriptor that adds common number validators +to NumberSchemaBuilder.

+

Included methods: positive, negative, finite, multipleOf, oneOf.

+
import { withExtensions } from '@cleverbrush/schema/core';
import { numberExtensions } from '@cleverbrush/schema';

const s = withExtensions(numberExtensions);
const schema = s.number().positive().multipleOf(5); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.object.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.object.html new file mode 100644 index 00000000..bbfe2f9b --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.object.html @@ -0,0 +1 @@ +object | Libraries

Variable objectConst

object: {
    (): ExtendedObject<{}>;
    <TProps extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
        props: TProps,
    ): ExtendedObject<TProps>;
    <TProps extends Record<string, SchemaBuilder<any, any, any, any, any>>>(
        props?: TProps,
    ): ExtendedObject<TProps>;
} = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.promise.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.promise.html new file mode 100644 index 00000000..d710cc30 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.promise.html @@ -0,0 +1 @@ +promise | Libraries

Variable promiseConst

promise: <TWrapped extends SchemaBuilder<any, any, any, any, any>>(
    wrapped: TWrapped,
) => ExtendedPromise<TWrapped> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.record.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.record.html new file mode 100644 index 00000000..d9dd47f6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.record.html @@ -0,0 +1 @@ +record | Libraries

Variable recordConst

record: <
    TKeySchema extends StringSchemaBuilder<any, any, any, any>,
    TValueSchema extends SchemaBuilder<any, any, any, any, any>,
>(
    keySchema: TKeySchema,
    valueSchema: TValueSchema,
) => ExtendedRecord<TKeySchema, TValueSchema> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.string.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.string.html new file mode 100644 index 00000000..275d9dc6 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.string.html @@ -0,0 +1 @@ +string | Libraries

Variable stringConst

string: { (): ExtendedString; <T extends string>(equals: T): ExtendedString<T> } = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.stringExtensions.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.stringExtensions.html new file mode 100644 index 00000000..97375753 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.stringExtensions.html @@ -0,0 +1,7 @@ +stringExtensions | Libraries

Variable stringExtensionsConst

stringExtensions: ExtensionDescriptor<
    {
        string: {
            email(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            ip(
                this: StringSchemaBuilder,
                opts?: { version?: "v4" | "v6" },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            nonempty(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            oneOf(
                this: StringSchemaBuilder,
                ...args: any[],
            ): StringSchemaBuilder<string, true, false, false, {}>;
            toLowerCase(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            trim(
                this: StringSchemaBuilder,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            url(
                this: StringSchemaBuilder,
                optsOrError?:
                    | ValidationErrorMessageProvider<
                        StringSchemaBuilder<string, true, false, false, {}>,
                    >
                    | { protocols?: string[] },
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
            uuid(
                this: StringSchemaBuilder,
                errorMessage?: ValidationErrorMessageProvider<
                    StringSchemaBuilder<string, true, false, false, {}>,
                >,
            ): StringSchemaBuilder<string, true, false, false, {}>;
        };
    },
> = ...

Extension descriptor that adds common string validators and preprocessors +to StringSchemaBuilder.

+

Included methods: email, url, uuid, ip, trim, toLowerCase, nonempty, oneOf.

+
import { withExtensions } from '@cleverbrush/schema/core';
import { stringExtensions } from '@cleverbrush/schema';

const s = withExtensions(stringExtensions);
const schema = s.string().email().trim(); +
+ +
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.tuple.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.tuple.html new file mode 100644 index 00000000..fad9dfc4 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.tuple.html @@ -0,0 +1 @@ +tuple | Libraries

Variable tupleConst

tuple: <
    const TElements extends
        readonly SchemaBuilder<any, any, any, any, any>[],
>(
    elements: [...TElements],
) => ExtendedTuple<TElements> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.union.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.union.html new file mode 100644 index 00000000..f04cea65 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_schema.union.html @@ -0,0 +1 @@ +union | Libraries

Variable unionConst

union: <TOptions extends SchemaBuilder<any, any, any, any, any>>(
    schema: TOptions,
) => ExtendedUnion<[TOptions]> = ...

Type Declaration

diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..DEFAULT_MAX_BODY_SIZE.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..DEFAULT_MAX_BODY_SIZE.html new file mode 100644 index 00000000..4cda7996 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..DEFAULT_MAX_BODY_SIZE.html @@ -0,0 +1,2 @@ +DEFAULT_MAX_BODY_SIZE | Libraries

Variable DEFAULT_MAX_BODY_SIZEConst

DEFAULT_MAX_BODY_SIZE: number = ...

Default maximum request body size: 5 MB.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..IRequestContext.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..IRequestContext.html new file mode 100644 index 00000000..659b5f23 --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..IRequestContext.html @@ -0,0 +1,3 @@ +IRequestContext | Libraries

Variable IRequestContextConst

IRequestContext: ExtendedObject<
    {
        body: FunctionSchemaBuilder<
            true,
            false,
            undefined,
            false,
            {},
            [],
            ExtendedPromise<ExtendedAny>,
            (...args: any[]) => Promise<any>,
        >;
        headers: ExtendedRecord<ExtendedString<string>, ExtendedString<string>>;
        items: ExtendedAny;
        json: FunctionSchemaBuilder<
            true,
            false,
            undefined,
            false,
            {},
            [],
            ExtendedPromise<ExtendedAny>,
            (...args: any[]) => Promise<any>,
        >;
        method: ExtendedString<string>;
        pathParams: ExtendedRecord<ExtendedString<string>, ExtendedString<string>>;
        queryParams: ExtendedRecord<
            ExtendedString<string>,
            ExtendedString<string>,
        >;
        responded: ExtendedBoolean;
        url: ExtendedString<string>;
    },
> = ...

IRequestContext — the schema definition for the request context. +Serves as both a DI key and a type definition.

+
diff --git a/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..endpoint.html b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..endpoint.html new file mode 100644 index 00000000..4c5820ca --- /dev/null +++ b/websites/docs/public/api-docs/v4.3.2/variables/_cleverbrush_server..endpoint.html @@ -0,0 +1,7 @@ +endpoint | Libraries

Variable endpointConst

endpoint: EndpointFactory = ...

The global endpoint factory singleton.

+

Creates EndpointBuilder instances for each HTTP method. Use +createEndpoints to get a role-constrained version.

+
import { endpoint } from '@cleverbrush/server';

const GetUsers = endpoint.get('/api/users');
const CreateUser = endpoint.post('/api/users').body(CreateUserSchema); +
+ +
diff --git a/websites/docs/public/api-docs/versions.json b/websites/docs/public/api-docs/versions.json index 11977a08..c34e544e 100644 --- a/websites/docs/public/api-docs/versions.json +++ b/websites/docs/public/api-docs/versions.json @@ -1,4 +1,6 @@ [ + { "version": "v4.3.2", "path": "v4.3.2/index.html" }, + { "version": "v4.3.1", "path": "v4.3.1/index.html" }, { "version": "v4.3.0", "path": "v4.3.0/index.html" }, { "version": "v4.2.0", "path": "v4.2.0/index.html" }, { "version": "v4.1.0", "path": "v4.1.0/index.html" }, diff --git a/websites/docs/public/llms.txt b/websites/docs/public/llms.txt index ea9f0a5f..f11d22d0 100644 --- a/websites/docs/public/llms.txt +++ b/websites/docs/public/llms.txt @@ -9,7 +9,7 @@ The key differentiator is **contract-first architecture**: a shared API contract | Package | Description | Docs | |---------|-------------|------| | `@cleverbrush/server` | HTTP server with typed endpoints, middleware, batching, WebSocket | [/server](/server) | -| `@cleverbrush/client` | Auto-typed REST client with retry, timeout, dedup, cache, batching | [/client](/client) | +| `@cleverbrush/client` | Auto-typed REST client with retry, timeout, dedup, cache, batching | [/client/getting-started](/client/getting-started) | | `@cleverbrush/auth` | JWT, cookies, OAuth2, OIDC, policy-based authorization | [/auth](/auth) | | `@cleverbrush/di` | Dependency injection with schema-as-key tokens | [/di](/di) | | `@cleverbrush/server-openapi` | OpenAPI 3.1 generation (links, callbacks, webhooks, security) | [/server-openapi](/server-openapi) | diff --git a/websites/schema/app/docs/[[...slug]]/SchemaDocLayout.tsx b/websites/schema/app/docs/[[...slug]]/SchemaDocLayout.tsx index df38e310..40282fc9 100644 --- a/websites/schema/app/docs/[[...slug]]/SchemaDocLayout.tsx +++ b/websites/schema/app/docs/[[...slug]]/SchemaDocLayout.tsx @@ -18,9 +18,9 @@ export function SchemaDocLayout({ currentSlug, children }: Props) { collapsed={navCollapsed} onToggle={() => setNavCollapsed(c => !c)} /> -
+
{children}
-
+ ); } diff --git a/websites/schema/app/docs/[[...slug]]/page.tsx b/websites/schema/app/docs/[[...slug]]/page.tsx index 26eef01b..854d0b28 100644 --- a/websites/schema/app/docs/[[...slug]]/page.tsx +++ b/websites/schema/app/docs/[[...slug]]/page.tsx @@ -1,4 +1,7 @@ -import { redirect } from 'next/navigation'; +import { breadcrumbJsonLd, JsonLd } from '@cleverbrush/website-shared/lib/seo'; +import type { Metadata } from 'next'; +import { notFound, permanentRedirect } from 'next/navigation'; +import { SCHEMA_SITE, schemaDocMetadata } from '../../site'; import ApiReferenceSection from '../sections/api-reference'; import BuiltInExtensionsSection from '../sections/built-in-extensions'; import ComparisonSection from '../sections/comparison'; @@ -57,6 +60,36 @@ const SECTION_COMPONENTS: Record = { 'api-reference': ApiReferenceSection }; +export async function generateMetadata({ + params +}: { + params: Promise<{ slug?: string[] }>; +}): Promise { + const { slug } = await params; + const currentSlug = slug?.[0] ?? null; + + if (!currentSlug) { + return schemaDocMetadata('why'); + } + + const redirectTarget = MODIFIER_REDIRECTS[currentSlug]; + if (redirectTarget) { + return schemaDocMetadata(redirectTarget.split('#')[0] ?? 'why'); + } + + if (!SECTION_COMPONENTS[currentSlug]) { + return { + title: 'Not Found', + robots: { + index: false, + follow: false + } + }; + } + + return schemaDocMetadata(currentSlug); +} + export default async function SchemaDocPage({ params }: { @@ -66,23 +99,37 @@ export default async function SchemaDocPage({ const currentSlug = slug?.[0] ?? null; if (!currentSlug) { - redirect('/docs/why'); + permanentRedirect('/docs/why'); } // Handle redirects from old individual modifier pages const redirectTarget = MODIFIER_REDIRECTS[currentSlug]; if (redirectTarget) { - redirect(`/docs/${redirectTarget}`); + permanentRedirect(`/docs/${redirectTarget}`); } const SectionComponent = SECTION_COMPONENTS[currentSlug]; if (!SectionComponent) { - redirect('/docs/why'); + notFound(); } + const section = SCHEMA_SECTIONS.find(entry => entry.slug === currentSlug); + return ( - - - + <> + + + + + ); } diff --git a/websites/schema/app/docs/sections/api-reference.tsx b/websites/schema/app/docs/sections/api-reference.tsx index 23a1c46b..9a85f5dc 100644 --- a/websites/schema/app/docs/sections/api-reference.tsx +++ b/websites/schema/app/docs/sections/api-reference.tsx @@ -9,11 +9,14 @@ export default function ApiReferenceSection() {

Builder Functions

+ - - - + + + @@ -194,10 +197,13 @@ export default function ApiReferenceSection() {

Extension Functions

+ API reference table +
FunctionDescriptionKey MethodsFunctionDescriptionKey Methods
+ - - + + @@ -228,10 +234,13 @@ export default function ApiReferenceSection() {

Utility Types

+ API reference table +
FunctionDescriptionFunctionDescription
+ - - + + diff --git a/websites/schema/app/docs/sections/built-in-extensions.tsx b/websites/schema/app/docs/sections/built-in-extensions.tsx index e8c2e7ed..57474cb2 100644 --- a/websites/schema/app/docs/sections/built-in-extensions.tsx +++ b/websites/schema/app/docs/sections/built-in-extensions.tsx @@ -19,10 +19,13 @@ export default function BuiltInExtensionsSection() {

String Extensions

+ API reference table +
TypeDescriptionTypeDescription
+ - - + + @@ -90,10 +93,13 @@ export default function BuiltInExtensionsSection() {

Number Extensions

+ API reference table +
MethodDescriptionMethodDescription
+ - - + + @@ -131,10 +137,13 @@ export default function BuiltInExtensionsSection() {

Array Extensions

+ API reference table +
MethodDescriptionMethodDescription
+ - - + + diff --git a/websites/schema/app/docs/sections/comparison.tsx b/websites/schema/app/docs/sections/comparison.tsx index e5c3c59f..ac466ebd 100644 --- a/websites/schema/app/docs/sections/comparison.tsx +++ b/websites/schema/app/docs/sections/comparison.tsx @@ -25,12 +25,15 @@ export default function ComparisonSection() {

Key differences at a glance

+ API reference table +
MethodDescriptionMethodDescription
+ - - - - + + + + @@ -258,15 +261,18 @@ export default function ComparisonSection() {

+ Comparison table +
Capability@cleverbrush/schemaZod 3/4NotesCapability@cleverbrush/schemaZod 3/4Notes
+ - - - - - - - + + + + + + + diff --git a/websites/schema/app/docs/sections/getting-started.tsx b/websites/schema/app/docs/sections/getting-started.tsx index 9fe16d7a..9653ee18 100644 --- a/websites/schema/app/docs/sections/getting-started.tsx +++ b/websites/schema/app/docs/sections/getting-started.tsx @@ -28,11 +28,14 @@ export default function GettingStartedSection() {

+ Comparison table +
Feature@cleverbrush/schemaZodValibotArkTypeYupJoiFeature@cleverbrush/schemaZodValibotArkTypeYupJoi
+ - - - + + + diff --git a/websites/schema/app/docs/sections/parse-string.tsx b/websites/schema/app/docs/sections/parse-string.tsx index ce235de2..f5b21f47 100644 --- a/websites/schema/app/docs/sections/parse-string.tsx +++ b/websites/schema/app/docs/sections/parse-string.tsx @@ -107,10 +107,13 @@ schema.validate('/orders/42/by/Alice');

All standard modifiers work and preserve type inference:

+ API reference table +
ImportGzippedBrotliImportGzippedBrotli
+ - - + + diff --git a/websites/schema/app/docs/sections/schema-modifiers.tsx b/websites/schema/app/docs/sections/schema-modifiers.tsx index 8f14caec..2a24b4df 100644 --- a/websites/schema/app/docs/sections/schema-modifiers.tsx +++ b/websites/schema/app/docs/sections/schema-modifiers.tsx @@ -139,10 +139,13 @@ console.log(schema.introspect().catchValue); // 'unknown'`)

+ API reference table +
MethodEffectMethodEffect
+ - - + diff --git a/websites/schema/app/docs/sections/schema-types.tsx b/websites/schema/app/docs/sections/schema-types.tsx index 3a8ae95a..7f957a35 100644 --- a/websites/schema/app/docs/sections/schema-types.tsx +++ b/websites/schema/app/docs/sections/schema-types.tsx @@ -13,11 +13,14 @@ export default function SchemaTypesSection() {

+ API reference table +
Builder + Builder Effect on InferType<T>
+ - - - + + + diff --git a/websites/schema/app/docs/sections/standard-schema.tsx b/websites/schema/app/docs/sections/standard-schema.tsx index 36f3597b..9f144c5f 100644 --- a/websites/schema/app/docs/sections/standard-schema.tsx +++ b/websites/schema/app/docs/sections/standard-schema.tsx @@ -29,11 +29,14 @@ export default function StandardSchemaSection() {

+ API reference table +
BuilderDescriptionKey MethodsBuilderDescriptionKey Methods
+ - - - + + + @@ -228,11 +231,14 @@ if (!result.valid) {

+ API reference table +
FieldValueDescriptionFieldValueDescription
+ - - - + + + diff --git a/websites/schema/app/layout.tsx b/websites/schema/app/layout.tsx index 07b6abe2..b7b32fa7 100644 --- a/websites/schema/app/layout.tsx +++ b/websites/schema/app/layout.tsx @@ -1,11 +1,19 @@ import type { Metadata } from 'next'; -import Script from 'next/script'; import '@cleverbrush/website-shared/styles/globals.css'; +import { ConsentManager } from '@cleverbrush/website-shared/components/ConsentManager'; import type { FooterSection } from '@cleverbrush/website-shared/components/Footer'; import { Footer } from '@cleverbrush/website-shared/components/Footer'; import type { NavItem } from '@cleverbrush/website-shared/components/Navbar'; import { Navbar } from '@cleverbrush/website-shared/components/Navbar'; import { ThemeProvider } from '@cleverbrush/website-shared/components/ThemeProvider'; +import { + createBaseMetadata, + JsonLd, + organizationJsonLd, + softwareSourceCodeJsonLd, + websiteJsonLd +} from '@cleverbrush/website-shared/lib/seo'; +import { SCHEMA_SITE } from './site'; const GTM_ID = 'GTM-WRLXDMG'; @@ -62,6 +70,10 @@ const FOOTER_SECTIONS: FooterSection[] = [ href: 'https://github.com/cleverbrush/framework', external: true }, + { + label: 'Privacy Policy', + href: '/privacy' + }, { label: 'Playground', href: '/playground' }, { label: 'API Reference', @@ -107,14 +119,7 @@ const FOOTER_SECTIONS: FooterSection[] = [ } ]; -export const metadata: Metadata = { - title: 'Cleverbrush Schema — Type-safe Validation for TypeScript', - description: - 'Zero-dependency schema validation with full type inference, Standard Schema support, and Zod-compatible API. Open-source TypeScript library.', - icons: { - icon: '/favicon.ico' - } -}; +export const metadata: Metadata = createBaseMetadata(SCHEMA_SITE); export default function RootLayout({ children @@ -130,35 +135,22 @@ export default function RootLayout({ href="https://fonts.gstatic.com" crossOrigin="anonymous" /> -
+ API reference table +
LibraryCategoryIntegrationLibraryCategoryIntegration