@resistdesign/voltra 3.0.0-alpha.4 → 3.0.0-alpha.40

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 (219) hide show
  1. package/README.md +379 -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 +55 -0
  51. package/api/ORM/TypeInfoORMService.d.ts +740 -0
  52. package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
  53. package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +89 -0
  54. package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
  55. package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +55 -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 +197 -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/index.d.ts +9 -0
  68. package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +22 -0
  69. package/api/Router/AWS.d.ts +80 -0
  70. package/api/Router/Auth.d.ts +14 -0
  71. package/api/Router/CORS.d.ts +66 -0
  72. package/api/Router/Types.d.ts +138 -0
  73. package/api/Router/index.d.ts +89 -0
  74. package/api/index.d.ts +72 -6
  75. package/api/index.js +3291 -1954
  76. package/app/forms/Engine.d.ts +23 -0
  77. package/app/forms/UI.d.ts +83 -0
  78. package/app/forms/core/createAutoField.d.ts +43 -0
  79. package/app/forms/core/createFormRenderer.d.ts +25 -0
  80. package/app/forms/core/getFieldKind.d.ts +14 -0
  81. package/app/forms/core/index.d.ts +11 -0
  82. package/app/forms/core/mergeSuites.d.ts +23 -0
  83. package/app/forms/core/resolveSuite.d.ts +15 -0
  84. package/app/forms/core/types.d.ts +180 -0
  85. package/app/forms/index.d.ts +9 -0
  86. package/app/forms/types.d.ts +137 -0
  87. package/app/helpers/styled.d.ts +3 -0
  88. package/app/index.d.ts +102 -5
  89. package/app/index.js +98 -327
  90. package/app/utils/ApplicationState.d.ts +167 -0
  91. package/app/utils/ApplicationStateLoader.d.ts +86 -0
  92. package/app/utils/Controller.d.ts +10 -0
  93. package/app/utils/Debug.d.ts +14 -0
  94. package/app/utils/EasyLayout.d.ts +89 -0
  95. package/app/utils/History.d.ts +165 -0
  96. package/app/utils/Route.d.ts +173 -0
  97. package/app/utils/RouteHistory.d.ts +27 -0
  98. package/app/utils/Service.d.ts +45 -0
  99. package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
  100. package/app/utils/TypeInfoORMClient.d.ts +103 -0
  101. package/app/utils/UniversalRouteAdapter.d.ts +73 -0
  102. package/app/utils/easy-layout/computeAreaBounds.d.ts +5 -0
  103. package/app/utils/easy-layout/computeTracks.d.ts +16 -0
  104. package/app/utils/easy-layout/index.d.ts +5 -0
  105. package/app/utils/easy-layout/parseTemplate.d.ts +12 -0
  106. package/app/utils/easy-layout/types.d.ts +52 -0
  107. package/app/utils/easy-layout/validateAreas.d.ts +5 -0
  108. package/app/utils/index.d.ts +24 -0
  109. package/build/TypeMapping.d.ts +17 -0
  110. package/build/TypeParsing.d.ts +10 -0
  111. package/build/index.d.ts +15 -0
  112. package/build/index.js +569 -0
  113. package/chunk-2MOLWZMQ.js +71 -0
  114. package/chunk-7AMEFPPP.js +78 -0
  115. package/chunk-ATO2455Q.js +258 -0
  116. package/chunk-DT6WWJUI.js +1185 -0
  117. package/chunk-I2KLQ2HA.js +19 -0
  118. package/chunk-TJFTWPXQ.js +39 -0
  119. package/chunk-WNFRDIBW.js +121 -0
  120. package/chunk-YCTVEW2I.js +546 -0
  121. package/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +9 -0
  122. package/common/CommandLine/index.d.ts +6 -0
  123. package/common/HelperTypes.d.ts +9 -0
  124. package/common/IdGeneration/getSimpleId.d.ts +8 -0
  125. package/common/IdGeneration/index.d.ts +1 -0
  126. package/common/ItemRelationshipInfoTypes.d.ts +64 -0
  127. package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
  128. package/common/ItemRelationships/index.d.ts +2 -0
  129. package/common/Logging/Utils.d.ts +10 -0
  130. package/common/Logging/index.d.ts +1 -0
  131. package/common/Routing.d.ts +81 -0
  132. package/common/SearchTypes.d.ts +227 -0
  133. package/common/SearchUtils.d.ts +55 -0
  134. package/common/SearchValidation.d.ts +27 -0
  135. package/common/StringTransformers.d.ts +28 -0
  136. package/common/Testing/CLI.d.ts +6 -0
  137. package/common/Testing/Types.d.ts +216 -0
  138. package/common/Testing/Utils.d.ts +112 -0
  139. package/common/Testing/index.d.ts +8 -0
  140. package/common/TypeInfoDataItemUtils.d.ts +39 -0
  141. package/{Types-C7XjUjoF.d.ts → common/TypeInfoORM/Types.d.ts} +117 -15
  142. package/common/TypeInfoORM/index.d.ts +3 -0
  143. package/common/TypeParsing/Constants.d.ts +4 -0
  144. package/common/TypeParsing/ParsingUtils/Constants.d.ts +8 -0
  145. package/common/TypeParsing/ParsingUtils/checkType.d.ts +14 -0
  146. package/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +12 -0
  147. package/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +8 -0
  148. package/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +12 -0
  149. package/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +14 -0
  150. package/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +18 -0
  151. package/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +9 -0
  152. package/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +9 -0
  153. package/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +11 -0
  154. package/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +12 -0
  155. package/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +11 -0
  156. package/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +9 -0
  157. package/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +11 -0
  158. package/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +8 -0
  159. package/common/TypeParsing/TypeInfo.d.ts +222 -0
  160. package/common/TypeParsing/Utils.d.ts +47 -0
  161. package/common/TypeParsing/Validation.d.ts +327 -0
  162. package/common/TypeParsing/index.d.ts +8 -0
  163. package/common/index.d.ts +40 -4
  164. package/common/index.js +25 -1737
  165. package/{index-BkFZlfit.d.ts → iac/SimpleCFT.d.ts} +5 -25
  166. package/iac/index.d.ts +40 -2
  167. package/iac/index.js +2 -1661
  168. package/iac/packs/auth.d.ts +131 -0
  169. package/iac/packs/build/utils.d.ts +289 -0
  170. package/iac/packs/build.d.ts +92 -0
  171. package/iac/packs/cdn.d.ts +33 -0
  172. package/iac/packs/cloud-function.d.ts +67 -0
  173. package/iac/packs/database.d.ts +32 -0
  174. package/iac/packs/dns.d.ts +34 -0
  175. package/iac/packs/file-storage.d.ts +46 -0
  176. package/iac/packs/gateway.d.ts +82 -0
  177. package/iac/packs/index.d.ts +60 -1
  178. package/iac/packs/index.js +311 -566
  179. package/iac/packs/repo.d.ts +28 -0
  180. package/iac/packs/ssl-certificate.d.ts +28 -0
  181. package/iac/types/Constants.d.ts +24 -0
  182. package/{index-DcvJOZ_c.d.ts → iac/types/IaCTypes.d.ts} +23 -1018
  183. package/iac/types/Renderers.d.ts +96 -0
  184. package/iac/types/Types.d.ts +131 -0
  185. package/iac/types/Utils.d.ts +9 -0
  186. package/iac/types/generate.d.ts +1 -0
  187. package/iac/utils/index.d.ts +87 -0
  188. package/iac/utils/patch-utils.d.ts +66 -0
  189. package/iac-packs/index.d.ts +6 -0
  190. package/native/forms/UI.d.ts +73 -0
  191. package/native/forms/createNativeFormRenderer.d.ts +21 -0
  192. package/native/forms/index.d.ts +25 -0
  193. package/native/forms/primitives/index.d.ts +38 -0
  194. package/native/forms/suite.d.ts +15 -0
  195. package/native/index.d.ts +19 -0
  196. package/native/index.js +748 -0
  197. package/native/testing/react-native.d.ts +46 -0
  198. package/native/utils/EasyLayout.d.ts +88 -0
  199. package/native/utils/History.d.ts +102 -0
  200. package/native/utils/Route.d.ts +80 -0
  201. package/native/utils/index.d.ts +20 -0
  202. package/package.json +54 -21
  203. package/web/forms/UI.d.ts +74 -0
  204. package/web/forms/createWebFormRenderer.d.ts +21 -0
  205. package/web/forms/index.d.ts +9 -0
  206. package/web/forms/primitives/index.d.ts +21 -0
  207. package/web/forms/suite.d.ts +15 -0
  208. package/web/index.d.ts +15 -0
  209. package/web/index.js +668 -0
  210. package/web/utils/EasyLayout.d.ts +47 -0
  211. package/web/utils/Route.d.ts +16 -0
  212. package/web/utils/index.d.ts +7 -0
  213. package/SearchTypes-DjN6YQzE.d.ts +0 -577
  214. package/Validation-CFP59oIP.d.ts +0 -226
  215. package/index-C3-iD9Mh.d.ts +0 -690
  216. package/index-DZ2BB4iX.d.ts +0 -5357
  217. package/index-IokxSNxm.d.ts +0 -745
  218. package/index.d.ts +0 -13
  219. package/index.js +0 -10973
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,279 @@ 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
+
246
+ Reference example: `examples/routing/app-routing.ts`
247
+
248
+ ```tsx
249
+ import { Route } from "@resistdesign/voltra/web";
250
+
251
+ <Route>
252
+ <Route path="/" exact>
253
+ <HomeScreen />
254
+ </Route>
255
+ <Route path="/login" exact>
256
+ <LoginScreen />
257
+ </Route>
258
+ <Route path="/signup" exact>
259
+ <SignUpScreen />
260
+ </Route>
261
+ </Route>;
262
+ ```
263
+
264
+ ```tsx
265
+ import { Route } from "@resistdesign/voltra/native";
266
+
267
+ <Route>
268
+ <Route path="/" exact>
269
+ <HomeScreen />
270
+ </Route>
271
+ </Route>;
272
+ ```
273
+
274
+ How it works:
275
+
276
+ - Root `<Route>` (no `path`) is provider mode.
277
+ - Nested `<Route path="...">` entries are matcher mode.
278
+ - Strategy is auto-selected:
279
+ - DOM + History API => browser history strategy.
280
+ - Otherwise => in-memory native strategy.
281
+ - Native strategy automatically wires Android hardware back to route history.
282
+ - If Voltra can go back (`history.index > 0`), it consumes the event and navigates back.
283
+ - If Voltra cannot go back, the event is not consumed so OS/native container behavior continues.
284
+
285
+ Optional back affordances:
286
+
287
+ - `adapter.back?.()` navigates backward when supported.
288
+ - `adapter.canGoBack?.()` reports whether back navigation is currently possible.
289
+
290
+ Escape hatches (root-only):
291
+
292
+ - `initialPath` sets fallback startup path when no ingress URL exists.
293
+ - `adapter` allows full custom adapter control.
294
+ - `ingress` supports deep-link ingress wiring (`getInitialURL`, `subscribe`, URL mapping, push/replace mode).
295
+
296
+ If you are looking for backend request routing (Cloud Function/API event routing), see:
297
+
298
+ - `examples/api/backend-routing.ts`
299
+
300
+ ## Form Suites (Web + Native + BYOCS)
301
+
302
+ Voltra's form system is split into a platform-agnostic core and platform suites:
303
+
304
+ - Core contracts live under `src/app/forms/core` (field kinds, suite resolution, renderer factories).
305
+ - Web DOM suite lives under `src/web/forms`.
306
+ - React Native suite lives under `src/native/forms`.
307
+
308
+ ### Web Usage
309
+
310
+ ```tsx
311
+ import { createWebFormRenderer } from "@resistdesign/voltra/web";
312
+
313
+ const { AutoField } = createWebFormRenderer();
314
+ ```
315
+
316
+ Override a single renderer:
317
+
318
+ ```tsx
319
+ import { withRendererOverride } from "@resistdesign/voltra/app";
320
+ import { createWebFormRenderer } from "@resistdesign/voltra/web";
321
+
322
+ const { AutoField } = createWebFormRenderer({
323
+ suite: withRendererOverride("string", (ctx) => {
324
+ return <input value={(ctx.value as string) || ""} onChange={(e) => ctx.onChange(e.target.value)} />;
325
+ }),
326
+ });
327
+ ```
328
+
329
+ ### Native Usage
330
+
331
+ ```tsx
332
+ import { createNativeFormRenderer } from "@resistdesign/voltra/native";
333
+
334
+ const { AutoField } = createNativeFormRenderer();
335
+ ```
336
+
337
+ ### BYOCS (Bring Your Own Component Suite)
338
+
339
+ Provide partial overrides (renderers and/or primitives). Missing renderers are filled from the default suite and validated.
340
+
341
+ ```tsx
342
+ import { createWebFormRenderer } from "@resistdesign/voltra/web";
343
+
344
+ const { AutoField } = createWebFormRenderer({
345
+ suite: {
346
+ primitives: {
347
+ Button: ({ children }) => <button className="my-button">{children}</button>,
348
+ },
349
+ renderers: {
350
+ boolean: (ctx) => (
351
+ <label>
352
+ <input
353
+ type="checkbox"
354
+ checked={!!ctx.value}
355
+ onChange={(e) => ctx.onChange(e.target.checked)}
356
+ />
357
+ {ctx.label}
358
+ </label>
359
+ ),
360
+ },
361
+ },
362
+ });
363
+ ```
364
+
365
+ ### Relation + Custom Type Hooks
366
+
367
+ Renderers emit actions via:
368
+
369
+ - `onRelationAction(payload)` for relation fields
370
+ - `onCustomTypeAction(payload)` for custom types
371
+
372
+ Use these to wire modals, selectors, or editors without baking UI into the core engine.
373
+
374
+ ### Centralized Validation
375
+
376
+ All TypeInfo data-item validation can be run directly from `@resistdesign/voltra/common`:
377
+
378
+ ```ts
379
+ import { validateTypeInfoDataItem } from "@resistdesign/voltra/common";
380
+ ```
381
+
382
+ `validateTypeInfoDataItem` supports:
383
+
384
+ - field-level `customValidatorMap` callbacks that return `ErrorDescriptor`
385
+ - `tags.validation` field options:
386
+ - `validateHidden`
387
+ - `validateReadonly`
388
+ - `emptyArrayIsValid`
389
+
390
+ AutoForm passes validation through the same centralized logic and supports:
391
+
392
+ - `customValidatorMap` for app-specific rules
393
+ - `translateValidationErrorCode` for UI-facing messages
394
+ - multiple value-level errors per field
395
+ - per-index array item errors for array fields
396
+
397
+ Validation error maps can include both value-level errors and array item errors:
398
+
399
+ ```ts
400
+ {
401
+ errorMap: {
402
+ title: [
403
+ { code: "MISSING_FIELD_VALUE" },
404
+ { code: "VALUE_DOES_NOT_MATCH_PATTERN" }
405
+ ],
406
+ tags: [
407
+ { code: "INVALID_TYPE" },
408
+ {
409
+ itemErrorMap: {
410
+ 0: [{ code: "NOT_A_STRING" }],
411
+ 2: [
412
+ { code: "NOT_A_STRING" },
413
+ { code: "INVALID_CUSTOM_TYPE" }
414
+ ]
415
+ }
416
+ }
417
+ ]
418
+ }
419
+ }
420
+ ```
421
+
422
+ - Field-level multiple errors are represented by multiple `ErrorDescriptor` entries in the field array.
423
+ - Array item errors are represented by `itemErrorMap[index] = ErrorDescriptor[]`.
424
+
425
+ Error-code constants are split by purpose:
426
+
427
+ - `PRIMITIVE_ERROR_MESSAGE_CONSTANTS` keys follow `typeof` (`string`, `number`, `boolean`)
428
+ - `DENIED_TYPE_OPERATIONS` keys follow `TypeOperation` (`CREATE`, `READ`, `UPDATE`, `DELETE`)
429
+ - `ERROR_MESSAGE_CONSTANTS` exposes canonical code-keyed entries (for example `NOT_A_STRING`, `DENIED_TYPE_OPERATION_CREATE`)
70
430
 
71
431
  ## Docs Site
72
432
 
@@ -74,8 +434,10 @@ The docs site is both reference documentation and a canonical usage example.
74
434
  Key pieces:
75
435
 
76
436
  - 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`.
437
+ - API bundle for the docs site is built by `yarn site:build:api` (see `site/build-api.mjs`) and written to
438
+ `site-dist/api`.
439
+ - The IaC demo template is generated by `yarn site:build:iac` from `site/iac/index.ts` and written to
440
+ `site-dist/iac/index.yml`.
79
441
 
80
442
  API docs flow:
81
443
 
@@ -89,12 +451,15 @@ IaC types are generated from the AWS CloudFormation resource specification.
89
451
  When updating, follow this flow:
90
452
 
91
453
  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).
454
+ 2) Replace the contents of `src/iac/types/CloudFormationResourceSpecification.ts` with the JSON payload (as the exported
455
+ data).
93
456
  3) Run `yarn iac:types:gen` to regenerate `dist/IaCTypes.ts`.
94
457
  4) Verify `dist/IaCTypes.ts` looks correct, then commit both files.
95
458
 
96
459
  Notes:
97
- - `src/iac/types/IaCTypes.ts` and `src/iac/types/CloudFormationResourceSpecification.ts` are generated artifacts; do not edit by hand.
460
+
461
+ - `src/iac/types/IaCTypes.ts` and `src/iac/types/CloudFormationResourceSpecification.ts` are generated artifacts; do not
462
+ edit by hand.
98
463
  - The generator entrypoint is `src/iac/types/generate.ts` and uses `src/iac/types/Renderers.ts` for output.
99
464
 
100
465
  ## 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[];