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

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 +391 -594
  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
@@ -0,0 +1,222 @@
1
+ /**
2
+ * TypeInfo definitions and tags used across parsing and validation.
3
+ */
4
+ /**
5
+ * A set of possible operations for a type or field value.
6
+ *
7
+ * @category TypeInfo
8
+ */
9
+ export declare enum TypeOperation {
10
+ /**
11
+ * Create operation.
12
+ */
13
+ CREATE = "CREATE",
14
+ /**
15
+ * Read operation.
16
+ */
17
+ READ = "READ",
18
+ /**
19
+ * Update operation.
20
+ */
21
+ UPDATE = "UPDATE",
22
+ /**
23
+ * Delete operation.
24
+ */
25
+ DELETE = "DELETE"
26
+ }
27
+ /**
28
+ * A map of denied operations for a type or field value.
29
+ * */
30
+ export type DeniedOperations = Partial<Record<TypeOperation, boolean>>;
31
+ /**
32
+ * Voltra supported `TypeInfo` tags.
33
+ * */
34
+ export type SupportedTags = Partial<{
35
+ /**
36
+ * The human-readable label for the type.
37
+ * */
38
+ label: string;
39
+ /**
40
+ * Operations that will be denied at the type level.
41
+ * */
42
+ deniedOperations: DeniedOperations;
43
+ /**
44
+ * Whether a pagination UI should enable full paging or just expect cursor-based paging.
45
+ * */
46
+ fullPaging: boolean;
47
+ /**
48
+ * Whether this type will be persisted in a storage solution.
49
+ * */
50
+ persisted: boolean;
51
+ }>;
52
+ /**
53
+ * Voltra supported `TypeInfoField` tags.
54
+ * */
55
+ export type SupportedFieldTags = Partial<{
56
+ /**
57
+ * Is this field the primary (uniquely identifying) field for the type?
58
+ * */
59
+ primaryField: boolean;
60
+ /**
61
+ * The human-readable label for the field.
62
+ * */
63
+ label: string;
64
+ /**
65
+ * The format or "type" for the field inout.
66
+ * Example: "number", "email", "tel", etc.
67
+ * */
68
+ format: string;
69
+ /**
70
+ * Allows a custom entry in a select input.
71
+ * */
72
+ allowCustomSelection: boolean;
73
+ /**
74
+ * A custom type name used to process the field value with custom validators and/or other custom application features.
75
+ * */
76
+ customType: string;
77
+ /**
78
+ * Whether this field is displayed in forms, information displays, lists, etc.
79
+ * */
80
+ hidden: boolean;
81
+ /**
82
+ * Whether a pagination UI should enable full paging or just expect cursor-based paging.
83
+ * NOTE: This is only used when the field has type reference.
84
+ * */
85
+ fullPaging: boolean;
86
+ /**
87
+ * A set of constraints for the field value.
88
+ * */
89
+ constraints: Partial<{
90
+ /**
91
+ * The default value for the field.
92
+ */
93
+ defaultValue: any;
94
+ /**
95
+ * The step increment for the field.
96
+ * */
97
+ step: number;
98
+ /**
99
+ * The minimum value for the field.
100
+ * */
101
+ min: number;
102
+ /**
103
+ * The maximum value for the field.
104
+ * */
105
+ max: number;
106
+ /**
107
+ * A regex pattern used to validate the field value.
108
+ * */
109
+ pattern: string;
110
+ }>;
111
+ /**
112
+ * Operations that will be denied at the field level.
113
+ * */
114
+ deniedOperations: DeniedOperations;
115
+ /**
116
+ * Validation behavior overrides for field processing.
117
+ * */
118
+ validation: Partial<{
119
+ /**
120
+ * Whether hidden fields should be validated.
121
+ * Defaults to false for data-item validation flows that opt into field-level behavior.
122
+ */
123
+ validateHidden: boolean;
124
+ /**
125
+ * Whether readonly fields should enforce required-value checks.
126
+ * Defaults to false for data-item validation flows that opt into field-level behavior.
127
+ */
128
+ validateReadonly: boolean;
129
+ /**
130
+ * Whether empty arrays are accepted for required array fields.
131
+ * Defaults to false.
132
+ */
133
+ emptyArrayIsValid: boolean;
134
+ }>;
135
+ }>;
136
+ /**
137
+ * The set of acceptable literal value types.
138
+ */
139
+ export type LiteralValue = string | number | boolean | null;
140
+ /**
141
+ * The set of acceptable type keywords.
142
+ */
143
+ export type TypeKeyword = "string" | "number" | "boolean";
144
+ /**
145
+ * Information about a field in a type definition.
146
+ */
147
+ export type TypeInfoField = {
148
+ /**
149
+ * Scalar type keyword for the field.
150
+ */
151
+ type: TypeKeyword;
152
+ /**
153
+ * Referenced TypeInfo type name, when relational.
154
+ */
155
+ typeReference?: string;
156
+ /**
157
+ * Whether the field is an array.
158
+ */
159
+ array: boolean;
160
+ /**
161
+ * Whether the field is read-only.
162
+ */
163
+ readonly: boolean;
164
+ /**
165
+ * Whether the field is optional.
166
+ */
167
+ optional: boolean;
168
+ /**
169
+ * Allowed literal values for the field.
170
+ */
171
+ possibleValues?: LiteralValue[];
172
+ /**
173
+ * Optional field tags and constraints.
174
+ */
175
+ tags?: SupportedFieldTags;
176
+ };
177
+ /**
178
+ * Information about a type definition.
179
+ *
180
+ * @category TypeInfo
181
+ */
182
+ export type TypeInfo = {
183
+ /**
184
+ * Primary field name for the type.
185
+ */
186
+ primaryField?: string;
187
+ /**
188
+ * Map of field names to field definitions.
189
+ */
190
+ fields?: Record<string, TypeInfoField>;
191
+ /**
192
+ * Optional type-level tags.
193
+ */
194
+ tags?: SupportedTags;
195
+ /**
196
+ * Field name groupings for union type definitions.
197
+ */
198
+ unionFieldSets?: string[][];
199
+ };
200
+ /**
201
+ * A map of type information maps.
202
+ *
203
+ * @category TypeInfo
204
+ */
205
+ export type TypeInfoMap = Record<string, TypeInfo>;
206
+ /**
207
+ * The necessary information to use a {@link TypeInfo} with the entire {@link TypeInfoMap} containing it.
208
+ * */
209
+ export type TypeInfoPack = {
210
+ /**
211
+ * Entry type name to resolve.
212
+ */
213
+ entryTypeName: string;
214
+ /**
215
+ * Type info map containing the entry type.
216
+ */
217
+ typeInfoMap: TypeInfoMap;
218
+ };
219
+ /**
220
+ * An actual data item described by type info.
221
+ * */
222
+ export type TypeInfoDataItem = Record<string, LiteralValue | LiteralValue[]>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Field-selection helpers for shaping TypeInfo data items.
3
+ */
4
+ import { TypeInfo, TypeInfoDataItem } from "./TypeInfo";
5
+ /**
6
+ * Remove all fields, from a list of selected fields, that are not in the type info.
7
+ *
8
+ * @typeParam ItemType - Data item shape for field selection.
9
+ * @param typeInfo - Type info describing available fields.
10
+ * @param selectedFields - Fields to filter.
11
+ * @returns Filtered list of selected fields.
12
+ * */
13
+ export declare const removeNonexistentFieldsFromSelectedFields: <ItemType extends TypeInfoDataItem>(typeInfo?: TypeInfo, selectedFields?: (keyof ItemType)[]) => (keyof ItemType)[] | undefined;
14
+ /**
15
+ * Remove all fields, from a list of selected fields, that are a type reference.
16
+ *
17
+ * @typeParam ItemType - Data item shape for field selection.
18
+ * @param typeInfo - Type info describing available fields.
19
+ * @param selectedFields - Fields to filter.
20
+ * @returns Filtered list of selected fields.
21
+ * */
22
+ export declare const removeTypeReferenceFieldsFromSelectedFields: <ItemType>(typeInfo?: TypeInfo, selectedFields?: (keyof ItemType)[]) => (keyof ItemType)[] | undefined;
23
+ /**
24
+ * Remove all fields, from a data item, that are a type reference.
25
+ *
26
+ * @param typeInfo - Type info describing available fields.
27
+ * @param dataItem - Data item to filter.
28
+ * @returns Filtered data item.
29
+ * */
30
+ export declare const removeTypeReferenceFieldsFromDataItem: (typeInfo?: TypeInfo, dataItem?: Partial<TypeInfoDataItem>) => Partial<TypeInfoDataItem>;
31
+ /**
32
+ * Remove all fields, from a data item, that are not in the type info.
33
+ *
34
+ * @param typeInfo - Type info describing available fields.
35
+ * @param dataItem - Data item to filter.
36
+ * @returns Filtered data item.
37
+ * */
38
+ export declare const removeNonexistentFieldsFromDataItem: (typeInfo?: TypeInfo, dataItem?: Partial<TypeInfoDataItem>) => Partial<TypeInfoDataItem>;
39
+ /**
40
+ * Remove all fields, from a data item, that are not selected.
41
+ *
42
+ * @typeParam ItemType - Data item shape for field selection.
43
+ * @param dataItem - Data item to filter.
44
+ * @param selectedFields - Fields to include.
45
+ * @returns Filtered data item.
46
+ * */
47
+ export declare const removeUnselectedFieldsFromDataItem: <ItemType extends TypeInfoDataItem>(dataItem?: Partial<ItemType>, selectedFields?: (keyof ItemType)[]) => Partial<ItemType>;
@@ -0,0 +1,327 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Validation helpers for TypeInfo values, including relationship rules and
5
+ * custom type validators.
6
+ */
7
+ import { TypeInfo, TypeInfoDataItem, TypeInfoField, TypeInfoMap, TypeKeyword, TypeOperation } from "./TypeInfo";
8
+ /**
9
+ * Relationship validation behavior for TypeInfo checks.
10
+ */
11
+ export declare enum RelationshipValidationType {
12
+ /**
13
+ * Include relationship values in validation.
14
+ */
15
+ INCLUDE = "INCLUDE",
16
+ /**
17
+ * Exclude relationship values from validation.
18
+ */
19
+ EXCLUDE = "EXCLUDE",
20
+ /**
21
+ * Disallow relationship values entirely.
22
+ */
23
+ STRICT_EXCLUDE = "STRICT_EXCLUDE"
24
+ }
25
+ /**
26
+ * A custom type info field validator.
27
+ * */
28
+ export type CustomTypeInfoFieldValidator = (value: any) => boolean;
29
+ /**
30
+ * A map of custom type info field validators.
31
+ * */
32
+ export type CustomTypeInfoFieldValidatorMap = Record<string, CustomTypeInfoFieldValidator>;
33
+ /**
34
+ * A custom field validator that can return a domain-specific error descriptor.
35
+ */
36
+ export type FieldValueValidator = (value: any, typeInfoField: TypeInfoField) => ErrorDescriptor;
37
+ /**
38
+ * A map of custom field validators by field key.
39
+ */
40
+ export type FieldValueValidatorMap = Record<string, FieldValueValidator>;
41
+ /**
42
+ * Error code for custom type validation failures.
43
+ */
44
+ export declare const INVALID_CUSTOM_TYPE = "INVALID_CUSTOM_TYPE";
45
+ /**
46
+ * Error codes for primitive type validation failures.
47
+ *
48
+ * Keys intentionally match `typeof value` results.
49
+ */
50
+ export declare const PRIMITIVE_ERROR_MESSAGE_CONSTANTS: {
51
+ readonly string: "NOT_A_STRING";
52
+ readonly number: "NOT_A_NUMBER";
53
+ readonly boolean: "NOT_A_BOOLEAN";
54
+ };
55
+ /**
56
+ * Error codes for denied type operations.
57
+ *
58
+ * Keys intentionally match `TypeOperation` names.
59
+ */
60
+ export declare const DENIED_TYPE_OPERATIONS: {
61
+ readonly CREATE: "DENIED_TYPE_OPERATION_CREATE";
62
+ readonly READ: "DENIED_TYPE_OPERATION_READ";
63
+ readonly UPDATE: "DENIED_TYPE_OPERATION_UPDATE";
64
+ readonly DELETE: "DENIED_TYPE_OPERATION_DELETE";
65
+ };
66
+ /**
67
+ * Error codes for TypeInfo validation failures.
68
+ *
69
+ * Uses canonical string-valued keys (for example `NOT_A_STRING` and
70
+ * `DENIED_TYPE_OPERATION_CREATE`) so consumers can key by code values.
71
+ */
72
+ export declare const ERROR_MESSAGE_CONSTANTS: {
73
+ readonly NONE: "NONE";
74
+ readonly INVALID_CUSTOM_TYPE: "INVALID_CUSTOM_TYPE";
75
+ readonly NOT_A_STRING: "NOT_A_STRING";
76
+ readonly NOT_A_NUMBER: "NOT_A_NUMBER";
77
+ readonly NOT_A_BOOLEAN: "NOT_A_BOOLEAN";
78
+ readonly DENIED_TYPE_OPERATION_CREATE: "DENIED_TYPE_OPERATION_CREATE";
79
+ readonly DENIED_TYPE_OPERATION_READ: "DENIED_TYPE_OPERATION_READ";
80
+ readonly DENIED_TYPE_OPERATION_UPDATE: "DENIED_TYPE_OPERATION_UPDATE";
81
+ readonly DENIED_TYPE_OPERATION_DELETE: "DENIED_TYPE_OPERATION_DELETE";
82
+ readonly MISSING_FIELD_VALUE: "MISSING_FIELD_VALUE";
83
+ readonly INVALID_OPTION: "INVALID_OPTION";
84
+ readonly INVALID_FIELD: "INVALID_FIELD";
85
+ readonly RELATIONSHIP_VALUES_ARE_STRICTLY_EXCLUDED: "RELATIONSHIP_VALUES_ARE_STRICTLY_EXCLUDED";
86
+ readonly INVALID_TYPE: "INVALID_TYPE";
87
+ readonly NO_UNION_TYPE_MATCHED: "NO_UNION_TYPE_MATCHED";
88
+ readonly TYPE_DOES_NOT_EXIST: "TYPE_DOES_NOT_EXIST";
89
+ readonly INVALID_PATTERN: "INVALID_PATTERN";
90
+ readonly VALUE_DOES_NOT_MATCH_PATTERN: "VALUE_DOES_NOT_MATCH_PATTERN";
91
+ readonly VALUE_BELOW_MINIMUM: "VALUE_BELOW_MINIMUM";
92
+ readonly VALUE_ABOVE_MAXIMUM: "VALUE_ABOVE_MAXIMUM";
93
+ };
94
+ export type ErrorCode = (typeof ERROR_MESSAGE_CONSTANTS)[keyof typeof ERROR_MESSAGE_CONSTANTS];
95
+ /**
96
+ * Primitive type keyword to error code mapping used during validation.
97
+ */
98
+ export declare const TYPE_KEYWORD_ERROR_MESSAGE_CONSTANTS: Record<TypeKeyword, ErrorCode>;
99
+ /**
100
+ * A descriptor for a validation error.
101
+ */
102
+ export type ErrorDescriptor = {
103
+ code: ErrorCode | string;
104
+ values?: string[];
105
+ };
106
+ /**
107
+ * A map of errors for an array of items.
108
+ */
109
+ export type ArrayItemErrorMap = {
110
+ [index: number]: ErrorDescriptor[];
111
+ };
112
+ /**
113
+ * A descriptor for an array of errors.
114
+ */
115
+ export type ArrayErrorDescriptorCollection = {
116
+ itemErrorMap: ArrayItemErrorMap;
117
+ };
118
+ /**
119
+ * A map of errors.
120
+ */
121
+ export type ErrorMap = {
122
+ [key: string]: (ErrorDescriptor | ArrayErrorDescriptorCollection)[];
123
+ };
124
+ /**
125
+ * The validation results for type info fields.
126
+ */
127
+ export type TypeInfoValidationResults = {
128
+ /**
129
+ * Type name being validated.
130
+ */
131
+ typeName: string | null;
132
+ /**
133
+ * Whether the validation passed.
134
+ */
135
+ valid: boolean;
136
+ /**
137
+ * Primary error code when validation fails.
138
+ */
139
+ error: ErrorDescriptor;
140
+ /**
141
+ * Field-level error mapping.
142
+ */
143
+ errorMap: ErrorMap;
144
+ };
145
+ /**
146
+ * Creates an error descriptor from a code and optional values.
147
+ */
148
+ export declare const getErrorDescriptor: (code?: ErrorCode | string, values?: string[]) => ErrorDescriptor;
149
+ /**
150
+ * Creates a descriptor representing the absence of an error.
151
+ */
152
+ export declare const getNoErrorDescriptor: () => ErrorDescriptor;
153
+ /**
154
+ * Type guard for array-item error collection entries.
155
+ */
156
+ export declare const isArrayErrorDescriptorCollection: (value: ErrorDescriptor | ArrayErrorDescriptorCollection) => value is ArrayErrorDescriptorCollection;
157
+ /**
158
+ * Returns only descriptor entries from a mixed error entry list.
159
+ */
160
+ export declare const getErrorDescriptors: (values?: (ErrorDescriptor | ArrayErrorDescriptorCollection)[]) => ErrorDescriptor[];
161
+ /**
162
+ * Merges all array-item error maps from a mixed entry list.
163
+ */
164
+ export declare const getArrayItemErrorMap: (values?: (ErrorDescriptor | ArrayErrorDescriptorCollection)[]) => ArrayItemErrorMap;
165
+ /**
166
+ * Validates a value against a pattern.
167
+ *
168
+ * `value` must be a string or not supplied.
169
+ * `pattern` must be a string or not supplied.
170
+ *
171
+ * If either are not supplied, the result is valid.
172
+ *
173
+ * @param typeName - Type name for the validation context.
174
+ * @param value - Value to validate.
175
+ * @param pattern - Regex pattern to validate against.
176
+ * @returns Validation results for the pattern.
177
+ * */
178
+ export declare const validateValueMatchesPattern: (typeName: string, value?: any, pattern?: string) => TypeInfoValidationResults;
179
+ /**
180
+ * Gets the validity value.
181
+ *
182
+ * @param existing - Current validity value.
183
+ * @param pending - New validity value.
184
+ * @returns Updated validity value.
185
+ */
186
+ export declare const getValidityValue: (existing: boolean, pending: boolean) => boolean;
187
+ /**
188
+ * The validators for primitive values.
189
+ */
190
+ export declare const TYPE_KEYWORD_VALIDATORS: Record<TypeKeyword, (value: any) => boolean>;
191
+ /**
192
+ * Checks if a value has a value.
193
+ *
194
+ * @param value - Value to check.
195
+ * @returns Whether the value is present.
196
+ */
197
+ export declare const hasValue: (value: any) => boolean;
198
+ /**
199
+ * Validates a primitive value.
200
+ *
201
+ * @param value - Value to validate.
202
+ * @param type - Primitive type keyword.
203
+ * @returns Whether the value matches the type.
204
+ */
205
+ export declare const validateKeywordType: (value: any, type: string) => boolean;
206
+ /**
207
+ * Validates a custom type.
208
+ *
209
+ * @param value - Value to validate.
210
+ * @param customType - Custom type name.
211
+ * @param customValidators - Custom validators map.
212
+ * @returns Whether the value passes custom validation.
213
+ */
214
+ export declare const validateCustomType: (value: any, customType?: string, customValidators?: CustomTypeInfoFieldValidatorMap) => boolean;
215
+ /**
216
+ * Validates a type info field value.
217
+ *
218
+ * @param value - Value to validate.
219
+ * @param typeInfoField - Field metadata.
220
+ * @param typeInfoMap - Type info map for referenced types.
221
+ * @param ignoreArray - Whether to ignore array validation.
222
+ * @param strict - Whether to validate unknown fields and unions strictly.
223
+ * @param customValidators - Custom validators map.
224
+ * @param typeOperation - Operation being validated.
225
+ * @param relationshipValidationType - Relationship validation behavior.
226
+ * @param itemIsPartial - Whether the item is partial.
227
+ * @returns Validation results for the field.
228
+ */
229
+ export declare const validateTypeInfoFieldValue: (value: any, typeInfoField: TypeInfoField, typeInfoMap: TypeInfoMap, ignoreArray?: boolean, strict?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap, typeOperation?: TypeOperation, relationshipValidationType?: RelationshipValidationType, itemIsPartial?: boolean) => TypeInfoValidationResults;
230
+ /**
231
+ * Validates an array of type info field values.
232
+ *
233
+ * @param values - Values to validate.
234
+ * @param typeInfoField - Field metadata.
235
+ * @param typeInfoMap - Type info map for referenced types.
236
+ * @param strict - Whether to validate unknown fields and unions strictly.
237
+ * @param customValidators - Custom validators map.
238
+ * @param typeOperation - Operation being validated.
239
+ * @param relationshipValidationType - Relationship validation behavior.
240
+ * @param itemIsPartial - Whether the item is partial.
241
+ * @returns Validation results for the array.
242
+ */
243
+ export declare const validateArrayOfTypeInfoFieldValues: (values: any[] | undefined, typeInfoField: TypeInfoField, typeInfoMap: TypeInfoMap, strict?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap, typeOperation?: TypeOperation, relationshipValidationType?: RelationshipValidationType, itemIsPartial?: boolean) => TypeInfoValidationResults;
244
+ /**
245
+ * Validates a type info field operation.
246
+ *
247
+ * @param fieldName - Field name to validate.
248
+ * @param fieldOperation - Operation to validate.
249
+ * @param typeInfoField - Field metadata.
250
+ * @returns Validation results for the field operation.
251
+ * */
252
+ export declare const validateTypeInfoFieldOperationAllowed: (fieldName: string, fieldOperation?: TypeOperation, typeInfoField?: TypeInfoField) => TypeInfoValidationResults;
253
+ /**
254
+ * Validates a type info operation.
255
+ *
256
+ * @param typeName - Type name to validate.
257
+ * @param valueFields - Fields included in the operation.
258
+ * @param typeOperation - Operation to validate.
259
+ * @param typeInfo - Type info metadata.
260
+ * @returns Validation results for the type operation.
261
+ * */
262
+ export declare const validateTypeOperationAllowed: (typeName: string, valueFields: string[], typeOperation: TypeOperation, typeInfo: TypeInfo) => TypeInfoValidationResults;
263
+ /**
264
+ * Options for validating a data item against a single TypeInfo definition.
265
+ */
266
+ export type ValidateTypeInfoDataItemOptions = {
267
+ /**
268
+ * Type name used for result metadata and nested lookups.
269
+ */
270
+ typeName?: string;
271
+ /**
272
+ * Additional types used for nested type references.
273
+ */
274
+ typeInfoMap?: TypeInfoMap;
275
+ /**
276
+ * Whether unknown fields should fail validation.
277
+ */
278
+ strict?: boolean;
279
+ /**
280
+ * Custom validators for `tags.customType` handling.
281
+ */
282
+ customTypeValidators?: CustomTypeInfoFieldValidatorMap;
283
+ /**
284
+ * Operation context for denied operation checks.
285
+ */
286
+ typeOperation?: TypeOperation;
287
+ /**
288
+ * Relationship validation behavior.
289
+ */
290
+ relationshipValidationType?: RelationshipValidationType;
291
+ /**
292
+ * Whether this is a partial payload.
293
+ */
294
+ itemIsPartial?: boolean;
295
+ /**
296
+ * Default hidden-field validation behavior.
297
+ */
298
+ validateHidden?: boolean;
299
+ /**
300
+ * Default readonly-field required-value behavior.
301
+ */
302
+ validateReadonly?: boolean;
303
+ };
304
+ /**
305
+ * Validates a data item against a TypeInfo definition.
306
+ *
307
+ * @param value - Data item to validate.
308
+ * @param typeInfo - TypeInfo definition used for validation.
309
+ * @param customValidatorMap - Optional custom validators keyed by field.
310
+ * @param options - Validation behavior options.
311
+ * @returns Validation result for the entire item.
312
+ */
313
+ export declare const validateTypeInfoDataItem: (value: Partial<TypeInfoDataItem> | undefined, typeInfo: TypeInfo, customValidatorMap?: FieldValueValidatorMap, options?: ValidateTypeInfoDataItemOptions) => TypeInfoValidationResults;
314
+ /**
315
+ * Validates a type info value.
316
+ *
317
+ * @param value - Value to validate.
318
+ * @param typeInfoFullName - Fully qualified type name.
319
+ * @param typeInfoMap - Type info map for referenced types.
320
+ * @param strict - Whether to validate unknown fields and unions strictly.
321
+ * @param customValidators - Custom validators map.
322
+ * @param typeOperation - Operation being validated.
323
+ * @param relationshipValidationType - Relationship validation behavior.
324
+ * @param itemIsPartial - Whether the item is partial.
325
+ * @returns Validation results for the value.
326
+ */
327
+ export declare const validateTypeInfoValue: (value: any, typeInfoFullName: string, typeInfoMap: TypeInfoMap, strict?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap, typeOperation?: TypeOperation, relationshipValidationType?: RelationshipValidationType, itemIsPartial?: boolean) => TypeInfoValidationResults;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Includes TypeInfo definitions, validation helpers, and AST mapping.
5
+ */
6
+ export * from "./Validation";
7
+ export * from "./TypeInfo";
8
+ export * from "./Constants";
package/common/index.d.ts CHANGED
@@ -1,4 +1,40 @@
1
- export { b as IDGeneration, d as ItemRelationships, f as Logging, R as Routing, S as SearchUtils, c as StringTransformers, e as Testing, a as TypeParsing } from '../index-C3-iD9Mh.js';
2
- export { H as HelperTypes, l as ItemRelationshipInfoTypes, m as SearchTypes } from '../SearchTypes-DjN6YQzE.js';
3
- import '../Validation-CFP59oIP.js';
4
- import 'typescript';
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Common module exports for shared utilities, types, and helpers used across
5
+ * app, API, and IaC layers.
6
+ *
7
+ * Import from the common subpath only:
8
+ * ```ts
9
+ * import {
10
+ * getPathString,
11
+ * getSimpleId,
12
+ * } from "@resistdesign/voltra/common";
13
+ *
14
+ * const path = getPathString(["users", 42], "/", true, false);
15
+ * const id = getSimpleId();
16
+ * ```
17
+ *
18
+ * See also: `@resistdesign/voltra/app`, `@resistdesign/voltra/api`, and
19
+ * `@resistdesign/voltra/iac`.
20
+ */
21
+ /**
22
+ * @category common
23
+ * @group Shared Types
24
+ */
25
+ export type * from "./HelperTypes";
26
+ /**
27
+ * @category common
28
+ * @group Command Line
29
+ */
30
+ export * from "./CommandLine";
31
+ /**
32
+ * @category common
33
+ * @group Type Parsing
34
+ */
35
+ export * from "./TypeParsing";
36
+ /**
37
+ * @category common
38
+ * @group Shared Types
39
+ */
40
+ export * from "./TypeInfoORM";