@resistdesign/voltra 3.0.0-alpha.5 → 3.0.0-alpha.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +392 -14
  2. package/api/DBX/DBXAsserts.d.ts +95 -0
  3. package/api/DBX/DBXRequest.d.ts +5 -0
  4. package/api/DBX/DBXRuntime.d.ts +5 -0
  5. package/api/DBX/DBXScenarioConfig.d.ts +9 -0
  6. package/api/DBX/DBXSeed.d.ts +124 -0
  7. package/api/DBX/DBXTypes.d.ts +176 -0
  8. package/api/DBX/index.d.ts +8 -0
  9. package/api/DataAccessControl.d.ts +220 -0
  10. package/api/Indexing/API.d.ts +224 -0
  11. package/api/Indexing/Cursor.d.ts +101 -0
  12. package/api/Indexing/Handler/Config.d.ts +39 -0
  13. package/api/Indexing/Handler.d.ts +166 -0
  14. package/api/Indexing/Trace.d.ts +54 -0
  15. package/api/Indexing/Types.d.ts +204 -0
  16. package/api/Indexing/ddb/AwsSdkV3Adapter.d.ts +8 -0
  17. package/api/Indexing/ddb/Types.d.ts +209 -0
  18. package/api/Indexing/docId.d.ts +27 -0
  19. package/api/Indexing/exact/ExactDdb.d.ts +58 -0
  20. package/api/Indexing/exact/ExactIndex.d.ts +90 -0
  21. package/api/Indexing/exact/ExactS3.d.ts +41 -0
  22. package/api/Indexing/fieldQualification.d.ts +12 -0
  23. package/api/Indexing/fulltext/FullTextDdbBackend.d.ts +212 -0
  24. package/api/Indexing/fulltext/FullTextMemoryBackend.d.ts +93 -0
  25. package/api/Indexing/fulltext/Schema.d.ts +164 -0
  26. package/api/Indexing/hashUniversal.d.ts +13 -0
  27. package/api/Indexing/index.d.ts +45 -0
  28. package/api/Indexing/lossy/LossyDdb.d.ts +43 -0
  29. package/api/Indexing/lossy/LossyIndex.d.ts +72 -0
  30. package/api/Indexing/lossy/LossyS3.d.ts +40 -0
  31. package/api/Indexing/rel/Cursor.d.ts +25 -0
  32. package/api/Indexing/rel/Handlers.d.ts +144 -0
  33. package/api/Indexing/rel/RelationalDdb.d.ts +169 -0
  34. package/api/Indexing/rel/RelationalInMemoryBackend.d.ts +38 -0
  35. package/api/Indexing/rel/Types.d.ts +69 -0
  36. package/api/Indexing/structured/Cursor.d.ts +26 -0
  37. package/api/Indexing/structured/Handlers.d.ts +128 -0
  38. package/api/Indexing/structured/SearchStructured.d.ts +44 -0
  39. package/api/Indexing/structured/StructuredDdb.d.ts +184 -0
  40. package/api/Indexing/structured/StructuredDdbBackend.d.ts +112 -0
  41. package/api/Indexing/structured/StructuredInMemoryBackend.d.ts +40 -0
  42. package/api/Indexing/structured/StructuredInMemoryIndex.d.ts +61 -0
  43. package/api/Indexing/structured/StructuredStringLike.d.ts +54 -0
  44. package/api/Indexing/structured/StructuredWriter.d.ts +74 -0
  45. package/api/Indexing/structured/Types.d.ts +126 -0
  46. package/api/Indexing/structured/index.d.ts +9 -0
  47. package/api/Indexing/tokenize.d.ts +31 -0
  48. package/api/ORM/DACUtils.d.ts +270 -0
  49. package/api/ORM/ListItemUtils.d.ts +40 -0
  50. package/api/ORM/ORMRouteMap.d.ts +70 -0
  51. package/api/ORM/TypeInfoORMService.d.ts +879 -0
  52. package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
  53. package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +90 -0
  54. package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
  55. package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +56 -0
  56. package/api/ORM/drivers/InMemoryFileItemDBDriver/ConfigTypes.d.ts +13 -0
  57. package/api/ORM/drivers/InMemoryFileItemDBDriver.d.ts +98 -0
  58. package/api/ORM/drivers/InMemoryItemRelationshipDBDriver.d.ts +16 -0
  59. package/api/ORM/drivers/IndexingRelationshipDriver.d.ts +123 -0
  60. package/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +322 -0
  61. package/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +118 -0
  62. package/api/ORM/drivers/S3FileItemDBDriver.d.ts +71 -0
  63. package/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +36 -0
  64. package/api/ORM/drivers/common/Types.d.ts +202 -0
  65. package/api/ORM/drivers/common/index.d.ts +2 -0
  66. package/api/ORM/drivers/index.d.ts +8 -0
  67. package/api/ORM/getTypeInfoORMIndexingConfigFromTypeInfoMap.d.ts +31 -0
  68. package/api/ORM/index.d.ts +10 -0
  69. package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +22 -0
  70. package/api/Router/AWS.d.ts +80 -0
  71. package/api/Router/Auth.d.ts +14 -0
  72. package/api/Router/CORS.d.ts +66 -0
  73. package/api/Router/Types.d.ts +138 -0
  74. package/api/Router/index.d.ts +89 -0
  75. package/api/index.d.ts +72 -6
  76. package/api/index.js +3553 -1948
  77. package/app/forms/Engine.d.ts +23 -0
  78. package/app/forms/UI.d.ts +83 -0
  79. package/app/forms/core/createAutoField.d.ts +43 -0
  80. package/app/forms/core/createFormRenderer.d.ts +25 -0
  81. package/app/forms/core/getFieldKind.d.ts +14 -0
  82. package/app/forms/core/index.d.ts +11 -0
  83. package/app/forms/core/mergeSuites.d.ts +23 -0
  84. package/app/forms/core/resolveSuite.d.ts +15 -0
  85. package/app/forms/core/types.d.ts +180 -0
  86. package/app/forms/index.d.ts +9 -0
  87. package/app/forms/types.d.ts +137 -0
  88. package/app/helpers/styled.d.ts +3 -0
  89. package/app/index.d.ts +116 -5
  90. package/app/index.js +120 -382
  91. package/app/utils/ApplicationState.d.ts +161 -0
  92. package/app/utils/ApplicationStateLoader.d.ts +91 -0
  93. package/app/utils/Controller.d.ts +10 -0
  94. package/app/utils/Debug.d.ts +14 -0
  95. package/app/utils/EasyLayout.d.ts +89 -0
  96. package/app/utils/History.d.ts +165 -0
  97. package/app/utils/Route.d.ts +207 -0
  98. package/app/utils/RouteHistory.d.ts +27 -0
  99. package/app/utils/Service.d.ts +45 -0
  100. package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
  101. package/app/utils/TypeInfoORMClient.d.ts +104 -0
  102. package/app/utils/UniversalRouteAdapter.d.ts +73 -0
  103. package/app/utils/easy-layout/computeAreaBounds.d.ts +5 -0
  104. package/app/utils/easy-layout/computeTracks.d.ts +16 -0
  105. package/app/utils/easy-layout/index.d.ts +5 -0
  106. package/app/utils/easy-layout/parseTemplate.d.ts +12 -0
  107. package/app/utils/easy-layout/types.d.ts +52 -0
  108. package/app/utils/easy-layout/validateAreas.d.ts +5 -0
  109. package/app/utils/index.d.ts +24 -0
  110. package/build/TypeMapping.d.ts +17 -0
  111. package/build/TypeParsing.d.ts +10 -0
  112. package/build/index.d.ts +15 -0
  113. package/build/index.js +569 -0
  114. package/chunk-2JDOM6PB.js +138 -0
  115. package/chunk-3HVYVX3S.js +546 -0
  116. package/chunk-ATO2455Q.js +258 -0
  117. package/chunk-BSHQIRBV.js +71 -0
  118. package/chunk-I2KLQ2HA.js +19 -0
  119. package/chunk-K4R2PFNG.js +1258 -0
  120. package/chunk-TJFTWPXQ.js +39 -0
  121. package/chunk-XHOMAXLR.js +84 -0
  122. package/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +9 -0
  123. package/common/CommandLine/index.d.ts +6 -0
  124. package/common/HelperTypes.d.ts +9 -0
  125. package/common/IdGeneration/getSimpleId.d.ts +8 -0
  126. package/common/IdGeneration/index.d.ts +1 -0
  127. package/common/ItemRelationshipInfoTypes.d.ts +64 -0
  128. package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
  129. package/common/ItemRelationships/index.d.ts +2 -0
  130. package/common/Logging/Utils.d.ts +10 -0
  131. package/common/Logging/index.d.ts +1 -0
  132. package/common/Routing.d.ts +81 -0
  133. package/common/SearchTypes.d.ts +227 -0
  134. package/common/SearchUtils.d.ts +55 -0
  135. package/common/SearchValidation.d.ts +27 -0
  136. package/common/StringTransformers.d.ts +28 -0
  137. package/common/Testing/CLI.d.ts +6 -0
  138. package/common/Testing/Types.d.ts +216 -0
  139. package/common/Testing/Utils.d.ts +112 -0
  140. package/common/Testing/index.d.ts +8 -0
  141. package/common/TypeInfoDataItemUtils.d.ts +39 -0
  142. package/{Types-C7XjUjoF.d.ts → common/TypeInfoORM/Types.d.ts} +150 -20
  143. package/common/TypeInfoORM/index.d.ts +3 -0
  144. package/common/TypeParsing/Constants.d.ts +4 -0
  145. package/common/TypeParsing/ParsingUtils/Constants.d.ts +8 -0
  146. package/common/TypeParsing/ParsingUtils/checkType.d.ts +14 -0
  147. package/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +12 -0
  148. package/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +8 -0
  149. package/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +12 -0
  150. package/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +14 -0
  151. package/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +18 -0
  152. package/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +9 -0
  153. package/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +9 -0
  154. package/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +11 -0
  155. package/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +12 -0
  156. package/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +11 -0
  157. package/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +9 -0
  158. package/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +11 -0
  159. package/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +8 -0
  160. package/common/TypeParsing/TypeInfo.d.ts +235 -0
  161. package/common/TypeParsing/Utils.d.ts +47 -0
  162. package/common/TypeParsing/Validation.d.ts +327 -0
  163. package/common/TypeParsing/index.d.ts +8 -0
  164. package/common/index.d.ts +47 -4
  165. package/common/index.js +25 -1737
  166. package/{index-BkFZlfit.d.ts → iac/SimpleCFT.d.ts} +5 -25
  167. package/iac/index.d.ts +40 -2
  168. package/iac/index.js +2 -1661
  169. package/iac/packs/auth.d.ts +131 -0
  170. package/iac/packs/build/utils.d.ts +289 -0
  171. package/iac/packs/build.d.ts +92 -0
  172. package/iac/packs/cdn.d.ts +33 -0
  173. package/iac/packs/cloud-function.d.ts +67 -0
  174. package/iac/packs/database.d.ts +32 -0
  175. package/iac/packs/dns.d.ts +34 -0
  176. package/iac/packs/file-storage.d.ts +46 -0
  177. package/iac/packs/gateway.d.ts +82 -0
  178. package/iac/packs/index.d.ts +60 -1
  179. package/iac/packs/index.js +391 -594
  180. package/iac/packs/repo.d.ts +28 -0
  181. package/iac/packs/ssl-certificate.d.ts +28 -0
  182. package/iac/types/Constants.d.ts +24 -0
  183. package/{index-DcvJOZ_c.d.ts → iac/types/IaCTypes.d.ts} +23 -1018
  184. package/iac/types/Renderers.d.ts +96 -0
  185. package/iac/types/Types.d.ts +131 -0
  186. package/iac/types/Utils.d.ts +9 -0
  187. package/iac/types/generate.d.ts +1 -0
  188. package/iac/utils/index.d.ts +87 -0
  189. package/iac/utils/patch-utils.d.ts +66 -0
  190. package/iac-packs/index.d.ts +6 -0
  191. package/native/forms/UI.d.ts +73 -0
  192. package/native/forms/createNativeFormRenderer.d.ts +21 -0
  193. package/native/forms/index.d.ts +25 -0
  194. package/native/forms/primitives/index.d.ts +38 -0
  195. package/native/forms/suite.d.ts +15 -0
  196. package/native/index.d.ts +19 -0
  197. package/native/index.js +792 -0
  198. package/native/testing/react-native.d.ts +46 -0
  199. package/native/utils/EasyLayout.d.ts +88 -0
  200. package/native/utils/History.d.ts +124 -0
  201. package/native/utils/NavButton.d.ts +25 -0
  202. package/native/utils/Route.d.ts +41 -0
  203. package/native/utils/index.d.ts +25 -0
  204. package/package.json +54 -21
  205. package/web/forms/UI.d.ts +74 -0
  206. package/web/forms/createWebFormRenderer.d.ts +21 -0
  207. package/web/forms/index.d.ts +9 -0
  208. package/web/forms/primitives/index.d.ts +21 -0
  209. package/web/forms/suite.d.ts +15 -0
  210. package/web/index.d.ts +15 -0
  211. package/web/index.js +701 -0
  212. package/web/utils/EasyLayout.d.ts +47 -0
  213. package/web/utils/NavLink.d.ts +24 -0
  214. package/web/utils/Route.d.ts +16 -0
  215. package/web/utils/index.d.ts +8 -0
  216. package/SearchTypes-DjN6YQzE.d.ts +0 -577
  217. package/Validation-CFP59oIP.d.ts +0 -226
  218. package/index-C3-iD9Mh.d.ts +0 -690
  219. package/index-CK5Qwvfb.d.ts +0 -5378
  220. package/index-IokxSNxm.d.ts +0 -745
  221. package/index.d.ts +0 -13
  222. package/index.js +0 -11005
package/README.md CHANGED
@@ -14,15 +14,23 @@
14
14
  yarn add @resistdesign/voltra
15
15
  ```
16
16
 
17
+ Runtime peer dependencies:
18
+
19
+ - Consumers must provide `react` (required).
20
+ - Web consumers must provide `react-dom`.
21
+ - Native consumers must provide `react-native`.
22
+
17
23
  ### Imports
18
24
 
19
25
  Prefer the public entrypoints below to keep imports stable and IDE auto-imports clean.
20
26
 
27
+ The root import `@resistdesign/voltra` is intentionally unsupported to avoid
28
+ cross-runtime bundling issues.
29
+
21
30
  Preferred:
22
31
 
23
32
  ```ts
24
- import { IaC } from "@resistdesign/voltra";
25
- import { Packs } from "@resistdesign/voltra/iac";
33
+ import { SimpleCFT } from "@resistdesign/voltra/iac";
26
34
  import { addDNS } from "@resistdesign/voltra/iac/packs";
27
35
  ```
28
36
 
@@ -34,12 +42,98 @@ import addDNS from "@resistdesign/voltra/iac/packs/dns";
34
42
 
35
43
  Public entrypoints:
36
44
 
37
- - `@resistdesign/voltra`
38
45
  - `@resistdesign/voltra/api`
39
46
  - `@resistdesign/voltra/app`
40
47
  - `@resistdesign/voltra/common`
48
+ - `@resistdesign/voltra/web`
49
+ - `@resistdesign/voltra/native`
41
50
  - `@resistdesign/voltra/iac`
42
51
  - `@resistdesign/voltra/iac/packs`
52
+ - `@resistdesign/voltra/build`
53
+
54
+ Common imports by domain:
55
+
56
+ ```ts
57
+ import { addRoutesToRouteMap, handleCloudFunctionEvent } from "@resistdesign/voltra/api";
58
+ import { TypeInfo, TypeInfoORMServiceError } from "@resistdesign/voltra/common";
59
+ import { parseTemplate, computeTrackPixels } from "@resistdesign/voltra/app";
60
+ import { AutoField, AutoForm, createWebFormRenderer, getEasyLayout } from "@resistdesign/voltra/web";
61
+ import { createNativeFormRenderer, makeNativeEasyLayout } from "@resistdesign/voltra/native";
62
+ import { SimpleCFT } from "@resistdesign/voltra/iac";
63
+ import { addDNS } from "@resistdesign/voltra/iac/packs";
64
+ import { getTypeInfoMapFromTypeScript } from "@resistdesign/voltra/build";
65
+ ```
66
+
67
+ ### IaC Auth/Gateway Example
68
+
69
+ `addGateway` authorizer provider ARNs can use CloudFormation intrinsics:
70
+
71
+ ```ts
72
+ import { addGateway } from "@resistdesign/voltra/iac/packs";
73
+ import { SimpleCFT } from "@resistdesign/voltra/iac";
74
+
75
+ new SimpleCFT().applyPack(addGateway, {
76
+ id: "ApiGateway",
77
+ hostedZoneId: { Ref: "HostedZoneId" },
78
+ domainName: { Ref: "ApiDomainName" },
79
+ certificateArn: { Ref: "ApiCertificateArn" },
80
+ cloudFunction: { id: "ApiFunction" },
81
+ authorizer: {
82
+ providerARNs: [{ "Fn::GetAtt": ["MyUserPool", "Arn"] }],
83
+ },
84
+ });
85
+ ```
86
+
87
+ `addAuth` can pass partial user-management id overrides without changing all defaults:
88
+
89
+ ```ts
90
+ import { addAuth } from "@resistdesign/voltra/iac/packs";
91
+ import { SimpleCFT } from "@resistdesign/voltra/iac";
92
+
93
+ new SimpleCFT().applyPack(addAuth, {
94
+ userManagementId: "UserPool",
95
+ userManagementIds: {
96
+ userPool: "MyUserPool",
97
+ userPoolClient: "MyUserPoolClient",
98
+ },
99
+ authRoleName: "AuthRole",
100
+ unauthRoleName: "UnauthRole",
101
+ apiCloudFunctionGatewayId: "ApiGateway",
102
+ apiStageName: "prod",
103
+ adminGroupId: "AdminGroup",
104
+ userManagementAdminGroupName: "admins",
105
+ hostedZoneIdParameterName: "HostedZoneId",
106
+ domainNameParameterName: "DomainName",
107
+ sslCertificateId: "CertificateArn",
108
+ mainCDNCloudFrontId: "MainCDN",
109
+ callbackUrls: ["https://example.com/callback"],
110
+ logoutUrls: ["https://example.com/logout"],
111
+ });
112
+ ```
113
+
114
+ ------------
115
+
116
+ ## Build-time Type Parsing (Advanced)
117
+
118
+ Voltra exposes TypeScript compiler–powered parsing utilities intended **only for build-time tooling** (scripts,
119
+ generators, CI).
120
+
121
+ These APIs depend on the TypeScript compiler and **must not be imported into runtime code** (e.g. Lambdas, servers,
122
+ browsers).
123
+
124
+ Build entrypoint:
125
+
126
+ ```ts
127
+ import {getTypeInfoMapFromTypeScript} from "@resistdesign/voltra/build";
128
+ ```
129
+
130
+ Use this entrypoint for:
131
+
132
+ - Code generation
133
+ - Pre-build analysis
134
+ - Producing static artifacts (JSON / TS)
135
+
136
+ Do **not** import `@resistdesign/voltra/build` from runtime code.
43
137
 
44
138
  ## With our powers combined!
45
139
 
@@ -60,13 +154,292 @@ front-end apps.</td>
60
154
 
61
155
  ## Features
62
156
 
63
- | API | App | IaC |
64
- |-----------------------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------|
65
- | RPC | Easy Layout | Full Parameter Support: Groups/Labels/Types/etc... |
66
- | Auth: Public/Secured/Role Based | State Management | Packs: Easy to add Database/Storage/Auth/Functions/etc... |
67
- | Routing: Nesting/Handlers/Injected Handlers | Routing: Param Handlers/Parallel Routes/Hooks | Utilities: Patching Stacks/Constants/Standard Includes/etc... |
68
- | ORM: TypeScript Type Driven Auto-generated Data Contexts with Relationships | | Typed Build Spec Creation |
69
- | | | Typed Resource Parameters |
157
+ App features include form generation via TypeInfo-driven AutoForm/AutoField with validation, constraints, and relation/custom handlers.
158
+
159
+ | API | App | IaC |
160
+ |-----------------------------------------------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------|
161
+ | RPC | Easy Layout | Full Parameter Support: Groups/Labels/Types/etc... |
162
+ | Auth: Public/Secured/Role Based | State Management | Packs: Easy to add Database/Storage/Auth/Functions/etc... |
163
+ | Routing: Nesting/Handlers/Injected Handlers | Routing: Param Handlers/Parallel Routes/Hooks | Utilities: Patching Stacks/Constants/Standard Includes/etc... |
164
+ | ORM: TypeScript Type Driven Auto-generated Data Contexts with Relationships | Form Generation: AutoForm/AutoField + constraints/relations | Typed Build Spec Creation |
165
+ | | Form Engine: validation, defaults, denied ops, custom type flow | Typed Resource Parameters |
166
+
167
+ ## EasyLayout (Web + Native + Core)
168
+
169
+ EasyLayout now has:
170
+
171
+ - Shared core parsing/math in `@resistdesign/voltra/app` (`parseTemplate`, `computeTrackPixels`, etc.).
172
+ - Web rendering via CSS Grid in `@resistdesign/voltra/web`.
173
+ - Native coordinate computation in `@resistdesign/voltra/native`.
174
+
175
+ ### Reference Examples
176
+
177
+ - Index: `examples/README.md`
178
+ - Client routing: `examples/routing/app-routing.ts`
179
+ - Backend API routing: `examples/api/backend-routing.ts`
180
+ - Forms: `examples/forms/`
181
+ - `examples/forms/auto-form-validation-customization.tsx`
182
+ - Layout: `examples/layout/`
183
+ - Common types: `examples/common/types.ts`
184
+ - `examples/common/typeinfo-validation.ts`
185
+ - Build-time parsing: `examples/build/type-parsing.ts`
186
+
187
+ ### Template syntax
188
+
189
+ ```text
190
+ header header, 1fr
191
+ side main, 2fr
192
+ \ 100px 1fr
193
+ ```
194
+
195
+ - Row lines: `<areas>, <row-track>` (row track optional)
196
+ - Column line: `\ <col-track> <col-track> ...`
197
+ - Supported units: `fr`, `px`, `%`
198
+ - Named areas must form rectangles
199
+
200
+ ### Web usage
201
+
202
+ ```tsx
203
+ import { getEasyLayout } from "@resistdesign/voltra/web";
204
+
205
+ const { layout: Layout, areas } = getEasyLayout(undefined, undefined, {
206
+ gap: 12,
207
+ padding: 16,
208
+ })`
209
+ header header, 1fr
210
+ side main, 2fr
211
+ \ 1fr 2fr
212
+ `;
213
+ ```
214
+
215
+ ### Native usage
216
+
217
+ ```tsx
218
+ import { makeNativeEasyLayout } from "@resistdesign/voltra/native";
219
+
220
+ const layout = makeNativeEasyLayout(`
221
+ header header, 100px
222
+ side main, 1fr
223
+ \\ 1fr 2fr
224
+ `);
225
+
226
+ const coords = layout.computeNativeCoords({
227
+ width: 320,
228
+ height: 240,
229
+ padding: 12,
230
+ gap: 8,
231
+ });
232
+ ```
233
+
234
+ ### Web vs Native
235
+
236
+ | Runtime | Rendering model | Output |
237
+ |---------|------------------|--------|
238
+ | Web | CSS Grid (browser layout engine) | CSS template strings |
239
+ | Native | Computed absolute layout | `{ left, top, width, height }` per area |
240
+
241
+ ## Routing (Web + Native)
242
+
243
+ Voltra routing uses the same `Route` API across app/web/native.
244
+ Use the platform barrel for root `Route` so runtime mechanics are auto-wired.
245
+ The routing model is path/history based on every platform.
246
+
247
+ Reference example: `examples/routing/app-routing.ts`
248
+
249
+ ```tsx
250
+ import { Route } from "@resistdesign/voltra/web";
251
+
252
+ <Route>
253
+ <Route path="/" exact>
254
+ <HomeScreen />
255
+ </Route>
256
+ <Route path="/login" exact>
257
+ <LoginScreen />
258
+ </Route>
259
+ <Route path="/signup" exact>
260
+ <SignUpScreen />
261
+ </Route>
262
+ </Route>;
263
+ ```
264
+
265
+ ```tsx
266
+ import { Route } from "@resistdesign/voltra/native";
267
+
268
+ <Route>
269
+ <Route path="/" exact>
270
+ <HomeScreen />
271
+ </Route>
272
+ </Route>;
273
+ ```
274
+
275
+ On native, Voltra provides the missing browser-like pieces:
276
+
277
+ - history-style path state for environments without the browser History API
278
+ - deep-link URL ingress so app opens behave like web navigations
279
+ - hardware back wiring into that same history model
280
+ - the `native` barrel auto-selects browser behavior on React Native web targets
281
+ and native-history behavior on mobile targets
282
+
283
+ How it works:
284
+
285
+ - Root `<Route>` (no `path`) is provider mode.
286
+ - Nested `<Route path="...">` entries are matcher mode.
287
+ - Shared app routing matches normalized path strings on every platform.
288
+ - Web already receives a browser pathname.
289
+ - Native provides the browser-like history/path source that mobile lacks.
290
+ - Native deep-link ingress is mapped into that same path/history model.
291
+ - Strategy is auto-selected:
292
+ - DOM + History API => browser history strategy.
293
+ - Otherwise => in-memory native strategy.
294
+ - Native strategy automatically wires Android hardware back to route history.
295
+ - If Voltra can go back (`history.index > 0`), it consumes the event and navigates back.
296
+ - If Voltra cannot go back, the event is not consumed so OS/native container behavior continues.
297
+
298
+ Optional back affordances:
299
+
300
+ - `adapter.back?.()` navigates backward when supported.
301
+ - `adapter.canGoBack?.()` reports whether back navigation is currently possible.
302
+
303
+ Escape hatches (root-only):
304
+
305
+ - `initialPath` sets fallback startup path when no ingress URL exists.
306
+ - `adapter` allows full custom adapter control.
307
+ - `ingress` supports deep-link ingress wiring (`getInitialURL`, `subscribe`, URL mapping, push/replace mode).
308
+
309
+ If you are looking for backend request routing (Cloud Function/API event routing), see:
310
+
311
+ - `examples/api/backend-routing.ts`
312
+
313
+ ## Form Suites (Web + Native + BYOCS)
314
+
315
+ Voltra's form system is split into a platform-agnostic core and platform suites:
316
+
317
+ - Core contracts live under `src/app/forms/core` (field kinds, suite resolution, renderer factories).
318
+ - Web DOM suite lives under `src/web/forms`.
319
+ - React Native suite lives under `src/native/forms`.
320
+
321
+ ### Web Usage
322
+
323
+ ```tsx
324
+ import { createWebFormRenderer } from "@resistdesign/voltra/web";
325
+
326
+ const { AutoField } = createWebFormRenderer();
327
+ ```
328
+
329
+ Override a single renderer:
330
+
331
+ ```tsx
332
+ import { withRendererOverride } from "@resistdesign/voltra/app";
333
+ import { createWebFormRenderer } from "@resistdesign/voltra/web";
334
+
335
+ const { AutoField } = createWebFormRenderer({
336
+ suite: withRendererOverride("string", (ctx) => {
337
+ return <input value={(ctx.value as string) || ""} onChange={(e) => ctx.onChange(e.target.value)} />;
338
+ }),
339
+ });
340
+ ```
341
+
342
+ ### Native Usage
343
+
344
+ ```tsx
345
+ import { createNativeFormRenderer } from "@resistdesign/voltra/native";
346
+
347
+ const { AutoField } = createNativeFormRenderer();
348
+ ```
349
+
350
+ ### BYOCS (Bring Your Own Component Suite)
351
+
352
+ Provide partial overrides (renderers and/or primitives). Missing renderers are filled from the default suite and validated.
353
+
354
+ ```tsx
355
+ import { createWebFormRenderer } from "@resistdesign/voltra/web";
356
+
357
+ const { AutoField } = createWebFormRenderer({
358
+ suite: {
359
+ primitives: {
360
+ Button: ({ children }) => <button className="my-button">{children}</button>,
361
+ },
362
+ renderers: {
363
+ boolean: (ctx) => (
364
+ <label>
365
+ <input
366
+ type="checkbox"
367
+ checked={!!ctx.value}
368
+ onChange={(e) => ctx.onChange(e.target.checked)}
369
+ />
370
+ {ctx.label}
371
+ </label>
372
+ ),
373
+ },
374
+ },
375
+ });
376
+ ```
377
+
378
+ ### Relation + Custom Type Hooks
379
+
380
+ Renderers emit actions via:
381
+
382
+ - `onRelationAction(payload)` for relation fields
383
+ - `onCustomTypeAction(payload)` for custom types
384
+
385
+ Use these to wire modals, selectors, or editors without baking UI into the core engine.
386
+
387
+ ### Centralized Validation
388
+
389
+ All TypeInfo data-item validation can be run directly from `@resistdesign/voltra/common`:
390
+
391
+ ```ts
392
+ import { validateTypeInfoDataItem } from "@resistdesign/voltra/common";
393
+ ```
394
+
395
+ `validateTypeInfoDataItem` supports:
396
+
397
+ - field-level `customValidatorMap` callbacks that return `ErrorDescriptor`
398
+ - `tags.validation` field options:
399
+ - `validateHidden`
400
+ - `validateReadonly`
401
+ - `emptyArrayIsValid`
402
+
403
+ AutoForm passes validation through the same centralized logic and supports:
404
+
405
+ - `customValidatorMap` for app-specific rules
406
+ - `translateValidationErrorCode` for UI-facing messages
407
+ - multiple value-level errors per field
408
+ - per-index array item errors for array fields
409
+
410
+ Validation error maps can include both value-level errors and array item errors:
411
+
412
+ ```ts
413
+ {
414
+ errorMap: {
415
+ title: [
416
+ { code: "MISSING_FIELD_VALUE" },
417
+ { code: "VALUE_DOES_NOT_MATCH_PATTERN" }
418
+ ],
419
+ tags: [
420
+ { code: "INVALID_TYPE" },
421
+ {
422
+ itemErrorMap: {
423
+ 0: [{ code: "NOT_A_STRING" }],
424
+ 2: [
425
+ { code: "NOT_A_STRING" },
426
+ { code: "INVALID_CUSTOM_TYPE" }
427
+ ]
428
+ }
429
+ }
430
+ ]
431
+ }
432
+ }
433
+ ```
434
+
435
+ - Field-level multiple errors are represented by multiple `ErrorDescriptor` entries in the field array.
436
+ - Array item errors are represented by `itemErrorMap[index] = ErrorDescriptor[]`.
437
+
438
+ Error-code constants are split by purpose:
439
+
440
+ - `PRIMITIVE_ERROR_MESSAGE_CONSTANTS` keys follow `typeof` (`string`, `number`, `boolean`)
441
+ - `DENIED_TYPE_OPERATIONS` keys follow `TypeOperation` (`CREATE`, `READ`, `UPDATE`, `DELETE`)
442
+ - `ERROR_MESSAGE_CONSTANTS` exposes canonical code-keyed entries (for example `NOT_A_STRING`, `DENIED_TYPE_OPERATION_CREATE`)
70
443
 
71
444
  ## Docs Site
72
445
 
@@ -74,8 +447,10 @@ The docs site is both reference documentation and a canonical usage example.
74
447
  Key pieces:
75
448
 
76
449
  - Astro app in `site/app` builds the UI into `site-dist/app` via `yarn site:build:app`.
77
- - API bundle for the docs site is built by `yarn site:build:api` (see `site/build-api.mjs`) and written to `site-dist/api`.
78
- - The IaC demo template is generated by `yarn site:build:iac` from `site/iac/index.ts` and written to `site-dist/iac/index.yml`.
450
+ - API bundle for the docs site is built by `yarn site:build:api` (see `site/build-api.mjs`) and written to
451
+ `site-dist/api`.
452
+ - The IaC demo template is generated by `yarn site:build:iac` from `site/iac/index.ts` and written to
453
+ `site-dist/iac/index.yml`.
79
454
 
80
455
  API docs flow:
81
456
 
@@ -89,12 +464,15 @@ IaC types are generated from the AWS CloudFormation resource specification.
89
464
  When updating, follow this flow:
90
465
 
91
466
  1) Download the latest CloudFormation resource specification JSON from AWS (region: `us-east-1`).
92
- 2) Replace the contents of `src/iac/types/CloudFormationResourceSpecification.ts` with the JSON payload (as the exported data).
467
+ 2) Replace the contents of `src/iac/types/CloudFormationResourceSpecification.ts` with the JSON payload (as the exported
468
+ data).
93
469
  3) Run `yarn iac:types:gen` to regenerate `dist/IaCTypes.ts`.
94
470
  4) Verify `dist/IaCTypes.ts` looks correct, then commit both files.
95
471
 
96
472
  Notes:
97
- - `src/iac/types/IaCTypes.ts` and `src/iac/types/CloudFormationResourceSpecification.ts` are generated artifacts; do not edit by hand.
473
+
474
+ - `src/iac/types/IaCTypes.ts` and `src/iac/types/CloudFormationResourceSpecification.ts` are generated artifacts; do not
475
+ edit by hand.
98
476
  - The generator entrypoint is `src/iac/types/generate.ts` and uses `src/iac/types/Renderers.ts` for output.
99
477
 
100
478
  ## Releasing
@@ -0,0 +1,95 @@
1
+ import type { ListItemsResults } from "../../common/SearchTypes";
2
+ /**
3
+ * Summary of IDs and cursors observed across pages.
4
+ */
5
+ export type DBXPagingTranscript = {
6
+ /**
7
+ * Number of pages inspected.
8
+ */
9
+ pageCount: number;
10
+ /**
11
+ * Cursors observed per page.
12
+ */
13
+ cursors: Array<string | undefined>;
14
+ /**
15
+ * IDs grouped by page.
16
+ */
17
+ idsByPage: string[][];
18
+ /**
19
+ * Flattened IDs across all pages (page order preserved).
20
+ */
21
+ flattenedIds: string[];
22
+ };
23
+ /**
24
+ * Results from paging invariant checks.
25
+ */
26
+ export type DBXPagingAssertionResult = {
27
+ /**
28
+ * True when no invariant violations were detected.
29
+ */
30
+ ok: boolean;
31
+ /**
32
+ * Total items observed across all pages.
33
+ */
34
+ totalItems: number;
35
+ /**
36
+ * Number of unique IDs observed across all pages.
37
+ */
38
+ uniqueItems: number;
39
+ /**
40
+ * IDs that appeared more than once.
41
+ */
42
+ duplicateIds: string[];
43
+ /**
44
+ * Pages with zero items.
45
+ */
46
+ emptyPageIndexes: number[];
47
+ /**
48
+ * Pages that violated the expected page size.
49
+ */
50
+ pageSizeViolations: Array<{
51
+ index: number;
52
+ size: number;
53
+ }>;
54
+ /**
55
+ * Raw paging transcript for debugging.
56
+ */
57
+ transcript: DBXPagingTranscript;
58
+ };
59
+ /**
60
+ * Results from ordering checks against an expected sequence.
61
+ */
62
+ export type DBXOrderingAssertionResult = {
63
+ /**
64
+ * True when actual ordering matches expected ordering.
65
+ */
66
+ ok: boolean;
67
+ /**
68
+ * Actual IDs in observed order.
69
+ */
70
+ actualIds: string[];
71
+ /**
72
+ * Expected IDs for comparison.
73
+ */
74
+ expectedIds: string[];
75
+ /**
76
+ * First mismatched index, if any.
77
+ */
78
+ mismatchIndex?: number;
79
+ };
80
+ /**
81
+ * Build a paging transcript for a set of list results.
82
+ */
83
+ export declare const getDbxPagingTranscript: <ItemType extends Record<string, any>>(pages: Array<ListItemsResults<ItemType>>, idField?: string) => DBXPagingTranscript;
84
+ /**
85
+ * Assert paging invariants such as stable pagination and no duplicates.
86
+ */
87
+ export declare const assertDbxPagingInvariants: <ItemType extends Record<string, any>>(pages: Array<ListItemsResults<ItemType>>, options?: {
88
+ idField?: string;
89
+ itemsPerPage?: number;
90
+ allowEmptyPages?: boolean;
91
+ }) => DBXPagingAssertionResult;
92
+ /**
93
+ * Assert that the observed ordering exactly matches an expected ordering.
94
+ */
95
+ export declare const assertDbxStableOrdering: <ItemType extends Record<string, any>>(pages: Array<ListItemsResults<ItemType>>, expectedIds: string[], idField?: string) => DBXOrderingAssertionResult;
@@ -0,0 +1,5 @@
1
+ import type { DBXRequestInput, DBXResponse, DBXRuntime } from "./DBXTypes";
2
+ /**
3
+ * Run a DBX request through the router.
4
+ */
5
+ export declare const runDbxRequest: <T = unknown>(runtime: DBXRuntime, request: DBXRequestInput) => Promise<DBXResponse<T>>;
@@ -0,0 +1,5 @@
1
+ import type { DBXRuntime, DBXRuntimeConfig } from "./DBXTypes";
2
+ /**
3
+ * Build an in-memory runtime for DBX scenarios.
4
+ */
5
+ export declare const createDbxRuntime: (config: DBXRuntimeConfig) => DBXRuntime;
@@ -0,0 +1,9 @@
1
+ import type { TypeInfoMap } from "../../common/TypeParsing/TypeInfo";
2
+ /**
3
+ * Canonical TypeInfo map used by DBX E2E scenario tests.
4
+ */
5
+ export declare const DBX_TYPE_INFO_MAP: TypeInfoMap;
6
+ /**
7
+ * Ordered list of DBX scenario type names.
8
+ */
9
+ export declare const DBX_TYPE_NAMES: string[];
@@ -0,0 +1,124 @@
1
+ import type { TypeInfoDataItem, TypeInfoMap } from "../../common/TypeParsing/TypeInfo";
2
+ /**
3
+ * Dataset size presets for DBX scenarios.
4
+ */
5
+ export declare const DBX_DATASET_SIZES: {
6
+ readonly SMALL: 50;
7
+ readonly MED: 200;
8
+ readonly LARGE: 1000;
9
+ };
10
+ /**
11
+ * Relationship edge shape used by DBX seeds.
12
+ */
13
+ export type DBXSeedRelationship = {
14
+ /**
15
+ * Type name of the relationship origin.
16
+ */
17
+ fromTypeName: string;
18
+ /**
19
+ * Field name on the origin type that defines the relationship.
20
+ */
21
+ fromTypeFieldName: string;
22
+ /**
23
+ * Primary field value for the origin item.
24
+ */
25
+ fromTypePrimaryFieldValue: string;
26
+ /**
27
+ * Primary field value for the target item.
28
+ */
29
+ toTypePrimaryFieldValue: string;
30
+ };
31
+ /**
32
+ * Configuration for generating a DBX dataset.
33
+ */
34
+ export type DBXSeedConfig = {
35
+ /**
36
+ * Seed used for deterministic generation.
37
+ */
38
+ seed: number | string;
39
+ /**
40
+ * Type info map used to shape items.
41
+ */
42
+ typeInfoMap: TypeInfoMap;
43
+ /**
44
+ * Optional list of type names to seed.
45
+ */
46
+ itemTypeNames?: string[];
47
+ /**
48
+ * Default item count per type when sizeByType is not provided.
49
+ */
50
+ size?: number;
51
+ /**
52
+ * Optional per-type overrides for item counts.
53
+ */
54
+ sizeByType?: Record<string, number>;
55
+ /**
56
+ * Optional base date for date-like string fields.
57
+ */
58
+ baseDate?: string;
59
+ /**
60
+ * Whether to include optional fields (default true).
61
+ */
62
+ includeOptionalFields?: boolean;
63
+ /**
64
+ * Whether to include array fields (default true).
65
+ */
66
+ includeArrayFields?: boolean;
67
+ /**
68
+ * Max array length when generating array fields.
69
+ */
70
+ maxArrayLength?: number;
71
+ /**
72
+ * Custom token pool for text generation.
73
+ */
74
+ textTokenPool?: string[];
75
+ /**
76
+ * Whether to include relationship edges (default true).
77
+ */
78
+ includeRelationships?: boolean;
79
+ /**
80
+ * Ratio of relationship edges that should point at missing targets.
81
+ */
82
+ relationshipDanglingRate?: number;
83
+ /**
84
+ * Number of relationships to generate per item when possible.
85
+ */
86
+ relationshipsPerItem?: number;
87
+ };
88
+ /**
89
+ * Seeded dataset payload returned by {@link makeDbxDataset}.
90
+ */
91
+ export type DBXSeedDataset = {
92
+ /**
93
+ * Seed used for deterministic generation.
94
+ */
95
+ seed: number | string;
96
+ /**
97
+ * Items keyed by type name.
98
+ */
99
+ itemsByType: Record<string, TypeInfoDataItem[]>;
100
+ /**
101
+ * Generated ids per type name.
102
+ */
103
+ idsByType: Record<string, string[]>;
104
+ /**
105
+ * Relationship edges seeded for scenarios.
106
+ */
107
+ relationships: DBXSeedRelationship[];
108
+ /**
109
+ * Token pool used for text values.
110
+ */
111
+ tokenPool: string[];
112
+ };
113
+ /**
114
+ * Generate a deterministic dataset for DBX scenarios.
115
+ */
116
+ export declare const makeDbxDataset: (config: DBXSeedConfig) => DBXSeedDataset;
117
+ /**
118
+ * Build relationship seeds from existing items.
119
+ */
120
+ export declare const makeDbxRelationshipSeeds: (typeInfoMap: TypeInfoMap, itemsByType: Record<string, TypeInfoDataItem[]>, idsByType: Record<string, string[]>, options: {
121
+ seed: number | string;
122
+ relationshipDanglingRate?: number;
123
+ relationshipsPerItem?: number;
124
+ }) => DBXSeedRelationship[];